Skip to content

Commit 98af104

Browse files
authored
Specify the environment variables named DISPLAY and XAUTHORITY (#384)
1 parent b20c307 commit 98af104

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/timeshift-launcher

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@ else
99
# user is not admin
1010
if echo $- | grep "i" >/dev/null 2>&1; then
1111
# script is running in interactive mode
12-
su - -c "${app_command}"
12+
su - -c "pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY ${app_command}"
1313
else
1414
# script is running in non-interactive mode
1515
if [ "$XDG_SESSION_TYPE" = "wayland" ] ; then
1616
xhost +SI:localuser:root
17-
pkexec ${app_command}
17+
pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY ${app_command}
1818
xhost -SI:localuser:root
1919
xhost
2020
elif command -v pkexec >/dev/null 2>&1; then
21-
pkexec ${app_command}
21+
pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY ${app_command}
2222
elif command -v sudo >/dev/null 2>&1; then
2323
x-terminal-emulator -e "sudo ${app_command}"
2424
elif command -v su >/dev/null 2>&1; then

0 commit comments

Comments
 (0)