Created
September 24, 2013 12:14
-
-
Save domenkozar/6683872 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ config, pkgs, ... }: | |
# auto configure monitors | |
# xfce 4.12 will fix this, once released. | |
# TODO: save configuration state. | |
let | |
autoconnect = pkgs.writeScript "automonitors.sh" '' | |
#!/bin/sh | |
export DISPLAY=:0.0 | |
export XAUTHORITY=/home/ollie/.Xauthority | |
XRANDR=${pkgs.xlibs.xrandr}/bin/xrandr | |
exec > /tmp/monitor 2>&1 | |
$XRANDR --auto | |
''; | |
in { | |
powerManagement.resumeCommands = '' | |
${autoconnect} | |
''; | |
services.udev.extraRules = '' | |
ACTION=="change", SUBSYSTEM=="drm", ENV{HOTPLUG}=="1", ENV{DEVNAME}=="dri/card0", RUN+="${autoconnect}" | |
''; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment