Skip to content

Commit 57f2e66

Browse files
committed
Add demo module, with desktop auto launch demo
1 parent adb60f1 commit 57f2e66

File tree

4 files changed

+25
-0
lines changed

4 files changed

+25
-0
lines changed

demo/DESCRIPTION.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This module demonstrates some more interesting ideas.

demo/desktop-auto-launch/.init

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/sh
2+
3+
PATH="/run/dojo/bin:$PATH"
4+
USER="hacker"
5+
6+
xfce_env() {
7+
local session_pid
8+
session_pid=$(pgrep -u "$USER" xfce4-session | head -n1)
9+
xargs -0 -a /proc/"$session_pid"/environ
10+
}
11+
12+
xfce_run() {
13+
setsid su "$USER" -c "env - $(xfce_env) $*"
14+
}
15+
16+
# Consider using `--geometry` to set the window size and position
17+
# Consider using `--fullscreen` to launch the application in fullscreen mode
18+
19+
xfce_run exo-open --launch TerminalEmulator

demo/module.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
name: Demo
2+
challenges:
3+
- id: desktop-auto-launch
4+
name: Desktop Auto Launch

dojo.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ image: pwncollege/challenge-simple
77
modules:
88
- id: hello
99
- id: world
10+
- id: demo

0 commit comments

Comments
 (0)