mirror of
https://github.com/Matir/skel.git
synced 2026-05-25 21:19:09 -07:00
add spicerandr
This commit is contained in:
16
bin/setup/spicerandr.sh
Normal file
16
bin/setup/spicerandr.sh
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -ue
|
||||||
|
|
||||||
|
cat >/usr/local/bin/x-resize <<"EOF"
|
||||||
|
#!/bin/sh
|
||||||
|
PATH=/usr/bin:/bin:/usr/local/bin
|
||||||
|
desktopuser=$(/bin/ps -ef | /bin/grep -oP '^\w+ (?=.*vdagent( |$))') || exit 0
|
||||||
|
export DISPLAY=:0
|
||||||
|
export XAUTHORITY=$(eval echo "~$desktopuser")/.Xauthority
|
||||||
|
/sbin/xrandr --output $(/sbin/xrandr | awk '/ connected/{print $1; exit; }') --auto
|
||||||
|
EOF
|
||||||
|
|
||||||
|
cat >/etc/udev/rules.d/50-resize.rules <<"EOF"
|
||||||
|
ACTION=="change",KERNEL=="card0", SUBSYSTEM=="drm", RUN+="/usr/local/bin/x-resize"
|
||||||
|
EOF
|
||||||
Reference in New Issue
Block a user