Compare commits

...

2 commits

Author SHA1 Message Date
fau
0c995da8af
niri: add keybind for ghostty spawning + window expelling
Signed-off-by: fau <fau@faukah.com>
Change-Id: I6a6a69649fa8323e8fcae94b4ffdc2123e4a75cd
2025-07-27 18:06:29 +02:00
fau
967218a48e
btop: move to modules/home, clean up
Signed-off-by: fau <fau@faukah.com>
Change-Id: I6a6a696439b1369f17f636024507155d43005dec
2025-07-27 18:06:28 +02:00
4 changed files with 43 additions and 50 deletions

View file

@ -75,7 +75,6 @@
}; };
programs = { programs = {
ssh.enable = true; ssh.enable = true;
btop.enable = true;
nh.enable = true; nh.enable = true;
thunar.enable = true; thunar.enable = true;
}; };

View file

@ -0,0 +1,40 @@
{
lib,
pkgs,
...
}:
let
inherit (builtins) attrValues;
inherit (lib.attrsets) mapAttrsToList;
inherit (lib.strings) concatStringsSep;
btop-settings = {
truecolor = "True";
vim_keys = "True";
rounded_corners = "True";
update_ms = "100";
graph_symbol = "braille";
cpu_single_graph = "True";
clock_format = "%X";
use_fstab = "True";
io_mode = "True";
net_sync = "True";
net_iface = "enp4s0";
log_level = "ERROR";
color_theme = "gruvbox_dark";
};
btop-no-desktop-entry = pkgs.btop.overrideAttrs (prev: {
postInstall = ''
${prev.postInstall or ""}
rm -rf $out/share/applications/*.desktop
'';
});
in
{
packages = attrValues { inherit btop-no-desktop-entry; };
files.".config/btop/btop.conf".text =
concatStringsSep "\n" <| mapAttrsToList (name: value: "${name} = ${toString value}") btop-settings;
}

View file

@ -1,49 +0,0 @@
{
config,
lib,
pkgs,
...
}:
let
inherit (lib.options) mkEnableOption;
inherit (lib.modules) mkIf;
cfg = config.modules.programs.btop;
btop-settings = pkgs.writeTextDir "btop/btop.conf" ''
truecolor = True
vim_keys = True
rounded_corners = True
update_ms = 100
graph_symbol = "braille"
cpu_single_graph = True
clock_format = "%X"
use_fstab = True
io_mode = True
net_sync = True
net_iface = "enp4s0"
log_level = "ERROR"
'';
btop-no-desktop-entry = pkgs.btop.overrideAttrs (prev: {
postInstall = ''
${prev.postInstall or ""}
rm -rf $out/share/applications/*.desktop
'';
});
btop-wrapped = pkgs.symlinkJoin {
name = "btop-wrapped";
paths = [ btop-no-desktop-entry ];
nativeBuildInputs = [ pkgs.makeWrapper ];
postBuild = ''
wrapProgram $out/bin/btop --set XDG_CONFIG_HOME "${btop-settings}"
'';
};
in
{
options.modules.programs.btop.enable = mkEnableOption "btop";
config = mkIf cfg.enable {
environment.systemPackages = [ btop-wrapped ];
};
}

View file

@ -127,6 +127,9 @@ binds {
Mod+Return { Mod+Return {
spawn "ghostty" spawn "ghostty"
} }
Mod+Shift+Return {
spawn "sh" "-c" "niri msg action spawn -- ghostty; sleep 0.3; niri msg action consume-or-expel-window-left"
}
Mod+B { Mod+B {
spawn "brave" spawn "brave"
} }