added wallpaper with swww

This commit is contained in:
Tomas Rivera
2026-02-27 10:00:33 +01:00
parent fc825e7d3d
commit b503fe7df5
4 changed files with 43 additions and 0 deletions
+2
View File
@@ -145,6 +145,8 @@ services.upower.enable = true;
hyprkeys # keybind helper hyprkeys # keybind helper
cowsay cowsay
cmatrix cmatrix
swww #wallpaper daemon
socat # Utility for bidirectional data transfer between two independent data channels (used to communicate between hyprland and swww to change wallpapers dinamically)
#we need to install gnome and kde utils individually as we dont use gnome #we need to install gnome and kde utils individually as we dont use gnome
gnome-calculator gnome-calculator
snapshot snapshot
+1
View File
@@ -40,6 +40,7 @@ home.packages = [
(pkgs.callPackage ../../modules/scripts/batterynotify.nix {}) (pkgs.callPackage ../../modules/scripts/batterynotify.nix {})
(pkgs.callPackage ../../modules/scripts/weather.nix {}) (pkgs.callPackage ../../modules/scripts/weather.nix {})
(pkgs.callPackage ../../modules/scripts/cowsay.nix {}) (pkgs.callPackage ../../modules/scripts/cowsay.nix {})
(pkgs.callPackage ../../modules/scripts/wallpaper.nix {})
# # Adds the 'hello' command to your environment. It prints a friendly # # Adds the 'hello' command to your environment. It prints a friendly
# # "Hello, world!" when run. # # "Hello, world!" when run.
# pkgs.hello # pkgs.hello
+1
View File
@@ -137,6 +137,7 @@
"wl-paste --type text --watch cliphist store" # clipboard store text data "wl-paste --type text --watch cliphist store" # clipboard store text data
"wl-paste --type image --watch cliphist store" # clipboard store image data "wl-paste --type image --watch cliphist store" # clipboard store image data
"custom-batterynotify" "custom-batterynotify"
"custom-wallpaper"
]; ];
# █░░ ▄▀█ █▄█ █▀█ █░█ ▀█▀ █▀ # █░░ ▄▀█ █▄█ █▀█ █░█ ▀█▀ █▀
# █▄▄ █▀█ ░█░ █▄█ █▄█ ░█░ ▄█ # █▄▄ █▀█ ░█░ █▄█ █▄█ ░█░ ▄█
+39
View File
@@ -0,0 +1,39 @@
{ writeShellApplication, socat, swww, ... }:
writeShellApplication {
name = "custom-wallpaper";
runtimeInputs = [
socat
swww
];
text = ''
handle() {
case $1 in
workspace*)
str=$1
i=$((''${#str}-1))
workspace="''${str:$i:1}"
case $workspace in
1 | 6)
swww img -t none ../../assets/wallpaper1.jpg
;;
2 | 7)
swww img -t none ../../assets/wallpaper2.jpg
;;
3 | 8)
swww img -t none ../../assets/wallpaper3.jpg
;;
4 | 9)
swww img -t none ../../assets/wallpaper4.jpg
;;
5 | 10)
swww img -t none ../../assets/wallpaper5.jpg
;;
esac
;;
esac
}
socat -U - UNIX-CONNECT:$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock | while read -r line; do handle "$line"; done
'';
}