feat: add XF86 keys and lid events

This commit is contained in:
Moritz Böhme 2024-10-16 14:07:12 +02:00
parent 101ab079ac
commit 914bbd7d53
Signed by: moritz
GPG key ID: 970C6E89EB0547A9

View file

@ -43,6 +43,8 @@ in
home-manager.users.moritz = {
home.packages = with pkgs; [
rivercarro
wlr-randr
jq
];
services.kanshi = {
enable = true;
@ -57,6 +59,12 @@ in
"normal"
"passthrough"
];
map-switch.normal.lid = {
close = ''
spawn 'wlr-randr --output eDP-1 --off; monitors=$(wlr-randr --json | jq .[].name | count); [ "$monitors" = 1] && loginctl lock-session'
'';
open = "spawn 'wlr-randr --output eDP-1 --on'";
};
map = {
normal = {
"Super Q" = "close";
@ -86,6 +94,14 @@ in
# lock screen
"Super+Alt L" = ''spawn "loginctl lock-session"'';
# XF86 keys
"None XF86AudioLowerVolume" = "spawn 'pamixer -d 5'";
"None XF86AudioRaiseVolume" = "spawn 'pamixer -i 5'";
"None XF86AudioMute" = "spawn 'pamixer -t'";
"None XF86AudioNext" = "spawn 'playerctl -p spotifyd,firefox next'";
"None XF86AudioPlay" = "spawn 'playerctl -p spotifyd,firefox play-pause'";
"None XF86AudioPrev" = "spawn 'playerctl -p spotifyd,firefox previous'";
} //
# tags
(
@ -110,13 +126,11 @@ in
lib.listToAttrs mappings
);
};
map-pointer = {
normal = {
map-pointer.normal = {
"Super BTN_LEFT" = "move-view";
"Super BTN_RIGHT" = "resize-view";
"Super BTN_MIDDLE" = "toggle-float";
};
};
attach-mode = "bottom";
default-layout = "rivercarro";
focus-follows-cursor = "normal";