nixos-config/users/rouven/modules/wayland/river.nix

86 lines
3.7 KiB
Nix
Raw Normal View History

2024-04-19 11:31:49 +02:00
{ pkgs, lib, ... }:
2023-06-26 23:04:01 +02:00
{
2024-03-11 22:47:56 +01:00
wayland.windowManager.river = {
enable = true;
2024-03-13 16:22:01 +01:00
systemd. extraCommands = [ "systemctl --user start river-session.target" ];
2024-03-11 22:47:56 +01:00
settings = {
focus-follows-cursor = "always";
set-cursor-warp = "on-focus-change";
attach-mode = "bottom";
default-layout = "rivertile";
output-layout = "rivertile";
2023-06-26 23:04:01 +02:00
2024-03-11 22:47:56 +01:00
keyboard-layout = "-variant dvorak-alt-intl us";
input."pointer-2-7-SynPS/2_Synaptics_TouchPad" = {
tap = "enabled";
drag = "enabled";
middle-emulation = "enabled";
accel-profile = "adaptive";
};
2023-06-26 23:04:01 +02:00
2024-03-11 22:47:56 +01:00
map.normal = lib.attrsets.zipAttrs [
{
"Super" = {
Return = "spawn footclient";
Space = "toggle-float";
2024-03-12 17:09:02 +01:00
A = "spawn ${pkgs.wofi-emoji}/bin/wofi-emoji";
2024-03-11 22:47:56 +01:00
F = "toggle-fullscreen";
H = "focus-output previous";
J = "focus-view previous";
K = "focus-view next";
L = "focus-output next";
O = "send-to-output next";
};
"Super+Shift" = {
Return = "zoom";
Q = "close";
H = ''send-layout-cmd rivertile "main-ratio -0.05"'';
J = ''send-layout-cmd rivertile "main-count -1"'';
K = ''send-layout-cmd rivertile "main-count +1"'';
L = ''send-layout-cmd rivertile "main-ratio +0.05"'';
};
2024-03-11 22:48:42 +01:00
"Alt" = builtins.mapAttrs (_key: bind: "spawn " + bind) {
2024-03-11 22:47:56 +01:00
Space = "${pkgs.fuzzel}/bin/fuzzel";
};
2024-03-11 22:48:42 +01:00
"None" = builtins.mapAttrs (_key: bind: "spawn \"" + bind + "\"") {
2024-03-11 22:47:56 +01:00
Print = "${pkgs.sway-contrib.grimshot}/bin/grimshot copy area";
XF86Launch2 = "${pkgs.sway-contrib.grimshot}/bin/grimshot save area - | ${pkgs.swappy}/bin/swappy -f -";
XF86MonBrightnessUp = "${pkgs.light}/bin/light -A 10";
XF86MonBrightnessDown = "${pkgs.light}/bin/light -U 10";
XF86AudioMute = "${pkgs.pulseaudio}/bin/pactl set-sink-mute @DEFAULT_SINK@ toggle";
XF86AudioMicMute = "${pkgs.pulseaudio}/bin/pactl set-source-mute @DEFAULT_SOURCE@ toggle";
XF86AudioRaiseVolume = "${pkgs.pulseaudio}/bin/pactl set-sink-volume @DEFAULT_SINK@ +5%";
XF86AudioLowerVolume = "${pkgs.pulseaudio}/bin/pactl set-sink-volume @DEFAULT_SINK@ -5%";
XF86Favorites = "${pkgs.systemd}/bin/loginctl lock-session";
XF86Messenger = "${pkgs.swaynotificationcenter}/bin/swaync-client --toggle-panel";
Cancel = "${pkgs.swaynotificationcenter}/bin/swaync-client --hide-latest";
};
2024-03-11 22:48:42 +01:00
"Shift" = builtins.mapAttrs (_key: bind: "spawn \"" + bind + "\"") {
2024-03-11 22:47:56 +01:00
XF86AudioRaiseVolume = "${pkgs.pulseaudio}/bin/pactl set-source-volume @DEFAULT_SOURCE@ +5%";
XF86AudioLowerVolume = "${pkgs.pulseaudio}/bin/pactl set-source-volume @DEFAULT_SOURCE@ -5%";
Cancel = "${pkgs.swaynotificationcenter}/bin/swaync-client --cloes-all";
};
}
# fuckery. Encodes https://github.com/riverwm/river/blob/c474be1537c833da35682ef54194c3d6ddf1eee0/example/init#L77 in nix
(lib.attrsets.mapAttrs
2024-03-11 22:48:42 +01:00
(_mod: value: lib.attrsets.genAttrs (lib.lists.forEach (lib.lists.range 1 9) (num: toString num))
2024-03-11 22:47:56 +01:00
(tag: value + builtins.replaceStrings [ "TAG" ] [ tag ] " $((1 << (TAG - 1)))"))
{
"Super" = "set-focused-tags";
"Super+Shift" = "set-view-tags";
"Super+Control" = "toggle-focused-tags";
"Super+Shift+Control" = "toggle-view-tags";
})
];
2024-03-12 17:09:02 +01:00
map-pointer.normal."Super" = {
"BTN_LEFT" = "move-view";
"BTN_RIGHT" = "resize-view";
2024-03-11 22:47:56 +01:00
};
2023-06-27 16:01:12 +02:00
2024-03-11 22:47:56 +01:00
spawn = [
"rivertile"
];
2023-06-26 23:04:01 +02:00
};
};
}