summaryrefslogtreecommitdiffstats
path: root/system/timeshift/timeshift-launcher
diff options
context:
space:
mode:
Diffstat (limited to 'system/timeshift/timeshift-launcher')
-rw-r--r--system/timeshift/timeshift-launcher17
1 files changed, 17 insertions, 0 deletions
diff --git a/system/timeshift/timeshift-launcher b/system/timeshift/timeshift-launcher
new file mode 100644
index 0000000000..37e8cb7ab4
--- /dev/null
+++ b/system/timeshift/timeshift-launcher
@@ -0,0 +1,17 @@
+#!/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