Breaking up srandrd.conf making it easier to define new computers
This commit is contained in:
parent
400bed77d7
commit
42fd94e173
|
@ -10,53 +10,8 @@ maptouchscreen() {
|
|||
setpasink() {
|
||||
# setpasink <name>
|
||||
# Find a unique string in the output of `pacmd list short` to use for <name>
|
||||
pacmd set-default-sink $(pactl list sinks short | grep "$1" | grep -o "^\S\+")
|
||||
pacmd set-default-sink "$(pactl list sinks short | grep "$1" | grep -o "^\S\+")"
|
||||
}
|
||||
|
||||
case "$(hostname)" in
|
||||
"thurstybook")
|
||||
tsid="ELAN Touchscreen"
|
||||
mainoutput="eDP-1"
|
||||
hdmi="HDMI-1"
|
||||
|
||||
case "$SRANDRD_ACTION" in
|
||||
"$hdmi connected")
|
||||
xrandr --output $hdmi --auto --right-of $mainoutput
|
||||
maptouchscreen "$tsid" "$mainoutput"
|
||||
setpasink hdmi
|
||||
;;
|
||||
|
||||
"$hdmi disconnected")
|
||||
xrandr --output $hdmi --off --output $mainoutput --auto
|
||||
maptouchscreen "$tsid" "$mainoutput"
|
||||
setpasink analog
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
|
||||
"dtarchaio")
|
||||
tsid="USBest Technology SiS HID Touch Controller"
|
||||
mainoutput="DP1"
|
||||
hdmi="HDMI2"
|
||||
|
||||
case "$SRANDRD_ACTION" in
|
||||
"$hdmi connected")
|
||||
xrandr --output $mainoutput --auto --output $hdmi --right-of $mainoutput
|
||||
#maptouchscreen "$tsid" "$mainoutput"
|
||||
;;
|
||||
"$hdmi disconnected")
|
||||
xrandr --output $mainoutput --auto
|
||||
#maptouchscreen "$tsid" "$mainoutput"
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
"thurstyserv")
|
||||
mainoutput=""
|
||||
|
||||
case "$SRANDRD_ACTION" in
|
||||
"$mainoutput connected")
|
||||
xrandr --output $mainoutput --auto
|
||||
;;
|
||||
esac
|
||||
esac
|
||||
|
||||
# shellcheck source=/dev/null
|
||||
source ~/.config/srandrd.d/"$(hostname)".conf
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
#!/bin/bash
|
||||
tsid="ELAN Touchscreen"
|
||||
mainoutput="eDP-1"
|
||||
hdmi="HDMI-1"
|
||||
|
||||
case "$SRANDRD_ACTION" in
|
||||
"$hdmi connected")
|
||||
xrandr --output $hdmi --auto --right-of $mainoutput
|
||||
maptouchscreen "$tsid" "$mainoutput"
|
||||
setpasink hdmi
|
||||
;;
|
||||
|
||||
"$hdmi disconnected")
|
||||
xrandr --output $hdmi --off --output $mainoutput --auto
|
||||
maptouchscreen "$tsid" "$mainoutput"
|
||||
setpasink analog
|
||||
;;
|
||||
esac
|
|
@ -0,0 +1,8 @@
|
|||
#!/bin/bash
|
||||
mainoutput=""
|
||||
|
||||
case "$SRANDRD_ACTION" in
|
||||
"$mainoutput connected")
|
||||
xrandr --output $mainoutput --auto
|
||||
;;
|
||||
esac
|
Loading…
Reference in New Issue