~scripts
55 itemsDownload ./*

55 itemsDownload ./*

..
dzen2
tiling
vosh
4cdl
4trips
alarm
ambient
ana-wall.sh
battery-monitor
brightness.sh
checkit
cleverbot.py
clock
color-gen
colors-hex
colorscheme.sh
compton
dailywall
dmenu
ffthumb
grid
gridmacro
gridmacro.kde
help
importw
indexer
install-all.sh
install-twily.sh
installng
keep-on
mp3ogg
orage
pipes
pipes.x
pipewire_bt.sh
ports
rain
randwall
rotate.sh
scan.sh
screen-dim
screencast
screencast2
scrot
scrotw
search
skull
slocker
starwars
streamit
sumnum
tty-colorize
usrmount
ytp
ytplay


scriptsrandwall
1 904•  6 years ago•  DownloadRawClose
6 years ago•  1 904

{}
#!/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.info 2013 - 2024
twily at twily dot info



2 017 433 visits
... ^ v