• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

Mikey Boldt

What am I doing?

  • Home
  • About Mikey
  • Contact

xfce

Recover from Blank Screen After Unplugging External Display in XFCE

2016-02-26 by Mikey Boldt Leave a Comment

I’ve been loving the XFCE desktop environment, but one annoyance I have is this: on my laptop, if I’m using only an external monitor and unplug it, XFCE doesn’t automatically turn the laptop screen back on, and I’m left with no display.

In this state, I can switch to a different virtual console with, e.g., Ctrl + Alt + F1. I had hoped a simple xrandr -d :0 --auto would have fixed it, but I kept getting messages like Configure crtc 0 failed. As I found from this forum thread, the trick is you need to have the display active, so something like chvt 7; sleep 2; xrandr -d :0 --auto will work.

What a pain! I don’t want to switch to a virtual console, log in, and run some series of commands just to get my X display back.

Then it dawned on me: just add a keybinding to run the xrandr command. I keep my keybindings in my xmonad window manager configuration, so I added this:

,((modMask, xK_F7), spawn "xrandr --auto")

Now I can recover from this black screen annoyance with a simple key combination.

Share this:

  • Email
  • Facebook
  • Twitter

Filed Under: Tech Tagged With: display, xfce, xrandr

Primary Sidebar

Categories

  • Orthodoxy
  • Tech
  • Uncategorized

Tags

4331 abfh android apache bible bluetooth cull dropbox dropsync emacs email ezpdf reader fastcgi geeqie gnome gnu global gnus htaccess key bindings keyboard linux mac macbook mod_fcgid msoffice nexus 7 notmuch orgmode papers pdf photo php politics prayer proced processes software sopa top ubuntu upgrade virtualbox vnc xfce xmonad

Archives

  • February 2016
  • January 2016
  • September 2014
  • December 2013
  • November 2013
  • December 2012
  • July 2012
  • June 2012
  • May 2012
  • April 2012
  • January 2012
  • December 2011
  • November 2011

Subscribe

  • RSS - Posts
  • RSS - Comments

Copyright © 2021 · Mikey Boldt Theme on Genesis Framework · WordPress · Log in

loading Cancel
Post was not sent - check your email addresses!
Email check failed, please try again
Sorry, your blog cannot share posts by email.