diff --git a/contrib/PKGBUILD b/contrib/PKGBUILD new file mode 100644 index 0000000..7560665 --- /dev/null +++ b/contrib/PKGBUILD @@ -0,0 +1,39 @@ +# Maintainer: Aakash Sharma +# Contributor: Sergey A. +# Contributor: rv178 + +_pkgname="swhkd" +pkgname="${_pkgname}-git" +pkgver=.552.g1b6cf27 +pkgrel=2 +arch=("x86_64") +url="https://github.com/waycrate/swhkd" +pkgdesc="A display server independent hotkey daemon inspired by sxhkd." +license=("BSD") +depends=("polkit") +makedepends=("rustup" "make" "git" "scdoc") +conflicts=("swhkd-musl-git") +source=("${_pkgname}::git+${url}.git") +sha256sums=("SKIP") + +build(){ + cd "$_pkgname" + make setup + make +} + +package() { + cd "$_pkgname" + install -Dm 755 ./target/release/swhkd "$pkgdir/usr/bin/swhkd" + install -Dm 755 ./target/release/swhks "$pkgdir/usr/bin/swhks" + + install -Dm 644 -o root ./com.github.swhkd.pkexec.policy -t "$pkgdir/usr/share/polkit-1/actions" + + install -Dm 644 ./docs/*.1.gz -t "$pkgdir/usr/share/man/man1/" + install -Dm 644 ./docs/*.5.gz -t "$pkgdir/usr/share/man/man5/" +} + +pkgver() { + cd $_pkgname + echo "$(grep "^version =" Cargo.toml|head -n1|cut -d\" -f2|cut -d\- -f1).$(git rev-list --count HEAD).g$(git rev-parse --short HEAD)" +} diff --git a/contrib/glibc/PKGBUILD b/contrib/glibc/PKGBUILD deleted file mode 100644 index 5d64f4d..0000000 --- a/contrib/glibc/PKGBUILD +++ /dev/null @@ -1,32 +0,0 @@ -# Maintainer: Aakash Sharma -pkgname='swhkd-git' -_pkgname="swhkd" -pkgver=1 -pkgrel=1 -arch=('x86_64') -url="https://github.com/waycrate/swhkd" -pkgdesc="A display server independent hotkey daemon inspired by sxhkd." -license=('BSD') -depends=('polkit') -makedepends=('rustup' 'make' 'git') -conflicts=('swhkd-musl-git') -source=("$_pkgname::git+https://github.com/waycrate/$_pkgname") -sha256sums=('SKIP') - -build(){ - cd "$_pkgname" - make setup - make glibc -} - -package() { - cd "$_pkgname" - install -Dm 755 ./bin/swhkd "$pkgdir/usr/bin/swhkd" - install -Dm 755 ./bin/swhks "$pkgdir/usr/bin/swhks" - install -Dm 644 ./swhkd.rules "$pkgdir/etc/polkit-1/rules.d/swhkd.rules" -} - -pkgver() { - cd $_pkgname - echo "$(grep '^version =' Cargo.toml|head -n1|cut -d\" -f2|cut -d\- -f1).$(git rev-list --count HEAD).g$(git rev-parse --short HEAD)" -} 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" + diff --git a/contrib/init/systemd/README.md b/contrib/init/systemd/README.md new file mode 100644 index 0000000..fc9d7a9 --- /dev/null +++ b/contrib/init/systemd/README.md @@ -0,0 +1,9 @@ +## systemd Instructions + +To have systemd automatically start `swhkd` for you: + +1. Copy `hotkeys.sh` into your preferred directory +2. `chmod +x hotkeys.sh` +3. Copy `hotkeys.service` into your `$XDG_CONFIG_DIR/systemd/user` directory +4. Using a text editor, uncomment line 7 of `hotkeys.service` and change the path accordingly +5. In a terminal: `systemctl --user enable hotkeys.service` diff --git a/contrib/init/systemd/hotkeys.service b/contrib/init/systemd/hotkeys.service new file mode 100644 index 0000000..db8b2c0 --- /dev/null +++ b/contrib/init/systemd/hotkeys.service @@ -0,0 +1,10 @@ +[Unit] +Description=swhkd hotkey daemon +BindsTo=default.target + +[Service] +Type=simple +# ExecStart=/path/to/hotkeys.sh + +[Install] +WantedBy=default.target diff --git a/contrib/init/systemd/hotkeys.sh b/contrib/init/systemd/hotkeys.sh new file mode 100755 index 0000000..0ce2516 --- /dev/null +++ b/contrib/init/systemd/hotkeys.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +killall swhks + +swhks & pkexec swhkd diff --git a/contrib/musl_libc/PKGBUILD b/contrib/musl_libc/PKGBUILD deleted file mode 100644 index 2ba447f..0000000 --- a/contrib/musl_libc/PKGBUILD +++ /dev/null @@ -1,32 +0,0 @@ -# Maintainer: Aakash Sharma -pkgname='swhkd-musl-git' -_pkgname="swhkd" -pkgver=1 -pkgrel=1 -arch=('x86_64') -url="https://github.com/waycrate/swhkd" -pkgdesc="A display server independent hotkey daemon inspired by sxhkd." -license=('BSD') -conflicts=('swhkd-glib-git') -depends=('polkit') -makedepends=('rustup' 'make' 'git') -source=("$_pkgname::git+https://github.com/waycrate/$_pkgname") -sha256sums=('SKIP') - -build(){ - cd "$_pkgname" - make setup - make -} - -package() { - cd "$_pkgname" - install -Dm 755 ./bin/swhkd "$pkgdir/usr/bin/swhkd" - install -Dm 755 ./bin/swhks "$pkgdir/usr/bin/swhks" - install -Dm 644 ./swhkd.rules "$pkgdir/etc/polkit-1/rules.d/swhkd.rules" -} - -pkgver() { - cd $_pkgname - echo "$(grep '^version =' Cargo.toml|head -n1|cut -d\" -f2|cut -d\- -f1).$(git rev-list --count HEAD).g$(git rev-parse --short HEAD)" -}