diff options
Diffstat (limited to '.scripts')
-rwxr-xr-x | .scripts/screensetup.sh | 9 | ||||
-rwxr-xr-x | .scripts/virtual_mic.sh | 7 |
2 files changed, 14 insertions, 2 deletions
diff --git a/.scripts/screensetup.sh b/.scripts/screensetup.sh new file mode 100755 index 0000000..31d9c3a --- /dev/null +++ b/.scripts/screensetup.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +if [[ $(xrandr --query | grep "eDP-1-1" ) ]]; then + if [[ $(cat /proc/acpi/button/lid/LID/state | awk '{print $2}') = "closed" ]]; then + xrandr --output HDMI-0 --primary --mode 1920x1080 --pos 1920x0 --rotate normal --output eDP-1-1 --off + else + xrandr --output HDMI-0 --primary --mode 1920x1080 --pos 1920x0 --rotate normal --output eDP-1-1 --mode 1920x1080 --pos 0x489 --rotate normal # monitor front, laptop left + fi +fi diff --git a/.scripts/virtual_mic.sh b/.scripts/virtual_mic.sh index a33382d..b5a6354 100755 --- a/.scripts/virtual_mic.sh +++ b/.scripts/virtual_mic.sh @@ -1,12 +1,15 @@ #!/bin/sh +default_source="$(pactl get-default-source)" +default_sink="$(pactl get-default-sink)" + # create virtual sinks pactl load-module module-null-sink sink_name=VirtualSpeaker pactl load-module module-null-sink media.class=Audio/Duplex sink_name=VirtualMicrophone # create loopbacks -pactl load-module module-loopback source="VirtualSpeaker.monitor" sink="$(pactl get-default-sink)" -pactl load-module module-loopback source="$(pactl get-default-source)" sink="VirtualMicrophone" +pactl load-module module-loopback source="VirtualSpeaker.monitor" sink="$default_sink" +pactl load-module module-loopback source="$default_source" sink="VirtualMicrophone" pactl load-module module-loopback source="VirtualSpeaker.monitor" sink="VirtualMicrophone" # set default mic |