aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMitja Felicijan <mitja.felicijan@gmail.com>2024-10-22 06:42:24 +0200
committerMitja Felicijan <mitja.felicijan@gmail.com>2024-10-22 06:42:24 +0200
commitc7bf7a17a4d523b040b72adce33acdbe95840127 (patch)
tree9259142cfa29e7819d93c71cbcc549ff2210cc2a
parent6fb6e6d94244c447eeed3e86c7e84c32f0c80838 (diff)
downloaddotfiles-c7bf7a17a4d523b040b72adce33acdbe95840127.tar.gz
Added pulseaudio sink toggler
-rw-r--r--i3config6
-rwxr-xr-xshenanigans.sh28
2 files changed, 30 insertions, 4 deletions
diff --git a/i3config b/i3config
index f390cb1..c4b0fe2 100644
--- a/i3config
+++ b/i3config
@@ -204,11 +204,13 @@ bar {
204 urgent_workspace #900000 #900000 #FFFFFF 204 urgent_workspace #900000 #900000 #FFFFFF
205 binding_mode #900000 #900000 #FFFFFF 205 binding_mode #900000 #900000 #FFFFFF
206 } 206 }
207 status_command i3status 207 # status_command i3status
208 status_command i3blocks
208} 209}
209 210
210focus_follows_mouse no 211focus_follows_mouse no
212hide_edge_borders both
211exec --no-startup-id picom --backend glx --vsync -b 213exec --no-startup-id picom --backend glx --vsync -b
212bindsym --release $mod+z exec scrot -s - | xclip -selection clipboard -target image/png 214bindsym --release $mod+z exec scrot -s - | xclip -selection clipboard -target image/png
213hide_edge_borders both 215bindsym --release $mod+p exec --no-startup-id bash -c 'source ~/.bashrc && togglesink'
214 216
diff --git a/shenanigans.sh b/shenanigans.sh
index e6a210a..30f2815 100755
--- a/shenanigans.sh
+++ b/shenanigans.sh
@@ -98,8 +98,9 @@ backup() {
98 cd $CWD 98 cd $CWD
99} 99}
100 100
101# Simple ticket system based on https://github.com/mitjafelicijan/ticket.
101export TICKETS=~/Vault/tickets 102export TICKETS=~/Vault/tickets
102tt() { # https://github.com/mitjafelicijan/ticket 103tt() {
103 if [ "$(uname -s)" != "Linux" ]; then 104 if [ "$(uname -s)" != "Linux" ]; then
104 printf "Currently only Linux is supported.\n" 105 printf "Currently only Linux is supported.\n"
105 return 1 106 return 1
@@ -128,7 +129,7 @@ tt() { # https://github.com/mitjafelicijan/ticket
128 printf "status: open\n" >> $ticket_file 129 printf "status: open\n" >> $ticket_file
129 printf "title: ?\n" >> $ticket_file 130 printf "title: ?\n" >> $ticket_file
130 printf "====\n" >> $ticket_file 131 printf "====\n" >> $ticket_file
131 printf "Describe your problem here\n" >> $ticket_file 132 printf "Description...\n" >> $ticket_file
132 $EDITOR $ticket_file 133 $EDITOR $ticket_file
133 ;; 134 ;;
134 -o|-open) 135 -o|-open)
@@ -172,3 +173,26 @@ tt() { # https://github.com/mitjafelicijan/ticket
172 esac 173 esac
173} 174}
174 175
176# Toggles between pulseaudio sinks in round-robin.
177togglesink() {
178 sinks=($(pactl list short sinks | awk '{print $2}'))
179 current_sink=$(pactl get-default-sink)
180 current_index=-1
181
182 for i in "${!sinks[@]}"; do
183 if [[ "${sinks[$i]}" == "$current_sink" ]]; then
184 current_index=$i
185 break
186 fi
187 done
188
189 if [[ $current_index -eq -1 ]]; then
190 next_index=0
191 else
192 next_index=$(( (current_index + 1) % ${#sinks[@]} ))
193 fi
194
195 pactl set-default-sink "${sinks[$next_index]}"
196 notify-send "Switched to sink: ${sinks[$next_index]}"
197}
198