Fix hyprland background

This commit is contained in:
Filippo Berto 2026-01-16 14:13:58 +01:00
parent c6cae00eba
commit 02d9349a03
No known key found for this signature in database
GPG key ID: F1D17F9BCEC62FBC
3 changed files with 24 additions and 29 deletions

View file

@ -229,7 +229,7 @@ in
"SUPER, J, togglesplit, # dwindle"
"SUPER ALT, E, exec, wofi-emoji"
"SUPER ALT, P, exec, wl-clipedit"
"SUPER ALT, B, exec, wl-update-background"
"SUPER ALT, B, exec, systemctl --user reload-or-restart wl-update-background"
",Print, exec, grimblast copy"
"SHIFT, Print, exec, grimblast copy area"

View file

@ -1,4 +1,9 @@
{ pkgs, ... }: {
{ pkgs, nixosConfig, ... }:
let
inherit (nixosConfig.networking) hostName;
backgrounds_directory = if hostName == "sif" then "$HOME/Pictures/Wallpapers/2160+" else "$HOME/Immagini/Sfondi/2160+";
in
{
home.packages = [ pkgs.wl-update-background ];
systemd.user.services."wl-update-background" = {
@ -6,7 +11,6 @@
Description = "Set random desktop background using swww";
After = [ "graphical-session.pre.target" ];
PartOf = [ "graphical-session.target" ];
RequiresMountsFor = [ "/home/bertof/Immagini" ];
};
Install = {
WantedBy = [ "graphical-session.target" ];
@ -14,7 +18,8 @@
Service = {
Type = "oneshot";
IOSchedulingClass = "idle";
ExecStart = "${pkgs.wl-update-background}/bin/wl-update-background";
StartLimitBurst = 0;
ExecStart = "${pkgs.wl-update-background.override {inherit backgrounds_directory;}}/bin/wl-update-background";
};
};