1
0
Fork 0
This commit is contained in:
Arthur K. 2025-11-11 00:41:42 +03:00
parent 7e5d880156
commit d93f63cf82
40 changed files with 448 additions and 649 deletions

View file

@ -1,7 +1,5 @@
#!/bin/bash
# supress stderr
change_dpi() {
sed -i -E --follow-symlinks "s/Xft\.dpi: .*?/Xft\.dpi: $1/g" ~/.Xresources
sed -i -E --follow-symlinks "s/Xcursor\.size: .*?/Xcursor\.size: $2/g" ~/.Xresources
@ -20,7 +18,7 @@ EXT_MON="$(xrandr | grep -ow "\(DP-[0-9]\) connected" | cut -d " " -f 1)"
INT_MODELINE=$(cvt 1560 1040 90 | grep "Modeline" | cut -d " " -f 2- | tr -d '"')
INT_RES="$(echo $INT_MODELINE | cut -d ' ' -f 1 | tr -d '\"')"
if [[ -z "${EXT_MON}" ]]; then
if [[ -z "${EXT_MON}" ]] || [ "$1" = "internal" ]; then
xrandr --output eDP-1 --pos 0x0 --mode "3120x2080" --rate 90 --primary --output DP-1 --off --output DP-2 --off --output DP-3 --off --output DP-4 --off
xrandr --delmode eDP-1 "${INT_RES}"
xrandr --rmmode "${INT_RES}"
@ -29,9 +27,13 @@ else
:
xrandr --rmmode "${INT_RES}"
# shellcheck disable=all
xrandr --newmode $(echo $INT_MODELINE) # this is a hack to make xrandr recognize the resolution
xrandr --addmode eDP-1 "${INT_RES}"
xrandr --output eDP-1 --pos 2560x400 --mode "${INT_RES}" --output "${EXT_MON}" --pos 0x0 --mode "2560x1440" --rate 144 --primary
# temp remove edp
# xrandr --newmode $(echo $INT_MODELINE) # this is a hack to make xrandr recognize the resolution
# xrandr --addmode eDP-1 "${INT_RES}"
# xrandr --output eDP-1 --pos 2560x400 --mode "${INT_RES}" --output "${EXT_MON}" --pos 0x0 --mode "2560x1440" --rate 144 --primary
xrandr --output eDP-1 --off --output "${EXT_MON}" --pos 0x0 --mode "2560x1440" --rate 144 --primary
change_dpi 96 24
fi