niri: configure wallpaper and wlsunset

This commit is contained in:
2026-02-03 22:10:34 +01:00
parent 4d550731af
commit a059882831

View File

@@ -2,12 +2,17 @@
wrappers, wrappers,
pkgs, pkgs,
lib, lib,
screenshotPath ? "~/Pictures/Screenshots/Screenshot from %Y-%m-%d %H-%M-%S.png", screenshotPath ? null,
fileManager ? lib.getExe pkgs.pcmanfm, fileManager ? lib.getExe pkgs.pcmanfm,
browser ? lib.getExe pkgs.firefox, browser ? lib.getExe pkgs.firefox,
terminal ? lib.getExe pkgs.alacritty, terminal ? lib.getExe pkgs.alacritty,
runnerCommand ? "${lib.getExe pkgs.rofi} -show run", runnerCommand ? "${lib.getExe pkgs.rofi} -show run",
locker ? lib.getExe pkgs.swaylock, locker ? lib.getExe pkgs.swaylock,
wallpaperPath ? null,
geolocation ? [
52.5244
13.4105
],
}: }:
let let
colors = { colors = {
@@ -18,12 +23,18 @@ let
niri = wrappers.wrapperModules.niri.apply { niri = wrappers.wrapperModules.niri.apply {
inherit pkgs; inherit pkgs;
settings = { settings = builtins.foldl' lib.recursiveUpdate { } (
[
{
input = { input = {
keyboard = { keyboard = {
xkb.layout = "de"; xkb.layout = "de";
numlock = null; numlock = null;
}; };
touchpad = {
tap = null;
drag = true;
};
mouse = null; mouse = null;
trackpoint = null; trackpoint = null;
warp-mouse-to-focus = null; warp-mouse-to-focus = null;
@@ -55,10 +66,29 @@ let
}; };
spawn-at-startup = [ spawn-at-startup = [
(lib.getExe pkgs.ashell-kmein) (lib.getExe pkgs.ashell-kmein)
]; ]
++ lib.optional (wallpaperPath != null) [
(lib.getExe pkgs.swaybg)
"--mode"
"fill"
"--image"
wallpaperPath
]
++ lib.optional (geolocation != null) (
let
latitude = builtins.elemAt geolocation 0;
longitude = builtins.elemAt geolocation 1;
in
[
(lib.getExe pkgs.wlsunset)
"-l"
(toString latitude)
"-L"
(toString longitude)
]
);
hotkey-overlay.skip-at-startup = null; hotkey-overlay.skip-at-startup = null;
prefer-no-csd = null; prefer-no-csd = null;
screenshot-path = screenshotPath;
animations.slowdown = 0.5; # twice as fast animations.slowdown = 0.5; # twice as fast
binds = binds =
let let
@@ -143,17 +173,25 @@ let
"Mod+V".toggle-window-floating = null; "Mod+V".toggle-window-floating = null;
"Mod+Shift+V".switch-focus-between-floating-and-tiling = null; "Mod+Shift+V".switch-focus-between-floating-and-tiling = null;
"Print".screenshot = null;
"Ctrl+Print".screenshot-screen = null;
"Alt+Print".screenshot-window = null;
# allow-inhibiting=false # allow-inhibiting=false
"Mod+Escape".toggle-keyboard-shortcuts-inhibit = null; "Mod+Escape".toggle-keyboard-shortcuts-inhibit = null;
"Mod+Shift+E".quit = null; "Mod+Shift+E".quit = null;
"Ctrl+Alt+Delete".quit = null; "Ctrl+Alt+Delete".quit = null;
}; };
}
]
++ lib.optional (screenshotPath != null) [
{
screenshot-path = screenshotPath;
binds = {
"Print".screenshot = null;
"Ctrl+Print".screenshot-screen = null;
"Alt+Print".screenshot-window = null;
}; };
}
]
);
}; };
in in
niri.wrapper niri.wrapper