dwm: Use wallpaper script for osu! backgrounds

This commit is contained in:
Donovan Glover 2024-09-15 12:49:40 -04:00
parent 40cfec263e
commit d3780d89f0
No known key found for this signature in database
GPG Key ID: EA7408A77AE1BE65

View File

@ -1,10 +1,19 @@
{ config, pkgs, ... }: {
nixosConfig,
config,
pkgs,
...
}:
let let
inherit (nixosConfig._module.specialArgs) nix-config;
inherit (config.lib.stylix.colors.withHashtag) base00 base03 base05; inherit (config.lib.stylix.colors.withHashtag) base00 base03 base05;
inherit (config.home) homeDirectory; inherit (config.home) homeDirectory;
inherit (nix-config.packages.${pkgs.system}) osu-backgrounds;
barScript = "dwm/bar.fish"; barScript = "dwm/bar.fish";
wallpaperScript = "dwm/wallpaper.fish";
in in
{ {
home = { home = {
@ -44,7 +53,7 @@ in
"xset", "r", "rate", "300", "50", NULL, "xset", "r", "rate", "300", "50", NULL,
"xset", "-dpms", NULL, "xset", "-dpms", NULL,
"fish", "${homeDirectory}/.config/${barScript}", NULL, "fish", "${homeDirectory}/.config/${barScript}", NULL,
"feh", "--no-fehbg", "--bg-scale", "${config.stylix.image}", NULL, "fish", "${homeDirectory}/.config/${wallpaperScript}", NULL,
"${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1", NULL, "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1", NULL,
NULL NULL
}; };
@ -188,6 +197,18 @@ in
}; };
xdg.configFile = { xdg.configFile = {
${wallpaperScript} = {
executable = true;
text = # fish
''
#!/usr/bin/env fish
feh --bg-fill \
(random choice (fd . ${osu-backgrounds}/2024-07-15-Aerial-Antics-Art-Contest-All-Entries --follow -e jpg -e png)) \
(random choice (fd . ${osu-backgrounds}/2024-07-15-Aerial-Antics-Art-Contest-All-Entries --follow -e jpg -e png))
'';
};
${barScript} = { ${barScript} = {
executable = true; executable = true;
text = # fish text = # fish