2020-06-03 14:19:16 +02:00
|
|
|
#! /bin/bash
|
|
|
|
|
|
|
|
activeconfig='laptop'
|
|
|
|
|
|
|
|
if [ -f ~/.screenlayout.info ] ; then
|
|
|
|
activeconfig=`cat ~/.screenlayout.info`
|
|
|
|
fi
|
|
|
|
|
|
|
|
nextconfig='laptop'
|
|
|
|
|
|
|
|
case $activeconfig in
|
|
|
|
home)
|
2020-06-07 22:56:23 +02:00
|
|
|
nextconfig='homeoffice'
|
2020-06-03 14:19:16 +02:00
|
|
|
;;
|
2020-06-07 22:56:23 +02:00
|
|
|
homeoffice)
|
2020-06-03 14:19:16 +02:00
|
|
|
nextconfig='laptop'
|
|
|
|
;;
|
|
|
|
laptop)
|
|
|
|
nextconfig='home'
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2020-06-07 22:56:23 +02:00
|
|
|
if [ $1 ]; then
|
|
|
|
if [ "$1" = "menu" ]; then
|
|
|
|
chosen="$(echo -e "$options" | $rofi_command -dmenu -selected-row 1)"
|
|
|
|
exit 0
|
|
|
|
else
|
|
|
|
nextconfig=$1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2020-06-03 14:19:16 +02:00
|
|
|
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
|
|
|
|
;;
|
2020-06-07 22:56:23 +02:00
|
|
|
homeoffice)
|
2020-06-03 14:19:16 +02:00
|
|
|
# Home Office
|
2020-09-26 18:12:58 +02:00
|
|
|
xrandr --output DP-2-1 --primary --mode 2560x1080 --pos 0x0 --rotate normal \
|
|
|
|
--output DP-2-2 --mode 1920x1080 --pos 2560x0 --rotate normal \
|
|
|
|
# --output DP-2-2 --mode 1920x1080 --pos 2560x0 --rotate left \
|
2020-06-03 14:19:16 +02:00
|
|
|
--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
|
2020-06-19 08:23:37 +02:00
|
|
|
|
|
|
|
# Reset wallpaper
|
2021-10-21 21:40:47 +02:00
|
|
|
~/bin/wallpaper.sh
|