]> git.armaanb.net Git - bin.git/commitdiff
dwmsetroot: new script
authorArmaan Bhojwani <me@armaanb.net>
Fri, 18 Jun 2021 22:05:54 +0000 (18:05 -0400)
committerArmaan Bhojwani <me@armaanb.net>
Fri, 18 Jun 2021 22:05:54 +0000 (18:05 -0400)
dwmsetroot [new file with mode: 0755]
man/dwmsetroot.1.scd [new file with mode: 0644]

diff --git a/dwmsetroot b/dwmsetroot
new file mode 100755 (executable)
index 0000000..f27749e
--- /dev/null
@@ -0,0 +1,10 @@
+#!/usr/bin/env sh
+
+while (true); do
+               date=$(date "+%A %Y-%m-%d %I:%M:%S %p")
+               charge=$(cat /sys/class/power_supply/BAT0/capacity)
+               status=$(cat /sys/class/power_supply/BAT0/status)
+               volume=$(amixer sget Master | awk -F"[][]" '/dB/ { print $2 ", " $6 }')
+               xsetroot -name "[${charge}%, ${status}] [${volume}] [${date}]"
+               sleep 1
+done
diff --git a/man/dwmsetroot.1.scd b/man/dwmsetroot.1.scd
new file mode 100644 (file)
index 0000000..adf40d2
--- /dev/null
@@ -0,0 +1,14 @@
+dwmsetroot(1)
+
+# NAME
+dwmsetroot - simple dwm status bar
+
+# SYNOPSIS
+*dwmsetroot*
+
+# DESCRIPTION
+Dead simple status bar for dwm. Shows battery level, volume, and time/date.
+
+# COPYRIGHT
+This is free and unencumbered software released into the public domain. For more
+information, please refer to <https://unlicense.org/>.
\ No newline at end of file