Created Sway without systemd on Arch Linux (markdown)

robotanarchy 2016-12-29 07:43:12 +00:00
parent 7cb03f214b
commit 6a699ba710

@ -0,0 +1,70 @@
If you run an [Arch Linux based distribution without systemd](https://wiki.parabola.nu/OpenRC), you will need to add the `setuid-bit` and the `cap_sys_tty_config` ([issue 1022](https://github.com/SirCmpwn/sway/issues/1022)) to your `/usr/bin/sway` file, or otherwise it will not start.
### manually
These are the commands, that you need to run as *root* after each sway installation/update:
```
setcap cap_sys_tty_config=ep /usr/bin/sway
chmod +s /usr/bin/sway
```
### automated
Place the following two [hook](https://www.archlinux.org/pacman/alpm-hooks.5.html) files in `/etc/pacman.d/hooks` (create the folder, if it does not exist).
`sway-setuid.hook`
```
[Trigger]
Operation = Install
Type = Package
Target = sway
[Trigger]
Operation = Upgrade
Type = Package
Target = sway
[Trigger]
Operation = Install
Type = Package
Target = sway-git
[Trigger]
Operation = Upgrade
Type = Package
Target = sway-git
[Action]
Description = Applying setuid-bit to sway
When = PostTransaction
Exec = /usr/bin/chmod +s /usr/bin/sway
```
`sway-cap-sys-ttyconfig.hook`
```
[Trigger]
Operation = Install
Type = Package
Target = sway
[Trigger]
Operation = Upgrade
Type = Package
Target = sway
[Trigger]
Operation = Install
Type = Package
Target = sway-git
[Trigger]
Operation = Upgrade
Type = Package
Target = sway-git
[Action]
Description = Applying cap_sys_tty_config to sway
When = PostTransaction
Exec = /usr/bin/setcap cap_sys_tty_config=ep /usr/bin/sway
```