diff --git a/config/niri/config.kdl b/config/niri/config.kdl new file mode 100644 index 0000000..f86cafa --- /dev/null +++ b/config/niri/config.kdl @@ -0,0 +1,104 @@ +input { + keyboard { + xkb { + layout "se" + variant "nodeadkeys" + options "caps:escape" + } + } + + touchpad { + tap + natural-scroll + scroll-factor 0.3 + } +} + +layout { + gaps 10 + + preset-column-widths { + proportion 0.33333 + proportion 0.5 + proportion 0.66667 + } + + default-column-width { proportion 0.5; } + + focus-ring { + width 2 + active-color "#cd0a00" + inactive-color "#560500" + } + + border { + off + } +} + +prefer-no-csd + +screenshot-path "~/Pictures/Screenshots/%Y-%m-%d_%H-%M-%S.png" + +spawn-at-startup "awww-daemon" +spawn-at-startup "foot" "--server" +spawn-at-startup "lxqt-policykit-agent" +spawn-at-startup "sh" "-c" "sleep 1 && ~/.local/bin/wallpaper.sh" +spawn-at-startup "sh" "-c" "waybar --config ~/.config/waybar/niri-config --style ~/.config/waybar/style.css" +spawn-at-startup "swayidle" "-w" "timeout" "300" "swaylock -f -c 0a0a0a && ~/.local/bin/wallpaper.sh" "timeout" "600" "niri msg action power-off-monitors; wpctl set-mute @DEFAULT_AUDIO_SINK@ 1" "resume" "niri msg action power-on-monitors; wpctl set-mute @DEFAULT_AUDIO_SINK@ 0" "before-sleep" "swaylock -f -c 0a0a0a" + +binds { + Mod+Return { spawn "footclient"; } + Mod+D { spawn "fuzzel"; } + Mod+Shift+Q { spawn "wlogout"; } + + Mod+Q { close-window; } + + Mod+H { focus-column-left; } + Mod+L { focus-column-right; } + Mod+J { focus-window-down; } + Mod+K { focus-window-up; } + + Mod+Shift+H { move-column-left; } + Mod+Shift+L { move-column-right; } + Mod+Shift+J { move-window-down; } + Mod+Shift+K { move-window-up; } + + Mod+F { fullscreen-window; } + Mod+Space { switch-preset-column-width; } + Mod+Shift+Space { toggle-window-floating; } + + Mod+Minus { set-column-width "-10%"; } + Mod+Equal { set-column-width "+10%"; } + + Mod+1 { focus-workspace 1; } + Mod+2 { focus-workspace 2; } + Mod+3 { focus-workspace 3; } + Mod+4 { focus-workspace 4; } + Mod+5 { focus-workspace 5; } + Mod+6 { focus-workspace 6; } + Mod+7 { focus-workspace 7; } + Mod+8 { focus-workspace 8; } + + Mod+Shift+1 { move-window-to-workspace 1; } + Mod+Shift+2 { move-window-to-workspace 2; } + Mod+Shift+3 { move-window-to-workspace 3; } + Mod+Shift+4 { move-window-to-workspace 4; } + Mod+Shift+5 { move-window-to-workspace 5; } + Mod+Shift+6 { move-window-to-workspace 6; } + Mod+Shift+7 { move-window-to-workspace 7; } + Mod+Shift+8 { move-window-to-workspace 8; } + + Mod+WheelScrollDown cooldown-ms=150 { focus-workspace-down; } + Mod+WheelScrollUp cooldown-ms=150 { focus-workspace-up; } + + XF86AudioRaiseVolume { spawn "wpctl" "set-volume" "-l" "1.5" "@DEFAULT_AUDIO_SINK@" "5%+"; } + XF86AudioLowerVolume { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "5%-"; } + XF86AudioMute { spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SINK@" "toggle"; } + + XF86MonBrightnessUp { spawn "brightnessctl" "set" "5%+"; } + XF86MonBrightnessDown { spawn "brightnessctl" "set" "5%-"; } + + Mod+Shift+S { spawn "sh" "-c" "grim -l 0 -g \"$(slurp)\" - | wl-copy"; } + Mod+Alt+S { spawn "sh" "-c" "mkdir -p ~/Pictures/Screenshots && grim -l 0 -g \"$(slurp)\" - | satty --filename - --output-filename ~/Pictures/Screenshots/$(date +\"%Y-%m-%d_%H-%M-%S\").png"; } +} diff --git a/config/waybar/niri-config b/config/waybar/niri-config new file mode 100644 index 0000000..dfcb502 --- /dev/null +++ b/config/waybar/niri-config @@ -0,0 +1,45 @@ +{ + "layer": "top", + "position": "top", + "height": 24, + "margin-left": 250, + "margin-right": 250, + "modules-left": ["custom/nurgle", "niri/workspaces"], + + "custom/nurgle": { + "format": " ", + "tooltip": false + }, + "modules-center": ["clock"], + "modules-right": ["custom/network", "cpu", "battery"], + + "niri/workspaces": { + "disable-scroll": true + }, + + "clock": { + "format": "{:%y-%m-%d (%a w%V) %H:%M}", + "interval": 60 + }, + + "custom/network": { + "exec": "~/.local/bin/waybar-network.sh", + "interval": 2, + "format": "{}" + }, + + "cpu": { + "format": "CPU {usage}%", + "interval": 2 + }, + + "battery": { + "format": "󰁹 {capacity}%", + "format-charging": "󱐋 {capacity}%", + "format-full": "󰁹 FULL", + "states": { + "warning": 30, + "critical": 15 + } + } +} diff --git a/configuration.nix b/configuration.nix index f348ab0..6bbe0c8 100644 --- a/configuration.nix +++ b/configuration.nix @@ -89,6 +89,8 @@ wrapperFeatures.gtk = true; }; + programs.niri.enable = true; + xdg.portal = { enable = true; wlr.enable = true; diff --git a/home.nix b/home.nix index ea86f5b..cb369da 100644 --- a/home.nix +++ b/home.nix @@ -239,6 +239,7 @@ source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/nixos-dotfiles/config/nvim"; }; xdg.configFile."sway".source = ./config/sway; + xdg.configFile."niri".source = ./config/niri; home.file.".local/bin/wallpaper.sh" = { source = ./config/sway/wallpaper.sh; executable = true;