niri: simplify spawn calls

This commit is contained in:
Simon Gardling 2025-09-15 14:48:48 -04:00
parent 8b07a2c595
commit 6d77b3a944
Signed by: titaniumtown
GPG Key ID: 9AB28AC10ECE533D

View File

@ -59,7 +59,7 @@
spawn-at-startup = [ spawn-at-startup = [
{ {
command = [ command = [
"${lib.getExe config.programs.eww.package}" (lib.getExe config.programs.eww.package)
"-c" "-c"
"${config.programs.eww.configDir}" "${config.programs.eww.configDir}"
"open" "open"
@ -70,7 +70,7 @@
# swaybg works on more than just sway (sets a wallpaper) # swaybg works on more than just sway (sets a wallpaper)
{ {
command = [ command = [
"${lib.getExe pkgs.swaybg}" (lib.getExe pkgs.swaybg)
"-i" "-i"
"${../wallpaper.png}" "${../wallpaper.png}"
]; ];
@ -79,7 +79,7 @@
# Xwayland on niri via xwayland-satellite # Xwayland on niri via xwayland-satellite
{ {
command = [ command = [
"${lib.getExe pkgs.xwayland-satellite}" (lib.getExe pkgs.xwayland-satellite)
config.programs.niri.settings.environment.DISPLAY config.programs.niri.settings.environment.DISPLAY
]; ];
} }
@ -125,14 +125,12 @@
# https://github.com/sodiboo/niri-flake/issues/591 # https://github.com/sodiboo/niri-flake/issues/591
switch-events = with config.lib.niri.actions; { switch-events = with config.lib.niri.actions; {
"lid-close".action = spawn "${pkgs.swaylock}/bin/swaylock"; "lid-close".action = spawn (lib.getExe pkgs.swaylock);
}; };
binds = with config.lib.niri.actions; { binds = with config.lib.niri.actions; {
# Application launcher # Application launcher
"Mod+Space".action = spawn [ "Mod+Space".action = spawn (lib.getExe pkgs.fuzzel);
"${pkgs.fuzzel}/bin/fuzzel"
];
"Mod+O".action = toggle-overview; "Mod+O".action = toggle-overview;
@ -140,7 +138,7 @@
"Mod+T".action = spawn config.home.sessionVariables.TERMINAL; "Mod+T".action = spawn config.home.sessionVariables.TERMINAL;
# lock the screen # lock the screen
"Mod+X".action = spawn "${pkgs.swaylock}/bin/swaylock"; "Mod+X".action = spawn (lib.getExe pkgs.swaylock);
# screenshotting # screenshotting
"Print".action = screenshot; "Print".action = screenshot;
@ -180,7 +178,7 @@
# color picker and copies to clipboard # color picker and copies to clipboard
"Mod+Ctrl+Alt+C".action = spawn [ "Mod+Ctrl+Alt+C".action = spawn [
"${pkgs.hyprpicker}/bin/hyprpicker" (lib.getExe pkgs.hyprpicker)
"-za" "-za"
]; ];