From 469398a950a48b90e361a72008a3c4ae6fab37bf Mon Sep 17 00:00:00 2001 From: Adam Date: Sun, 10 Apr 2022 14:30:00 -0600 Subject: [PATCH] feat: validate desktop environment Check that the desktop environment currently being used is GNOME. --- usr/local/bin/wallpaperctl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/usr/local/bin/wallpaperctl b/usr/local/bin/wallpaperctl index 708edd2..dc3dc6f 100755 --- a/usr/local/bin/wallpaperctl +++ b/usr/local/bin/wallpaperctl @@ -3,6 +3,10 @@ gversion="0" pictureuri="picture-uri" validate_config() { + if [ "$XDG_CURRENT_DESKTOP" != "GNOME" ]; then + quit "Error: GNOME is not detected. Please install GNOME." + fi + if [ -z "$WALLPAPER_DIR" ]; then quit "Error: The wallpaper directory environment variable (WALLPAPER_DIR) has not been set." fi