Center patch for dmenu.

This commit is contained in:
Bartek Stalewski 2021-10-20 10:20:38 +02:00
parent e05070759f
commit 32c401e9ae
12 changed files with 958 additions and 20 deletions

View file

@ -3,7 +3,7 @@
div="----------"
set_output() {
sel_sink=$(printf "$sinks\\n$div\\nback\\nexit" | dmenu -l 10 -i -p "sink")
sel_sink=$(printf "$sinks\\n$div\\nback\\nexit" | dmenu -c -l 10 -i)
case "$sel_sink" in
back) show_current ;;
exit) exit ;;
@ -14,7 +14,7 @@ set_output() {
}
set_input() {
sel_source=$(printf "$sources\\n$div\\nBluetooth profile\\n$div\\nback\\nexit" | dmenu -l 10 -i -p "source")
sel_source=$(printf "$sources\\n$div\\nBluetooth profile\\n$div\\nback\\nexit" | dmenu -c -l 10 -i)
case "$sel_source" in
back) show_current ;;
exit) exit ;;
@ -29,7 +29,7 @@ set_bt_profile() {
bt_sink=$(pactl list cards | awk -F'"' '/device.name.*bluez/ {print $2}')
[ -z "${bt_sink}" ] &&
{ dunstify -u critical "🎧 no headphones connected"; exit; }
profile_chosen=$(printf "profile mSBC\\nprofile LDAC\\n$div\\nback\\nexit" | dmenu -l 5 -i -p "profile")
profile_chosen=$(printf "profile mSBC\\nprofile LDAC\\n$div\\nback\\nexit" | dmenu -c -l 5 -i)
case "$profile_chosen" in
back) show_current ;;
exit) exit ;;
@ -44,7 +44,7 @@ set_bt_profile() {
show_current() {
def_snk=$(pactl list | grep -A 1 "Name: $(pactl get-default-sink)\$" | awk -F': ' '/Description: / {print $2}')
def_src=$(pactl list | grep -A 1 "Name: $(pactl get-default-source)\$" | awk -F': ' '/Description: / {print $2}')
chosen=$(printf "Output: $def_snk\\nInput: $def_src" | dmenu -l 2 -p "current settings")
chosen=$(printf "Output: $def_snk\\nInput: $def_src" | dmenu -c -l 2)
if [ "$1" = "no_switch" ]; then
case "$chosen" in
*) dunstify -u critical "🔊 no device to switch" ;;