Skip to content

Commit 80c4206

Browse files
committed
Fix desktop auto launch
1 parent a4227a7 commit 80c4206

File tree

1 file changed

+13
-10
lines changed
  • demo/desktop-auto-launch

1 file changed

+13
-10
lines changed

demo/desktop-auto-launch/.init

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,25 @@ PATH="/run/dojo/bin:$PATH"
44
USER="hacker"
55

66
xfce_env() {
7-
local session_pid
8-
session_pid=$(pgrep -u "$USER" xfce4-session | head -n1)
9-
xargs -0 -a /proc/"$session_pid"/environ
7+
local session_pid
8+
session_pid=$(pgrep -u "$USER" xfce4-session | head -n1)
9+
xargs -0 -a /proc/"$session_pid"/environ
1010
}
1111

1212
xfce_run() {
13-
setsid su "$USER" -c "env - $(xfce_env) $*"
13+
id
14+
which su
15+
echo "$USER"
16+
setsid runuser "$USER" -c "env - $(xfce_env) $*"
1417
}
1518

1619
# Launch a background process that waits for xfce4-session and then runs the command.
1720
(
18-
while ! pgrep -u "$USER" xfce4-session > /dev/null; do
19-
sleep 1
20-
done
21+
while ! pgrep -u "$USER" xfce4-session > /dev/null; do
22+
sleep 1
23+
done
2124

22-
# Consider using `--geometry` to set the window size and position
23-
# Consider using `--fullscreen` to launch the application in fullscreen mode
24-
xfce_run exo-open --launch TerminalEmulator
25+
# Consider using `--geometry` to set the window size and position
26+
# Consider using `--fullscreen` to launch the application in fullscreen mode
27+
xfce_run exo-open --launch TerminalEmulator
2528
) &

0 commit comments

Comments
 (0)