Update launcher script

This commit is contained in:
Tony George 2020-11-16 17:49:05 +05:30
parent 151a4d586e
commit 078c6af77d

View File

@ -2,17 +2,17 @@
app_command='timeshift-gtk' app_command='timeshift-gtk'
if [ `id -u` -eq 0 ]; then if [ "$(id -u)" -eq 0 ]; then
#user is admin # user is admin
${app_command} ${app_command}
else else
#user is not admin # user is not admin
if `echo $- | grep "i" >/dev/null 2>&1`; then if echo $- | grep "i" >/dev/null 2>&1; then
#script is running in interactive mode # script is running in interactive mode
su - -c "${app_command}" su - -c "${app_command}"
else else
#script is running in non-interactive mode # script is running in non-interactive mode
if [ $XDG_SESSION_TYPE = "wayland" ] ; then if [ "$XDG_SESSION_TYPE" = "wayland" ] ; then
xhost +SI:localuser:root xhost +SI:localuser:root
pkexec ${app_command} pkexec ${app_command}
xhost -SI:localuser:root xhost -SI:localuser:root