Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
[Unit]
Description=Define output profiles that are automatically enabled and disabled on hotplug
PartOf=sway-session.target
After=sway-session.target
[Service]
Type=simple
ExecStart=/usr/bin/kanshi
Restart=on-failure
[Install]
WantedBy=sway-session.target
# Maintainer: Ben Widawsky <ben@bwidawsk.net>
pkgname=kanshi-git
pkgver=r92.dabd7a2
pkgrel=1
pkgdesc="Dynamic display configuration for WMs like i3/sway"
arch=(x86_64)
url="https://github.com/emersion/kanshi"
license=('MIT')
groups=()
depends=('wlroots>=0.7')
optdepends=('sway-services-git: for kanshi systemd unit')
makedepends=('git' 'meson' 'ninja' 'scdoc' 'wayland')
provides=("${pkgname%-git}")
conflicts=("${pkgname%-git}")
replaces=()
backup=()
options=()
install=
source=('kanshi::git+https://github.com/emersion/kanshi.git' 'kanshi.service')
noextract=()
md5sums=('SKIP' 'b6a11315894951b867a4c1d0423e4ea9')
pkgver() {
cd "$srcdir/${pkgname%-git}"
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}
prepare() {
cd "${srcdir}/${pkgname%-git}"
mkdir -p build
meson build \
--buildtype=release \
--prefix=/usr
}
build() {
cd "${srcdir}/${pkgname%-git}"
ninja -C build
}
package() {
cd "$srcdir/${pkgname%-git}"
DESTDIR="${pkgdir}/" ninja -C build install
install -D -m 644 -o root -g root -t "${pkgdir}/usr/lib/systemd/system" "${srcdir}/kanshi.service"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment