1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
| #! /bin/bash
if [ $# -lt 1 ]; then echo 'Usage screen <action>' echo 'action:' echo ' (s)ingle 仅[电脑]显示器' echo ' (e)xtend 双显示器[扩展]' echo ' s(y)nc 双显示器[同步]' fi
intern=eDP-1-1 extern=HDMI-0
case $1 in single|s) echo '仅[电脑]显示器' xrandr --output "$intern" --auto --output "$extern" --off ;; extend|e) echo '双显示器[扩展]' xrandr --output "$intern" --auto --output "$extern" --primary --auto --right-of "$intern" bspc monitor "$intern" -d I II III IV V bspc monitor HDMI-0 -d I II III IV V ;; left|l) echo '双显示器[扩展 LEFT]' xrandr --output "$intern" --primary --auto --output "$extern" --auto --right-of "$intern" bspc monitor "$intern" -d I II III IV V bspc monitor HDMI-0 -d I II III IV V ;; sync|y|d) echo '双显示器[同步]' xrandr --output "$intern" --auto --output "$extern" --same-as "$intern" --auto bspc monitor "$intern" -d I II III IV V bspc monitor HDMI-0 -d I II III IV V ;; *) echo '未知参数[' $1 ']' ;; esac
|