2025-12-30 22:04:10 +01:00
|
|
|
#!/usr/bin/env fish
|
|
|
|
|
|
2026-01-20 17:11:15 +01:00
|
|
|
function open_semester
|
|
|
|
|
set recent "/home/never/Documents/InNa/25_WiSe/"
|
|
|
|
|
set options (ls $recent)
|
|
|
|
|
set input (menu $options)
|
|
|
|
|
|
|
|
|
|
alacritty --working-directory $recent/$input
|
|
|
|
|
end
|
|
|
|
|
|
2026-01-15 01:58:32 +01:00
|
|
|
function open_location
|
2026-01-20 17:11:15 +01:00
|
|
|
set options "25_WiSe" " Documents" " Music" " Pictures" " Videos" " Downloads"
|
2026-01-15 01:58:32 +01:00
|
|
|
set input (menu $options)
|
2026-01-20 17:11:15 +01:00
|
|
|
|
|
|
|
|
switch $input
|
|
|
|
|
case $options[1]
|
|
|
|
|
open_semester
|
|
|
|
|
case $options[2]
|
|
|
|
|
alacritty --working-directory (xdg-user-dir)/Documents/
|
|
|
|
|
case $options[3]
|
|
|
|
|
alacritty --working-directory (xdg-user-dir)/Music/
|
|
|
|
|
case $options[4]
|
|
|
|
|
alacritty --working-directory (xdg-user-dir)/Pictures/
|
|
|
|
|
case $options[5]
|
|
|
|
|
alacritty --working-directory (xdg-user-dir)/Videos/
|
|
|
|
|
case $options[6]
|
|
|
|
|
alacritty --working-directory (xdg-user-dir)/Downloads/
|
2026-01-15 01:58:32 +01:00
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
2026-01-21 13:23:28 +01:00
|
|
|
function audio_source
|
|
|
|
|
set dump (string trim -c '"' (pw-dump | jq '.[] | select(.info.props."media.class" == "Audio/Source")' | jq '.id, .info.props."node.nick"'))
|
|
|
|
|
|
|
|
|
|
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 (menu $names)
|
|
|
|
|
|
|
|
|
|
wpctl set-default $ids[(contains -i $input $names)]
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function audio_sink
|
|
|
|
|
set dump (string trim -c '"' (pw-dump | jq '.[] | select(.info.props."media.class" == "Audio/Sink")' | jq '.id, .info.props."node.nick"'))
|
|
|
|
|
|
|
|
|
|
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 (menu $names)
|
|
|
|
|
|
|
|
|
|
wpctl set-default $ids[(contains -i $input $names)]
|
|
|
|
|
end
|
|
|
|
|
|
2026-01-25 15:44:54 +01:00
|
|
|
set options " Open Location" " Select Audio Source" " Select Audio Sink"
|
2025-12-30 22:04:10 +01:00
|
|
|
set input (menu $options)
|
|
|
|
|
|
|
|
|
|
switch $input
|
2026-01-15 01:58:32 +01:00
|
|
|
case $options[1]
|
2026-01-21 13:23:28 +01:00
|
|
|
open_location
|
2025-12-30 22:04:10 +01:00
|
|
|
|
2026-01-25 15:44:54 +01:00
|
|
|
case $options[2]
|
2026-01-21 13:23:28 +01:00
|
|
|
audio_source
|
|
|
|
|
|
2026-01-25 15:44:54 +01:00
|
|
|
case $options[3]
|
2026-01-21 13:23:28 +01:00
|
|
|
audio_sink
|
2025-12-30 22:04:10 +01:00
|
|
|
end
|