From f64f5727d0f7484932a68781592596a8dafb60e1 Mon Sep 17 00:00:00 2001 From: Aminda Suomalainen Date: Sat, 20 Jul 2024 07:20:06 +0300 Subject: [PATCH] darkman/wallpaper: error if lsb_release is not installed --- local/share/dark-mode.d/15-wallpaper-dark.bash | 7 +++++++ local/share/light-mode.d/15-wallpaper-light.bash | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/local/share/dark-mode.d/15-wallpaper-dark.bash b/local/share/dark-mode.d/15-wallpaper-dark.bash index dab6f0e4..defceaef 100755 --- a/local/share/dark-mode.d/15-wallpaper-dark.bash +++ b/local/share/dark-mode.d/15-wallpaper-dark.bash @@ -1,5 +1,12 @@ #!/usr/bin/env bash +if ! hash lsb_release 2> /dev/null; then + ERRORMESSAGE="lsb_release was not found, the wallpaper scripts cannot figure out the distribution" + echo $ERRORMESSAGE + notify-send $ERRORMESSAGE + exit 1 +fi + export DISTROID=$(lsb_release -si) export DISTROREL=$(lsb_release -sr) diff --git a/local/share/light-mode.d/15-wallpaper-light.bash b/local/share/light-mode.d/15-wallpaper-light.bash index 135d45e7..b07c4861 100755 --- a/local/share/light-mode.d/15-wallpaper-light.bash +++ b/local/share/light-mode.d/15-wallpaper-light.bash @@ -1,5 +1,12 @@ #!/usr/bin/env bash +if ! hash lsb_release 2> /dev/null; then + ERRORMESSAGE="lsb_release was not found, the wallpaper scripts cannot figure out the distribution" + echo $ERRORMESSAGE + notify-send $ERRORMESSAGE + exit 1 +fi + export DISTROID=$(lsb_release -si) export DISTROREL=$(lsb_release -sr)