返回顶部

收藏

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-03-12 21:31:34改变我的文档路径 by xfk
  2. 2014-05-02 11:17:36禁止保留文档记录 by 凤歌
  3. 2014-05-27 10:32:06查看进程使用的端口 by Echo
  4. 2014-06-17 11:25:14批处理dos动态时钟 by owensh
  5. 2014-07-09 11:58:36测试一个进程是否存在 by 古殇
  6. 2014-07-19 09:50:44获得所有驱动器的盘符 by 凤歌
  7. 2014-08-21 19:54:37简单的防火墙脚本 by shixiaoliang
  8. 2014-10-16 10:16:22nginx服务自动启动 by 0晓风残月0
  9. 2014-10-22 12:30:10linux下批量添加用户 by Smile_love
  10. 2014-10-28 10:49:57程序加载进度条 by 玖夏
  11. 2014-03-13 17:19:37查看工作组 by xfk

发表评论