Skip to content

Instantly share code, notes, and snippets.

@mapix
Created December 25, 2012 15:22
Show Gist options
  • Save mapix/4373704 to your computer and use it in GitHub Desktop.
Save mapix/4373704 to your computer and use it in GitHub Desktop.
Not always does Xorg run on :0. For times like those, this script allows you to find out which it is.
export DISPLAY=$(tr '\000' '\n' < /proc/`pidof X`/cmdline | egrep '^:[0-9]+')
OR some what:
export DISPLAY=$(tr '\000' '\n' < /proc/`pidof Xorg`/cmdline | egrep '^:[0-9]+')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment