Skip to content

Instantly share code, notes, and snippets.

@andersonfraga
Last active March 2, 2018 18:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andersonfraga/a4d8e197515557cf7b24038c6a61d566 to your computer and use it in GitHub Desktop.
Save andersonfraga/a4d8e197515557cf7b24038c6a61d566 to your computer and use it in GitHub Desktop.
Xfce 4.12 it's dumb and stupid. So I need to manually inform the order of monitors and their panel's location
#!/bin/bash
# source https://forum.xfce.org/viewtopic.php?pid=46361#p46361
#
# Check if our external monitor name is in the list connected displays
grep_output=`xrandr | grep "HDMI-1 connected"`
if [ "$grep_output" != "" ]; then
# The external monitor IS connected. Put it right of there internal and move xfce-panel there
xrandr --output LVDS-1 --mode 1366x768 --preferred --pos 2560x312 --output HDMI-1 --mode 2560x1080 --primary --pos 0x0
xfconf-query -v -c xfce4-panel -p /panels/panel-1/output-name -s monitor-1
else
# The external monitor IS NOT connected.
xrandr --verbose --output LVDS-1 --mode 1366x768 --pos 0x0
xfconf-query -v -c xfce4-panel -p /panels/panel-1/output-name -s monitor-0
fi
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment