wok rev 657

Moved jwmbgconf to jwm package
author Christophe Lincoln <pankso@slitaz.org>
date Tue Apr 22 23:01:10 2008 +0200 (2008-04-22)
parents 3c4e0201ce56
children db65cf82fa6a
files jwm/stuff/jwmbgconf
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/jwm/stuff/jwmbgconf	Tue Apr 22 23:01:10 2008 +0200
     1.3 @@ -0,0 +1,79 @@
     1.4 +#!/bin/sh
     1.5 +# 
     1.6 +# Gtkdialog box to change JWM backgroud.
     1.7 +# - SliTaz GNU/Linux 2008.
     1.8 +#
     1.9 +VERSION=20080305
    1.10 +
    1.11 +# Get current image zype and path.
    1.12 +LINE=`cat ~/.jwmrc | grep -w '^      <Background type='`
    1.13 +TYPE=${LINE#*=\"}
    1.14 +TYPE=${TYPE%%\"\>*}
    1.15 +BG_PATH=${LINE#*\"$TYPE\">}
    1.16 +export BG_PATH=${BG_PATH%</Background>}
    1.17 +
    1.18 +# We need an actions to be executed by another window dialog
    1.19 +# to get values from the main dialog variables.
    1.20 +export ACTION='
    1.21 +  <vbox>
    1.22 +    <text use-markup="true" width-chars="28">
    1.23 +      <label>
    1.24 +"
    1.25 +<b>Changing JWM background</b>
    1.26 +"
    1.27 +      </label>
    1.28 +    </text>
    1.29 +    <progressbar>
    1.30 +      <label>Please wait...</label>
    1.31 +      <action>sed -i s#$BG_PATH#$NEW_PATH# $HOME/.jwmrc</action>
    1.32 +      <input>echo 50; jwm -restart; echo 100</input>
    1.33 +      <action type="closewindow">ACTION</action>
    1.34 +    </progressbar>
    1.35 +  </vbox>
    1.36 +'
    1.37 +
    1.38 +# Image type, path and reload button. We use \" to be Ash compatible.
    1.39 +#
    1.40 +export BG_DIALOG="
    1.41 +<window title=\"JWM Background\">
    1.42 +  <vbox>
    1.43 +    
    1.44 +        <text use-markup=\"true\" width-chars=\"50\">
    1.45 +      <label>
    1.46 +\"
    1.47 +<b>Wallpaper - JWM Background image</b>
    1.48 +\"
    1.49 +</label>
    1.50 +    </text>
    1.51 +      
    1.52 +      <hbox>
    1.53 +        <entry>
    1.54 +          <default>$BG_PATH</default>
    1.55 +          <variable>NEW_PATH</variable>
    1.56 +        </entry>
    1.57 +        <button>
    1.58 +          <input file icon=\"image\"></input>
    1.59 +          <action type=\"fileselect\">NEW_PATH</action>
    1.60 +        </button>
    1.61 +      </hbox>
    1.62 +    
    1.63 +    <hbox>
    1.64 +      <button>
    1.65 +        <label>Change Wallpaper</label>
    1.66 +        <input file icon=\"reload\"></input>
    1.67 +        <action type=\"launch\">ACTION</action>
    1.68 +      </button>
    1.69 +      <button>
    1.70 +        <input file icon=\"exit\"></input>
    1.71 +        <action type=\"exit\">Exit</action>
    1.72 +      </button>
    1.73 +    </hbox>
    1.74 +  
    1.75 +  </vbox>
    1.76 +</window>
    1.77 +"
    1.78 +
    1.79 +# Execute main dialog.
    1.80 +gtkdialog --program=BG_DIALOG
    1.81 +
    1.82 +exit 0