commit 953012a8c92db23203e221a3ef3ec0c211c21f7a
parent ed0c39482da0c029bc1eaea72ec0114ad482fbd0
Author: Alex Balgavy <alex@balgavy.eu>
Date: Wed, 22 Jun 2022 11:44:15 +0200
waldl: die if HOME not set
Diffstat:
1 file changed, 3 insertions(+), 0 deletions(-)
diff --git a/scripts/waldl b/scripts/waldl
@@ -1,7 +1,10 @@
#!/bin/sh
+die() { printf '%s\n' "$1" >&2 && exit 1; }
+
set -x
# script to find and download wallpapers from wallhaven
+[ -z "$HOME" ] && die '$HOME not set.'
walldir="$HOME/.local/share/wallhaven"
cachedir="$HOME/.cache/wallhaven"
mkdir -p "$walldir"