Browse Source

Added sink change script

red-hat-laptop
Kevin Mok 6 years ago
parent
commit
3b13c63410
  1. 15
      aliases/zsh_aliases
  2. 18
      change-sink.sh
  3. 5
      configs/i3/config

15
aliases/zsh_aliases

@ -104,6 +104,11 @@ function rt() {
} }
# }}} rotate monitor # # }}} rotate monitor #
# sound
alias vlm="alsamixer -c 0"
alias vlmh="alsamixer -c 3"
# apt
function apti() { sudo apt install $1 ; } function apti() { sudo apt install $1 ; }
function aptr() { sudo apt remove $1 ; } function aptr() { sudo apt remove $1 ; }
# }}} system # # }}} system #
@ -157,8 +162,6 @@ function auc() { xdotool click --repeat 1000000 --delay $1 1 ; }
alias rsl="java -jar ~/Downloads/RuneLite.jar" alias rsl="java -jar ~/Downloads/RuneLite.jar"
alias vbn="cvlc --loop --alsa-gain 1 ~/Music/brown-noise.mp3" alias vbn="cvlc --loop --alsa-gain 1 ~/Music/brown-noise.mp3"
alias vlm="alsamixer -c 0"
alias vlmh="alsamixer -c 3"
alias rmsw="rm .sw*" alias rmsw="rm .sw*"
# function rs(){ redshift -O $(echo "scale=2;$1*1000" | bc) ; } # function rs(){ redshift -O $(echo "scale=2;$1*1000" | bc) ; }
@ -335,3 +338,11 @@ alias djs="python manage.py shell"
# }}} # }}}
# }}} coding projs # # }}} coding projs #
# school {{{ #
alias sch="f ~/Documents/school"
alias sta="f ~/Documents/school/sta"
alias 236="f ~/Documents/school/236"
# }}} school #

18
change-sink.sh

@ -0,0 +1,18 @@
#!/bin/bash
#Device name variable
if [ $1 = "dac" ]; then
devicename="alsa_output.usb-FiiO_DigiHug_USB_Audio-01.iec958-stereo"
elif [ $1 = "line-out" ]; then
devicename="alsa_output.pci-0000_00_14.2.analog-stereo"
fi
echo "$devicename"
#change the default sink
pacmd "set-default-sink "$devicename""
#move all inputs to the new sink
for app in $(pacmd list-sink-inputs | sed -n -e 's/index:[[:space:]]\([[:digit:]]\)/\1/p');
do
pacmd "move-sink-input $app "$devicename""
done

5
configs/i3/config

@ -154,7 +154,7 @@ bindsym Mod4+g workspace $ws5; layout stacking; exec steam
set $ws6 "6 " set $ws6 "6 "
workspace $ws6 output $samsung workspace $ws6 output $samsung
bindsym Mod4+d workspace $ws6; exec discord bindsym Mod4+d workspace $ws6; exec discord
bindsym Mod4+l workspace $ws6; exec slack
bindsym Mod4+k workspace $ws6; exec slack
assign [class="Slack"] $ws6 assign [class="Slack"] $ws6
set $ws7 "7 " set $ws7 "7 "
@ -305,6 +305,9 @@ font pango:Hack 11
# }}} mod key/font # # }}} mod key/font #
# media keys {{{ # # media keys {{{ #
bindsym $mod+d exec ~/linux-config/change-sink.sh dac
bindsym $mod+o exec ~/linux-config/change-sink.sh line-out
bindsym XF86AudioRaiseVolume exec --no-startup-id amixer -c 0 sset Master 3+ bindsym XF86AudioRaiseVolume exec --no-startup-id amixer -c 0 sset Master 3+
bindsym XF86AudioLowerVolume exec --no-startup-id amixer -c 0 sset Master 3- bindsym XF86AudioLowerVolume exec --no-startup-id amixer -c 0 sset Master 3-
bindsym XF86AudioMute exec --no-startup-id amixer -D pulse set Master 0+ toggle bindsym XF86AudioMute exec --no-startup-id amixer -D pulse set Master 0+ toggle

Loading…
Cancel
Save