From 6621b1998e6f02772adb2df2fc19343691b086cf Mon Sep 17 00:00:00 2001 From: Arpit Chakladar Date: Sat, 25 Jul 2026 11:00:04 +0530 Subject: feat(display): using proper window classes for i3 --- modules/desktop/i3/default.nix | 8 ++------ modules/desktop/i3/keybindings.nix | 4 ++-- modules/file-management/yazi/assertions.nix | 13 +++++++++++++ modules/file-management/yazi/default.nix | 15 ++++++++++++++- modules/web/chromium/default.nix | 2 +- 5 files changed, 32 insertions(+), 10 deletions(-) create mode 100644 modules/file-management/yazi/assertions.nix diff --git a/modules/desktop/i3/default.nix b/modules/desktop/i3/default.nix index 5a428d3..b3d0672 100644 --- a/modules/desktop/i3/default.nix +++ b/modules/desktop/i3/default.nix @@ -53,7 +53,7 @@ window.commands = [ { - command = "floating enable, resize set 1400 800, move position center"; + command = "floating enable, resize set 1280 720, move position center"; criteria.class = "file-explorer"; } { @@ -61,13 +61,9 @@ criteria.class = "application-launcher"; } { - command = "floating enable, resize set 1000 600, move position center"; + command = "floating enable, resize set 1280 720, move position center"; criteria.class = "keybindings-viewer"; } - { - command = "if_floating_resize_set 1280 720"; - criteria.class = ".*"; - } ]; focus.followMouse = true; diff --git a/modules/desktop/i3/keybindings.nix b/modules/desktop/i3/keybindings.nix index b421dba..8857e7d 100644 --- a/modules/desktop/i3/keybindings.nix +++ b/modules/desktop/i3/keybindings.nix @@ -15,7 +15,7 @@ in lib.mkIf config.terminal.kitty.enable "exec ${lib.getExe config.terminal.kitty.package}"; "${mod}+f" = lib.mkIf (config.terminal.kitty.enable && config.file-management.yazi.enable) - "exec ${lib.getExe config.terminal.kitty.package} --title 'Yazi' -e ${lib.getExe config.file-management.yazi.package}"; + "exec ${lib.getExe config.terminal.kitty.package} --class file-explorer --title 'Yazi' -e ${lib.getExe config.file-management.yazi.package}"; "${mod}+s" = lib.mkIf config.terminal.kitty.enable "exec ${lib.getExe config.terminal.kitty.package} --title 'Keybindings' --class keybindings-viewer -e ${lib.getExe config.scripts.i3-keybindings.package}"; "${mod}+q" = "kill"; @@ -54,7 +54,7 @@ in "${mod}+Control+l" = "resize grow width 20 px or 20 ppt"; # Layout Modes - "${mod}+d" = "floating toggle"; + "${mod}+d" = "floating toggle, resize set 1280 720, move position center"; "${mod}+m" = "fullscreen toggle"; # --- Workspaces --- diff --git a/modules/file-management/yazi/assertions.nix b/modules/file-management/yazi/assertions.nix new file mode 100644 index 0000000..b100fca --- /dev/null +++ b/modules/file-management/yazi/assertions.nix @@ -0,0 +1,13 @@ +# Assertions - Validates kitty is enabled for yazi desktop entry +{ config, ... }: +{ + assertions = [ + { + assertion = !config.file-management.yazi.enable || config.terminal.kitty.enable; + message = '' + file-management.yazi is enabled but terminal.kitty.enable is not. + yazi's desktop entry requires kitty as the terminal launcher. Please enable terminal.kitty. + ''; + } + ]; +} diff --git a/modules/file-management/yazi/default.nix b/modules/file-management/yazi/default.nix index b43ed5e..f52943f 100644 --- a/modules/file-management/yazi/default.nix +++ b/modules/file-management/yazi/default.nix @@ -1,7 +1,10 @@ # yazi - Terminal file manager with native previews { config, lib, ... }: { - imports = [ ./theme.nix ]; + imports = [ + ./theme.nix + ./assertions.nix + ]; options.file-management.yazi = { enable = lib.mkEnableOption "Enables yazi."; @@ -25,6 +28,16 @@ }; }; + xdg.desktopEntries."yazi" = { + name = "Yazi"; + exec = "${lib.getExe config.terminal.kitty.package} -e ${lib.getExe config.file-management.yazi.package}"; + icon = "kitty"; + categories = [ "Utility" ]; + comment = "Terminal file manager"; + terminal = false; + type = "Application"; + }; + xdg.mimeApps.defaultApplications = { "inode/directory" = "yazi.desktop"; }; diff --git a/modules/web/chromium/default.nix b/modules/web/chromium/default.nix index 4296430..380d2ea 100644 --- a/modules/web/chromium/default.nix +++ b/modules/web/chromium/default.nix @@ -30,7 +30,7 @@ extensions = [ { id = "ddkjiahejlhfcafbddmgiahcphecmpfh"; } # uBlock Origin Lite { id = "naepdomgkenhinolocfifgehidddafch"; } # Browserpass - { id = "mpkodccbngfoacfalldjimigbofkhgjn"; } # Dark Reader + { id = "kioklelcojgbjoljlilalgdcppkiioge"; } # Quite Black { id = "eimadpbcbfnmbkopoojfekhnkhdbieeh"; } # Dark Reader { id = "hpejmncgbammabkkodflfeekpcicfjnk"; } # Aria2 Explorer ]; -- cgit v1.2.3