From 7986b63aa28070cff1a169af16bab63db1845002 Mon Sep 17 00:00:00 2001 From: Ivan Dimitrov Date: Sun, 3 Jul 2022 12:35:04 +0000 Subject: [PATCH] [contrib]OpenRC service file --- README.md | 2 +- contrib/init/openrc/README.md | 9 +++++++++ contrib/init/openrc/swhkd | 6 ++++++ 3 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 contrib/init/openrc/README.md create mode 100755 contrib/init/openrc/swhkd diff --git a/README.md b/README.md index 174af8b..7948ee4 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ All supported key and modifier names are listed in `man 5 swhkd-keys`. ### To autostart swhkd you can do one of two things: 1. Add the commands from the ["Running" section](https://github.com/waycrate/swhkd#running) to your window managers configuration file. -1. Enable the [service file](https://github.com/waycrate/swhkd/tree/main/contrib/init) for your respective init system. Currently only systemd service files exist and more will be added soon including Runit and OpenRC. +1. Enable the [service file](https://github.com/waycrate/swhkd/tree/main/contrib/init) for your respective init system. Currently only systemd and OpenRC service files exist and more will be added soon including Runit. ## Security: diff --git a/contrib/init/openrc/README.md b/contrib/init/openrc/README.md new file mode 100644 index 0000000..01ca2a3 --- /dev/null +++ b/contrib/init/openrc/README.md @@ -0,0 +1,9 @@ +## OpenRC Instructions + +To have OpenRC automatically start `swhkd` for you: + +1. `chmod +x swhkd` +2. Copy `swhkd` into /etc/init.d/ +3. Run `sudo rc-update add swhkd` +4. Run `swhks` on login ( Add it to your `.xinitrc` file or your setup script ) + diff --git a/contrib/init/openrc/swhkd b/contrib/init/openrc/swhkd new file mode 100755 index 0000000..eb944d3 --- /dev/null +++ b/contrib/init/openrc/swhkd @@ -0,0 +1,6 @@ +#!/sbin/openrc-run + +command="/usr/bin/swhkd" +command_background=true +pidfile="/run/${RC_SVCNAME}.pid" +