diff options
| author | Gregor Kleen <gkleen@yggdrasil.li> | 2026-04-14 22:08:01 +0200 |
|---|---|---|
| committer | Gregor Kleen <gkleen@yggdrasil.li> | 2026-04-14 22:08:01 +0200 |
| commit | ffa13a9b9cda0c012d9d3793412104bb10c79ebe (patch) | |
| tree | b45e6e98ac1b982b817b07a9fbcf317297059eee /accounts/gkleen@sif/niri.nix | |
| parent | 19d093c29f0b6b64f4c0f383ec34a85f76e04537 (diff) | |
| download | nixos-ffa13a9b9cda0c012d9d3793412104bb10c79ebe.tar nixos-ffa13a9b9cda0c012d9d3793412104bb10c79ebe.tar.gz nixos-ffa13a9b9cda0c012d9d3793412104bb10c79ebe.tar.bz2 nixos-ffa13a9b9cda0c012d9d3793412104bb10c79ebe.tar.xz nixos-ffa13a9b9cda0c012d9d3793412104bb10c79ebe.zip | |
alacritty
Diffstat (limited to 'accounts/gkleen@sif/niri.nix')
| -rw-r--r-- | accounts/gkleen@sif/niri.nix | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/accounts/gkleen@sif/niri.nix b/accounts/gkleen@sif/niri.nix index 80abfc1a..a27b4137 100644 --- a/accounts/gkleen@sif/niri.nix +++ b/accounts/gkleen@sif/niri.nix | |||
| @@ -6,7 +6,8 @@ let | |||
| 6 | sleaf = name: arg: kdl.node name [arg] []; | 6 | sleaf = name: arg: kdl.node name [arg] []; |
| 7 | 7 | ||
| 8 | niri = cfg.package; | 8 | niri = cfg.package; |
| 9 | terminal = lib.getExe config.programs.kitty.package; | 9 | spawnTerminal = { command ? lib.getExe config.programs.zsh.package, extraArgs ? [] }: |
| 10 | [(lib.getExe config.programs.alacritty.package) "msg" "--socket" "/run/user/1000/alacritty.sock" "create-window"] ++ lib.toList extraArgs ++ ["--command" (lib.getExe' hostConfig.systemd.package "systemd-run") "--user" "--pty" "--same-dir" "--wait" "--collect" "--quiet" "--service-type=exec" "--expand-environment=no"] ++ lib.toList command; | ||
| 10 | 11 | ||
| 11 | focus_or_spawn = pkgs.writeShellApplication { | 12 | focus_or_spawn = pkgs.writeShellApplication { |
| 12 | name = "focus-or-spawn"; | 13 | name = "focus-or-spawn"; |
| @@ -425,8 +426,8 @@ in { | |||
| 425 | } | 426 | } |
| 426 | { name = "term"; | 427 | { name = "term"; |
| 427 | key = "Mod+Control+Return"; | 428 | key = "Mod+Control+Return"; |
| 428 | app-id = "kitty-scratch"; | 429 | app-id = "alacritty-scratch"; |
| 429 | spawn = [ "kitty" "--app-id" "kitty-scratch" ]; | 430 | spawn = spawnTerminal { extraArgs = ["--class" "alacritty-scratch"]; }; |
| 430 | } | 431 | } |
| 431 | { name = "edit"; | 432 | { name = "edit"; |
| 432 | match = [ { title = "^scratch$"; app-id = "^emacs$"; } ]; | 433 | match = [ { title = "^scratch$"; app-id = "^emacs$"; } ]; |
| @@ -656,7 +657,8 @@ in { | |||
| 656 | ]) | 657 | ]) |
| 657 | (plain "window-rule" [ | 658 | (plain "window-rule" [ |
| 658 | (sleaf "match" { app-id = "^kitty$"; }) | 659 | (sleaf "match" { app-id = "^kitty$"; }) |
| 659 | (sleaf "match" { app-id = "^kitty-play$"; }) | 660 | (sleaf "match" { app-id = "^alacritty$"; }) |
| 661 | (sleaf "match" { app-id = "^(kitty|alacritty)-play$"; }) | ||
| 660 | (plain "default-column-width" [(sleaf "proportion" (1. / 3.))]) | 662 | (plain "default-column-width" [(sleaf "proportion" (1. / 3.))]) |
| 661 | ]) | 663 | ]) |
| 662 | 664 | ||
| @@ -677,7 +679,7 @@ in { | |||
| 677 | (plain "default-column-width" [(sleaf "proportion" 1.)]) | 679 | (plain "default-column-width" [(sleaf "proportion" 1.)]) |
| 678 | ]) | 680 | ]) |
| 679 | (plain "window-rule" [ | 681 | (plain "window-rule" [ |
| 680 | (sleaf "match" { app-id = "^kitty-play$"; }) | 682 | (sleaf "match" { app-id = "^(kitty|alacritty)-play$"; }) |
| 681 | (sleaf "open-on-workspace" "vid") | 683 | (sleaf "open-on-workspace" "vid") |
| 682 | (sleaf "open-focused" false) | 684 | (sleaf "open-focused" false) |
| 683 | ]) | 685 | ]) |
| @@ -754,7 +756,7 @@ in { | |||
| 754 | (lib.mapAttrsToList bind (with config.lib.niri.actions; { | 756 | (lib.mapAttrsToList bind (with config.lib.niri.actions; { |
| 755 | "Mod+Slash".action = show-hotkey-overlay; | 757 | "Mod+Slash".action = show-hotkey-overlay; |
| 756 | 758 | ||
| 757 | "Mod+Return".action = spawn terminal; | 759 | "Mod+Return".action = spawn (spawnTerminal {}); |
| 758 | "Mod+Shift+Return".action = | 760 | "Mod+Shift+Return".action = |
| 759 | let | 761 | let |
| 760 | nushellKitty = pkgs.symlinkJoin { | 762 | nushellKitty = pkgs.symlinkJoin { |
| @@ -784,9 +786,12 @@ in { | |||
| 784 | })); | 786 | })); |
| 785 | "Mod+Alt+L".action = spawn (lib.getExe (pkgs.writeShellApplication { | 787 | "Mod+Alt+L".action = spawn (lib.getExe (pkgs.writeShellApplication { |
| 786 | name = "queue-yt-dlp"; | 788 | name = "queue-yt-dlp"; |
| 787 | runtimeInputs = with pkgs; [ wl-clipboard-rs config.programs.kitty.package ]; | 789 | runtimeInputs = with pkgs; [ wl-clipboard-rs ]; |
| 788 | text = '' | 790 | text = '' |
| 789 | exec -- kitty --app-id kitty-play --directory "$HOME"/media mpv "$(wl-paste)" | 791 | exec -- ${lib.concatStringsSep " " (spawnTerminal { |
| 792 | extraArgs = [ "--class" "alacritty-play" "--working-directory" "\"$HOME\"/media" ]; | ||
| 793 | command = ["mpv" "\"$(wl-paste)\""]; | ||
| 794 | })} | ||
| 790 | ''; | 795 | ''; |
| 791 | })); | 796 | })); |
| 792 | "Mod+Alt+M".action = spawn (lib.getExe' pkgs.screen-message "sm") "-n" "Fira Mono" "-a" "1" "-f" "#fff" "-b" "#000"; | 797 | "Mod+Alt+M".action = spawn (lib.getExe' pkgs.screen-message "sm") "-n" "Fira Mono" "-a" "1" "-f" "#fff" "-b" "#000"; |
