Skip to content

Commit

Permalink
niri und disable kwallet
Browse files Browse the repository at this point in the history
Signed-off-by: Maximilian Huber <[email protected]>
  • Loading branch information
maxhbr committed Dec 9, 2024
1 parent d844088 commit f81f994
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 38 deletions.
3 changes: 3 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down
14 changes: 14 additions & 0 deletions modules/myconfig.desktop.wayland.kde/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
'';
};
})
];
}
]));
}
85 changes: 49 additions & 36 deletions modules/myconfig.desktop.wayland.niri/config.kdl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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; }
Expand All @@ -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; }
Expand Down Expand 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; }
Expand All @@ -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"; }
}
12 changes: 11 additions & 1 deletion modules/myconfig.desktop.wayland.niri/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# SPDX-License-Identifier: MIT
{ pkgs, config, lib, myconfig, ... }:
{ pkgs, config, lib, myconfig, inputs, ... }:
let
nixosConfig = config;
cfg = config.myconfig;
Expand All @@ -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 = {
Expand All @@ -39,6 +40,10 @@ in {
cat <<EOF >$out/config.kdl
$(cat $src)
environment {
DISPLAY "${config.home.sessionVariables.DISPLAY}"
}
${cfg.desktop.wayland.niri.additionalConfigKdl}
spawn-at-startup "${autostart}/bin/autostart.sh"
Expand All @@ -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";
Expand Down
4 changes: 3 additions & 1 deletion modules/myconfig.desktop.wayland/programs.waybar/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ let
position = "top";
height = 25;
spacing = 4;
modules-left = [ ];
modules-left = [
];
modules-center = [
# "wlr/taskbar"
# "group/hardware"
Expand Down Expand Up @@ -110,6 +111,7 @@ let
tooltip-format = ''
{title}
{name}
app_id: {app_id}
{short_state}'';
on-click = "activate";
on-click-middle = "close";
Expand Down

0 comments on commit f81f994

Please sign in to comment.