Updated screen switch
This commit is contained in:
parent
ef051a20ef
commit
d454f36e52
3 changed files with 63 additions and 18 deletions
59
Bin/screenlayout.sh
Executable file
59
Bin/screenlayout.sh
Executable file
|
@ -0,0 +1,59 @@
|
|||
#! /bin/bash
|
||||
|
||||
activeconfig='laptop'
|
||||
|
||||
if [ -f ~/.screenlayout.info ] ; then
|
||||
activeconfig=`cat ~/.screenlayout.info`
|
||||
fi
|
||||
|
||||
nextconfig='laptop'
|
||||
|
||||
case $activeconfig in
|
||||
home)
|
||||
nextconfig='home-office'
|
||||
;;
|
||||
home-office)
|
||||
nextconfig='laptop'
|
||||
;;
|
||||
laptop)
|
||||
nextconfig='home'
|
||||
;;
|
||||
esac
|
||||
|
||||
echo ${nextconfig} > ~/.screenlayout.info
|
||||
|
||||
case $nextconfig in
|
||||
home)
|
||||
# Home
|
||||
xrandr --output DP-2-1 --primary --mode 2560x1080 --pos 0x0 --rotate normal \
|
||||
--output DP-2-2 --off \
|
||||
--output DP-2-3 --off \
|
||||
--output eDP-1 --off \
|
||||
--output HDMI-2 --off \
|
||||
--output HDMI-1 --off \
|
||||
--output DP-2 --off \
|
||||
--output DP-1 --off
|
||||
;;
|
||||
home-office)
|
||||
# Home Office
|
||||
xrandr --output DP-2-1 --primary --mode 2560x1080 --pos 0x520 --rotate normal \
|
||||
--output DP-2-2 --mode 1920x1080 --pos 2560x0 --rotate left \
|
||||
--output DP-2-3 --off \
|
||||
--output eDP-1 --off \
|
||||
--output HDMI-2 --off \
|
||||
--output HDMI-1 --off \
|
||||
--output DP-2 --off \
|
||||
--output DP-1 --off
|
||||
;;
|
||||
laptop)
|
||||
# Laptop mode
|
||||
xrandr --output DP-2-1 --off \
|
||||
--output DP-2-2 --off \
|
||||
--output DP-2-3 --off \
|
||||
--output eDP-1 --primary --mode 1920x1080 --pos 0x0 --rotate normal \
|
||||
--output HDMI-2 --off \
|
||||
--output HDMI-1 --off \
|
||||
--output DP-2 --off \
|
||||
--output DP-1 --off
|
||||
;;
|
||||
esac
|
Loading…
Add table
Add a link
Reference in a new issue