Skip to content

Instantly share code, notes, and snippets.

@dschep
Created January 29, 2015 00:10
Show Gist options
  • Save dschep/a2649b9379cb8979626b to your computer and use it in GitHub Desktop.
Save dschep/a2649b9379cb8979626b to your computer and use it in GitHub Desktop.
Automatically call autorandr
# detect monitor [un]plug events, and call autorandr
SUBSYSTEM=="drm", ACTION=="change", RUN+="/bin/bash -c 'DISPLAY=:0 sudo -u $(who|sed -nre s/\(.*\)\\s:0.*/\\1/p) /usr/bin/autorandr -c'"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment