[Hyprland,Eww] Refactors configs so that I can share more between Vega and Altair
This commit is contained in:
71
home-manager/options/monitors.nix
Normal file
71
home-manager/options/monitors.nix
Normal file
@@ -0,0 +1,71 @@
|
||||
{ lib, config, ... }:
|
||||
{
|
||||
options =
|
||||
with lib;
|
||||
with types;
|
||||
{
|
||||
hardware.monitors = mkOption {
|
||||
type = lazyAttrsOf (submodule {
|
||||
options = {
|
||||
mode = mkOption {
|
||||
type = str;
|
||||
default = "auto";
|
||||
};
|
||||
position = mkOption {
|
||||
type = str;
|
||||
default = "auto";
|
||||
};
|
||||
rotation = mkOption {
|
||||
type = enum [
|
||||
"none"
|
||||
"90"
|
||||
"180"
|
||||
"270"
|
||||
];
|
||||
default = "none";
|
||||
};
|
||||
flipped = mkOption {
|
||||
type = bool;
|
||||
default = false;
|
||||
};
|
||||
};
|
||||
});
|
||||
default = { };
|
||||
description = "Monitor configuration";
|
||||
};
|
||||
};
|
||||
|
||||
# config = {
|
||||
# wayland.windowManager.hyprland.settings.monitors =
|
||||
# let
|
||||
# transformMap = {
|
||||
# "none" = {
|
||||
# normal = 0;
|
||||
# flipped = 4;
|
||||
# };
|
||||
# "90" = {
|
||||
# normal = 1;
|
||||
# flipped = 5;
|
||||
# };
|
||||
# "180" = {
|
||||
# normal = 2;
|
||||
# flipped = 6;
|
||||
# };
|
||||
# "270" = {
|
||||
# normal = 3;
|
||||
# flipped = 7;
|
||||
# };
|
||||
# };
|
||||
#
|
||||
# monitorTransform =
|
||||
# m:
|
||||
# let
|
||||
# t = transformMap.${m.rotation};
|
||||
# in
|
||||
# if m.flipped then t.flipped else t.normal;
|
||||
# monitorString =
|
||||
# name: m: "${name}, ${m.mode}, ${m.position}, 1, transform, ${toString (monitorTransform m)}";
|
||||
# in
|
||||
# lib.mapAttrsToList monitorString config.hardware.monitors;
|
||||
# };
|
||||
}
|
||||
Reference in New Issue
Block a user