diff --git a/i3config b/i3config index f390cb18094a99242d0804bde63450a930cb5baf..c4b0fe2bf20fd85b1c660268251e2352598efa3f 100644 --- a/i3config +++ b/i3config @@ -204,11 +204,13 @@ inactive_workspace #222222 #222222 #888888 urgent_workspace #900000 #900000 #FFFFFF binding_mode #900000 #900000 #FFFFFF } - status_command i3status + # status_command i3status + status_command i3blocks } focus_follows_mouse no +hide_edge_borders both exec --no-startup-id picom --backend glx --vsync -b bindsym --release $mod+z exec scrot -s - | xclip -selection clipboard -target image/png -hide_edge_borders both +bindsym --release $mod+p exec --no-startup-id bash -c 'source ~/.bashrc && togglesink' diff --git a/shenanigans.sh b/shenanigans.sh index e6a210a5cbbf3d03cd36c51cd2602656ae62273d..30f281568175fce2ade97699103b14f758af9ef7 100755 --- a/shenanigans.sh +++ b/shenanigans.sh @@ -98,8 +98,9 @@ # Return back to original directory cd $CWD } +# Simple ticket system based on https://github.com/mitjafelicijan/ticket. export TICKETS=~/Vault/tickets -tt() { # https://github.com/mitjafelicijan/ticket +tt() { if [ "$(uname -s)" != "Linux" ]; then printf "Currently only Linux is supported.\n" return 1 @@ -128,7 +129,7 @@ printf "created: %s\n" "`date`" >> $ticket_file printf "status: open\n" >> $ticket_file printf "title: ?\n" >> $ticket_file printf "====\n" >> $ticket_file - printf "Describe your problem here\n" >> $ticket_file + printf "Description...\n" >> $ticket_file $EDITOR $ticket_file ;; -o|-open) @@ -172,3 +173,26 @@ ;; esac } +# Toggles between pulseaudio sinks in round-robin. +togglesink() { + sinks=($(pactl list short sinks | awk '{print $2}')) + current_sink=$(pactl get-default-sink) + current_index=-1 + + for i in "${!sinks[@]}"; do + if [[ "${sinks[$i]}" == "$current_sink" ]]; then + current_index=$i + break + fi + done + + if [[ $current_index -eq -1 ]]; then + next_index=0 + else + next_index=$(( (current_index + 1) % ${#sinks[@]} )) + fi + + pactl set-default-sink "${sinks[$next_index]}" + notify-send "Switched to sink: ${sinks[$next_index]}" +} +