summaryrefslogtreecommitdiffstats
path: root/.local/bin
diff options
context:
space:
mode:
authorAmin Bandali <bandali@kelar.org>2024-08-31 14:21:28 -0400
committerAmin Bandali <bandali@kelar.org>2024-08-31 14:21:28 -0400
commitc6d8f5f99ec23a6b7cb537c79e716bf5eea5446a (patch)
tree41b0de4b61e765d9c4cca317ebce66d530e640aa /.local/bin
parent8052f35b9b29d9d3624be1c161ad4f41ee26a533 (diff)
downloadconfigs-c6d8f5f99ec23a6b7cb537c79e716bf5eea5446a.tar.gz
configs-c6d8f5f99ec23a6b7cb537c79e716bf5eea5446a.tar.xz
configs-c6d8f5f99ec23a6b7cb537c79e716bf5eea5446a.zip
A few more updates from anahita
Diffstat (limited to '.local/bin')
-rwxr-xr-x.local/bin/b-prompt12
-rwxr-xr-x.local/bin/dmenu-light2
-rwxr-xr-x.local/bin/dmenu-pavols2
3 files changed, 14 insertions, 2 deletions
diff --git a/.local/bin/b-prompt b/.local/bin/b-prompt
new file mode 100755
index 0000000..2f98e59
--- /dev/null
+++ b/.local/bin/b-prompt
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+# $1: newline-separated choices
+# $2: prompt string
+
+if [ "$WAYLAND_DISPLAY" ]; then
+ menu_font='Source Code Pro Medium 10.5'
+ printf "$1" | wmenu -i -p "$2" -f "$menu_font"
+else
+ menu_font='Source Code Pro Medium-10.5'
+ printf "$1" | dmenu -i -p "$2" -fn "$menu_font"
+fi
diff --git a/.local/bin/dmenu-light b/.local/bin/dmenu-light
index 614281c..8c46f0f 100755
--- a/.local/bin/dmenu-light
+++ b/.local/bin/dmenu-light
@@ -1,4 +1,4 @@
#!/bin/sh
cur=$(light -G)
-val=$(dmenu -fn 'Source Code Pro Medium-10.5' -p "brightness ($cur):" < /dev/null)
+val=$(b-prompt '' "brightness ($cur):")
[ -n "$val" ] && light -S "$val"
diff --git a/.local/bin/dmenu-pavols b/.local/bin/dmenu-pavols
index 0b840ad..c30bdf8 100755
--- a/.local/bin/dmenu-pavols
+++ b/.local/bin/dmenu-pavols
@@ -1,4 +1,4 @@
#!/bin/sh
cur=$(pactl get-sink-volume @DEFAULT_SINK@ | grep -Po '\d+(?=%)' | head -n1)
-val=$(dmenu -fn 'Source Code Pro Medium-10.5' -p "volume ($cur):" < /dev/null)
+val=$(b-prompt '' "volume ($cur):")
[ -n "$val" ] && pactl set-sink-volume @DEFAULT_SINK@ "${val}%"