call menus from waybar
This commit is contained in:
parent
c84f9047fe
commit
4d412a1613
6 changed files with 78 additions and 6 deletions
|
|
@ -143,16 +143,20 @@ switch $input
|
|||
open_course
|
||||
|
||||
case $options[3]
|
||||
audio_source
|
||||
wpsourcemenu.fish
|
||||
# audio_source
|
||||
|
||||
case $options[4]
|
||||
audio_sink
|
||||
wpsinkmenu.fish
|
||||
# audio_sink
|
||||
|
||||
case $options[5]
|
||||
bluetooth_connection
|
||||
bluetoothmenu.fish
|
||||
# bluetooth_connection
|
||||
|
||||
case $options[6]
|
||||
network_connection
|
||||
networkmenu.fish
|
||||
# network_connection
|
||||
|
||||
case $options[7]
|
||||
color_scheme
|
||||
|
|
|
|||
19
.local/scripts/bluetoothmenu.fish
Executable file
19
.local/scripts/bluetoothmenu.fish
Executable file
|
|
@ -0,0 +1,19 @@
|
|||
#!/usr/bin/env fish
|
||||
|
||||
# Select a paired bluetooth connection
|
||||
set dump (bluetoothctl devices | string replace "Device " "" | string split -m 1 " ")
|
||||
|
||||
set ids
|
||||
set names
|
||||
|
||||
for i in (seq (count $dump))
|
||||
if test (math $i % 2) -eq 0
|
||||
set -a names $dump[$i]
|
||||
else
|
||||
set -a ids $dump[$i]
|
||||
end
|
||||
end
|
||||
|
||||
set input (math (menu --index $names || exit) + 1)
|
||||
|
||||
notify-send "Connect to bluetooth device $names[$input]" (bluetoothctl connect $ids[$input] | string collect)
|
||||
7
.local/scripts/networkmenu.fish
Executable file
7
.local/scripts/networkmenu.fish
Executable file
|
|
@ -0,0 +1,7 @@
|
|||
#!/usr/bin/env fish
|
||||
|
||||
# Select the network connection profile
|
||||
set options (nmcli --terse --fields name connection show)
|
||||
set input (menu $options || exit)
|
||||
|
||||
notify-send "Connect to network $input" (nmcli connection up $input)
|
||||
19
.local/scripts/wpsinkmenu.fish
Executable file
19
.local/scripts/wpsinkmenu.fish
Executable file
|
|
@ -0,0 +1,19 @@
|
|||
#!/usr/bin/env fish
|
||||
|
||||
# Select the default audio sink
|
||||
set dump (string trim -c '"' (pw-dump | jq '.[] | select(.info.props."media.class" == "Audio/Sink")' | jq '.id, .info.props."node.description"'))
|
||||
|
||||
set ids
|
||||
set names
|
||||
|
||||
for i in (seq (count $dump))
|
||||
if test (math $i % 2) -eq 0
|
||||
set -a names $dump[$i]
|
||||
else
|
||||
set -a ids $dump[$i]
|
||||
end
|
||||
end
|
||||
|
||||
set input (math (menu --index $names) + 1)
|
||||
|
||||
wpctl set-default $ids[$input]
|
||||
19
.local/scripts/wpsourcemenu.fish
Executable file
19
.local/scripts/wpsourcemenu.fish
Executable file
|
|
@ -0,0 +1,19 @@
|
|||
#!/usr/bin/env fish
|
||||
|
||||
# Select the default audio source
|
||||
set dump (string trim -c '"' (pw-dump | jq '.[] | select(.info.props."media.class" == "Audio/Source")' | jq '.id, .info.props."node.description"'))
|
||||
|
||||
set ids
|
||||
set names
|
||||
|
||||
for i in (seq (count $dump))
|
||||
if test (math $i % 2) -eq 0
|
||||
set -a names $dump[$i]
|
||||
else
|
||||
set -a ids $dump[$i]
|
||||
end
|
||||
end
|
||||
|
||||
set input (math (menu --index $names) + 1)
|
||||
|
||||
wpctl set-default $ids[$input]
|
||||
Loading…
Add table
Add a link
Reference in a new issue