Customize Gptel and bTop floating windows sizes for each host

This commit is contained in:
Andrea Ciceri 2025-02-27 14:18:12 +07:00
parent e1ebdc68e9
commit fccbf30dd3
Signed by: aciceri
SSH key fingerprint: SHA256:/AagBweyV4Hlfg9u092n8hbHwD5fcB6A3qhDiDA65Rg
2 changed files with 43 additions and 2 deletions

View file

@ -351,11 +351,13 @@ binds {
Mod+B { spawn "firefox"; } Mod+B { spawn "firefox"; }
Mod+RETURN { spawn "emacsclient" "-c" "--eval" "(ccr/start-eshell)"; } Mod+RETURN { spawn "emacsclient" "-c" "--eval" "(ccr/start-eshell)"; }
Mod+M { spawn "emacsclient" "-c" "--eval" "(notmuch-search \"tag:new\")"; } Mod+M { spawn "emacsclient" "-c" "--eval" "(notmuch-search \"tag:new\")"; }
Mod+G { spawn "emacsclient" "-c" "--eval" "(switch-to-buffer (gptel \"*ChatGPT*\"))" "-F" "((name . \"GPTel - Emacs\") (width . 150) (height . 60))'"; } // Mod+G { spawn "emacsclient" "-c" "--eval" "(switch-to-buffer (gptel \"*ChatGPT*\"))" "-F" "((name . \"GPTel - Emacs\") (width . $NIRI_GPTEL_COLS) (height . $NIRI_GPTEL_ROWS))'"; }
Mod+G { spawn "run-floating-gptel"; }
Mod+Shift+C { spawn "emacsclient" "-c" "--eval" "(org-roam-dailies-capture-today)"; } Mod+Shift+C { spawn "emacsclient" "-c" "--eval" "(org-roam-dailies-capture-today)"; }
Mod+Alt+L { spawn "swaylock"; } Mod+Alt+L { spawn "swaylock"; }
Mod+Space { spawn "rofi" "-show" "menu" "-modi" "menu:rofi-power-menu"; } Mod+Space { spawn "rofi" "-show" "menu" "-modi" "menu:rofi-power-menu"; }
Mod+Ctrl+b { spawn "foot" "--title='bTop'" "-W" "210x60" "btop";} // Mod+Ctrl+b { spawn "foot" "--title='bTop'" "-W" "$NIRI_BTOP_COLSx$NIRI_BTOP_ROWS" "btop";}
Mod+Ctrl+b { spawn "run-floating-btop"; }
// Example volume keys mappings for PipeWire & WirePlumber. // Example volume keys mappings for PipeWire & WirePlumber.
// The allow-when-locked=true property makes them work even when the session is locked. // The allow-when-locked=true property makes them work even when the session is locked.

View file

@ -2,13 +2,52 @@
pkgs, pkgs,
lib, lib,
config, config,
hostname,
... ...
}: }:
let
niriVars =
{
picard = {
floating-gptel = {
rows = "60";
cols = "150";
};
floating-btop = {
rows = "210";
cols = "60";
};
};
kirk = {
floating-gptel = {
rows = "40";
cols = "140";
};
floating-btop = {
rows = "40";
cols = "140";
};
};
}
."${hostname}" or niriVars.kirk;
run-floating-gptel =
with niriVars.floating-gptel;
pkgs.writeScriptBin "run-floating-gptel" ''
emacsclient -c --eval '(switch-to-buffer (gptel "*GptEl*"))' -F '((name . "GPTel - Emacs") (width . ${cols}) (height . ${rows}))'
'';
run-floating-btop =
with niriVars.floating-btop;
pkgs.writeScriptBin "run-floating-btop" ''
foot --title='bTop' -W ${rows}x${cols} btop
'';
in
{ {
home.packages = with pkgs; [ home.packages = with pkgs; [
niri niri
waypaper waypaper
xwayland-satellite xwayland-satellite
run-floating-gptel
run-floating-btop
]; ];
systemd.user.targets.niri-session = { systemd.user.targets.niri-session = {
Unit = { Unit = {