From 2930e933305e653f2f26deacd459dd100f257168 Mon Sep 17 00:00:00 2001 From: "Adam T. Carpenter" Date: Fri, 15 May 2020 07:55:58 -0400 Subject: updated i3blocks, fixed themer, added 6cord, combined docked and undocked into toggle-docked --- themer.sh | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) (limited to 'themer.sh') diff --git a/themer.sh b/themer.sh index c8b01a0..b36c444 100755 --- a/themer.sh +++ b/themer.sh @@ -1,26 +1,30 @@ #!/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" + indir="$1" + [ -z "$indir" ] && indir=$HOME/downloads + outdir=$HOME/.local/share/wallpapers + [ ! -d "$indir" ] && exit 1 + [ ! -d "$outdir" ] && mkdir -p "$outdir" + sxiv -rot "$indir" | while read infile; do + outfile="$outdir"/$(basename "$infile") + convert "$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 & + 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 & } +reapply_theme() { + wpg -s "$(wpg -c)" +} + +[ "$1" = "-r" ] && reapply_theme && exit [ "$1" = "-a" ] && add_theme "$2" -set_theme +[ "$1" = "-s" ] && set_theme wait -- cgit v1.2.3