Compare commits

..

No commits in common. "c4b536f3cf7b47742e6097a7de2bf0a07d1c4668" and "cc89a7a0c425962f4ac575dcbe766d5d603f94fd" have entirely different histories.

3 changed files with 12 additions and 50 deletions

View File

@ -65,24 +65,17 @@ in
systemctl suspend systemctl suspend
'') '')
(writeXrandrScriptBin "tv-on" { (writeShellScriptBin "tv-on" ''
DP-0 = { xrandr \
primary = true; --output DP-0 --primary --mode 1920x1080 --pos 1920x1080 --rotate normal \
mode = "1920x1080"; --output HDMI-0 --mode 1920x1080 --pos 0x1080 --rotate normal \
pos = "1920x1080"; --output HDMI-1 --mode 1920x1080 --pos 1920x0 --rotate normal \
rotate = "normal"; --output DP-1 --off \
}; --output DP-2 --off \
HDMI-0 = { --output DP-3 --off \
mode = "1920x1080"; --output DP-4 --off \
pos = "0x1080"; --output DP-5 --off
rotate = "normal"; '')
};
HDMI-1 = {
mode = "1920x1080";
pos = "1920x0";
rotate = "normal";
};
})
feh feh
imagemagick imagemagick

View File

@ -1,8 +1,4 @@
final: prev: final: prev:
let
callDefaultPackage = path: prev.callPackage path { };
in
{ {
wrapWine = callDefaultPackage ./wrapWine.nix; wrapWine = prev.lib.callPackage ./wrapWine.nix { };
writeXrandrScriptBin = callDefaultPackage ./writeXrandrScriptBin.nix;
} }

View File

@ -1,27 +0,0 @@
{ lib, writeShellScriptBin }:
let
inherit (builtins) getAttr hasAttr isAttrs concatStringsSep;
inherit (lib) assertMsg lists escapeShellArgs;
inherit (lib.attrsets) mapAttrsToList;
inherit (lib.cli) toGNUCommandLine;
in
name: config:
assert assertMsg (isAttrs config)
"config should be an attrs, found ${lib.typeOf config}";
let
isPrimary = config:
(hasAttr "primary" config) && (getAttr "primary" config);
getArgList = output: config:
(escapeShellArgs (lists.flatten [
(toGNUCommandLine { } { "--output" = output; })
(lists.optional (isPrimary config) "--primary")
(toGNUCommandLine { } config)
]));
args = mapAttrsToList getArgList config;
in
writeShellScriptBin name ''
xrandr \
${concatStringsSep " \\\n " args}
''