scripts/surface-res

30 lines
978 B
Plaintext
Raw Normal View History

2020-06-12 22:48:19 +00:00
#! /usr/bin/env bash
# Janky ass resolution switching for Ubuntu. Kinda works kinda doesn't.
# Mostly for lowering the res while playing games in wine that can't scale
OUTPUT="eDP-1"
WIDTH=2736
HEIGHT=1824
WIDTH_HALF=$(expr $WIDTH / 2)
HEIGHT_HALF=$(expr $HEIGHT / 2)
NATIVE="${WIDTH}x${HEIGHT}"
HALF="${WIDTH_HALF}x${HEIGHT_HALF}"
if [[ $1 == "low" ]]
then
echo "Going low"
xrandr --output eDP-1 --mode $NATIVE --fb $HALF --panning $HALF --scale-from $HALF
gsettings set org.gnome.desktop.interface scaling-factor 2
gsettings set org.gnome.settings-daemon.plugins.xsettings overrides "{'Gdk/WindowScalingFactor': <1>}"
elif [[ $1 == "high" ]]
then
echo "Going high"
xrandr --output eDP-1 --mode $NATIVE --fb $NATIVE --panning $NATIVE --scale-from $NATIVE
gsettings set org.gnome.desktop.interface scaling-factor 1
gsettings set org.gnome.settings-daemon.plugins.xsettings overrides "{'Gdk/WindowScalingFactor': <2>}"
else
echo "USAGE: ${0} [low|high]"
fi