fuzzel has an option for what I want lol
This commit is contained in:
parent
79b9f435dd
commit
6ad5b53896
2 changed files with 2 additions and 8 deletions
|
|
@ -1,11 +1,8 @@
|
||||||
cmds=('shutdown now' 'reboot' 'hyprlock' 'hyprctl dispatch exit')
|
cmds=('shutdown now' 'reboot' 'hyprlock' 'hyprctl dispatch exit')
|
||||||
|
|
||||||
count=${#cmds[@]}
|
count=${#cmds[@]}
|
||||||
default=15
|
|
||||||
|
|
||||||
lines=$((count > default ? default : count))
|
a=$(printf ' Shut down\n Reboot\n Lock\n Log out' | fuzzel --cache /dev/null --dmenu --index --minimal-lines -l $count --placeholder "Power action: " -I)
|
||||||
|
|
||||||
a=$(printf ' Shut down\n Reboot\n Lock\n Log out' | fuzzel --cache /dev/null --dmenu --index --lines $lines --placeholder "Power action: " -I)
|
|
||||||
|
|
||||||
if [ -n "$a" ]; then
|
if [ -n "$a" ]; then
|
||||||
${cmds[a]}
|
${cmds[a]}
|
||||||
|
|
|
||||||
|
|
@ -3,11 +3,8 @@ mapfile -t ids < <(wpctl status | sed -n '/Audio/,/Video/p' | sed -n '/├─ Si
|
||||||
mapfile -t sinks < <(wpctl status | sed -n '/Audio/,/Video/p' | sed -n '/├─ Sinks:/,/├─ Sources:/p' | tail -n +2 | head -n -2 | sed -r 's/^........//' | sed -r 's/[0-9]+\. //')
|
mapfile -t sinks < <(wpctl status | sed -n '/Audio/,/Video/p' | sed -n '/├─ Sinks:/,/├─ Sources:/p' | tail -n +2 | head -n -2 | sed -r 's/^........//' | sed -r 's/[0-9]+\. //')
|
||||||
|
|
||||||
count=${#ids[@]}
|
count=${#ids[@]}
|
||||||
default=15
|
|
||||||
|
|
||||||
lines=$((count > default ? default : count))
|
a=$(printf '%s\n' "${sinks[@]}" | fuzzel --cache /dev/null --dmenu --index --minimal-lines -l $count --placeholder "Switch audio source: " -I)
|
||||||
|
|
||||||
a=$(printf '%s\n' "${sinks[@]}" | fuzzel --cache /dev/null --dmenu --index --lines $lines --placeholder "Switch audio source: " -I)
|
|
||||||
|
|
||||||
if [ -n "$a" ]; then
|
if [ -n "$a" ]; then
|
||||||
wpctl set-default ${ids[a]}
|
wpctl set-default ${ids[a]}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue