109 lines
2.9 KiB
Bash
Executable file
109 lines
2.9 KiB
Bash
Executable file
#!/bin/sh
|
|
set -e
|
|
shopt -s extglob
|
|
|
|
WACOM_STYLUS="Wacom Intuos BT S Pen stylus"
|
|
|
|
disable_all_external() {
|
|
xrandr \
|
|
--output HDMI-A-0 --off \
|
|
--output DisplayPort-0 --off \
|
|
--output DisplayPort-1 --off \
|
|
--output DisplayPort-2 --off \
|
|
--output DisplayPort-3 --off \
|
|
--output DisplayPort-4 --off \
|
|
--output DisplayPort-5 --off \
|
|
--output DisplayPort-6 --off
|
|
}
|
|
|
|
set_dpi() {
|
|
DPI=$1
|
|
echo "rofi.dpi: ${DPI}" | xrdb -merge
|
|
echo "Xft.dpi: ${DPI}" | xrdb -merge
|
|
echo "Xft/DPI $(expr 1024 \* ${DPI})" > ~/.xsettingsd
|
|
killall -HUP xsettingsd
|
|
}
|
|
|
|
privat() {
|
|
# --output eDP --mode 3840x2160 --pos 7280x0 --rotate normal \
|
|
# --output DisplayPort-2 --primary --mode 3440x1440 --pos 3840x720 --rotate normal \
|
|
# --output DisplayPort-3 --mode 3840x2160 --pos 0x0 --rotate normal \
|
|
xrandr --dpi 300 \
|
|
--output eDP --mode 3840x2160 --pos 6000x0 --rotate normal \
|
|
--output DisplayPort-2 --primary --mode 3440x1440 --pos 2560x720 --rotate normal \
|
|
--output DisplayPort-5 --mode 2560x1440 --pos 0x720 --rotate normal \
|
|
--output HDMI-A-0 --off \
|
|
--output DisplayPort-0 --off \
|
|
--output DisplayPort-1 --off \
|
|
--output DisplayPort-4 --off \
|
|
--output DisplayPort-3 --off \
|
|
--output DisplayPort-6 --off
|
|
set_dpi 150
|
|
}
|
|
|
|
standalone() {
|
|
disable_all_external
|
|
xrandr \
|
|
--dpi 175 \
|
|
--output eDP --primary --mode 3840x2160 --pos 0x0 --rotate normal
|
|
#echo "rofi.dpi: 175" | xrdb -merge
|
|
#echo "Xft.dpi: 175" | xrdb -merge
|
|
set_dpi 200
|
|
}
|
|
|
|
work() {
|
|
xrandr \
|
|
--dpi 175 \
|
|
--output eDP --mode 3840x2160 --pos 0x0 --rotate normal \
|
|
--output DisplayPort-5 --primary --mode 3440x1440 --pos 3840x720 --rotate normal \
|
|
--output DisplayPort-6 --mode 3440x1440 --pos 7280x720 --rotate normal \
|
|
--output HDMI-A-0 --off \
|
|
--output DisplayPort-0 --off \
|
|
--output DisplayPort-1 --off \
|
|
--output DisplayPort-2 --off \
|
|
--output DisplayPort-3 --off \
|
|
--output DisplayPort-4 --off
|
|
set_dpi 150
|
|
}
|
|
|
|
camper() {
|
|
xrandr \
|
|
--output eDP --mode 1920x1080 --pos 0x0 --rotate normal \
|
|
--output DisplayPort-1 --primary --mode 1920x1080 --pos 1920x0 --rotate normal \
|
|
--output HDMI-A-0 --off --output DisplayPort-0 --off \
|
|
--output DisplayPort-2 --off \
|
|
--output DisplayPort-3 --off \
|
|
--output DisplayPort-4 --off \
|
|
--output DisplayPort-5 --off \
|
|
--output DisplayPort-6 --off
|
|
DPI=110
|
|
echo "rofi.dpi: ${DPI}" | xrdb -merge
|
|
echo "Xft.dpi: ${DPI}" | xrdb -merge
|
|
echo "Xft/DPI $(expr 1024 \* ${DPI})" > ~/.xsettingsd
|
|
killall -HUP xsettingsd
|
|
}
|
|
|
|
|
|
wacom() {
|
|
PRIMARY=$(xrandr --query | grep " connected" | grep "primary" | cut -d" " -f1)
|
|
xsetwacom --set "${WACOM_STYLUS}" MapToOutput $PRIMARY | true
|
|
. ~/.xinitrc
|
|
}
|
|
|
|
DISPLAYS='privat|work|camper|standalone'
|
|
DISPLAYTYPES="@(${DISPLAYS})"
|
|
|
|
case $1 in
|
|
$DISPLAYTYPES )
|
|
$1
|
|
;;
|
|
*)
|
|
echo "Displaytype ${1} not supported - use one of ${DISPLAYS}"
|
|
exit 2
|
|
esac
|
|
|
|
i3-msg restart
|
|
|
|
wacom
|
|
|
|
exit 0
|