summaryrefslogtreecommitdiff
path: root/gen_waybar_confs.sh
diff options
context:
space:
mode:
authorZachIR <zachir@librem.one>2022-11-28 00:04:12 -0600
committerZachIR <zachir@librem.one>2022-11-28 00:04:12 -0600
commit9581b754cb39212dbebee56f46cb0260572c5df9 (patch)
tree6da4285ea5f4c5f97c97cc30e5c9908a222d56a2 /gen_waybar_confs.sh
parentbf07bae38661f7a1dfb49ca25b2b1227876ed6be (diff)
use /bin/sh not /sbin/sh
Diffstat (limited to 'gen_waybar_confs.sh')
-rwxr-xr-xgen_waybar_confs.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/gen_waybar_confs.sh b/gen_waybar_confs.sh
new file mode 100755
index 0000000..36befae
--- /dev/null
+++ b/gen_waybar_confs.sh
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+WCLONG="$(crcparse WC)"
+WC="$(basename "$WCLONG")"
+
+OUTPUTS="$(wlr-randr | grep -B2 'Enabled: yes' | sed '/^\s\s*/d;/^--/d' | cut -d' ' -f1)"
+
+echo "$OUTPUTS" | while read i; do
+ sed 's/%%DISPLAY%%/'$i'/' "$XDG_CONFIG_HOME"/waybar/config-$WC > "$XDG_CONFIG_HOME"/waybar/config-$WC-$i
+done