commit d6f258639ae4b92c1af04343989908f65975e406 parent 77c4647032e0a6850f0a81ebfd1d84587d34ce69 Author: oscarbenedito <oscar@oscarbenedito.com> Date: Mon, 27 Apr 2020 23:37:47 +0200 Fixed i3-lock when no env variables Diffstat:
M | dot_local/bin/executable_,i3-lock | | | 8 | ++++++-- |
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/dot_local/bin/executable_,i3-lock b/dot_local/bin/executable_,i3-lock @@ -1,12 +1,16 @@ #!/usr/bin/env sh +XDG_CONFIG_HOME=${XDG_CONFIG_HOME:-"$HOME/.config"} +XDG_CACHE_HOME=${XDG_CACHE_HOME:-"$HOME/.cache"} + DIMS="$(xdpyinfo | grep dimensions | awk '{print $2}')" WALL="$XDG_CONFIG_HOME/i3/wallpaper.png" OUTDIR="$XDG_CACHE_HOME/i3/wallpapers" OUT="$OUTDIR/$DIMS.png" -[ -f "$OUT" ] && i3lock -i "$OUT" && exit -[ ! -f "$WALL" ] && i3lock -c 142a3a && exit +[ -f "$OUT" ] && i3lock -i "$OUT" && sleep 0.3 && xset dpms force off && exit +[ ! -f "$WALL" ] && i3lock -c 142a3a && sleep 0.3 && xset dpms force off && exit [ ! -d "$OUTDIR" ] && mkdir --parents $OUTDIR convert -resize "$DIMS^" -gravity center -extent "$DIMS" $WALL $OUT i3lock -i "$OUT" +sleep 0.3 && xset dpms force off && exit