blob: c8b01a0861ea7cac75d61052e35504807a7e4b06 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
#!/bin/sh
add_theme() {
INDIR="$1"
[ -z "$INDIR" ] && INDIR=$HOME/pictures/wallpapers
OUTDIR=$HOME/.local/share/wallpapers
[ ! -d "$INDIR" ] && exit 1
[ ! -d "$OUTDIR" ] && mkdir -p "$OUTDIR"
for INFILE in $(sxiv -rot "$INDIR"); do
OUTFILE="$OUTDIR"/$(basename "$INFILE")
convert -verbose "$INFILE" -geometry 1920x1080^ -gravity center -crop 1920x1080+0+0 "$OUTFILE"
wpg -a "$OUTFILE"
done
wait
}
set_theme() {
THEME=$(sxiv -rot $HOME/.config/wpg/wallpapers)
[ -z "$THEME" ] && exit 4
wpg -s "$THEME" &
convert -verbose -background black -vignette 100x65000 "$THEME" $HOME/.local/share/wallpapers/lock.png &
}
[ "$1" = "-a" ] && add_theme "$2"
set_theme
wait
|