From 078c6af77db19f23bda0f991ce6adfe6cd9bc3d5 Mon Sep 17 00:00:00 2001 From: Tony George Date: Mon, 16 Nov 2020 17:49:05 +0530 Subject: [PATCH] Update launcher script --- src/timeshift-launcher | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/timeshift-launcher b/src/timeshift-launcher index aef6067..29b8fc4 100755 --- a/src/timeshift-launcher +++ b/src/timeshift-launcher @@ -2,17 +2,17 @@ app_command='timeshift-gtk' -if [ `id -u` -eq 0 ]; then - #user is admin +if [ "$(id -u)" -eq 0 ]; then + # user is admin ${app_command} else - #user is not admin - if `echo $- | grep "i" >/dev/null 2>&1`; then - #script is running in interactive mode + # user is not admin + if echo $- | grep "i" >/dev/null 2>&1; then + # script is running in interactive mode su - -c "${app_command}" else - #script is running in non-interactive mode - if [ $XDG_SESSION_TYPE = "wayland" ] ; then + # script is running in non-interactive mode + if [ "$XDG_SESSION_TYPE" = "wayland" ] ; then xhost +SI:localuser:root pkexec ${app_command} xhost -SI:localuser:root