niri: configure wallpaper and wlsunset
This commit is contained in:
@@ -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,142 +23,175 @@ let
|
|||||||
|
|
||||||
niri = wrappers.wrapperModules.niri.apply {
|
niri = wrappers.wrapperModules.niri.apply {
|
||||||
inherit pkgs;
|
inherit pkgs;
|
||||||
settings = {
|
settings = builtins.foldl' lib.recursiveUpdate { } (
|
||||||
input = {
|
[
|
||||||
keyboard = {
|
|
||||||
xkb.layout = "de";
|
|
||||||
numlock = null;
|
|
||||||
};
|
|
||||||
mouse = null;
|
|
||||||
trackpoint = null;
|
|
||||||
warp-mouse-to-focus = null;
|
|
||||||
focus-follows-mouse = null;
|
|
||||||
};
|
|
||||||
layout = {
|
|
||||||
gaps = 8;
|
|
||||||
center-focused-column = "never";
|
|
||||||
preset-column-widths = [
|
|
||||||
{ proportion = 1. / 3.; }
|
|
||||||
{ proportion = 1. / 2.; }
|
|
||||||
{ proportion = 2. / 3.; }
|
|
||||||
];
|
|
||||||
default-column-width = {
|
|
||||||
proportion = 1. / 2.;
|
|
||||||
};
|
|
||||||
focus-ring = {
|
|
||||||
width = 2;
|
|
||||||
active-color = colors.active-color;
|
|
||||||
inactive-color = colors.inactive-color;
|
|
||||||
};
|
|
||||||
shadow = {
|
|
||||||
on = null;
|
|
||||||
draw-behind-window = true;
|
|
||||||
softness = 30;
|
|
||||||
spread = 5;
|
|
||||||
color = colors.shadow-color;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
spawn-at-startup = [
|
|
||||||
(lib.getExe pkgs.ashell-kmein)
|
|
||||||
];
|
|
||||||
hotkey-overlay.skip-at-startup = null;
|
|
||||||
prefer-no-csd = null;
|
|
||||||
screenshot-path = screenshotPath;
|
|
||||||
animations.slowdown = 0.5; # twice as fast
|
|
||||||
binds =
|
|
||||||
let
|
|
||||||
wpctl = lib.getExe' pkgs.wireplumber "wpctl";
|
|
||||||
in
|
|
||||||
{
|
{
|
||||||
"Mod+Shift+Slash".show-hotkey-overlay = null;
|
input = {
|
||||||
"Mod+Y".spawn = browser;
|
keyboard = {
|
||||||
"Mod+T".spawn = fileManager;
|
xkb.layout = "de";
|
||||||
"Mod+Return".spawn = terminal;
|
numlock = null;
|
||||||
"Mod+D".spawn-sh = runnerCommand;
|
};
|
||||||
"Mod+Shift+W".spawn = locker;
|
touchpad = {
|
||||||
|
tap = null;
|
||||||
|
drag = true;
|
||||||
|
};
|
||||||
|
mouse = null;
|
||||||
|
trackpoint = null;
|
||||||
|
warp-mouse-to-focus = null;
|
||||||
|
focus-follows-mouse = null;
|
||||||
|
};
|
||||||
|
layout = {
|
||||||
|
gaps = 8;
|
||||||
|
center-focused-column = "never";
|
||||||
|
preset-column-widths = [
|
||||||
|
{ proportion = 1. / 3.; }
|
||||||
|
{ proportion = 1. / 2.; }
|
||||||
|
{ proportion = 2. / 3.; }
|
||||||
|
];
|
||||||
|
default-column-width = {
|
||||||
|
proportion = 1. / 2.;
|
||||||
|
};
|
||||||
|
focus-ring = {
|
||||||
|
width = 2;
|
||||||
|
active-color = colors.active-color;
|
||||||
|
inactive-color = colors.inactive-color;
|
||||||
|
};
|
||||||
|
shadow = {
|
||||||
|
on = null;
|
||||||
|
draw-behind-window = true;
|
||||||
|
softness = 30;
|
||||||
|
spread = 5;
|
||||||
|
color = colors.shadow-color;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
spawn-at-startup = [
|
||||||
|
(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;
|
||||||
|
prefer-no-csd = null;
|
||||||
|
animations.slowdown = 0.5; # twice as fast
|
||||||
|
binds =
|
||||||
|
let
|
||||||
|
wpctl = lib.getExe' pkgs.wireplumber "wpctl";
|
||||||
|
in
|
||||||
|
{
|
||||||
|
"Mod+Shift+Slash".show-hotkey-overlay = null;
|
||||||
|
"Mod+Y".spawn = browser;
|
||||||
|
"Mod+T".spawn = fileManager;
|
||||||
|
"Mod+Return".spawn = terminal;
|
||||||
|
"Mod+D".spawn-sh = runnerCommand;
|
||||||
|
"Mod+Shift+W".spawn = locker;
|
||||||
|
|
||||||
# TODO allow-when-locked
|
# TODO allow-when-locked
|
||||||
"XF86AudioRaiseVolume".spawn-sh = "${wpctl} set-volume @DEFAULT_AUDIO_SINK@ 0.1+ -l 1.0";
|
"XF86AudioRaiseVolume".spawn-sh = "${wpctl} set-volume @DEFAULT_AUDIO_SINK@ 0.1+ -l 1.0";
|
||||||
"XF86AudioLowerVolume".spawn-sh = "${wpctl} set-volume @DEFAULT_AUDIO_SINK@ 0.1-";
|
"XF86AudioLowerVolume".spawn-sh = "${wpctl} set-volume @DEFAULT_AUDIO_SINK@ 0.1-";
|
||||||
"XF86AudioMute".spawn-sh = "${wpctl} set-mute @DEFAULT_AUDIO_SINK@ toggle";
|
"XF86AudioMute".spawn-sh = "${wpctl} set-mute @DEFAULT_AUDIO_SINK@ toggle";
|
||||||
"XF86AudioMicMute".spawn-sh = "${wpctl} set-mute @DEFAULT_AUDIO_SOURCE@ toggle";
|
"XF86AudioMicMute".spawn-sh = "${wpctl} set-mute @DEFAULT_AUDIO_SOURCE@ toggle";
|
||||||
"XF86AudioPlay".spawn-sh = "${lib.getExe pkgs.playerctl} play-pause";
|
"XF86AudioPlay".spawn-sh = "${lib.getExe pkgs.playerctl} play-pause";
|
||||||
"XF86AudioStop".spawn-sh = "${lib.getExe pkgs.playerctl} stop";
|
"XF86AudioStop".spawn-sh = "${lib.getExe pkgs.playerctl} stop";
|
||||||
"XF86AudioPrev".spawn-sh = "${lib.getExe pkgs.playerctl} previous";
|
"XF86AudioPrev".spawn-sh = "${lib.getExe pkgs.playerctl} previous";
|
||||||
"XF86AudioNext".spawn-sh = "${lib.getExe pkgs.playerctl} next";
|
"XF86AudioNext".spawn-sh = "${lib.getExe pkgs.playerctl} next";
|
||||||
"XF86MonBrightnessUp".spawn-sh = "${lib.getExe pkgs.brightnessctl} --class=backlight set +10%";
|
"XF86MonBrightnessUp".spawn-sh = "${lib.getExe pkgs.brightnessctl} --class=backlight set +10%";
|
||||||
"XF86MonBrightnessDown".spawn-sh = "${lib.getExe pkgs.brightnessctl} --class=backlight set 10%-";
|
"XF86MonBrightnessDown".spawn-sh = "${lib.getExe pkgs.brightnessctl} --class=backlight set 10%-";
|
||||||
|
|
||||||
# TODO repeat=false
|
# TODO repeat=false
|
||||||
"Mod+O".toggle-overview = null;
|
"Mod+O".toggle-overview = null;
|
||||||
"Mod+Shift+Q".close-window = null;
|
"Mod+Shift+Q".close-window = null;
|
||||||
|
|
||||||
"Mod+H".focus-column-left = null;
|
"Mod+H".focus-column-left = null;
|
||||||
"Mod+J".focus-window-or-workspace-down = null;
|
"Mod+J".focus-window-or-workspace-down = null;
|
||||||
"Mod+K".focus-window-or-workspace-up = null;
|
"Mod+K".focus-window-or-workspace-up = null;
|
||||||
"Mod+L".focus-column-right = null;
|
"Mod+L".focus-column-right = null;
|
||||||
"Mod+Shift+H".move-column-left = null;
|
"Mod+Shift+H".move-column-left = null;
|
||||||
"Mod+Shift+J".move-window-down-or-to-workspace-down = null;
|
"Mod+Shift+J".move-window-down-or-to-workspace-down = null;
|
||||||
"Mod+Shift+K".move-window-up-or-to-workspace-up = null;
|
"Mod+Shift+K".move-window-up-or-to-workspace-up = null;
|
||||||
"Mod+Shift+L".move-column-right = null;
|
"Mod+Shift+L".move-column-right = null;
|
||||||
"Mod+Home".focus-column-first = null;
|
"Mod+Home".focus-column-first = null;
|
||||||
"Mod+End".focus-column-last = null;
|
"Mod+End".focus-column-last = null;
|
||||||
"Mod+Shift+Home".move-column-to-first = null;
|
"Mod+Shift+Home".move-column-to-first = null;
|
||||||
"Mod+Shift+End".move-column-to-last = null;
|
"Mod+Shift+End".move-column-to-last = null;
|
||||||
|
|
||||||
# TODO cooldown-ms=150
|
# TODO cooldown-ms=150
|
||||||
"Mod+WheelScrollDown".focus-workspace-down = null;
|
"Mod+WheelScrollDown".focus-workspace-down = null;
|
||||||
"Mod+WheelScrollUp".focus-workspace-up = null;
|
"Mod+WheelScrollUp".focus-workspace-up = null;
|
||||||
"Mod+Shift+WheelScrollDown".move-column-to-workspace-down = null;
|
"Mod+Shift+WheelScrollDown".move-column-to-workspace-down = null;
|
||||||
"Mod+Shift+WheelScrollUp".move-column-to-workspace-up = null;
|
"Mod+Shift+WheelScrollUp".move-column-to-workspace-up = null;
|
||||||
|
|
||||||
"Mod+WheelScrollRight".focus-column-right = null;
|
"Mod+WheelScrollRight".focus-column-right = null;
|
||||||
"Mod+WheelScrollLeft".focus-column-left = null;
|
"Mod+WheelScrollLeft".focus-column-left = null;
|
||||||
"Mod+Shift+WheelScrollRight".move-column-right = null;
|
"Mod+Shift+WheelScrollRight".move-column-right = null;
|
||||||
"Mod+Shift+WheelScrollLeft".move-column-left = null;
|
"Mod+Shift+WheelScrollLeft".move-column-left = null;
|
||||||
|
|
||||||
"Mod+1".focus-workspace = 1;
|
"Mod+1".focus-workspace = 1;
|
||||||
"Mod+2".focus-workspace = 2;
|
"Mod+2".focus-workspace = 2;
|
||||||
"Mod+3".focus-workspace = 3;
|
"Mod+3".focus-workspace = 3;
|
||||||
"Mod+4".focus-workspace = 4;
|
"Mod+4".focus-workspace = 4;
|
||||||
"Mod+5".focus-workspace = 5;
|
"Mod+5".focus-workspace = 5;
|
||||||
"Mod+6".focus-workspace = 6;
|
"Mod+6".focus-workspace = 6;
|
||||||
"Mod+7".focus-workspace = 7;
|
"Mod+7".focus-workspace = 7;
|
||||||
"Mod+8".focus-workspace = 8;
|
"Mod+8".focus-workspace = 8;
|
||||||
"Mod+9".focus-workspace = 9;
|
"Mod+9".focus-workspace = 9;
|
||||||
"Mod+Shift+1".move-window-to-workspace = 1;
|
"Mod+Shift+1".move-window-to-workspace = 1;
|
||||||
"Mod+Shift+2".move-window-to-workspace = 2;
|
"Mod+Shift+2".move-window-to-workspace = 2;
|
||||||
"Mod+Shift+3".move-window-to-workspace = 3;
|
"Mod+Shift+3".move-window-to-workspace = 3;
|
||||||
"Mod+Shift+4".move-window-to-workspace = 4;
|
"Mod+Shift+4".move-window-to-workspace = 4;
|
||||||
"Mod+Shift+5".move-window-to-workspace = 5;
|
"Mod+Shift+5".move-window-to-workspace = 5;
|
||||||
"Mod+Shift+6".move-window-to-workspace = 6;
|
"Mod+Shift+6".move-window-to-workspace = 6;
|
||||||
"Mod+Shift+7".move-window-to-workspace = 7;
|
"Mod+Shift+7".move-window-to-workspace = 7;
|
||||||
"Mod+Shift+8".move-window-to-workspace = 8;
|
"Mod+Shift+8".move-window-to-workspace = 8;
|
||||||
"Mod+Shift+9".move-window-to-workspace = 9;
|
"Mod+Shift+9".move-window-to-workspace = 9;
|
||||||
"Mod+Tab".focus-workspace-previous = null;
|
"Mod+Tab".focus-workspace-previous = null;
|
||||||
"Mod+Comma".consume-window-into-column = null;
|
"Mod+Comma".consume-window-into-column = null;
|
||||||
"Mod+Period".expel-window-from-column = null;
|
"Mod+Period".expel-window-from-column = null;
|
||||||
"Mod+R".switch-preset-column-width = null;
|
"Mod+R".switch-preset-column-width = null;
|
||||||
"Mod+F".maximize-column = null;
|
"Mod+F".maximize-column = null;
|
||||||
"Mod+Shift+F".fullscreen-window = null;
|
"Mod+Shift+F".fullscreen-window = null;
|
||||||
"Mod+Ctrl+F".expand-column-to-available-width = null;
|
"Mod+Ctrl+F".expand-column-to-available-width = null;
|
||||||
"Mod+Minus".set-column-width = "-10%";
|
"Mod+Minus".set-column-width = "-10%";
|
||||||
"Mod+Plus".set-column-width = "+10%";
|
"Mod+Plus".set-column-width = "+10%";
|
||||||
|
|
||||||
"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;
|
# allow-inhibiting=false
|
||||||
"Ctrl+Print".screenshot-screen = null;
|
"Mod+Escape".toggle-keyboard-shortcuts-inhibit = null;
|
||||||
"Alt+Print".screenshot-window = null;
|
|
||||||
|
|
||||||
# allow-inhibiting=false
|
"Mod+Shift+E".quit = null;
|
||||||
"Mod+Escape".toggle-keyboard-shortcuts-inhibit = null;
|
"Ctrl+Alt+Delete".quit = null;
|
||||||
|
};
|
||||||
"Mod+Shift+E".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
|
||||||
|
|||||||
Reference in New Issue
Block a user