build status notifications for volume and brightness
This commit is contained in:
parent
41aaa02156
commit
78dce1ecfa
11 changed files with 188 additions and 93 deletions
|
|
@ -1,5 +1,6 @@
|
|||
#!/usr/bin/env fish
|
||||
|
||||
# Select folders in current semester
|
||||
function open_semester
|
||||
set recent "/home/never/Documents/InNa/25_WiSe/"
|
||||
set options (ls $recent)
|
||||
|
|
@ -8,6 +9,7 @@ function open_semester
|
|||
alacritty --working-directory $recent/$input
|
||||
end
|
||||
|
||||
# Open user directories
|
||||
function open_location
|
||||
set options "25_WiSe" " Documents" " Music" " Pictures" " Videos" " Downloads"
|
||||
set input (menu $options)
|
||||
|
|
@ -28,6 +30,7 @@ function open_location
|
|||
end
|
||||
end
|
||||
|
||||
# Open WueCampus Courses
|
||||
function open_course
|
||||
set options "Algorithmen und Datenstrukturen" "Modellbildung und Simulation" "Amateurfunkkurs" "Datenbanken"
|
||||
set input (menu $options)
|
||||
|
|
@ -44,6 +47,7 @@ function open_course
|
|||
end
|
||||
end
|
||||
|
||||
# Select the default audio source
|
||||
function audio_source
|
||||
set dump (string trim -c '"' (pw-dump | jq '.[] | select(.info.props."media.class" == "Audio/Source")' | jq '.id, .info.props."node.description"'))
|
||||
|
||||
|
|
@ -63,6 +67,7 @@ function audio_source
|
|||
wpctl set-default $ids[$input]
|
||||
end
|
||||
|
||||
# Select the default audio sink
|
||||
function audio_sink
|
||||
set dump (string trim -c '"' (pw-dump | jq '.[] | select(.info.props."media.class" == "Audio/Sink")' | jq '.id, .info.props."node.description"'))
|
||||
|
||||
|
|
@ -82,6 +87,7 @@ function audio_sink
|
|||
wpctl set-default $ids[$input]
|
||||
end
|
||||
|
||||
# Select the network connection profile
|
||||
function network_connection
|
||||
set options (nmcli --terse --fields name connection show)
|
||||
set input (menu $options || exit)
|
||||
|
|
@ -89,6 +95,7 @@ function network_connection
|
|||
notify-send "Connect to network $input" (nmcli connection up $input)
|
||||
end
|
||||
|
||||
# Select a paired bluetooth connection
|
||||
function bluetooth_connection
|
||||
set dump (bluetoothctl devices | string replace "Device " "" | string split -m 1 " ")
|
||||
|
||||
|
|
@ -108,18 +115,23 @@ function bluetooth_connection
|
|||
notify-send "Connect to bluetooth device $names[$input]" (bluetoothctl connect $ids[$input] | string collect)
|
||||
end
|
||||
|
||||
# Select the system color scheme preference
|
||||
function color_scheme
|
||||
set options "Light" "Dark"
|
||||
set input (menu $options)
|
||||
|
||||
switch $input
|
||||
case $options[1]
|
||||
niri msg action do-screen-transition
|
||||
dconf write /org/gnome/desktop/interface/color-scheme \'prefer-light\'
|
||||
case $options[2]
|
||||
niri msg action do-screen-transition
|
||||
dconf write /org/gnome/desktop/interface/color-scheme \'prefer-dark\'
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
# Select sub menu
|
||||
set options " Open Location" " Open WueCampus Course" " Select Audio Source" " Select Audio Sink" " Select Bluetooth" " Select Network" " Color Scheme"
|
||||
set input (menu $options)
|
||||
|
||||
|
|
|
|||
8
.local/scripts/brightnessnotify.fish
Executable file
8
.local/scripts/brightnessnotify.fish
Executable file
|
|
@ -0,0 +1,8 @@
|
|||
#!/usr/bin/env fish
|
||||
|
||||
set brightness (brightnessctl --class=backlight get)
|
||||
set max_brightness (brightnessctl --class=backlight max)
|
||||
|
||||
set brightness (math --scale 0 --scale-mode round "($brightness / $max_brightness) * 100")
|
||||
|
||||
notify-send -c 'status' -h int:value:$brightness "Brightness: $brightness%"
|
||||
7
.local/scripts/volumenotify.fish
Executable file
7
.local/scripts/volumenotify.fish
Executable file
|
|
@ -0,0 +1,7 @@
|
|||
#!/usr/bin/env fish
|
||||
|
||||
set volume (string match -r '[0-9]+.[0-9]+' (wpctl get-volume @DEFAULT_AUDIO_SINK@))
|
||||
|
||||
set volume (math --scale 0 --scale-mode round "$volume * 100")
|
||||
|
||||
notify-send -c 'status' -h int:value:$volume "Volume: $volume%"
|
||||
Loading…
Add table
Add a link
Reference in a new issue