分页: 1 / 1

简短的设置壁纸程序

发表于 : 2011-07-24 22:18
wiewi
[bash]

[liwei@myhost ~] $ >>_ cat bin/setwallpaper
#!/bin/bash
# Set background using hsetroot,with a file selection dialog of zenity
# Necessary parts: zenity,hsetroot(or other similar wallpaper programs)
# 11/07/24,[email protected]

Dest=$HOME/media/images/background/1280x800

[ -d "$Dest" ] && cd "$Dest"
[ "$?" -ne 0 ] && zenity --notification --text="No such directory: $Dest" && exit 1

Wallpaper=$(zenity --file-selection --title=请选择壁纸)

[ -n "$Wallpaper" ] &&{
ln -sf "$Wallpaper" ~/.wallpaper
hsetroot -fill ~/.wallpaper && exit 0
}

[/bash]
来个图吧
:em06 :em06
2011-07-24-22-21-30.png

Re: 简短的设置壁纸程序

发表于 : 2011-07-24 22:47
monk
很少看到桌面
不过还是支持一下 :em11

Re: 简短的设置壁纸程序

发表于 : 2011-07-24 22:59
wiewi
monk 写了:很少看到桌面
不过还是支持一下 :em11
纯CLI & Coder? ym~~

Re: 简短的设置壁纸程序

发表于 : 2011-07-25 12:40
vinoca
不错。早上也搞了个,每5分钟换壁纸,rox+openbox环境。
crontab -e :
*/5 * * * * /home/user/.config/scripts/chbg.sh `bash -c 'echo /media/Wallpaper/$(ls /media/Wallpaper/ | sed -n "$(($RANDOM%$(ls /media/Wallpaper/ | wc -l)+1))p")'`

/home/user/.config/scripts/chbg.sh :

#!/bin/sh
rox --RPC << EOF
<?xml version="1.0"?>
<env:Envelope xmlns:env="http://www.w3.org/2001/12/soap-envelope">
<env:Body xmlns="http://rox.sourceforge.net/SOAP/ROX-Filer">
<SetBackdrop>
<Filename>$1</Filename>
<Style>Stretch</Style>
</SetBackdrop>
</env:Body>
</env:Envelope>

EOF

不用rox -pDefault,也可以是这样:hsetroot -fill "$(find /media/Wallpaper/ -type f | shuf -n 1)"

Re: 简短的设置壁纸程序

发表于 : 2011-07-25 16:31
eexpress
--RPC... 还真不知道这。