wok view jwm/stuff/jwmbgconf @ rev 9471
Automated merge with http://repos.slitaz.org/wok
author | Antoine Bodin <gokhlayeh@slitaz.org> |
---|---|
date | Mon Apr 04 01:32:45 2011 +0200 (2011-04-04) |
parents | |
children |
line source
1 #!/bin/sh
2 #
3 # Gtkdialog box to change JWM backgroud.
4 # - SliTaz GNU/Linux 2008.
5 #
6 VERSION=20080305
8 # Get current image zype and path.
9 LINE=`cat ~/.jwmrc | grep -w '^ <Background type='`
10 TYPE=${LINE#*=\"}
11 TYPE=${TYPE%%\"\>*}
12 BG_PATH=${LINE#*\"$TYPE\">}
13 export BG_PATH=${BG_PATH%</Background>}
15 # We need an actions to be executed by another window dialog
16 # to get values from the main dialog variables.
17 export ACTION='
18 <vbox>
19 <text use-markup="true" width-chars="28">
20 <label>
21 "
22 <b>Changing JWM background</b>
23 "
24 </label>
25 </text>
26 <progressbar>
27 <label>Please wait...</label>
28 <action>sed -i s#$BG_PATH#$NEW_PATH# $HOME/.jwmrc</action>
29 <input>echo 50; jwm -restart; echo 100</input>
30 <action type="closewindow">ACTION</action>
31 </progressbar>
32 </vbox>
33 '
35 # Image type, path and reload button. We use \" to be Ash compatible.
36 #
37 export BG_DIALOG="
38 <window title=\"JWM Background\">
39 <vbox>
41 <text use-markup=\"true\" width-chars=\"50\">
42 <label>
43 \"
44 <b>Wallpaper - JWM Background image</b>
45 \"
46 </label>
47 </text>
49 <hbox>
50 <entry>
51 <default>$BG_PATH</default>
52 <variable>NEW_PATH</variable>
53 </entry>
54 <button>
55 <input file icon=\"image\"></input>
56 <action type=\"fileselect\">NEW_PATH</action>
57 </button>
58 </hbox>
60 <hbox>
61 <button>
62 <label>Change Wallpaper</label>
63 <input file icon=\"reload\"></input>
64 <action type=\"launch\">ACTION</action>
65 </button>
66 <button>
67 <input file icon=\"exit\"></input>
68 <action type=\"exit\">Exit</action>
69 </button>
70 </hbox>
72 </vbox>
73 </window>
74 "
76 # Execute main dialog.
77 gtkdialog --program=BG_DIALOG
79 exit 0