diff --git a/flake.nix b/flake.nix index 0db64ceef0..4646a4285f 100644 --- a/flake.nix +++ b/flake.nix @@ -74,6 +74,9 @@ "git+https://git.sr.ht/~novakane/rivercarro?submodules=1"; rivercarro-src.flake = false; + niri.url = "github:YaLTeR/niri"; + niri.inputs.nixpkgs.follows = "nixpkgs"; + mydwl.url = "github:maxhbr/mydwl"; mydwl.inputs.nixpkgs.follows = "nixpkgs"; diff --git a/modules/myconfig.desktop.wayland.kde/default.nix b/modules/myconfig.desktop.wayland.kde/default.nix index 08c2f72135..2b926c349c 100644 --- a/modules/myconfig.desktop.wayland.kde/default.nix +++ b/modules/myconfig.desktop.wayland.kde/default.nix @@ -57,5 +57,19 @@ in { ] ++ (with pkgs.kdePackages; [ arianna ]) ; programs.kdeconnect.enable = lib.mkDefault false; } + { + home-manager.sharedModules = [ + ({ config, ... }: { + xdg.configFile = { + "kwalletrc".text = '' +[Wallet] +# permanently disable kwallet +Enabled=false +First Use=false + ''; + }; + }) + ]; + } ])); } diff --git a/modules/myconfig.desktop.wayland.niri/config.kdl b/modules/myconfig.desktop.wayland.niri/config.kdl index b8fbad2f7f..1ddefd5690 100644 --- a/modules/myconfig.desktop.wayland.niri/config.kdl +++ b/modules/myconfig.desktop.wayland.niri/config.kdl @@ -39,8 +39,16 @@ input { // Uncomment this to make the mouse warp to the center of newly focused windows. // warp-mouse-to-focus - // Focus windows and outputs automatically when moving the mouse into them. - // focus-follows-mouse + // Allow focus-follows-mouse only when it will not scroll the view. + focus-follows-mouse max-scroll-amount="0%" + workspace-auto-back-and-forth +} + +cursor { + xcursor-size 128 + hide-when-typing + // Hide the cursor after one second of inactivity. + hide-after-inactive-ms 5000 } // You can configure outputs by their name, which you can find @@ -267,6 +275,29 @@ window-rule { block-out-from "screen-capture" } +// comes with 1.11.0 +// layer-rule { +// match namespace="waybar" +// match at-startup=true +// +// // Properties that apply continuously. +// opacity 0.5 +// block-out-from "screen-capture" +// } +// +// layer-rule { +// match namespace="^notifications$" +// +// block-out-from "screen-capture" +// } +// +// // Make fuzzel semitransparent. +// layer-rule { +// match namespace="^launcher$" +// +// opacity 0.95 +// } + binds { // Keys consist of modifiers separated by + signs, followed by an XKB key name // in the end. To find an XKB name for a particular key, you may use a program @@ -305,26 +336,14 @@ binds { Mod+Down { focus-window-down; } Mod+Up { focus-window-up; } Mod+Right { focus-column-right; } - // Mod+H { focus-column-left; } - // Mod+J { focus-window-down; } - // Mod+K { focus-window-up; } - // Mod+L { focus-column-right; } Mod+Ctrl+Left { move-column-left; } Mod+Ctrl+Down { move-window-down; } Mod+Ctrl+Up { move-window-up; } Mod+Ctrl+Right { move-column-right; } - // Mod+Ctrl+H { move-column-left; } - // Mod+Ctrl+J { move-window-down; } - // Mod+Ctrl+K { move-window-up; } - // Mod+Ctrl+L { move-column-right; } // Alternative commands that move across workspaces when reaching // the first or last window in a column. - // Mod+J { focus-window-or-workspace-down; } - // Mod+K { focus-window-or-workspace-up; } - // Mod+Ctrl+J { move-window-down-or-to-workspace-down; } - // Mod+Ctrl+K { move-window-up-or-to-workspace-up; } Mod+Home { focus-column-first; } Mod+End { focus-column-last; } @@ -335,27 +354,21 @@ binds { Mod+Shift+Down { focus-monitor-down; } Mod+Shift+Up { focus-monitor-up; } Mod+Shift+Right { focus-monitor-right; } - // Mod+Shift+H { focus-monitor-left; } - // Mod+Shift+J { focus-monitor-down; } - // Mod+Shift+K { focus-monitor-up; } - // Mod+Shift+L { focus-monitor-right; } - - Mod+Shift+Ctrl+Left { move-column-to-monitor-left; } - Mod+Shift+Ctrl+Down { move-column-to-monitor-down; } - Mod+Shift+Ctrl+Up { move-column-to-monitor-up; } - Mod+Shift+Ctrl+Right { move-column-to-monitor-right; } - // Mod+Shift+Ctrl+H { move-column-to-monitor-left; } - // Mod+Shift+Ctrl+J { move-column-to-monitor-down; } - // Mod+Shift+Ctrl+K { move-column-to-monitor-up; } - // Mod+Shift+Ctrl+L { move-column-to-monitor-right; } + + Mod5+Left { move-column-to-monitor-left; } + Mod5+Down { move-column-to-monitor-down; } + Mod5+Up { move-column-to-monitor-up; } + Mod5+Right { move-column-to-monitor-right; } // Alternatively, there are commands to move just a single window: // Mod+Shift+Ctrl+Left { move-window-to-monitor-left; } // ... // And you can also move a whole workspace to another monitor: - // Mod+Shift+Ctrl+Left { move-workspace-to-monitor-left; } - // ... + Mod+Shift+Ctrl+Left { move-workspace-to-monitor-left; } + Mod+Shift+Ctrl+Down { move-workspace-to-monitor-down; } + Mod+Shift+Ctrl+Up { move-workspace-to-monitor-up; } + Mod+Shift+Ctrl+Right { move-workspace-to-monitor-right; } Mod+Page_Down { focus-workspace-down; } Mod+Page_Up { focus-workspace-up; } @@ -475,7 +488,7 @@ binds { // a matching layout switch hotkey configured in xkb options above. // Having both at once on the same hotkey will break the switching, // since it will switch twice upon pressing the hotkey (once by xkb, once by niri). - // Mod+Space { switch-layout "next"; } + Mod+Ctrl+Space { switch-layout "next"; } // Mod+Shift+Space { switch-layout "prev"; } Print { screenshot; } @@ -489,10 +502,10 @@ binds { // moving the mouse or pressing any other key. // Mod+Shift+Y { power-off-monitors; } - XF86AudioMedia { spawn "playerctl" "play-pause"; } - XF86AudioPlay { spawn "playerctl" "play-pause"; } - XF86AudioPrev { spawn "playerctl" "previous"; } - XF86AudioNext { spawn "playerctl" "next"; } - XF86Go { spawn "playerctl" "play"; } - Cancel { spawn "playerctl" "pause"; } + XF86AudioMedia allow-when-locked=true { spawn "playerctl" "play-pause"; } + XF86AudioPlay allow-when-locked=true { spawn "playerctl" "play-pause"; } + XF86AudioPrev allow-when-locked=true { spawn "playerctl" "previous"; } + XF86AudioNext allow-when-locked=true { spawn "playerctl" "next"; } + XF86Go allow-when-locked=true { spawn "playerctl" "play"; } + Cancel allow-when-locked=true { spawn "playerctl" "pause"; } } diff --git a/modules/myconfig.desktop.wayland.niri/default.nix b/modules/myconfig.desktop.wayland.niri/default.nix index fe0012c1b9..0ec9920e9b 100644 --- a/modules/myconfig.desktop.wayland.niri/default.nix +++ b/modules/myconfig.desktop.wayland.niri/default.nix @@ -1,5 +1,5 @@ # SPDX-License-Identifier: MIT -{ pkgs, config, lib, myconfig, ... }: +{ pkgs, config, lib, myconfig, inputs, ... }: let nixosConfig = config; cfg = config.myconfig; @@ -17,6 +17,7 @@ in { config = (lib.mkIf (cfg.desktop.wayland.enable && (builtins.elem "niri" cfg.desktop.wayland.selectedSessions || builtins.elem "niri-plain" cfg.desktop.wayland.selectedSessions)) { + nixpkgs.overlays = [ inputs.niri.overlays.default ]; home-manager.sharedModules = [ ({ config, ... }: { home.sessionVariables = { @@ -39,6 +40,10 @@ in { cat <$out/config.kdl $(cat $src) + environment { + DISPLAY "${config.home.sessionVariables.DISPLAY}" + } + ${cfg.desktop.wayland.niri.additionalConfigKdl} spawn-at-startup "${autostart}/bin/autostart.sh" @@ -47,6 +52,11 @@ in { ''; in "${drv}/config.kdl"; }; + programs.waybar.settings.mainBar = { + modules-left = [ + "wlr/taskbar" + ]; + }; systemd.user.services.niri = { Unit = { Description = "A scrollable-tiling Wayland compositor"; diff --git a/modules/myconfig.desktop.wayland/programs.waybar/default.nix b/modules/myconfig.desktop.wayland/programs.waybar/default.nix index 3f97777ce0..afe4a42291 100644 --- a/modules/myconfig.desktop.wayland/programs.waybar/default.nix +++ b/modules/myconfig.desktop.wayland/programs.waybar/default.nix @@ -59,7 +59,8 @@ let position = "top"; height = 25; spacing = 4; - modules-left = [ ]; + modules-left = [ + ]; modules-center = [ # "wlr/taskbar" # "group/hardware" @@ -110,6 +111,7 @@ let tooltip-format = '' {title} {name} + app_id: {app_id} {short_state}''; on-click = "activate"; on-click-middle = "close";