diff options
Diffstat (limited to '')
| -rw-r--r-- | home/apps/astal.nix | 13 | ||||
| -rw-r--r-- | home/apps/caelestia/settings.nix | 6 | ||||
| -rw-r--r-- | home/apps/default.nix | 1 | ||||
| -rw-r--r-- | home/apps/kanshi.nix | 53 |
4 files changed, 67 insertions, 6 deletions
diff --git a/home/apps/astal.nix b/home/apps/astal.nix index 1dd8527..73e90f7 100644 --- a/home/apps/astal.nix +++ b/home/apps/astal.nix @@ -1,11 +1,12 @@ { lib, config, - inputs, - system, + pkgs, ... }: let - astal = inputs.self.packages.${system}; + astal = pkgs.astal.override { + inherit (config.options) theme; + }; inherit (lib) mkIf; cfg = config.apps.astal; @@ -16,8 +17,8 @@ in { default.appLauncher = lib.mkDefault "astal-launcher"; home.packages = [ - astal.astal.shell - astal.astal.launcher + astal.shell + astal.launcher ]; systemd.user.services.astal = { @@ -33,7 +34,7 @@ in { }; Service = { - ExecStart = "${astal.astal.shell}/bin/astal-shell"; + ExecStart = "${astal.shell}/bin/astal-shell"; Restart = "always"; RestartSec = "10"; }; diff --git a/home/apps/caelestia/settings.nix b/home/apps/caelestia/settings.nix index c116025..de81df7 100644 --- a/home/apps/caelestia/settings.nix +++ b/home/apps/caelestia/settings.nix @@ -83,6 +83,12 @@ in { }; }; + # Launcher settings + launcher = { + enabled = true; + useFuzzy = true; + }; + # Background background.enabled = true; paths = { diff --git a/home/apps/default.nix b/home/apps/default.nix index 1823b0d..baf9d82 100644 --- a/home/apps/default.nix +++ b/home/apps/default.nix @@ -7,6 +7,7 @@ _: { ./alacritty.nix ./astal.nix ./hyprlock.nix + ./kanshi.nix ./kitty.nix ./mako.nix ]; diff --git a/home/apps/kanshi.nix b/home/apps/kanshi.nix new file mode 100644 index 0000000..ed7622a --- /dev/null +++ b/home/apps/kanshi.nix @@ -0,0 +1,53 @@ +{ + config, + lib, + ... +}: let + inherit (lib) mkIf; + cfg = config.apps.kanshi; + + laptopMonitors = lib.lists.filter (mon: mon.laptop) config.monitors; + dockedMonitors = lib.lists.filter (mon: !mon.laptop) config.monitors; + + mkOutput = mon: status: + lib.mkMerge [ + { + criteria = + if mon.desc == "" + then mon.port + else mon.desc; + scale = mon.scale; + inherit status; + } + (lib.mkIf (mon.position.x != 0 || mon.position.y != 0) { + position = "${toString mon.position.x},${toString mon.position.y}"; + }) + (lib.mkIf (mon.size.x != 0 && mon.size.y != 0) { + mode = "${toString mon.size.x}x${toString mon.size.y}"; + }) + ]; + + mkEnabledOutput = mon: (mkOutput mon "enable"); + mkDisabledOutput = mon: (mkOutput mon "disable"); +in { + config = mkIf cfg.enable { + services.kanshi = { + enable = true; + + settings = [ + { + profile = { + name = "laptop"; + outputs = map mkEnabledOutput laptopMonitors; + }; + } + { + profile = { + name = "docked"; + outputs = (map mkEnabledOutput dockedMonitors) ++ (map mkDisabledOutput laptopMonitors); + }; + } + ]; + }; + }; +} |