meow
This commit is contained in:
parent
4d269a9e8d
commit
f9c369c584
12 changed files with 638 additions and 73 deletions
Binary file not shown.
|
|
@ -2,11 +2,10 @@
|
||||||
# your system. Help is available in the configuration.nix(5) man page, on
|
# your system. Help is available in the configuration.nix(5) man page, on
|
||||||
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
|
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
|
||||||
|
|
||||||
{
|
{ config
|
||||||
config,
|
, lib
|
||||||
lib,
|
, pkgs
|
||||||
pkgs,
|
, ...
|
||||||
...
|
|
||||||
}:
|
}:
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
|
||||||
76
flake.nix
76
flake.nix
|
|
@ -38,24 +38,25 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs =
|
outputs =
|
||||||
inputs@{
|
inputs@{ self
|
||||||
self,
|
, nixpkgs
|
||||||
nixpkgs,
|
, c3d2-user-module
|
||||||
c3d2-user-module,
|
, home-manager
|
||||||
home-manager,
|
, niri
|
||||||
niri,
|
, nixos-hardware
|
||||||
nixos-hardware,
|
, treefmt-nix
|
||||||
treefmt-nix,
|
, determinate
|
||||||
determinate,
|
, nix-index-db
|
||||||
nix-index-db,
|
, quickshell
|
||||||
quickshell,
|
, stylix
|
||||||
stylix,
|
, comin
|
||||||
comin,
|
, firefox-addons
|
||||||
firefox-addons,
|
,
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
pkgs = nixpkgs.legacyPackages.${system};
|
pkgs = nixpkgs.legacyPackages.${system};
|
||||||
|
lib = pkgs.lib;
|
||||||
|
|
||||||
# Configure treefmt
|
# Configure treefmt
|
||||||
treefmtEval = treefmt-nix.lib.evalModule pkgs {
|
treefmtEval = treefmt-nix.lib.evalModule pkgs {
|
||||||
|
|
@ -88,15 +89,39 @@
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
packages.${system}.wallpaper = pkgs.stdenv.mkDerivation {
|
packages.${system}.wallpapers = pkgs.stdenv.mkDerivation {
|
||||||
name = "wallpaper";
|
name = "wallpapers";
|
||||||
src = ./assets/wp6553608.jpg;
|
src = ./assets;
|
||||||
dontUnpack = true;
|
|
||||||
|
buildInputs = with pkgs; [ ffmpeg ];
|
||||||
|
|
||||||
|
buildPhase = ''
|
||||||
|
# Create output directory
|
||||||
|
mkdir -p $out/share/wallpapers
|
||||||
|
|
||||||
|
# Copy static wallpaper
|
||||||
|
cp "wp6553608.jpg" "$out/share/wallpapers/static-wallpaper.jpg"
|
||||||
|
|
||||||
|
# Copy original animated wallpaper
|
||||||
|
cp "Anime Live Wallpaper - Anime Cat Girl Snow - HD - no copyright [SiMc3l0ido0].mp4" \
|
||||||
|
"$out/share/wallpapers/anime-cat-girl-snow.mp4"
|
||||||
|
|
||||||
|
# Create optimized version
|
||||||
|
${pkgs.ffmpeg}/bin/ffmpeg -i "Anime Live Wallpaper - Anime Cat Girl Snow - HD - no copyright [SiMc3l0ido0].mp4" \
|
||||||
|
-vf "scale=1920:1080:force_original_aspect_ratio=increase,crop=1920:1080" \
|
||||||
|
-r 30 -c:v libx264 -crf 28 -preset medium \
|
||||||
|
-t 30 -an "$out/share/wallpapers/anime-cat-girl-snow-optimized.mp4"
|
||||||
|
'';
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
mkdir -p $out
|
# Files are already in the right place from buildPhase
|
||||||
cp $src $out/wallpaper.jpg
|
echo "Wallpapers installed to $out/share/wallpapers"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
meta = with lib; {
|
||||||
|
description = "Personal wallpaper collection";
|
||||||
|
platforms = platforms.linux;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
nixosConfigurations.p50 = nixpkgs.lib.nixosSystem {
|
nixosConfigurations.p50 = nixpkgs.lib.nixosSystem {
|
||||||
specialArgs = { inherit inputs; };
|
specialArgs = { inherit inputs; };
|
||||||
|
|
@ -112,12 +137,11 @@
|
||||||
home-manager.useUserPackages = true;
|
home-manager.useUserPackages = true;
|
||||||
home-manager.backupFileExtension = "backup";
|
home-manager.backupFileExtension = "backup";
|
||||||
home-manager.users.lucy =
|
home-manager.users.lucy =
|
||||||
{
|
{ config
|
||||||
config,
|
, pkgs
|
||||||
pkgs,
|
, lib
|
||||||
lib,
|
, inputs
|
||||||
inputs,
|
, ...
|
||||||
...
|
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,7 @@
|
||||||
{
|
{ config
|
||||||
config,
|
, pkgs
|
||||||
pkgs,
|
, inputs
|
||||||
inputs,
|
, ...
|
||||||
...
|
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,7 @@
|
||||||
{
|
{ pkgs
|
||||||
pkgs,
|
, lib
|
||||||
lib,
|
, config
|
||||||
config,
|
, ...
|
||||||
...
|
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
lock = "${pkgs.systemd}/bin/loginctl lock-session";
|
lock = "${pkgs.systemd}/bin/loginctl lock-session";
|
||||||
|
|
|
||||||
|
|
@ -34,10 +34,11 @@ let
|
||||||
|
|
||||||
# Generate workspace focus binds (Mod+1 to Mod+9)
|
# Generate workspace focus binds (Mod+1 to Mod+9)
|
||||||
wsBinds = builtins.listToAttrs (
|
wsBinds = builtins.listToAttrs (
|
||||||
builtins.genList (i: {
|
builtins.genList
|
||||||
name = "Mod+${toString (i + 1)}";
|
(i: {
|
||||||
value.action.focus-workspace = i + 1;
|
name = "Mod+${toString (i + 1)}";
|
||||||
}) 9
|
value.action.focus-workspace = i + 1;
|
||||||
|
}) 9
|
||||||
);
|
);
|
||||||
|
|
||||||
in
|
in
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,13 @@ let
|
||||||
};
|
};
|
||||||
qs = "${pkgs.quickshell}/bin/qs";
|
qs = "${pkgs.quickshell}/bin/qs";
|
||||||
wl-paste = "${pkgs.wl-clipboard}/bin/wl-paste";
|
wl-paste = "${pkgs.wl-clipboard}/bin/wl-paste";
|
||||||
|
swww = "${pkgs.swww}/bin/swww";
|
||||||
|
swww-daemon = "${pkgs.swww}/bin/swww-daemon";
|
||||||
|
|
||||||
|
# Your assets - adjust paths as needed
|
||||||
|
assetsPath = ./assets;
|
||||||
|
wallpaperDir = "${config.home.homeDirectory}/.config/wallpapers";
|
||||||
|
systemctl = "${pkgs.systemd}/bin/systemctl";
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
programs.niri.settings = {
|
programs.niri.settings = {
|
||||||
|
|
@ -25,7 +32,7 @@ in
|
||||||
};
|
};
|
||||||
spawn-at-startup = [
|
spawn-at-startup = [
|
||||||
(makeCommand "${lib.getExe pkgs.hyprlock}")
|
(makeCommand "${lib.getExe pkgs.hyprlock}")
|
||||||
(makeCommand "${pkgs.swww}/bin/swww-daemon")
|
(makeCommand swww-daemon)
|
||||||
{
|
{
|
||||||
command = [
|
command = [
|
||||||
"${wl-paste}"
|
"${wl-paste}"
|
||||||
|
|
@ -50,8 +57,24 @@ in
|
||||||
"DankMaterialShell"
|
"DankMaterialShell"
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
# Set animated wallpaper on startup
|
||||||
|
{
|
||||||
|
command = [
|
||||||
|
"${pkgs.bash}/bin/bash"
|
||||||
|
"-c"
|
||||||
|
''
|
||||||
|
sleep 3
|
||||||
|
while ! ${swww} query &>/dev/null; do
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
|
${swww} img "${wallpaperDir}/anime-cat-girl-snow.mp4" \
|
||||||
|
--transition-type fade \
|
||||||
|
--transition-duration 2 \
|
||||||
|
--transition-fps 30
|
||||||
|
''
|
||||||
|
];
|
||||||
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
input = {
|
input = {
|
||||||
touchpad = {
|
touchpad = {
|
||||||
click-method = "button-areas";
|
click-method = "button-areas";
|
||||||
|
|
@ -71,7 +94,6 @@ in
|
||||||
warp-mouse-to-focus.enable = true;
|
warp-mouse-to-focus.enable = true;
|
||||||
workspace-auto-back-and-forth = true;
|
workspace-auto-back-and-forth = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = {
|
outputs = {
|
||||||
"eDP-1" = {
|
"eDP-1" = {
|
||||||
scale = 1.0;
|
scale = 1.0;
|
||||||
|
|
@ -81,7 +103,6 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
overview = {
|
overview = {
|
||||||
workspace-shadow.enable = false;
|
workspace-shadow.enable = false;
|
||||||
backdrop-color = "transparent";
|
backdrop-color = "transparent";
|
||||||
|
|
@ -109,7 +130,6 @@ in
|
||||||
default-column-width = {
|
default-column-width = {
|
||||||
proportion = 0.5;
|
proportion = 0.5;
|
||||||
};
|
};
|
||||||
|
|
||||||
gaps = 6;
|
gaps = 6;
|
||||||
struts = {
|
struts = {
|
||||||
left = 0;
|
left = 0;
|
||||||
|
|
@ -117,7 +137,6 @@ in
|
||||||
top = 0;
|
top = 0;
|
||||||
bottom = 0;
|
bottom = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
tab-indicator = {
|
tab-indicator = {
|
||||||
hide-when-single-tab = true;
|
hide-when-single-tab = true;
|
||||||
place-within-column = true;
|
place-within-column = true;
|
||||||
|
|
@ -129,8 +148,136 @@ in
|
||||||
length.total-proportion = 0.1;
|
length.total-proportion = 0.1;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
prefer-no-csd = true;
|
prefer-no-csd = true;
|
||||||
hotkey-overlay.skip-at-startup = true;
|
hotkey-overlay.skip-at-startup = true;
|
||||||
|
|
||||||
|
# Wallpaper keybindings
|
||||||
|
binds = with config.lib.niri.actions; {
|
||||||
|
# Switch between your wallpapers
|
||||||
|
|
||||||
|
# Interactive wallpaper selection
|
||||||
|
"Mod+Shift+A".action = spawn [
|
||||||
|
"${pkgs.bash}/bin/bash"
|
||||||
|
"-c"
|
||||||
|
''
|
||||||
|
selected=$(find "${wallpaperDir}" -type f \( -name "*.gif" -o -name "*.mp4" -o -name "*.webm" -o -name "*.jpg" -o -name "*.png" \) | ${pkgs.fzf}/bin/fzf --preview='basename {}')
|
||||||
|
if [ -n "$selected" ]; then
|
||||||
|
${swww} img "$selected" \
|
||||||
|
--transition-type fade \
|
||||||
|
--transition-duration 2 \
|
||||||
|
--transition-fps 30
|
||||||
|
fi
|
||||||
|
''
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
swww
|
||||||
|
fzf
|
||||||
|
ffmpeg
|
||||||
|
];
|
||||||
|
|
||||||
|
# Create cache directory for wallpaper state
|
||||||
|
home.file = {
|
||||||
|
# Create wallpaper directory
|
||||||
|
".config/wallpapers/.keep".text = "";
|
||||||
|
|
||||||
|
# Create cache directory for rotation state
|
||||||
|
|
||||||
|
# Initialize wallpaper rotation state (starts at 0, so first rotation goes to index 1)
|
||||||
|
".cache/wallpaper-rotation-state".text = "0";
|
||||||
|
|
||||||
|
# Copy your animated wallpaper
|
||||||
|
".config/wallpapers/anime-cat-girl-snow.mp4" = {
|
||||||
|
source = "${assetsPath}/Anime Live Wallpaper - Anime Cat Girl Snow - HD - no copyright [SiMc3l0ido0].mp4";
|
||||||
|
};
|
||||||
|
|
||||||
|
# Copy your static wallpaper
|
||||||
|
".config/wallpapers/static-wallpaper.jpg" = {
|
||||||
|
source = "${assetsPath}/wp6553608.jpg";
|
||||||
|
};
|
||||||
|
|
||||||
|
# Create optimized version of the MP4 using a script
|
||||||
|
".config/wallpapers/anime-cat-girl-snow-optimized.mp4" = {
|
||||||
|
source =
|
||||||
|
pkgs.runCommand "optimized-wallpaper"
|
||||||
|
{
|
||||||
|
buildInputs = [ pkgs.ffmpeg ];
|
||||||
|
}
|
||||||
|
''
|
||||||
|
${pkgs.ffmpeg}/bin/ffmpeg -i "${assetsPath}/Anime Live Wallpaper - Anime Cat Girl Snow - HD - no copyright [SiMc3l0ido0].mp4" \
|
||||||
|
-vf "scale=1920:1080:force_original_aspect_ratio=increase,crop=1920:1080" \
|
||||||
|
-r 30 -c:v libx264 -crf 28 -preset medium \
|
||||||
|
-t 30 -an "$out"
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
# SWWW configuration
|
||||||
|
".config/swww/config".text = ''
|
||||||
|
resize=crop
|
||||||
|
fill_color=000000
|
||||||
|
filter=Lanczos3
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
# Wallpaper rotation service
|
||||||
|
systemd.user.services.wallpaper-rotation = {
|
||||||
|
Unit = {
|
||||||
|
Description = "Rotate between wallpapers";
|
||||||
|
After = [ "graphical-session.target" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
Service = {
|
||||||
|
Type = "oneshot";
|
||||||
|
ExecStart = "${pkgs.writeShellScript "rotate-wallpaper" ''
|
||||||
|
wallpapers=(
|
||||||
|
"${wallpaperDir}/anime-cat-girl-snow.mp4"
|
||||||
|
"${wallpaperDir}/anime-cat-girl-snow-optimized.mp4"
|
||||||
|
"${wallpaperDir}/static-wallpaper.jpg"
|
||||||
|
)
|
||||||
|
|
||||||
|
# Wait for swww to be available
|
||||||
|
while ! ${swww} query &>/dev/null; do
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
|
|
||||||
|
# Get random wallpaper
|
||||||
|
random_wallpaper="''${wallpapers[$RANDOM % ''${#wallpapers[@]}]}"
|
||||||
|
|
||||||
|
${swww} img "$random_wallpaper" \
|
||||||
|
--transition-type random \
|
||||||
|
--transition-duration 3 \
|
||||||
|
--transition-fps 30
|
||||||
|
''}";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# Optional: Timer for automatic wallpaper rotation
|
||||||
|
systemd.user.timers.wallpaper-rotation = {
|
||||||
|
Unit = {
|
||||||
|
Description = "Timer for wallpaper rotation";
|
||||||
|
};
|
||||||
|
|
||||||
|
Timer = {
|
||||||
|
OnBootSec = "10min";
|
||||||
|
OnUnitActiveSec = "10min";
|
||||||
|
Unit = "wallpaper-rotation.service";
|
||||||
|
};
|
||||||
|
|
||||||
|
Install = {
|
||||||
|
WantedBy = [ "timers.target" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# Shell aliases
|
||||||
|
programs.bash.shellAliases = {
|
||||||
|
wallpaper = "${swww} img";
|
||||||
|
wallpaper-anime = "${swww} img ${wallpaperDir}/anime-cat-girl-snow.mp4 --transition-type fade --transition-fps 30";
|
||||||
|
wallpaper-static = "${swww} img ${wallpaperDir}/static-wallpaper.jpg --transition-type fade";
|
||||||
|
wallpaper-optimized = "${swww} img ${wallpaperDir}/anime-cat-girl-snow-optimized.mp4 --transition-type fade --transition-fps 30";
|
||||||
|
wallpaper-rotate = "${systemctl} --user start wallpaper-rotation.service";
|
||||||
|
wallpaper-auto-start = "${systemctl} --user start wallpaper-rotation.timer";
|
||||||
|
wallpaper-auto-stop = "${systemctl} --user stop wallpaper-rotation.timer";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -106,6 +106,7 @@ in
|
||||||
go-hello = "${nix} flake init --template templates#go-hello";
|
go-hello = "${nix} flake init --template templates#go-hello";
|
||||||
haskell-hello = "${nix} flake init --template templates#haskell-hello";
|
haskell-hello = "${nix} flake init --template templates#haskell-hello";
|
||||||
g = "${lib.getExe pkgs.git}";
|
g = "${lib.getExe pkgs.git}";
|
||||||
|
copy = "${pkgs.wl-wl-clipboard}/bin/wl-copy";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
carapace.enable = true;
|
carapace.enable = true;
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,7 @@
|
||||||
{
|
{ pkgs
|
||||||
pkgs,
|
, inputs
|
||||||
inputs,
|
, lib
|
||||||
lib,
|
, ...
|
||||||
...
|
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
quickshell = inputs.quickshell.packages.${pkgs.system}.default;
|
quickshell = inputs.quickshell.packages.${pkgs.system}.default;
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,7 @@
|
||||||
{
|
{ config
|
||||||
config,
|
, pkgs
|
||||||
pkgs,
|
, lib
|
||||||
lib,
|
, ...
|
||||||
...
|
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,411 @@
|
||||||
{ ... }:
|
|
||||||
{
|
{
|
||||||
services.wpaperd = {
|
config,
|
||||||
enable = true;
|
lib,
|
||||||
settings = {
|
pkgs,
|
||||||
eDP-1 = {
|
...
|
||||||
path = ../assets/wp6553608.jpg;
|
}:
|
||||||
|
let
|
||||||
|
makeCommand = command: {
|
||||||
|
command = [ command ];
|
||||||
|
};
|
||||||
|
qs = "${pkgs.quickshell}/bin/qs";
|
||||||
|
wl-paste = "${pkgs.wl-clipboard}/bin/wl-paste";
|
||||||
|
swww = "${pkgs.swww}/bin/swww";
|
||||||
|
swww-daemon = "${pkgs.swww}/bin/swww-daemon";
|
||||||
|
|
||||||
|
# Your assets - adjust paths as needed
|
||||||
|
assetsPath = ../assets;
|
||||||
|
wallpaperDir = "${config.home.homeDirectory}/.config/wallpapers";
|
||||||
|
systemctl = "${pkgs.systemd}/bin/systemctl";
|
||||||
|
in
|
||||||
|
{
|
||||||
|
programs.niri.settings = {
|
||||||
|
environment = {
|
||||||
|
CLUTTER_BACKEND = "wayland";
|
||||||
|
DISPLAY = ":0";
|
||||||
|
GDK_BACKEND = "wayland,x11";
|
||||||
|
MOZ_ENABLE_WAYLAND = "1";
|
||||||
|
NIXOS_OZONE_WL = "1";
|
||||||
|
QT_QPA_PLATFORM = "wayland;xcb";
|
||||||
|
QT_WAYLAND_DISABLE_WINDOWDECORATION = "1";
|
||||||
|
SDL_VIDEODRIVER = "wayland";
|
||||||
|
};
|
||||||
|
spawn-at-startup = [
|
||||||
|
(makeCommand "${lib.getExe pkgs.hyprlock}")
|
||||||
|
(makeCommand swww-daemon)
|
||||||
|
{
|
||||||
|
command = [
|
||||||
|
"${wl-paste}"
|
||||||
|
"--watch"
|
||||||
|
"cliphist"
|
||||||
|
"store"
|
||||||
|
];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
command = [
|
||||||
|
"${wl-paste}"
|
||||||
|
"--type text"
|
||||||
|
"--watch"
|
||||||
|
"cliphist"
|
||||||
|
"store"
|
||||||
|
];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
command = [
|
||||||
|
"${qs}"
|
||||||
|
"-c"
|
||||||
|
"DankMaterialShell"
|
||||||
|
];
|
||||||
|
}
|
||||||
|
# Set animated wallpaper on startup and start rotation timer
|
||||||
|
{
|
||||||
|
command = [
|
||||||
|
"${pkgs.bash}/bin/bash"
|
||||||
|
"-c"
|
||||||
|
''
|
||||||
|
# Wait for swww daemon to be ready
|
||||||
|
sleep 3
|
||||||
|
timeout=30
|
||||||
|
while ! ${swww} query &>/dev/null && [ $timeout -gt 0 ]; do
|
||||||
|
sleep 1
|
||||||
|
timeout=$((timeout - 1))
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ $timeout -eq 0 ]; then
|
||||||
|
echo "Timeout waiting for swww daemon"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Ensure wallpaper directory exists
|
||||||
|
mkdir -p "${wallpaperDir}"
|
||||||
|
|
||||||
|
# Set initial wallpaper (the video)
|
||||||
|
if [ -f "${wallpaperDir}/anime-cat-girl-snow.mp4" ]; then
|
||||||
|
${swww} img "${wallpaperDir}/anime-cat-girl-snow.mp4" \
|
||||||
|
--transition-type fade \
|
||||||
|
--transition-duration 2 \
|
||||||
|
--transition-fps 30
|
||||||
|
|
||||||
|
# Initialize state file
|
||||||
|
echo "0" > "$HOME/.cache/wallpaper-rotation-state"
|
||||||
|
|
||||||
|
# Start the rotation timer automatically
|
||||||
|
${systemctl} --user start wallpaper-rotation.timer
|
||||||
|
else
|
||||||
|
echo "Wallpaper file not found: ${wallpaperDir}/anime-cat-girl-snow.mp4"
|
||||||
|
fi
|
||||||
|
''
|
||||||
|
];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
input = {
|
||||||
|
touchpad = {
|
||||||
|
click-method = "button-areas";
|
||||||
|
dwt = true;
|
||||||
|
dwtp = true;
|
||||||
|
natural-scroll = true;
|
||||||
|
scroll-method = "two-finger";
|
||||||
|
tap = true;
|
||||||
|
tap-button-map = "left-right-middle";
|
||||||
|
middle-emulation = true;
|
||||||
|
accel-profile = "adaptive";
|
||||||
|
};
|
||||||
|
focus-follows-mouse = {
|
||||||
|
enable = true;
|
||||||
|
max-scroll-amount = "90%";
|
||||||
|
};
|
||||||
|
warp-mouse-to-focus.enable = true;
|
||||||
|
workspace-auto-back-and-forth = true;
|
||||||
|
};
|
||||||
|
outputs = {
|
||||||
|
"eDP-1" = {
|
||||||
|
scale = 1.0;
|
||||||
|
position = {
|
||||||
|
x = 0;
|
||||||
|
y = 0;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
overview = {
|
||||||
|
workspace-shadow.enable = false;
|
||||||
|
backdrop-color = "transparent";
|
||||||
|
};
|
||||||
|
gestures = {
|
||||||
|
hot-corners.enable = true;
|
||||||
|
};
|
||||||
|
layout = {
|
||||||
|
focus-ring.enable = false;
|
||||||
|
border = {
|
||||||
|
enable = true;
|
||||||
|
width = 2;
|
||||||
|
active.color = "#ff69b4";
|
||||||
|
inactive.color = "#7d0d2d";
|
||||||
|
};
|
||||||
|
shadow = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
preset-column-widths = [
|
||||||
|
{ proportion = 0.25; }
|
||||||
|
{ proportion = 0.5; }
|
||||||
|
{ proportion = 0.75; }
|
||||||
|
{ proportion = 1.0; }
|
||||||
|
];
|
||||||
|
default-column-width = {
|
||||||
|
proportion = 0.5;
|
||||||
|
};
|
||||||
|
gaps = 6;
|
||||||
|
struts = {
|
||||||
|
left = 0;
|
||||||
|
right = 0;
|
||||||
|
top = 0;
|
||||||
|
bottom = 0;
|
||||||
|
};
|
||||||
|
tab-indicator = {
|
||||||
|
hide-when-single-tab = true;
|
||||||
|
place-within-column = true;
|
||||||
|
position = "left";
|
||||||
|
corner-radius = 20.0;
|
||||||
|
gap = -12.0;
|
||||||
|
gaps-between-tabs = 10.0;
|
||||||
|
width = 4.0;
|
||||||
|
length.total-proportion = 0.1;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
prefer-no-csd = true;
|
||||||
|
hotkey-overlay.skip-at-startup = true;
|
||||||
|
|
||||||
|
# Wallpaper keybindings
|
||||||
|
binds = with config.lib.niri.actions; {
|
||||||
|
# Switch between your wallpapers sequentially
|
||||||
|
"Mod+Shift+W".action = spawn [
|
||||||
|
"${pkgs.bash}/bin/bash"
|
||||||
|
"-c"
|
||||||
|
''
|
||||||
|
wallpapers=(
|
||||||
|
"${wallpaperDir}/anime-cat-girl-snow.mp4"
|
||||||
|
"${wallpaperDir}/static-wallpaper.jpg"
|
||||||
|
"${wallpaperDir}/anime-cat-girl-snow-optimized.mp4"
|
||||||
|
)
|
||||||
|
|
||||||
|
# Check if swww is running
|
||||||
|
if ! ${swww} query &>/dev/null; then
|
||||||
|
echo "swww daemon not running"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
current_wallpaper=$(${swww} query | head -n1 | awk '{print $NF}')
|
||||||
|
|
||||||
|
for i in "''${!wallpapers[@]}"; do
|
||||||
|
if [[ "''${wallpapers[$i]}" == "$current_wallpaper" ]]; then
|
||||||
|
next_index=$(( (i + 1) % ''${#wallpapers[@]} ))
|
||||||
|
|
||||||
|
# Check if next wallpaper exists
|
||||||
|
if [ -f "''${wallpapers[$next_index]}" ]; then
|
||||||
|
${swww} img "''${wallpapers[$next_index]}" \
|
||||||
|
--transition-type random \
|
||||||
|
--transition-duration 2 \
|
||||||
|
--transition-fps 30
|
||||||
|
|
||||||
|
# Update the rotation state to sync with manual change
|
||||||
|
mkdir -p "$HOME/.cache"
|
||||||
|
echo "$next_index" > "$HOME/.cache/wallpaper-rotation-state"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
# If current wallpaper not in list, set first available one
|
||||||
|
for i in "''${!wallpapers[@]}"; do
|
||||||
|
if [ -f "''${wallpapers[$i]}" ]; then
|
||||||
|
${swww} img "''${wallpapers[$i]}" \
|
||||||
|
--transition-type fade \
|
||||||
|
--transition-duration 2 \
|
||||||
|
--transition-fps 30
|
||||||
|
mkdir -p "$HOME/.cache"
|
||||||
|
echo "$i" > "$HOME/.cache/wallpaper-rotation-state"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
''
|
||||||
|
];
|
||||||
|
|
||||||
|
# Interactive wallpaper selection
|
||||||
|
"Mod+Ctrl+W".action = spawn [
|
||||||
|
"${pkgs.bash}/bin/bash"
|
||||||
|
"-c"
|
||||||
|
''
|
||||||
|
if ! ${swww} query &>/dev/null; then
|
||||||
|
echo "swww daemon not running"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
selected=$(find "${wallpaperDir}" -type f \( -name "*.gif" -o -name "*.mp4" -o -name "*.webm" -o -name "*.jpg" -o -name "*.png" \) 2>/dev/null | ${pkgs.fzf}/bin/fzf --preview='basename {}' || true)
|
||||||
|
|
||||||
|
if [ -n "$selected" ] && [ -f "$selected" ]; then
|
||||||
|
${swww} img "$selected" \
|
||||||
|
--transition-type fade \
|
||||||
|
--transition-duration 2 \
|
||||||
|
--transition-fps 30
|
||||||
|
fi
|
||||||
|
''
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
swww
|
||||||
|
fzf
|
||||||
|
ffmpeg
|
||||||
|
];
|
||||||
|
|
||||||
|
# Create directories and files
|
||||||
|
home.file = {
|
||||||
|
# Create wallpaper directory
|
||||||
|
".config/wallpapers/.keep".text = "";
|
||||||
|
|
||||||
|
# Create cache directory for rotation state
|
||||||
|
|
||||||
|
# Initialize wallpaper rotation state (starts at 0, so first rotation goes to index 1)
|
||||||
|
".cache/wallpaper-rotation-state".text = "0";
|
||||||
|
|
||||||
|
# Copy your animated wallpaper
|
||||||
|
".config/wallpapers/anime-cat-girl-snow.mp4" = {
|
||||||
|
source = "${assetsPath}/Anime Live Wallpaper - Anime Cat Girl Snow - HD - no copyright [SiMc3l0ido0].mp4";
|
||||||
|
};
|
||||||
|
|
||||||
|
# Copy your static wallpaper
|
||||||
|
".config/wallpapers/static-wallpaper.jpg" = {
|
||||||
|
source = "${assetsPath}/wp6553608.jpg";
|
||||||
|
};
|
||||||
|
|
||||||
|
# Create optimized version of the MP4 using a script
|
||||||
|
".config/wallpapers/anime-cat-girl-snow-optimized.mp4" = {
|
||||||
|
source =
|
||||||
|
pkgs.runCommand "optimized-wallpaper"
|
||||||
|
{
|
||||||
|
buildInputs = [ pkgs.ffmpeg ];
|
||||||
|
meta.timeout = 300; # 5 minute timeout for ffmpeg
|
||||||
|
}
|
||||||
|
''
|
||||||
|
# Ensure input file exists
|
||||||
|
if [ ! -f "${assetsPath}/Anime Live Wallpaper - Anime Cat Girl Snow - HD - no copyright [SiMc3l0ido0].mp4" ]; then
|
||||||
|
echo "Source video not found!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
${pkgs.ffmpeg}/bin/ffmpeg -i "${assetsPath}/Anime Live Wallpaper - Anime Cat Girl Snow - HD - no copyright [SiMc3l0ido0].mp4" \
|
||||||
|
-vf "scale=1920:1080:force_original_aspect_ratio=increase,crop=1920:1080" \
|
||||||
|
-r 30 -c:v libx264 -crf 28 -preset medium \
|
||||||
|
-t 30 -an -y "$out"
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
# SWWW configuration
|
||||||
|
".config/swww/config".text = ''
|
||||||
|
resize=crop
|
||||||
|
fill_color=000000
|
||||||
|
filter=Lanczos3
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
# Wallpaper rotation service with sequential switching
|
||||||
|
systemd.user.services.wallpaper-rotation = {
|
||||||
|
Unit = {
|
||||||
|
Description = "Rotate between wallpapers sequentially";
|
||||||
|
After = [ "graphical-session.target" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
Service = {
|
||||||
|
Type = "oneshot";
|
||||||
|
ExecStart = "${pkgs.writeShellScript "rotate-wallpaper" ''
|
||||||
|
wallpapers=(
|
||||||
|
"${wallpaperDir}/anime-cat-girl-snow.mp4"
|
||||||
|
"${wallpaperDir}/static-wallpaper.jpg"
|
||||||
|
"${wallpaperDir}/anime-cat-girl-snow-optimized.mp4"
|
||||||
|
)
|
||||||
|
|
||||||
|
# Wait for swww to be available with timeout
|
||||||
|
timeout=30
|
||||||
|
while ! ${swww} query &>/dev/null && [ $timeout -gt 0 ]; do
|
||||||
|
sleep 1
|
||||||
|
timeout=$((timeout - 1))
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ $timeout -eq 0 ]; then
|
||||||
|
echo "Timeout waiting for swww daemon"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Get current wallpaper index from state file
|
||||||
|
state_file="$HOME/.cache/wallpaper-rotation-state"
|
||||||
|
if [ -f "$state_file" ]; then
|
||||||
|
current_index=$(cat "$state_file" 2>/dev/null || echo "0")
|
||||||
|
else
|
||||||
|
current_index=0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Ensure current_index is a valid number
|
||||||
|
if ! [[ "$current_index" =~ ^[0-9]+$ ]]; then
|
||||||
|
current_index=0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Move to next wallpaper, ensuring it exists
|
||||||
|
attempts=0
|
||||||
|
max_attempts=''${#wallpapers[@]}
|
||||||
|
|
||||||
|
while [ $attempts -lt $max_attempts ]; do
|
||||||
|
next_index=$(( (current_index + 1) % ''${#wallpapers[@]} ))
|
||||||
|
|
||||||
|
if [ -f "''${wallpapers[$next_index]}" ]; then
|
||||||
|
echo "$next_index" > "$state_file"
|
||||||
|
|
||||||
|
${swww} img "''${wallpapers[$next_index]}" \
|
||||||
|
--transition-type random \
|
||||||
|
--transition-duration 3 \
|
||||||
|
--transition-fps 30
|
||||||
|
|
||||||
|
echo "Switched to wallpaper $next_index: ''${wallpapers[$next_index]}"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
current_index=$next_index
|
||||||
|
attempts=$((attempts + 1))
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "No valid wallpapers found"
|
||||||
|
exit 1
|
||||||
|
''}";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# Timer for automatic wallpaper rotation every 5 minutes
|
||||||
|
systemd.user.timers.wallpaper-rotation = {
|
||||||
|
Unit = {
|
||||||
|
Description = "Timer for wallpaper rotation every 5 minutes";
|
||||||
|
};
|
||||||
|
|
||||||
|
Timer = {
|
||||||
|
OnBootSec = "5min";
|
||||||
|
OnUnitActiveSec = "5min";
|
||||||
|
Unit = "wallpaper-rotation.service";
|
||||||
|
Persistent = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
Install = {
|
||||||
|
WantedBy = [ "timers.target" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# Shell aliases
|
||||||
|
programs.bash.shellAliases = {
|
||||||
|
wallpaper = "${swww} img";
|
||||||
|
wallpaper-anime = "${swww} img ${wallpaperDir}/anime-cat-girl-snow.mp4 --transition-type fade --transition-fps 30";
|
||||||
|
wallpaper-static = "${swww} img ${wallpaperDir}/static-wallpaper.jpg --transition-type fade";
|
||||||
|
wallpaper-optimized = "${swww} img ${wallpaperDir}/anime-cat-girl-snow-optimized.mp4 --transition-type fade --transition-fps 30";
|
||||||
|
wallpaper-rotate = "${systemctl} --user start wallpaper-rotation.service";
|
||||||
|
wallpaper-auto-start = "${systemctl} --user start wallpaper-rotation.timer";
|
||||||
|
wallpaper-auto-stop = "${systemctl} --user stop wallpaper-rotation.timer";
|
||||||
|
wallpaper-status = "${systemctl} --user status wallpaper-rotation.timer";
|
||||||
|
wallpaper-logs = "journalctl --user -u wallpaper-rotation.service -f";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,10 +10,7 @@
|
||||||
#
|
#
|
||||||
# For this to work you will need to create the directory yourself:
|
# For this to work you will need to create the directory yourself:
|
||||||
# $ mkdir /nix/persist/etc/ssh
|
# $ mkdir /nix/persist/etc/ssh
|
||||||
environment.etc."ssh/ssh_host_rsa_key".source = "/nix/persist/etc/ssh/ssh_host_rsa_key";
|
environment.etc."ssh/id_ed25519".source = "/nix/persist/etc/ssh/id_ed25519";
|
||||||
environment.etc."ssh/ssh_host_rsa_key.pub".source = "/nix/persist/etc/ssh/ssh_host_rsa_key.pub";
|
environment.etc."ssh/id_ed25519.pub".source = "/nix/persist/etc/ssh/id_ed25519.pub";
|
||||||
environment.etc."ssh/ssh_host_ed25519_key".source = "/nix/persist/etc/ssh/ssh_host_ed25519_key";
|
|
||||||
environment.etc."ssh/ssh_host_ed25519_key.pub".source =
|
|
||||||
"/nix/persist/etc/ssh/ssh_host_ed25519_key.pub";
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue