feat: add hyprland monitor options
This commit is contained in:
parent
a11717c8ce
commit
1cae5d144a
3 changed files with 48 additions and 8 deletions
|
|
@ -3,10 +3,18 @@
|
|||
, ...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
inherit (lib) concatStringsSep flip boolToString mapAttrsToList;
|
||||
cfg = config.my.programs.hyprland;
|
||||
|
||||
mkMonitor = { name, resolution, position, scale, disabled, extra }:
|
||||
if disabled
|
||||
then "monitor=${name},disabled"
|
||||
else "monitor=${name},${resolution},${position},${scale},${extra}";
|
||||
|
||||
monitorsList = mapAttrsToList (name: value: { name = name; } // value) cfg.monitors;
|
||||
monitors = map mkMonitor monitorsList;
|
||||
|
||||
mkRule = rule: windowRegexes: "windowrulev2 = ${rule},${concatStringsSep "," windowRegexes}";
|
||||
mkRules = rules: windowRegexes: concatStringsSep "\n" (map (flip mkRule windowRegexes) rules);
|
||||
in
|
||||
|
|
@ -17,7 +25,7 @@ in
|
|||
#
|
||||
|
||||
# See https://wiki.hyprland.org/Configuring/Monitors/
|
||||
${concatLines (map (x: "monitor=${x}") cfg.monitors)}
|
||||
${concatStringsSep "\n" monitors}
|
||||
|
||||
# See https://wiki.hyprland.org/Configuring/Keywords/ for more
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue