summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorValentin Weber2024-04-03 22:03:29 +0200
committerValentin Weber2024-04-03 22:08:58 +0200
commitc706e4dd13ff1a3f09d0b07a6de708190219b407 (patch)
treed9665b3d706596855dc1913966b5b74e4e4b8a95
downloadaur-c706e4dd13ff1a3f09d0b07a6de708190219b407.tar.gz
Initial Commit
-rw-r--r--.SRCINFO17
-rw-r--r--PKGBUILD40
-rw-r--r--battery_status_rs_notification.service11
-rw-r--r--battery_status_rs_sleep.service11
4 files changed, 79 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..30c9155b357d
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,17 @@
+pkgbase = battery_status_rs
+ pkgdesc = A utility to watch the battery level and send the system to sleep if low.
+ pkgver = 3.0.0
+ pkgrel = 1
+ arch = any
+ makedepends = cargo
+ makedepends = git
+ source = git+https://git.unfug.hs-furtwangen.de/weva/battery_status_rs/#tag=3.0.0
+ source = battery_status_rs_notification.service
+ source = battery_status_rs_sleep.service
+ sha256sums = 4a858b6467fe4aba898c9a3f0b944cf0b3da51043903cb637971712dba9f3846
+ sha256sums = 92ecbb16524c4ec6423d87979f655838b502fc0c5206127f34553c5ff837f3f8
+ sha256sums = e104c41b6c84c60ebca61545cc06a9e53c169f00d4eab50c2dd4df3d2f22500b
+
+pkgname = battery_status_rs_notification
+
+pkgname = battery_status_rs_sleep
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..65ecfd3bba95
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,40 @@
+# Maintainer: Valentin Weber
+pkgbase="battery_status_rs"
+pkgname=("battery_status_rs_notification"
+ "battery_status_rs_sleep")
+pkgver="3.0.0"
+pkgrel="1"
+pkgdesc="A utility to watch the battery level and send the system to sleep if low."
+arch=('any')
+makedepends=('cargo'
+ 'git')
+
+source=("git+https://git.unfug.hs-furtwangen.de/weva/battery_status_rs/#tag=$pkgver"
+ "battery_status_rs_notification.service"
+ "battery_status_rs_sleep.service")
+
+sha256sums=('4a858b6467fe4aba898c9a3f0b944cf0b3da51043903cb637971712dba9f3846'
+ '92ecbb16524c4ec6423d87979f655838b502fc0c5206127f34553c5ff837f3f8'
+ 'e104c41b6c84c60ebca61545cc06a9e53c169f00d4eab50c2dd4df3d2f22500b')
+
+prepare() {
+ cd battery_status_rs
+ cargo fetch --target "$CARCH-unknown-linux-gnu"
+}
+
+build() {
+ cd battery_status_rs
+ export RUSTUP_TOOLCHAIN=stable
+ export CARGO_TARGET_DIR=target
+ cargo build --frozen --release --all-features
+}
+
+package_battery_status_rs_notification() {
+ install -Dm0755 -t "$pkgdir/usr/lib/systemd/user/" "$pkgname.service"
+ install -Dm0755 -t "$pkgdir/usr/bin/" "battery_status_rs/target/release/$pkgname"
+}
+
+package_battery_status_rs_sleep() {
+ install -Dm0755 -t "$pkgdir/usr/lib/systemd/system/" "$pkgname.service"
+ install -Dm0755 -t "$pkgdir/usr/bin/" "battery_status_rs/target/release/$pkgname"
+}
diff --git a/battery_status_rs_notification.service b/battery_status_rs_notification.service
new file mode 100644
index 000000000000..b0218ab8e98e
--- /dev/null
+++ b/battery_status_rs_notification.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Battery Status Notification Daemon
+
+[Service]
+Type=notify
+ExecStart=/bin/battery_status_rs_notification
+Restart=always
+RestartSec=1
+
+[Install]
+WantedBy=default.target
diff --git a/battery_status_rs_sleep.service b/battery_status_rs_sleep.service
new file mode 100644
index 000000000000..2d7397e8b7a5
--- /dev/null
+++ b/battery_status_rs_sleep.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Battery Status Sleep Daemon
+
+[Service]
+Type=notify
+ExecStart=/bin/battery_status_rs_sleep
+Restart=always
+RestartSec=1
+
+[Install]
+WantedBy=default.target