feat(wallpaper): add better wallpaper module

This commit is contained in:
Moritz Böhme 2023-05-07 13:53:31 +02:00
parent 326b14d39a
commit 3e9468d872
No known key found for this signature in database
GPG key ID: 970C6E89EB0547A9
8 changed files with 99 additions and 23 deletions

View file

@ -9,7 +9,6 @@ let
cfg = config.my.bin;
cycleSinks = import ./cycleSinks.nix { inherit pkgs; };
protonge = import ./protonge.nix { inherit pkgs; };
randomWallpaper = import ./randomWallpaper.nix { inherit pkgs; };
share = import ./share.nix { inherit pkgs; };
sxhkdHelp = import ./sxhkdHelp.nix { inherit pkgs; };
in
@ -17,10 +16,9 @@ in
options.my.bin.enable = mkEnableOption "bin";
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [
environment.systemPackages = [
cycleSinks
protonge
randomWallpaper
share
sxhkdHelp
];

View file

@ -1,17 +0,0 @@
{ pkgs }:
pkgs.writeShellApplication {
name = "randomWallpaper";
runtimeInputs = with pkgs; [ findutils coreutils feh hyprland jq ];
text = ''
wallpaper="$(find ~/.config/wallpapers/ -type f,l | shuf -n 1)"
if [ -z ''${WAYLAND_DISPLAY+x} ]; then
feh --bg-fill "$wallpaper"
else
hyprctl hyprpaper preload "$wallpaper"
hyprctl monitors -j | jq '.[].name' | xargs -I{} hyprctl hyprpaper wallpaper '{}',"$wallpaper"
hyprctl hyprpaper unload all
fi
'';
}