From f6961d8157f77ff9568250aa0ab95e3276a1ec77 Mon Sep 17 00:00:00 2001 From: q3aql Date: Sun, 29 May 2022 17:52:26 +0200 Subject: [PATCH] Fix run term with root (dmenu_themes) --- dmenu_themes | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/dmenu_themes b/dmenu_themes index 39a9e3d..d8fe5fe 100755 --- a/dmenu_themes +++ b/dmenu_themes @@ -48,8 +48,12 @@ function load_theme() { if [ -z "${file}" ] ; then echo "# Theme selector canceled" else - ${termrun} sudo ${main_folder}/scripts/build-theme.sh "${file}" - load_theme + if [ -f /usr/bin/sudo ] ; then + ${termrun} sudo ${main_folder}/scripts/build-theme.sh "${file}" + load_theme + else + ${termrun} su -c ${main_folder}/scripts/build-theme.sh "${file}" + fi fi }