multidisplay hack for #OpenBSD, #NetBSD xenodm/xdm.
#!/bin/ksh # Define variables at the top for easy access readonly MULTIDISPLAY_DIRECTION="--right-of" # find list of connected monitors to span moni
from izder456@fe.disroot.org to (none) on 19 May 09:48
https://fe.disroot.org/objects/06fbb6a5-fb20-47c2-8b20-479328e2353f
from izder456@fe.disroot.org to (none) on 19 May 09:48
https://fe.disroot.org/objects/06fbb6a5-fb20-47c2-8b20-479328e2353f
multidisplay hack for #OpenBSD, #NetBSD xenodm/xdm.
#!/bin/ksh
# Define variables at the top for easy access
readonly MULTIDISPLAY_DIRECTION="--right-of"
# find list of connected monitors to span
monitors=$(xrandr --query | awk '/[^s]connected/{print $1}')
# the first monitor found will be the primary
primary=$(echo "$monitors" | head -n 1)
# initialize the xrandr command
xrandr_cmd="xrandr --output $primary --auto --primary"
# loop through the displays, assigning them --auto and MULTIDISPLAY_DIRECTION with randr
previous=$primary
for monitor in $monitors
do
if [ "$monitor" != "$primary" ]; then
xrandr_cmd+=" --output $monitor --auto $MULTIDISPLAY_DIRECTION $previous"
previous=$monitor
fi
done
# Execute the composed xrandr command
eval "$xrandr_cmd"could drop in to your Xsetup_0 file. written in ksh, should work in OpenBSD’s ksh and NetBSD’s ksh.
threaded - newest