worst wallpaper switcher EVER
|
@ -4,7 +4,8 @@ with lib;
|
|||
let
|
||||
cfg = config.modules.desktop.swww;
|
||||
|
||||
img = ../../assets/wallpaper.png;
|
||||
wallpapersFolder = "${pkgs.my.wallpapers}/share/backgrounds";
|
||||
lastWallpaper = "$XDG_DATA_HOME/swww-last-wallpaper";
|
||||
in {
|
||||
options.modules.desktop.swww = {
|
||||
enable = mkEnableOption "Enable swww, a Solution to your Wayland Wallpaper Woes";
|
||||
|
@ -16,8 +17,25 @@ in {
|
|||
startScript = mkOption {
|
||||
type = types.package;
|
||||
default = pkgs.writeScript "swww-start" ''
|
||||
if [ ! -f "${lastWallpaper}" ]; then
|
||||
echo "$(ls ${wallpapersFolder} | shuf -n 1)" > "${lastWallpaper}"
|
||||
fi
|
||||
|
||||
${cfg.package}/bin/swww-daemon &
|
||||
${lib.getExe cfg.package} img "${img}" --transition-type none
|
||||
${lib.getExe cfg.package} img "${wallpapersFolder}/$(cat ${lastWallpaper})" --transition-type none
|
||||
'';
|
||||
};
|
||||
swapScript = mkOption {
|
||||
type = types.package;
|
||||
default = pkgs.writeScript "swww-swap" ''
|
||||
file=$(ls ${wallpapersFolder} | ${lib.getExe pkgs.rofi-wayland} -dmenu -sep '\n' -i -p "select a wallpaper")
|
||||
wallpaper="${wallpapersFolder}/$file"
|
||||
|
||||
[ ! -f "$wallpaper" ] && exit 1
|
||||
|
||||
${lib.getExe cfg.package} img "$wallpaper" --transition-type grow --transition-fps 60 --transition-pos 0.915,0.977 --transition-duration 1.5
|
||||
|
||||
echo "$file" > "${lastWallpaper}"
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
|
|
@ -66,6 +66,7 @@ in {
|
|||
"battery"
|
||||
"custom/weather"
|
||||
"privacy"
|
||||
"custom/wallpaper"
|
||||
];
|
||||
};
|
||||
"group/power" = {
|
||||
|
@ -98,6 +99,12 @@ in {
|
|||
tooltip-format = "Power menu";
|
||||
on-click = "${powerSelect}";
|
||||
};
|
||||
"custom/wallpaper" = {
|
||||
format = "";
|
||||
tooltip = true;
|
||||
tooltip-format = "Change wallpaper";
|
||||
on-click = "${config.modules.desktop.swww.swapScript}";
|
||||
};
|
||||
"hyprland/workspaces" = {
|
||||
format = "{icon}";
|
||||
format-icons = {
|
||||
|
|
|
@ -13,7 +13,7 @@ stdenvNoCC.mkDerivation {
|
|||
|
||||
installPhase = ''
|
||||
mkdir -p "$out/lib/firmware/brcm"
|
||||
cp -r lib/firmware/brcm/. "$out/lib/firmware/brcm/"
|
||||
cp -r "$src/lib/firmware/brcm/." "$out/lib/firmware/brcm/"
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
|
|
22
packages/wallpapers/default.nix
Normal file
|
@ -0,0 +1,22 @@
|
|||
{ lib, stdenvNoCC }:
|
||||
|
||||
stdenvNoCC.mkDerivation {
|
||||
pname = "wallpapers";
|
||||
version = "unstable";
|
||||
|
||||
src = ./.;
|
||||
|
||||
# later, add XML files to /usr(?)/share/backgrounds
|
||||
# then, it is selectable from places like in gnome and also do the same for KDE
|
||||
installPhase = ''
|
||||
mkdir -p "$out/share/backgrounds"
|
||||
cp -r "$src/img/." "$out/share/backgrounds/"
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Small collection of wallpapers";
|
||||
# idk what to put here:
|
||||
# license = licenses.ofl;
|
||||
platforms = platforms.all;
|
||||
};
|
||||
}
|
BIN
packages/wallpapers/img/fish_whisperer.jpg
Normal file
After Width: | Height: | Size: 649 KiB |
BIN
packages/wallpapers/img/os_catwalks.png
Normal file
After Width: | Height: | Size: 1.6 MiB |
Before Width: | Height: | Size: 3.1 MiB After Width: | Height: | Size: 3.1 MiB |
BIN
packages/wallpapers/img/os_library_stroll.png
Normal file
After Width: | Height: | Size: 2.2 MiB |
BIN
packages/wallpapers/img/os_memory.png
Normal file
After Width: | Height: | Size: 2.1 MiB |
BIN
packages/wallpapers/img/os_outpost.png
Normal file
After Width: | Height: | Size: 2.1 MiB |
BIN
packages/wallpapers/img/os_prophets.png
Normal file
After Width: | Height: | Size: 1.6 MiB |
BIN
packages/wallpapers/img/rw_drainage_system.png
Normal file
After Width: | Height: | Size: 2.4 MiB |
BIN
packages/wallpapers/img/rw_shoreline.jpg
Normal file
After Width: | Height: | Size: 453 KiB |