返回顶部

收藏

Shiftwallpaper.sh 每隔数秒更换墙纸的脚本

更多
#!/usr/bin/env bash
#  shiftwallpaper.sh
#  A very simple bash script to shift wallpaper every n seconds.
#  Turns your desktop in a kind of digital frame :-)
#  Tested in and for Fluxbox [TM].
#  Public Domain Code. No Warranty at all.
#  ksaver, July 2011.

# Modify this line to you own wallpapers directory.
WALLPAPER_DIR="$HOME/MyPictures/Wallpaper"

# Set interval in seconds to shift wallpaper.
WAIT=120

function load_wallpapers()
{
    # Load the wallpaper list into an array
    # loads new wallpapers added to directory in runtime.
    n=0
    for wallpaper in "$1/*"; do
        wallpaper_list[n]=$wallpaper
        let n=$n+1
    done
}

function rotate_wallpapers()
{
    # Rotate wallpaper every n seconds.
    for wallpaper in ${wallpaper_list[@]}; do
        /usr/bin/env fbsetbg -F $wallpaper
        sleep $1
    done
}

## main()
while [ True ]; do
    load_wallpapers   $WALLPAPER_DIR
    rotate_wallpapers $WAIT
done
#该片段来自于http://outofmemory.cn

标签:shell,系统

收藏

0人收藏

支持

0

反对

0

»更多 您可能感兴趣的代码
  1. 2014-05-29 10:38:01备份linux nat服务器配置 by Echo
  2. 2014-07-03 11:04:19给每个盘添加卷标 by 玖夏
  3. 2014-07-29 12:31:11设置BASH快捷键 by zjbpku
  4. 2014-08-10 11:52:21被锁定帐户 by shixiaoliang
  5. 2014-08-27 11:38:35弹出光驱 by owensh
  6. 2014-08-31 20:49:55把当前目录的文件写入到指定的文档中 by 屠夫
  7. 2014-09-18 12:39:26PowerDesiger 将Name中的字符COPY至Comment中 by shixiaoliang
  8. 2014-10-07 09:25:25查看网关的MAC地址 by xfk
  9. 2014-11-07 09:55:38显示用户名 by 0晓风残月0
  10. 2014-04-21 14:41:26nagios检测cpu的插件 by Smile_love
  11. 2014-04-24 17:28:06记录系统运行状态 by 屠夫

发表评论