Skip to content

Commit 1594251

Browse files
fkobiemersion
authored andcommitted
Add OpenRC user init scrpt
OpenRC supports user services since 0.60. This commit adds a simple service script that mimics what the systemd service is doing. Wrote & tested on Gentoo, inspired by gui-apps/foot's. Please note that checking $WAYLAND_SESSION requires `rc_env_allow=WAYLAND_DISPLAY` to be set in user's `/rc.conf` Closes: #614 Signed-off-by: Filip Kobierski <fkobi@pm.me>
1 parent c2c0d04 commit 1594251

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

contrib/openrc-user.init

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/sbin/openrc-run
2+
3+
description="Lightweight Wayland notification daemon"
4+
5+
supervisor="supervise-daemon"
6+
command="/usr/bin/mako"
7+
8+
depend() {
9+
after dbus
10+
provide notification-daemon
11+
}
12+
13+
start_pre() {
14+
if [ -z "$WAYLAND_DISPLAY" ]; then
15+
eerror "\$WAYLAND_DISPLAY unset, can't proceed."
16+
return 1
17+
fi
18+
}
19+
20+
extra_started_commands="reload"
21+
description_reload="Reload mako configuration using makoctl"
22+
reload() {
23+
makoctl reload
24+
eend $? "Reloaded mako configuration"
25+
}

0 commit comments

Comments
 (0)