You are not logged in.
Pages: 1
Hi,
I have two monitors, the laptop's monitor and an attached HDMI monitor. I have setup duel screen and it is working. However, I want my panels to automatically attach to the laptop monitor when I detach the HDMI monitor and reattach to the HDMI monitor when I reattach it. When I set the panel preference to "auto" they always attach to the laptop monitor. I have tried `xrandr --auto`, and using `xrandr` to set the preferred monitor to the HDMI monitor. For reference this is the script I have in my startup:
xrandr --output LVDS1 --left-of HDMI1 --output HDMI1 --primary --preferred --auto
Thanks for any help.
Offline
Right now, I also manually run a script to reset the displays when I connect or disconnect an external monitor at work. I've been meaning to automate such a process myself, but haven't gotten around to it yet. I did manage to find some information on automating this via udev or inotifywait. Here are the links:
- via udev
- via inotifywait
I won't be able to look at this further until I'm back at the office, but perhaps they can be of some assistance to you. If you get it to work, please post back your solution.
Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki | Community | Contribute ---
Offline
OK got a hack fix for it. I had not got desperate enough to start looking at udev. The udev rules, and general method in the link you posted work for me. Thanks for that. As far as I know there is no CLI interface to XFCE4 panels, but there is a DBus interface (there probably is a CLI interface now that I think about it). The following adaption works with dbus to talk to xfce4 panels. Still, XFCE4 struggles to reposition the windows exactly right on my system, but at least the panels problem is hack fixed. Cheers!
#!/bin/bash -e
PRIMARY_SCREEN_NAME=HDMI1
SECONDARY_SCREEN_NAME=LVDS1
PANELS=(0 1)
XUSER=`w -h -s|awk '$3~"^:0"{print $1; exit 0}'`
if [ -z "$XUSER" ]; then
echo "No one logged in, exiting."
exit 0;
fi
XHOMEDIR=`getent passwd $XUSER|cut -d: -f6`
export DISPLAY=":0"
export XAUTHORITY="$XHOMEDIR/.Xauthority"
PANEL_SCREEN=${SECONDARY_SCREEN_NAME}
if xrandr | egrep -q "^${PRIMARY_SCREEN_NAME} connected"; then
PANEL_SCREEN=${PRIMARY_SCREEN_NAME};
fi
echo "Switching panels ${PANELS[*]} to display ${PANEL_SCREEN} for ${XHOMEDIR}/.Xauthority"
for i in ${PANELS[*]}; do
su ${XUSER} -c "dbus-send --type=method_call --print-reply --dest=org.xfce.Xfconf /org/xfce/Xfconf org.xfce.Xfconf.SetProperty string:xfce4-panel string:/panels/panel-${i}/output-name variant:string:${PANEL_SCREEN}"
done
Last edited by 33333 (2014-07-27 12:53:21)
Offline
Pages: 1
[ Generated in 0.007 seconds, 7 queries executed - Memory usage: 524.2 KiB (Peak: 528.39 KiB) ]