Compare commits
4 Commits
c4b536f3cf
...
21f82ed506
Author | SHA1 | Date |
---|---|---|
Zynh Ludwig | 21f82ed506 | |
Zynh Ludwig | 6bdd69426c | |
Zynh Ludwig | 4f22744983 | |
Zynh Ludwig | 02fa077d37 |
|
@ -50,17 +50,20 @@
|
|||
|
||||
|
||||
systemd.user.services.screenlayout = {
|
||||
script = ''
|
||||
${pkgs.xorg.xrandr}/bin/xrandr \
|
||||
--output DP-0 --primary --mode 1920x1080 --pos 1920x0 --rotate normal \
|
||||
--output HDMI-0 --mode 1920x1080 --pos 0x0 --rotate normal \
|
||||
--output DP-1 --off \
|
||||
--output DP-2 --off \
|
||||
--output DP-3 --off \
|
||||
--output DP-4 --off \
|
||||
--output DP-5 --off \
|
||||
--output HDMI-1 --off
|
||||
'';
|
||||
script = lib.getExe
|
||||
(pkgs.writeXrandrScriptBin "default-monitors" {
|
||||
DP-0 = {
|
||||
primary = true;
|
||||
mode = "1920x1080";
|
||||
pos = "1920x0";
|
||||
rotate = "normal";
|
||||
};
|
||||
HDMI-0 = {
|
||||
mode = "1920x1080";
|
||||
pos = "0x0";
|
||||
rotate = "normal";
|
||||
};
|
||||
});
|
||||
wantedBy = [ "graphical-session.target" ];
|
||||
partOf = [ "graphical-session.target" ];
|
||||
};
|
||||
|
|
|
@ -3,6 +3,6 @@ let
|
|||
callDefaultPackage = path: prev.callPackage path { };
|
||||
in
|
||||
{
|
||||
wrapWine = callDefaultPackage ./wrapWine.nix;
|
||||
writeXrandrScriptBin = callDefaultPackage ./writeXrandrScriptBin.nix;
|
||||
wrapWine = callDefaultPackage ./wrapWine;
|
||||
writeXrandrScriptBin = callDefaultPackage ./writeXrandrScriptBin;
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{ lib, writeShellScriptBin }:
|
||||
{ lib, writeShellScriptBin, xrandr }:
|
||||
let
|
||||
inherit (builtins) getAttr hasAttr isAttrs concatStringsSep;
|
||||
inherit (lib) assertMsg lists escapeShellArgs;
|
||||
inherit (lib) assertMsg lists escapeShellArgs getExe;
|
||||
inherit (lib.attrsets) mapAttrsToList;
|
||||
inherit (lib.cli) toGNUCommandLine;
|
||||
in
|
||||
|
@ -14,7 +14,7 @@ let
|
|||
|
||||
getArgList = output: config:
|
||||
(escapeShellArgs (lists.flatten [
|
||||
(toGNUCommandLine { } { "--output" = output; })
|
||||
(toGNUCommandLine { } { inherit output; })
|
||||
(lists.optional (isPrimary config) "--primary")
|
||||
(toGNUCommandLine { } config)
|
||||
]));
|
||||
|
@ -22,6 +22,6 @@ let
|
|||
args = mapAttrsToList getArgList config;
|
||||
in
|
||||
writeShellScriptBin name ''
|
||||
xrandr \
|
||||
${getExe xrandr} \
|
||||
${concatStringsSep " \\\n " args}
|
||||
''
|
Loading…
Reference in New Issue