Last active
July 11, 2023 07:27
-
-
Save somejavadev/7f33f8d9569a76e322f45a29c3661a05 to your computer and use it in GitHub Desktop.
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 | |
# -b <integer>, bus or screen, run: ddcutil detect --verbose look for: I2C bus: /dev/i2c-9, which will evaluate to: -b 9 | |
# setvcp 0x60, select input control | |
# Select source | |
## 0x11 hdmi | |
## 0x0f displayport | |
#Reference: https://fostips.com/shortcut-key-switch-monitor-input-source-linux/ | |
CHOSEN_SOURCE="$1" | |
if [[ "$CHOSEN_SOURCE" = "1" ]]; then | |
ddcutil -b 9 setvcp 0x60 0x11 | |
ddcutil -b 10 setvcp 0x60 0x0f | |
ddcutil -b 11 setvcp 0x60 0x0f | |
elif [[ "$CHOSEN_SOURCE" = "2" ]]; then | |
ddcutil -b 9 setvcp 0x60 0x0f | |
ddcutil -b 10 setvcp 0x60 0x11 | |
ddcutil -b 11 setvcp 0x60 0x11 | |
else | |
echo "Please pass in option 1 or 2 for primary or secondary" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment