Update
| Author | Mitja Felicijan <mitja.felicijan@gmail.com> | 2025-02-12 07:15:36 +0100 |
| Committer | Mitja Felicijan <mitja.felicijan@gmail.com> | 2025-02-12 07:15:36 +0100 |
| Commit | ab26783d64b186d414bcc1ee085e59f16b71d528 (patch) |
|
-rwxr-xr-x |
.shenanigans.sh | 24 |
1 files changed, 0 insertions, 24 deletions
| diff --git a/.shenanigans.sh b/.shenanigans.sh | |||
| ... | |||
| 90 | --exclude '.godot/' \ |
90 | --exclude '.godot/' \ |
| 91 | --exclude '.zig-cache/' \ |
91 | --exclude '.zig-cache/' \ |
| 92 | --exclude 'node_modules/' \ |
92 | --exclude 'node_modules/' \ |
| 93 | --exclude 'digg-v5/' \ |
||
| 94 | --delete \ |
93 | --delete \ |
| 95 | $VHOME/ /media/Void/Backup/$ME/ |
94 | $VHOME/ /media/Void/Backup/$ME/ |
| 96 | 95 | ||
| ... | |||
| 102 | cd $CWD |
101 | cd $CWD |
| 103 | } |
102 | } |
| 104 | 103 | ||
| 105 | # Toggles between pulseaudio sinks in round-robin. |
||
| 106 | togglesink() { |
||
| 107 | sinks=($(pactl list short sinks | awk '{print $2}')) |
||
| 108 | current_sink=$(pactl get-default-sink) |
||
| 109 | current_index=-1 |
||
| 110 | |||
| 111 | for i in "${!sinks[@]}"; do |
||
| 112 | if [[ "${sinks[$i]}" == "$current_sink" ]]; then |
||
| 113 | current_index=$i |
||
| 114 | break |
||
| 115 | fi |
||
| 116 | done |
||
| 117 | |||
| 118 | if [[ $current_index -eq -1 ]]; then |
||
| 119 | next_index=0 |
||
| 120 | else |
||
| 121 | next_index=$(( (current_index + 1) % ${#sinks[@]} )) |
||
| 122 | fi |
||
| 123 | |||
| 124 | pactl set-default-sink "${sinks[$next_index]}" |
||
| 125 | notify-send "Switched to sink: ${sinks[$next_index]}" |
||
| 126 | } |
||
| 127 | |||