summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorclsr <clsr@clsr.net>2019-12-28 21:50:06 +0100
committerclsr <clsr@clsr.net>2019-12-28 21:50:06 +0100
commitc62e1681f7635254561d01ccaf995d0a16232b58 (patch)
tree006d18405af689babf9af8ca3ef810deef79da4f
downloaddwmclock-pkgbuild-c62e1681f7635254561d01ccaf995d0a16232b58.tar.gz
dwmclock-pkgbuild-c62e1681f7635254561d01ccaf995d0a16232b58.zip
Initial commitv1.3.2
-rw-r--r--.gitignore4
-rw-r--r--PKGBUILD34
-rw-r--r--config.mk27
3 files changed, 65 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..61f0d5e
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,4 @@
+/dwmclock-*.*.*.tar.*
+/src/
+/pkg/
+/dwmclock-*.*.*-*-*.pkg.tar.*
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 0000000..0c74991
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,34 @@
+# Maintainer: clsr <clsr@clsr.net>
+
+pkgname=dwmclock
+pkgver=1.3.2
+pkgrel=1
+pkgdesc="Time and battery charge display for dwm"
+arch=('x86_64')
+url="https://git.clsr.net/util/dwmclock/about/"
+license=('custom:Public Domain')
+depends=('libx11')
+source=("https://git.clsr.net/util/dwmclock/snapshot/dwmclock-$pkgver.tar.gz"
+ config.mk)
+sha256sums=('f3b9d49f151350857fbe30813f56a20b8aa570407aa1853f7cf0ec0c9b749138'
+ 'SKIP')
+
+prepare() {
+ cd "$pkgname-$pkgver"
+ if [[ -f "$srcdir/config.mk" ]]; then
+ cp -fv "$srcdir/config.mk" config.mk
+ elif [[ ! -f config.mk ]]; then
+ cp -v config.def.mk config.mk
+ fi
+}
+
+build() {
+ cd "$pkgname-$pkgver"
+ make
+}
+
+package() {
+ cd "$pkgname-$pkgver"
+ make DESTDIR="$pkgdir/" PREFIX="/usr" install
+ install -Dm644 COPYING "$pkgdir/usr/share/licenses/$pkgname/COPYING"
+}
diff --git a/config.mk b/config.mk
new file mode 100644
index 0000000..a9dfe19
--- /dev/null
+++ b/config.mk
@@ -0,0 +1,27 @@
+# dwmclock settings
+
+# enable battery charge display
+CFLAGS += -DBATTERY
+
+# set this to the correct path for your current system
+CFLAGS += -DENERGY_FULL=\"/sys/class/power_supply/BAT0/energy_full\"
+CFLAGS += -DENERGY_NOW=\"/sys/class/power_supply/BAT0/energy_now\"
+CFLAGS += -DSTATUS=\"/sys/class/power_supply/BAT0/status\"
+
+# the string to match when the battery is charging; comment out to disable charging detection
+CFLAGS += -DCHARGING=\"Charging\\n\"
+
+# possible alternative on some systems
+#CFLAGS += -DENERGY_FULL=\"/sys/class/power_supply/BAT0/charge_full\"
+#CFLAGS += -DENERGY_NOW=\"/sys/class/power_supply/BAT0/charge_now\"
+#CFLAGS += -DSTATUS=\"/sys/class/power_supply/ADP1/online\"
+#CFLAGS += -DCHARGING=\"1\\n\"
+
+# every how many seconds to refresh the battery charge display
+CFLAGS += -DBAT_REFRESH_SECONDS=10
+
+# this is here for legacy reasons, ignore it
+CFLAGS += -DMUL=1
+
+# sleep to the start of the next second instead of for 1s
+CFLAGS += -DEXACT_SLEEP