• 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

February 26, 2016 by 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.

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

Primary Sidebar

Recent Posts

  • Recover from Blank Screen After Unplugging External Display in XFCE
  • Remove a Key Binding From Emacs Mode
  • Disable Bluetooth on Ubuntu Startup
  • Geequie: Cull Photos on Linux
  • Sync PDFs with Android using Dropsync

Recent Comments

  • Ricardo Orbegozo on Linking to MS Office File in Emacs Org Mode
  • eliaso on Linking to MS Office File in Emacs Org Mode
  • Joao Brito on Linking to MS Office File in Emacs Org Mode
  • Unable to install Emacs 24 from ppa:cassou/emacs | Ubuntu InfoUbuntu Info on Install Emacs 24 in Ubuntu
  • Unable to install Emacs 24 from ppa:cassou/emacs | WyldePlayground.netWyldePlayground.net - on Install Emacs 24 in Ubuntu

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