feat: add wlr-which module and config

This commit is contained in:
2025-11-02 17:56:58 +01:00
parent b309aa3893
commit 87047b5b1b
12 changed files with 484 additions and 39 deletions

View File

@@ -6,8 +6,8 @@
Sent from GNU/Emacs
*** Sauvez un arbre, mangez un castor ***
*** Save a tree, eat a beaver ***
@@@ Sauvez un arbre, mangez un castor @@@
@@@ Save a tree, eat a beaver @@@
'';
in {
home.file.".signature" = {

View File

@@ -7,15 +7,42 @@
./light-home.nix
./packages.nix
./email.nix
./wlr-which-key
../modules
];
config = let
emacsPkg = with pkgs; ((emacsPackagesFor emacs).emacsWithPackages (
epkgs: [
epkgs.mu4e
epkgs.pdf-tools
]
emacsPackage = with pkgs; ((emacsPackagesFor emacs).emacsWithPackages (
epkgs:
with epkgs; [
mu4e
pdf-tools
tree-sitter
tree-sitter-langs
(treesit-grammars.with-grammars (grammar:
with grammar; [
tree-sitter-bash
tree-sitter-c
tree-sitter-cpp
tree-sitter-css
tree-sitter-dockerfile
tree-sitter-http
tree-sitter-javascript
tree-sitter-jsdoc
tree-sitter-json
tree-sitter-just
tree-sitter-markdown
tree-sitter-markdown-inline
tree-sitter-nix
tree-sitter-rust
tree-sitter-sql
tree-sitter-toml
tree-sitter-typescript
tree-sitter-typst
tree-sitter-vue
tree-sitter-yaml
]))
]
));
askpass = import ../modules/cli/scripts/askpass.nix {inherit pkgs;};
launchWithEmacsclient = import ../modules/cli/scripts/launch-with-emacsclient.nix {
@@ -30,18 +57,23 @@
home = {
sessionVariables = {
EDITOR = "${emacsPkg}/bin/emacsclient -c -a ${emacsPkg}/bin/emacs";
EDITOR = "${config.home.dev.editors.emacs.package}/bin/emacsclient -c -a ${config.home.dev.editors.emacs.package}/bin/emacs";
LAUNCH_EDITOR = "${launchWithEmacsclient}/bin/launch-with-emacsclient";
SUDO_ASKPASS = "${askpass}/bin/askpass";
LSP_USE_PLISTS = "true";
};
desktop.waybar.style = ./config/waybar/style.css;
dev.ai.claude.enable = true;
dev = {
ai.claude.enable = true;
editors.emacs.package = emacsPackage;
vcs.jj.signing.enable = true;
};
fullDesktop = true;
shell.fish.enable = true;
};
manual.html.enable = true;
manual = {
html.enable = true;
manpages.enable = true;
};
};
}

View File

@@ -0,0 +1,4 @@
{pkgs, ...}:
pkgs.writeShellScriptBin "center-window" ''
pidof -x Hyprland && hyprctl dispatch centerwindow
''

View File

@@ -0,0 +1,4 @@
{pkgs, ...}:
pkgs.writeShellScriptBin "close-window" ''
pidof -x Hyprland && hyprctl dispatch killactive
''

View File

@@ -0,0 +1,221 @@
{
config,
pkgs,
...
}: {
config.home.desktop.wlr-which-key.settings = {
font = "Cascadia Code 12";
background = "#3b4252d0";
color = "#eceff4";
border = "#2e3440";
border_width = 2;
corner_r = 10;
rows_per_column = 5;
column_padding = 25;
inhibit_compositor_keyboard_shortcuts = true;
auto_kbd_layout = true;
menu = let
left = "c";
down = "t";
up = "s";
right = "r";
center-window = import ./center-window.nix {inherit pkgs;};
close-window = import ./close-window.nix {inherit pkgs;};
float-window = import ./float-window.nix {inherit pkgs;};
focus-urgent = import ./focus-urgent.nix {inherit pkgs;};
fullscreen = import ./fullscreen.nix {inherit pkgs;};
ytplay = import ../../modules/cli/scripts/ytplay.nix {inherit pkgs;};
in [
{
key = "a";
desc = "Apps";
submenu = [
{
key = "b";
desc = "Browser";
cmd = "zen";
}
{
key = "B";
desc = "Qutebrowser";
cmd = "${pkgs.qutebrowser}/bin/qutebrowser";
}
{
key = "d";
desc = "Discord";
cmd = "${pkgs.vesktop}/bin/vesktop";
}
{
key = "e";
desc = "Emacs";
cmd = "${config.home.dev.editors.emacs.package}/bin/emacsclient -c -n";
}
{
key = "g";
desc = "Gimp";
cmd = "${pkgs.gimp}/bin/gimp";
}
{
key = "n";
desc = "Nemo";
cmd = "${pkgs.nemo}/bin/nemo";
}
{
key = "N";
desc = "Nextcloud";
cmd = "${pkgs.nextcloud-client}/bin/nextcloud";
}
{
key = "r";
desc = "Rofi";
submenu = [
{
key = "b";
desc = "Bluetooth";
cmd = "${pkgs.rofi-bluetooth}/bin/rofi-bluetooth";
}
{
key = "e";
desc = "Emoji";
cmd = "rofi -show emoji";
}
{
key = "r";
desc = "App Menu";
cmd = "rofi -combi-modi drun,calc -show combi";
}
{
key = "s";
desc = "SSH";
cmd = "rofi -show ssh";
}
{
key = "y";
desc = "YouTube";
cmd = "${ytplay}/bin/ytplay";
}
];
}
];
}
{
key = "b";
desc = "Buffers";
submenu = [
{
key = "c";
desc = "Center";
cmd = "${center-window}/bin/center-window";
}
{
key = "d";
desc = "Close";
cmd = "${close-window}/bin/close-window";
}
{
key = "f";
desc = "Fullscreen";
cmd = "${fullscreen}/bin/fullscreen";
}
{
key = "F";
desc = "Float";
cmd = "${float-window}/bin/float-window";
}
{
key = "u";
desc = "Urgent";
cmd = "${focus-urgent}/bin/focus-urgent";
}
{
key = ".";
desc = "Resize";
submenu = [
{
key = left;
desc = "Decrease Width";
cmd = "echo decrease width";
keep-open = true;
}
{
key = down;
desc = "Increase Height";
cmd = "echo decrease height";
keep-open = true;
}
{
key = up;
desc = "Decrease Height";
cmd = "echo decrease height";
keep-open = true;
}
{
key = right;
desc = "Increase Width";
cmd = "echo increase width";
keep-open = true;
}
];
}
];
}
{
key = "p";
desc = "Power";
submenu = [
{
key = "s";
desc = "Suspend";
cmd = "systemctl suspend";
}
{
key = "r";
desc = "Reboot";
cmd = "systemctl reboot";
}
{
key = "o";
desc = "Poweroff";
cmd = "systemctl poweroff";
}
];
}
{
key = "s";
desc = "Screenshots";
submenu = [
{
key = "Print";
desc = "Screenshot";
cmd = "screenshot";
}
{
key = "d";
desc = "Delayed";
cmd = "screenshot -d 3";
}
{
key = "D";
desc = "Select, Delay, Edit, and Copy";
cmd = "screenshot -secd 3";
}
{
key = "e";
desc = "Select, Edit, and Copy";
cmd = "screenshot -sec";
}
{
key = "g";
desc = "Select, Gimp, and Copy";
cmd = "screenshot -sgc";
}
{
key = "s";
desc = "Select and Copy";
cmd = "screenshot -sc";
}
];
}
];
};
}

View File

@@ -0,0 +1,5 @@
{pkgs, ...}:
pkgs.writeShellScriptBin "float" ''
pidof -x Hyprland && hyprctl dispatch togglefloating
echo test
''

View File

@@ -0,0 +1,4 @@
{pkgs, ...}:
pkgs.writeShellScriptBin "focus-urgent" ''
pidof -x Hyprland && hyprctl dispatch focusurgentorlast
''

View File

@@ -0,0 +1,4 @@
{pkgs, ...}:
pkgs.writeShellScriptBin "fullscreen" ''
pidof -x Hyprland && hyprctl dispatch fullscreen
''