mirror of
https://github.com/phillipberndt/autorandr
synced 2025-02-08 15:37:39 +00:00
24 lines
395 B
Bash
Executable File
24 lines
395 B
Bash
Executable File
#!/bin/sh
|
|
#
|
|
# 40autorandr: Change autorandr profile on thaw/resume
|
|
|
|
AUTORANDR="autorandr -c"
|
|
|
|
detect_display()
|
|
{
|
|
for X in /tmp/.X11-unix/X*; do
|
|
D="${X##/tmp/.X11-unix/X}"
|
|
user=$(who | awk -vD="$D" '$5 ~ "\\(:"D"\\)$" {print $1}')
|
|
if [ x"$user" != x"" ]; then
|
|
export DISPLAY=":$D"
|
|
/bin/su -c "${AUTORANDR}" "$user"
|
|
fi
|
|
done
|
|
}
|
|
|
|
case "$1" in
|
|
thaw|resume)
|
|
detect_display
|
|
;;
|
|
esac
|