blob: ddfa56a6df14eafdab1e6f2d094453e6f12c05fb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
#!/bin/sh
BIN_PATH=~/.local/share/python-dateTimeSetter/dateTime
SCRIPT_PATH=~/.local/share/python-dateTimeSetter/dateTime.py
if [ -f "$BIN_PATH" ]; then
if command -v lxsudo > /dev/null 2>&1; then
lxsudo $BIN_PATH
elif command -v gksudo > /dev/null 2>&1; then
gksudo $BIN_PATH
elif command -v pkexec > /dev/null 2>&1; then
pkexec env DISPLAY="$DISPLAY" XAUTHORITY="$XAUTHORITY" $BIN_PATH
else
echo "No suitable graphical authentication tool found. Running without root privileges."
notify-send "No suitable graphical authentication tool found. Running without root privileges."
$BIN_PATH
fi
elif [ -f "$SCRIPT_PATH" ]; then
if command -v lxsudo > /dev/null 2>&1; then
lxsudo python3 $SCRIPT_PATH
elif command -v gksudo > /dev/null 2>&1; then
gksudo python3 $SCRIPT_PATH
elif command -v pkexec > /dev/null 2>&1; then
pkexec env DISPLAY="$DISPLAY" XAUTHORITY="$XAUTHORITY" python3 $SCRIPT_PATH
else
echo "No suitable graphical authentication tool found. Running without root privileges."
notify-send "No suitable graphical authentication tool found. Running without root privileges."
python3 $SCRIPT_PATH
fi
else
echo "dateTime/dateTime.py not found"
notify-send "Error!" "dateTime/dateTime.py not found" --urgency critical
fi
|