From 6035f25ab6d20146308a9caeef1b3fbe2b5fb2ab Mon Sep 17 00:00:00 2001 From: Lexi Stelter Date: Wed, 8 Jul 2020 20:22:42 +0200 Subject: [PATCH] [vriska] add screenlayout scripts --- _local/vriska/.screenlayout/homeoffice.sh | 21 ++++++++++++++++ .../vriska/.screenlayout/homeoffice_jenny.sh | 10 ++++++++ _local/vriska/.screenlayout/laptop_only.sh | 16 ++++++++++++ _local/vriska/.screenlayout/workplace.sh | 14 +++++++++++ .../.screenlayout/workplace_withlaptop.sh | 22 ++++++++++++++++ _local/vriska/bin/autoscreenlayout | 25 +++++++++++++++++++ 6 files changed, 108 insertions(+) create mode 100755 _local/vriska/.screenlayout/homeoffice.sh create mode 100755 _local/vriska/.screenlayout/homeoffice_jenny.sh create mode 100755 _local/vriska/.screenlayout/laptop_only.sh create mode 100755 _local/vriska/.screenlayout/workplace.sh create mode 100755 _local/vriska/.screenlayout/workplace_withlaptop.sh create mode 100755 _local/vriska/bin/autoscreenlayout diff --git a/_local/vriska/.screenlayout/homeoffice.sh b/_local/vriska/.screenlayout/homeoffice.sh new file mode 100755 index 0000000..1e00e1c --- /dev/null +++ b/_local/vriska/.screenlayout/homeoffice.sh @@ -0,0 +1,21 @@ +#!/bin/sh + +# reset first +xrandr --output eDP-1 --auto \ + --output DP-1-1 --off \ + --output DP-1-2 --off \ + --output DP-1-3 --off \ + --output DP-2-1 --off \ + --output DP-2-2 --off \ + --output DP-2-3 --off + +#xrandr --output eDP-1 --off --mode 1920x1080 --scale "1.25x1.25" --pos 0x0 \ +# --output DP-2-3 --primary --mode 1920x1080 --scale "1.5x1.5" --pos 2400x0 + +xrandr --output eDP-1 --mode 1920x1080 --pos 0x0 --scale 1x1 --rotate normal \ + --output DP-1-1 --primary --mode 2560x1080 --pos 1920x0 --scale 1x1 --rotate normal \ + --output DP-2-3 --mode 1920x1080 --pos 4480x0 --scale 1x1 --rotate normal + + +[ -f ~/.fehbg ] && sh ~/.fehbg + diff --git a/_local/vriska/.screenlayout/homeoffice_jenny.sh b/_local/vriska/.screenlayout/homeoffice_jenny.sh new file mode 100755 index 0000000..94f780f --- /dev/null +++ b/_local/vriska/.screenlayout/homeoffice_jenny.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +# needed because this script stops working after detaching laptop from docking station +#xrandr --output DP-2-1 --off --output DP-2-2 --off + +xrandr --output eDP-1 --mode 1920x1080 --pos 0x0 --scale 1x1 --rotate normal \ + --output DP-1 --primary --mode 1920x1080 --pos 1920x0 --rotate normal + +[ -f ~/.fehbg ] && sh ~/.fehbg + diff --git a/_local/vriska/.screenlayout/laptop_only.sh b/_local/vriska/.screenlayout/laptop_only.sh new file mode 100755 index 0000000..00f1167 --- /dev/null +++ b/_local/vriska/.screenlayout/laptop_only.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +# needed because this script stops working after detaching laptop from docking station +#xrandr --output DP2-1 --off --output DP2-2 --off + +#xrandr --output eDP-1 --primary --auto --scale "1.25x1.25" \ +xrandr --output eDP-1 --primary --auto --scale "0.8x0.8" \ + --output DP-1 --off \ + --output DP-2 --off \ + --output DP-2-1 --off \ + --output DP-2-2 --off \ + --output DP-2-3 --off \ + --output DP-1-2 --off + +[ -f ~/.fehbg ] && sh ~/.fehbg + diff --git a/_local/vriska/.screenlayout/workplace.sh b/_local/vriska/.screenlayout/workplace.sh new file mode 100755 index 0000000..82fa626 --- /dev/null +++ b/_local/vriska/.screenlayout/workplace.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +# needed because this script stops working after detaching laptop from docking station +#xrandr --output DP2-1 --off --output DP2-2 --off + +xrandr --output eDP-1 --off \ + --output DP-2-2 --mode 3840x2160 --pos 0x0 --rotate normal \ + --output DP-2-1 --mode 3840x2160 --right-of DP-2-2 --rotate normal \ + --output DP-2 --off \ + --output DP-2-1 --off \ + --output DP-2-3 --off + +[ -f ~/.fehbg ] && sh ~/.fehbg + diff --git a/_local/vriska/.screenlayout/workplace_withlaptop.sh b/_local/vriska/.screenlayout/workplace_withlaptop.sh new file mode 100755 index 0000000..950c194 --- /dev/null +++ b/_local/vriska/.screenlayout/workplace_withlaptop.sh @@ -0,0 +1,22 @@ +#!/bin/sh + +# needed because this script stops working after detaching laptop from docking station +#xrandr --output DP2-1 --off --output DP2-2 --off + +xrandr --output eDP-1 --mode 1920x1080 --pos 0x2160 --scale 1x1 --rotate normal \ + --output DP-1-2 --primary --mode 3840x2160 --pos 0x0 --rotate normal \ + --output DP-2-2 --mode 3840x2160 --right-of DP-1-2 --rotate normal \ + --output DP-2 --off \ + --output DP-2-1 --off \ + --output DP-2-3 --off + +# TEST TEST TEST +#xrandr --output eDP-1 --primary --mode 1920x1080 --pos 0x1080 --scale 1x1 --rotate normal \ +# --output DP-1-2 --mode 1920x1080 --pos 0x0 --rotate normal \ +# --output DP-2-2 --mode 1920x1080 --right-of DP-1-2 --rotate normal \ +# --output DP-2 --off \ +# --output DP-2-1 --off \ +# --output DP-2-3 --off + +[ -f ~/.fehbg ] && sh ~/.fehbg + diff --git a/_local/vriska/bin/autoscreenlayout b/_local/vriska/bin/autoscreenlayout new file mode 100755 index 0000000..d4e3390 --- /dev/null +++ b/_local/vriska/bin/autoscreenlayout @@ -0,0 +1,25 @@ +#!/bin/sh + +if xrandr | grep -q '^DP-2-[1-3] connected'; then + echo switching to profile homeoffice + ~/.screenlayout/homeoffice.sh +elif xrandr | grep -q '^DP-[1-2] connected'; then + echo switching to profile homeoffice_jenny + ~/.screenlayout/homeoffice_jenny.sh +else + echo switching to profile laptop_only + ~/.screenlayout/laptop_only.sh +fi + +#if xrandr | grep -q 'DP-2-2 connected'; then +# ~/.screenlayout/workplace_withlaptop.sh +#else +# ~/.screenlayout/laptop_only.sh +#fi + +# Set keyboard layout +setxkbmap us altgr-intl + +# Remap Context Menu key to Super +xmodmap -e "keysym Menu = Super_R" +