wallpaper: convert to systemd service
This commit is contained in:
parent
4af7963adf
commit
3b75df4b94
7 changed files with 42 additions and 16 deletions
|
@ -39,7 +39,6 @@ in {
|
||||||
|
|
||||||
lockscreen = mkOption {default = "hyprlock";};
|
lockscreen = mkOption {default = "hyprlock";};
|
||||||
menu = mkOption {default = "rofi";};
|
menu = mkOption {default = "rofi";};
|
||||||
wallpaper = mkOption {default = false;};
|
|
||||||
|
|
||||||
browser = {
|
browser = {
|
||||||
# TODO: Use lib.getExe' instead of /bin/ where possible
|
# TODO: Use lib.getExe' instead of /bin/ where possible
|
||||||
|
|
|
@ -105,9 +105,6 @@ in {
|
||||||
"[workspace special:hidden silent] ${command loupe}"
|
"[workspace special:hidden silent] ${command loupe}"
|
||||||
"[workspace special:hidden silent] ${command nautilus}"
|
"[workspace special:hidden silent] ${command nautilus}"
|
||||||
]
|
]
|
||||||
++ optionals config.custom.wallpaper [
|
|
||||||
(command wallpaper)
|
|
||||||
]
|
|
||||||
++ optionals config.custom.settings.vm.passthrough.blacklist [
|
++ optionals config.custom.settings.vm.passthrough.blacklist [
|
||||||
# HACK: Delay driver initialization to work around reset issues
|
# HACK: Delay driver initialization to work around reset issues
|
||||||
(command "${virsh} list | ${grep} ${config.custom.settings.vm.passthrough.guest} || sudo ${modprobe} ${config.custom.settings.vm.passthrough.driver}")
|
(command "${virsh} list | ${grep} ${config.custom.settings.vm.passthrough.guest} || sudo ${modprobe} ${config.custom.settings.vm.passthrough.driver}")
|
||||||
|
|
|
@ -52,15 +52,11 @@ in {
|
||||||
#!! Not executed in a shell
|
#!! Not executed in a shell
|
||||||
# https://github.com/YaLTeR/niri/wiki/Configuration:-Key-Bindings#spawn
|
# https://github.com/YaLTeR/niri/wiki/Configuration:-Key-Bindings#spawn
|
||||||
# https://github.com/sodiboo/niri-flake/blob/main/docs.md#programsnirisettingsspawn-at-startup
|
# https://github.com/sodiboo/niri-flake/blob/main/docs.md#programsnirisettingsspawn-at-startup
|
||||||
spawn-at-startup =
|
spawn-at-startup = [
|
||||||
[
|
{command = [audio "--init"];} # Enforce audio profile state
|
||||||
{command = [audio "--init"];} # Enforce audio profile state
|
{command = [config.custom.menus.clipboard.clear-silent];} # Clear clipboard history
|
||||||
{command = [config.custom.menus.clipboard.clear-silent];} # Clear clipboard history
|
{command = [sway-audio-idle-inhibit];} # Inhibit while audio is playing
|
||||||
{command = [sway-audio-idle-inhibit];} # Inhibit while audio is playing
|
];
|
||||||
]
|
|
||||||
++ optionals config.custom.wallpaper [
|
|
||||||
{command = [wallpaper];}
|
|
||||||
];
|
|
||||||
|
|
||||||
# https://github.com/sodiboo/niri-flake/blob/main/docs.md#programsnirisettingsswitch-eventslid-close
|
# https://github.com/sodiboo/niri-flake/blob/main/docs.md#programsnirisettingsswitch-eventslid-close
|
||||||
switch-events = {
|
switch-events = {
|
||||||
|
|
|
@ -41,7 +41,7 @@ in {
|
||||||
background = {
|
background = {
|
||||||
blur_passes = 5;
|
blur_passes = 5;
|
||||||
color = "rgb(073642)"; # Fallback
|
color = "rgb(073642)"; # Fallback
|
||||||
path = mkIf config.custom.wallpaper "/tmp/wallpaper.png";
|
path = mkIf config.custom.services.wallpaper.enable "/tmp/wallpaper.png";
|
||||||
};
|
};
|
||||||
|
|
||||||
# https://wiki.hyprland.org/Hypr-Ecosystem/hyprlock/#input-field
|
# https://wiki.hyprland.org/Hypr-Ecosystem/hyprlock/#input-field
|
||||||
|
|
|
@ -32,7 +32,7 @@ in {
|
||||||
indicator-radius = 150;
|
indicator-radius = 150;
|
||||||
font-size = 48 * config.custom.scale;
|
font-size = 48 * config.custom.scale;
|
||||||
font = config.stylix.fonts.monospace.name;
|
font = config.stylix.fonts.monospace.name;
|
||||||
image = mkIf config.custom.wallpaper "/tmp/altered.png";
|
image = mkIf config.custom.services.wallpaper.enable "/tmp/altered.png";
|
||||||
bs-hl-color = "93a1a1";
|
bs-hl-color = "93a1a1";
|
||||||
color = "073642";
|
color = "073642";
|
||||||
inside-caps-lock-color = "002b36";
|
inside-caps-lock-color = "002b36";
|
||||||
|
|
34
options/custom/services/wallpaper.nix
Normal file
34
options/custom/services/wallpaper.nix
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
with lib; let
|
||||||
|
cfg = config.custom.services.wallpaper;
|
||||||
|
hm = config.home-manager.users.${config.custom.username};
|
||||||
|
in {
|
||||||
|
options.custom.services.wallpaper = {
|
||||||
|
enable = mkEnableOption "wallpaper";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
home-manager.sharedModules = [
|
||||||
|
{
|
||||||
|
systemd.user.services.wallpaper = {
|
||||||
|
Unit = {
|
||||||
|
Description = "Periodically change wallpaper";
|
||||||
|
};
|
||||||
|
|
||||||
|
Install = {
|
||||||
|
WantedBy = ["default.target"];
|
||||||
|
};
|
||||||
|
|
||||||
|
Service = {
|
||||||
|
Type = "simple";
|
||||||
|
ExecStart = hm.home.file.".local/bin/wallpaper".source;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
|
@ -3,11 +3,11 @@
|
||||||
full = true;
|
full = true;
|
||||||
profile = "desktop";
|
profile = "desktop";
|
||||||
desktop = "niri";
|
desktop = "niri";
|
||||||
wallpaper = true;
|
|
||||||
|
|
||||||
services = {
|
services = {
|
||||||
ollama.download = "high";
|
ollama.download = "high";
|
||||||
power-profiles-daemon.enable = true;
|
power-profiles-daemon.enable = true;
|
||||||
|
wallpaper.enable = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue