Last active
May 19, 2021 08:55
-
-
Save yoyosan/ea539c46fca501ee12492393ea3c7958 to your computer and use it in GitHub Desktop.
Example scripts of switching HDMI outputs when using Pipewire
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
hdmi="$(pactl list sinks|grep Name|grep hdmi|sed 's/Name: //'|sed 's/\s//')" | |
pactl set-default-sink "$hdmi" | |
pactl set-sink-port "$hdmi" hdmi-output-2 | |
pactl set-card-profile alsa_card.pci-0000_0b_00.1 output:hdmi-stereo-extra2 | |
pactl set-sink-volume @DEFAULT_SINK@ 50% | |
# obtain ports: pactl list | |
# my ports: hdmi-output-1, hdmi-output-2 | |
# After sleep, the card profile changes for `fuck knows` what reason | |
# so I use this version: | |
hdmi="$(pactl list sinks|grep Name|grep hdmi|sed 's/Name: //'|sed 's/\s//')" | |
pactl set-default-sink "$hdmi" | |
pactl set-sink-port "$hdmi" hdmi-output-2 | |
pactl set-card-profile alsa_card.pci-0000_0b_00.1 output:hdmi-stereo-extra1 | |
pactl set-sink-volume @DEFAULT_SINK@ 50% |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment