Blog IndexPosts by TagHome

Dell XPS 13 (2015) Display Switch on Linux

Posted <2015-09-08 Tue 12:12> by Aaron S. Jackson.

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.

F8 Display Button

F8 Display Button

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.

Related posts:

Tags: hacks laptop linux

Blog IndexPosts by TagHome

Copyright 2007-2017 Aaron S. Jackson (modified: Sun 23 Jul 14:30:51 BST 2017)