From 2a93b1ab669c6a90ad253306e5cf3d84ed3cc041 Mon Sep 17 00:00:00 2001 From: Quad Date: Sat, 22 May 2021 19:01:02 +0200 Subject: [PATCH] Fix sudo prompt --- scripts/tdp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/tdp b/scripts/tdp index 0ce56f2..62231dd 100755 --- a/scripts/tdp +++ b/scripts/tdp @@ -147,6 +147,8 @@ set_pl () { fi if [ "$EUID" -eq 0 ]; then echo $(w_to_uw $2) > $pl_path + elif [ $gui_used == 1 ]; then + sudo -A bash -c "echo $(w_to_uw $2) > ${pl_path}" else sudo bash -c "echo $(w_to_uw $2) > ${pl_path}" fi @@ -227,6 +229,7 @@ gui_handler() { print_help "gui" else export SUDO_ASKPASS="${script_dir}/gpd-sudo-prompt" + export gui_used=1 while : ; do # Contains some ugly hacks to "widen" the entries for the small GPD screen, might tweak later gui_action=$(zenity --list --title="${gui_name}" --width=400 --height=300 $gui_options --text="Chose action to perform:" --hide-column=1 --column="" --column="Action"\