Dell XPS 13 (2015) Display Switch on Linux
By default, the Fn-F8 key combo on my Dell XPS didn't do anything. This was kind of annoying because if I was using it with just the external monitor, and that somehow got disconnected, it was difficult to recover the display.
I recently solved this problem by binding a script to that button which uses Xrandr to switch between the internal and external display. Kind of like the "LCD/CRT" button on older laptops.
#!/bin/sh TOGGLE=$HOME/.display_toggle if [ ! -e $TOGGLE ]; then touch $TOGGLE xrandr --output eDP1 --mode 1920x1080 xrandr --output HDMI1 --off else rm $TOGGLE xrandr --output eDP1 --off xrandr --output HDMI1 --mode 1920x1080 fi
A simple hack that works surprisingly well. Incidentally, Fn-F8 translates to Super-P on this laptop (possibly all?), so you can call it pretty easily from your external keyboard too.