mirror of
https://github.com/frebib/dotfiles.git
synced 2024-06-14 12:57:23 +00:00
scripts: re-add missing dock-displays utility
This commit is contained in:
parent
0c99fe83be
commit
914881a320
17
scripts/dock-displays
Executable file
17
scripts/dock-displays
Executable file
@ -0,0 +1,17 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
SCALE=${1:-1.4}
|
||||
OUTPUT=eDP1
|
||||
NWIDTH=2160
|
||||
NHEIGHT=1440
|
||||
|
||||
WIDTH="$(bc <<< "$NWIDTH / $SCALE")" # $(($NWIDTH / $SCALE))
|
||||
HEIGHT="$(bc <<< "$NHEIGHT / $SCALE")" # $(($NHEIGHT / $SCALE))
|
||||
|
||||
MODELINE=$(cvt $WIDTH $HEIGHT | sed -n 's/Modeline\s*//p' | tr -d \")
|
||||
MODENAME=${MODELINE%% *}
|
||||
|
||||
xrandr --newmode $MODELINE 2>/dev/null || true
|
||||
xrandr --addmode $OUTPUT $MODENAME 2>/dev/null || true
|
||||
xrandr --output $OUTPUT --mode $MODENAME
|
Loading…
Reference in New Issue
Block a user