change wallpaper with systemd 😎
This commit is contained in:
parent
928fa4d2ca
commit
96b69f7760
3 changed files with 21 additions and 3 deletions
|
@ -7,5 +7,6 @@
|
|||
./swayidle.nix
|
||||
./swaylock.nix
|
||||
./swww.nix
|
||||
./wallpaper.nix
|
||||
];
|
||||
}
|
||||
|
|
19
home/wm/addon/wallpaper.nix
Normal file
19
home/wm/addon/wallpaper.nix
Normal file
|
@ -0,0 +1,19 @@
|
|||
{ config, pkgs, ... }:
|
||||
let
|
||||
pictures = "${config.xdg.userDirs.pictures}";
|
||||
change-wallpaper = "${pkgs.scripts}/bin/chpaper ${pictures}/Wallpapers";
|
||||
in
|
||||
{
|
||||
systemd.user.services.wallpaper = {
|
||||
Unit = {
|
||||
Description = "Change Wallpaper";
|
||||
PartOf = [ "graphical-session.target" ];
|
||||
After = [ "graphical-session-pre.target" ];
|
||||
Wants = "swww-daemon.service";
|
||||
};
|
||||
Service = {
|
||||
Type = "oneshot";
|
||||
ExecStart = "${change-wallpaper}";
|
||||
};
|
||||
};
|
||||
}
|
|
@ -15,7 +15,6 @@ let
|
|||
wpctl = "${pkgs.wireplumber}/bin/wpctl";
|
||||
|
||||
pictures = "${config.xdg.userDirs.pictures}";
|
||||
change-wallpaper = "${pkgs.scripts}/bin/chpaper ${pictures}/Wallpapers";
|
||||
wallhaven-wallpaper = "${pkgs.scripts}/bin/chpaper \$(${pkgs.scripts}/bin/wallhaven ${pictures}/Wallpapers)";
|
||||
in
|
||||
{
|
||||
|
@ -138,7 +137,6 @@ in
|
|||
|
||||
exec-once = [
|
||||
"${hyprctl} setcursor ${config.gtk.cursorTheme.name} 24"
|
||||
"${change-wallpaper}"
|
||||
"${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1"
|
||||
];
|
||||
|
||||
|
@ -171,7 +169,7 @@ in
|
|||
"SUPER_SHIFT,b, exec, ${pkgs.rofi-bluetooth}/bin/rofi-bluetooth"
|
||||
|
||||
"SUPER,escape, exec, ${swaylock} -f -i /tmp/wallpaper.jpg"
|
||||
"SUPER_SHIFT,W, exec, ${change-wallpaper}"
|
||||
"SUPER_SHIFT,W, exec, systemctl --user start wallpaper.service"
|
||||
"SUPER_ALT,W, exec, ${wallhaven-wallpaper}"
|
||||
|
||||
"SUPER,1, workspace, 1"
|
||||
|
|
Loading…
Reference in a new issue