~scripts
40 itemsDownload ./*


..
dzen2
tiling
vosh
4cdl
4trips
alarm
ambient
battery-monitor
checkit
cleverbot.py
clock
color-gen
colors-hex
compton
dailywall
dmenu
importw
indexer
keep-on
mp3ogg
orage
pipes
pipes.x
rain
randwall
screen-dim
screencast
screencast2
scrot
scrotw
search
skull
slocker
starwars
streamit
sumnum
tty-colorize
usrmount
ytp
ytplay


scriptsrandwall
4 months agoDownloadRawClose


#!/bin/bash
#
# Author:      Twily                            2017
# Description: Wallpaper switcher ever X second.
# Usage:       $ nohup ./randwall > /dev/null 2>&1 &
#              (ps aux|grep randwall)
# Requires:    curl and python for remote wallpapers
# Source:      desktoppr: https://gist.github.com/zviryatko/055f8f4850bf17323c4f127a4daeccdf
#

lock() {
    exec 200>/var/lock/.randwall.exclusivelock
    flock -n 200 && return 0 || return 1
}
lock || exit 1


DIR="/home/amalie/Pictures/WP"
LST="/tmp/myimages.list"

SEC=$(( 10 * 60  ))

while :; do
    # Use local images
    #rm -f "$LST"
    #find $DIR -type f \( -iname \*.jpg -o -iname \*.jpeg -o -iname \*.png \) > "$LST"
    #PIC=$(shuf -n 1 "$LST")

    # Use remote images (requires curl, python, optional imagemagic)
    PIC="/tmp/wallpaper.jpg"
    curl -s `curl -s https://api.desktoppr.co/1/wallpapers/random | python -c "import json,sys; obj=json.load(sys.stdin); print obj['response']['image']['url'];"` > $PIC
    convert $PIC -blur 0x16 $PIC

    #pcmanfm --set-wallpaper "$PIC"
    feh "$PIC" --bg-fill

    sleep $SEC
done


exit

Top
twily at openmailbox dot org
©twily.info 2013 - 2017



744 068 visits
... ^ v