mirror of
https://github.com/Ponce/slackbuilds
synced 2024-11-16 19:50:19 +01:00
be6d494aa4
Signed-off-by: Andrew Clemons <andrew.clemons@gmail.com> Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
17 lines
326 B
Bash
17 lines
326 B
Bash
#!/bin/bash
|
|
|
|
app_command='timeshift-gtk'
|
|
|
|
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
|
|
su - -c "${app_command}"
|
|
else
|
|
# script is running in non-interactive mode
|
|
gksu ${app_command}
|
|
fi
|
|
fi
|