diff options
author | fluxgen <fluxgen> | 2003-04-28 14:45:13 (GMT) |
---|---|---|
committer | fluxgen <fluxgen> | 2003-04-28 14:45:13 (GMT) |
commit | b58d23091d3878fd8b4fbfdd7acca4383381fdf8 (patch) | |
tree | 7a6bac872954420f4fe161573429d14bda7a3ba4 /util/fbsetbg | |
parent | e7b893beba45053ff05a8a192d198b7c5d7918bf (diff) | |
download | fluxbox_lack-b58d23091d3878fd8b4fbfdd7acca4383381fdf8.zip fluxbox_lack-b58d23091d3878fd8b4fbfdd7acca4383381fdf8.tar.bz2 |
update
Diffstat (limited to 'util/fbsetbg')
-rw-r--r-- | util/fbsetbg | 62 |
1 files changed, 41 insertions, 21 deletions
diff --git a/util/fbsetbg b/util/fbsetbg index 3080846..be7b093 100644 --- a/util/fbsetbg +++ b/util/fbsetbg | |||
@@ -23,14 +23,14 @@ | |||
23 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE | 23 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE |
24 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | 24 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
25 | # | 25 | # |
26 | # $Id: fbsetbg,v 1.1 2003/04/27 15:33:26 fluxgen Exp $ | 26 | # $Id: fbsetbg,v 1.2 2003/04/28 14:45:13 fluxgen Exp $ |
27 | 27 | ||
28 | # | 28 | # |
29 | # Portability notes: | 29 | # Portability notes: |
30 | # To guarantee this script works on all platforms that support fluxbox | 30 | # To guarantee this script works on all platforms that support fluxbox |
31 | # please keep the following restrictions in mind: | 31 | # please keep the following restrictions in mind: |
32 | # | 32 | # |
33 | # don't use [ -e file ] use [ -r file ] | 33 | # don't use [ -e file ], use [ -r file ] |
34 | # don't use $(), use `` | 34 | # don't use $(), use `` |
35 | # don't use ~, use ${HOME} | 35 | # don't use ~, use ${HOME} |
36 | # don't use id -u, use whoami | 36 | # don't use id -u, use whoami |
@@ -61,6 +61,9 @@ Options: | |||
61 | -f Set fullscreen wallpaper | 61 | -f Set fullscreen wallpaper |
62 | -c Set centered wallpaper | 62 | -c Set centered wallpaper |
63 | -t Set tiled wallpaper | 63 | -t Set tiled wallpaper |
64 | -a Set maximized wallpaper, preserving aspect. | ||
65 | ( if your bgsetter doesn't support this | ||
66 | fbsetbg falls back to -f ) | ||
64 | 67 | ||
65 | -h Display this help | 68 | -h Display this help |
66 | 69 | ||
@@ -81,9 +84,9 @@ cat<<EOF | |||
81 | 84 | ||
82 | To replace all occurances of bsetbg in a file use this command: | 85 | To replace all occurances of bsetbg in a file use this command: |
83 | 86 | ||
84 | perl -pi -e 's, bsetbg, fbsetbg,' | 87 | perl -pi -e 's,([^f]|^)bsetbg,fbsetbg,' |
85 | 88 | ||
86 | If you want to choose your own wallpapers and you want fbsetbg to | 89 | If you want the style to set the wallpaper and you want fbsetbg to |
87 | remember the previous wallpaper put this in your ~/.fluxbox/init | 90 | remember the previous wallpaper put this in your ~/.fluxbox/init |
88 | 91 | ||
89 | session.screen0.rootCommand: fbsetbg -l | 92 | session.screen0.rootCommand: fbsetbg -l |
@@ -110,6 +113,11 @@ message() { | |||
110 | xmessage -center "$@" | 113 | xmessage -center "$@" |
111 | } | 114 | } |
112 | 115 | ||
116 | remembercommand() { | ||
117 | echo $option > $lastwallpaper | ||
118 | echo $wallpaper >> $lastwallpaper | ||
119 | } | ||
120 | |||
113 | debugfbsetbg (){ | 121 | debugfbsetbg (){ |
114 | 122 | ||
115 | standardrant (){ | 123 | standardrant (){ |
@@ -131,24 +139,27 @@ EOF | |||
131 | 139 | ||
132 | case $WPSETTER in | 140 | case $WPSETTER in |
133 | xsri) | 141 | xsri) |
134 | echo 'Actually I never heard of this app.' | 142 | echo "This is a RedHat specific app. I can't find docs about it." |
135 | ;; | 143 | ;; |
136 | display) | 144 | display) |
137 | standardrant | 145 | standardrant |
138 | ;; | 146 | ;; |
139 | Esetroot) | 147 | Esetroot) |
140 | echo 'Esetroot is a nice app :)' | 148 | echo 'Esetroot is a nice app :)' |
141 | echo "You won't have any problems" | 149 | echo "You won't have any problems." |
142 | ;; | 150 | ;; |
143 | wmsetbg) | 151 | wmsetbg) |
144 | echo 'wmsetbg is my favourite :)' | 152 | echo 'wmsetbg is my favourite :)' |
145 | echo "You won't have any problems" | 153 | echo "You won't have any problems." |
146 | ;; | 154 | ;; |
147 | xsetbg) | 155 | xsetbg) |
148 | standardrant | 156 | standardrant |
157 | echo 'Is actually xli' | ||
158 | echo 'fillscreen option (-f) is broken, defaults to (-a)' | ||
149 | ;; | 159 | ;; |
150 | xli) | 160 | xli) |
151 | standardrant | 161 | standardrant |
162 | echo 'fillscreen option (-f) is broken, defaults to (-a)' | ||
152 | ;; | 163 | ;; |
153 | qiv) | 164 | qiv) |
154 | standardrant | 165 | standardrant |
@@ -187,41 +198,49 @@ case $WPSETTER in | |||
187 | full='--center-x --center-y --scale-width=100 --scale-width=100' | 198 | full='--center-x --center-y --scale-width=100 --scale-width=100' |
188 | tile='--tile' | 199 | tile='--tile' |
189 | center='--center-x --center-y' | 200 | center='--center-x --center-y' |
201 | aspect=$full | ||
190 | ;; | 202 | ;; |
191 | display) | 203 | display) |
192 | full='-geometry 800x600 -window root' | 204 | full='`xwininfo -root|grep geom` -window root' |
193 | tile='-window root' | 205 | tile='-window root' |
194 | center='-backdrop -window root' | 206 | center='-backdrop -window root' |
207 | aspect=$full | ||
195 | ;; | 208 | ;; |
196 | Esetroot) | 209 | Esetroot) |
197 | full='-scale' | 210 | full='-scale' |
198 | tile='' | 211 | tile='' |
199 | center='-c' | 212 | center='-c' |
213 | aspect='-fit' | ||
200 | ;; | 214 | ;; |
201 | wmsetbg) | 215 | wmsetbg) |
202 | full='-s -S' | 216 | full='-s -S' |
203 | tile='-t' | 217 | tile='-t' |
204 | center='-b black -e' | 218 | center='-b black -e' |
219 | aspect='-b black -a' | ||
205 | ;; | 220 | ;; |
206 | xsetbg) | 221 | xsetbg) |
207 | full='-fillscreen' | 222 | tile='-border black' |
208 | tile='' | 223 | center='-center -border black' |
209 | center='-center' | 224 | aspect='-fullscreen -border black' |
225 | full=$aspect #broken | ||
210 | ;; | 226 | ;; |
211 | xli) | 227 | xli) |
212 | full='-fillscreen -onroot -quiet' | 228 | tile='-onroot -quiet -border black' |
213 | tile='-onroot -quiet' | 229 | center='-center -onroot -quiet -border black' |
214 | center='-center -onroot quiet' | 230 | aspect='-fullscreen -onroot -quiet -border black' |
231 | full=$aspect #broken | ||
215 | ;; | 232 | ;; |
216 | qiv) | 233 | qiv) |
217 | full='--root_s' | 234 | full='--root_s' |
218 | tile='--root_t' | 235 | tile='--root_t' |
219 | center='--root' | 236 | center='--root' |
237 | aspect='-m --root' | ||
220 | ;; | 238 | ;; |
221 | xv) | 239 | xv) |
222 | full='-max -smooth -root -quit' | 240 | full='-max -smooth -root -quit' |
223 | tile='-root -quit' | 241 | tile='-root -quit' |
224 | center='-rmode 5 -root -quit' | 242 | center='-rmode 5 -root -quit' |
243 | aspect='-maxpect -smooth -root -quit' | ||
225 | ;; | 244 | ;; |
226 | '') | 245 | '') |
227 | message "Can't find and app to set the wallpaper with. | 246 | message "Can't find and app to set the wallpaper with. |
@@ -230,22 +249,23 @@ Use fbsetbg -d to find out what to do next" | |||
230 | esac | 249 | esac |
231 | 250 | ||
232 | #Get options. | 251 | #Get options. |
233 | getopts ":f:c:t:Tlh-" COMMAND_LINE_ARGUMENT | 252 | getopts ":a:f:c:t:Tlh-" COMMAND_LINE_ARGUMENT |
234 | case "${COMMAND_LINE_ARGUMENT}" in | 253 | case "${COMMAND_LINE_ARGUMENT}" in |
254 | a) option=$aspect | ||
255 | wallpaper=$OPTARG | ||
256 | remembercommand | ||
257 | ;; | ||
235 | f) option=$full | 258 | f) option=$full |
236 | wallpaper=$OPTARG | 259 | wallpaper=$OPTARG |
237 | echo $option > $lastwallpaper | 260 | remembercommand |
238 | echo $wallpaper >> $lastwallpaper | ||
239 | ;; | 261 | ;; |
240 | c) option=$center | 262 | c) option=$center |
241 | wallpaper=$OPTARG | 263 | wallpaper=$OPTARG |
242 | echo $option > $lastwallpaper | 264 | remembercommand |
243 | echo $wallpaper >> $lastwallpaper | ||
244 | ;; | 265 | ;; |
245 | t) option=$tile | 266 | t) option=$tile |
246 | wallpaper=$OPTARG | 267 | wallpaper=$OPTARG |
247 | echo $option > $lastwallpaper | 268 | remembercommand |
248 | echo $wallpaper >> $lastwallpaper | ||
249 | ;; | 269 | ;; |
250 | l) | 270 | l) |
251 | if [ -r $lastwallpaper ];then | 271 | if [ -r $lastwallpaper ];then |