Trying to fix swaync reloading it's still a pain, and improve wallpaper script next

This commit is contained in:
Tyler Kelley 2024-01-19 21:40:26 -06:00
parent 85c2e0e8c0
commit e370d6dc9d
8 changed files with 55 additions and 57 deletions

View File

@ -1,4 +1,5 @@
{ pkgs, config, lib, browser, deviceProfile, ... }:
{ pkgs, config, lib, browser,
deviceProfile, wallpaperDir, ... }:
let
theme = config.colorScheme.colors;

View File

@ -1,4 +1,5 @@
{ pkgs, config, browser, wallpaperDir, flakeDir, ... }:
{ pkgs, config, browser, wallpaperDir, flakeDir,
username, wallpaperGit, ... }:
{
# Install Packages For The User
@ -12,7 +13,8 @@
(import ./../scripts/emopicker9000.nix { inherit pkgs; })
(import ./../scripts/task-waybar.nix { inherit pkgs; })
(import ./../scripts/squirtle.nix { inherit pkgs; })
(import ./../scripts/wallsetter.nix { inherit pkgs; inherit wallpaperDir; })
(import ./../scripts/wallsetter.nix { inherit pkgs; inherit wallpaperDir;
inherit username; inherit wallpaperGit; })
(import ./../scripts/themechange.nix { inherit pkgs; inherit flakeDir; })
(import ./../scripts/theme-selector.nix { inherit pkgs; })
];

View File

@ -11,6 +11,6 @@ pkgs.writeShellScriptBin "theme-selector" ''
themechange "$chosen"
else
${pkgs.libnotify}/bin/notify-send "$chosen is building please wait" &
kitty -e themechange "$chosen"
themechange "$chosen"
fi
''

View File

@ -6,9 +6,8 @@ pkgs.writeShellScriptBin "themechange" ''
else
replacement="$1"
sed -i "/^\s*theme[[:space:]]*=[[:space:]]*\"/s/\"\(.*\)\"/\"$replacement\"/" ${flakeDir}/flake.nix
sudo nixos-rebuild switch --flake ${flakeDir}
sleep 1
${pkgs.swaynotificationcenter}/bin/swaync-client -R
${pkgs.swaynotificationcenter}/bin/swaync-client -rs
pkexec nixos-rebuild switch --flake ${flakeDir}
${pkgs.swaynotificationcenter}/bin/swaync-client -R &
${pkgs.swaynotificationcenter}/bin/swaync-client -rs &
fi
''

View File

@ -1,42 +1,45 @@
{ pkgs, wallpaperDir, }:
{ pkgs, username, wallpaperDir, wallpaperGit, ... }:
pkgs.writeShellScriptBin "wallsetter" ''
TIMEOUT=720
TRANSITION1="--transition-type wave --transition-angle 120 --transition-step 30"
TRANSITION2="--transition-type wipe --transition-angle 30 --transition-step 30"
TRANSITION3="--transition-type center --transition-step 30"
TRANSITION4="--transition-type outer --transition-pos 0.3,0.8 --transition-step 30"
TRANSITION5="--transition-type wipe --transition-angle 270 --transition-step 30"
WALLPAPER=$(find ${wallpaperDir}/* -type f | shuf -n 1)
PREVIOUS=$WALLPAPER
while true;
do
TIMEOUT=720
TRANSITION1="--transition-type wave --transition-angle 120 --transition-step 30"
TRANSITION2="--transition-type wipe --transition-angle 30 --transition-step 30"
TRANSITION3="--transition-type center --transition-step 30"
TRANSITION4="--transition-type outer --transition-pos 0.3,0.8 --transition-step 30"
TRANSITION5="--transition-type wipe --transition-angle 270 --transition-step 30"
WALLPAPER=$(find ${wallpaperDir}/* -type f | shuf -n 1)
PREVIOUS=$WALLPAPER
rm -rf ${wallpaperDir}
${pkgs.git}/bin/git clone ${wallpaperGit} ${wallpaperDir}
sleep 1
chown -R ${username}:users ${wallpaperDir}
while true;
do
if [ $WALLPAPER == $PREVIOUS ]
then
WALLPAPER=$(find ${wallpaperDir}/* -type f | shuf -n 1)
WALLPAPER=$(find ${wallpaperDir}/* -type f | shuf -n 1)
else
PREVIOUS=$WALLPAPER
NUM=$(shuf -i 1-5 -n 1)
case $NUM in
1)
TRANSITION=$TRANSITION1
;;
2)
TRANSITION=$TRANSITION2
;;
3)
TRANSITION=$TRANSITION3
;;
4)
TRANSITION=$TRANSITION4
;;
5)
TRANSITION=$TRANSITION5
;;
esac
${pkgs.swww}/bin/swww img $WALLPAPER $TRANSITION
sleep $TIMEOUT
PREVIOUS=$WALLPAPER
NUM=$(shuf -i 1-5 -n 1)
case $NUM in
1)
TRANSITION=$TRANSITION1
;;
2)
TRANSITION=$TRANSITION2
;;
3)
TRANSITION=$TRANSITION3
;;
4)
TRANSITION=$TRANSITION4
;;
5)
TRANSITION=$TRANSITION5
;;
esac
${pkgs.swww}/bin/swww img $WALLPAPER $TRANSITION
sleep $TIMEOUT
fi
done
done
''

View File

@ -2,15 +2,8 @@
wallpaperGit, username, ... }:
{
system.activationScripts = {
gitwallpapers.text = ''
if [ -d ${wallpaperDir} ]; then
cd ${wallpaperDir}
${pkgs.git}/bin/git pull
else
${pkgs.git}/bin/git clone ${wallpaperGit} ${wallpaperDir}
chown -R ${username}:users ${wallpaperDir}
fi
'';
};
# system.userActivationScripts = {
# gitwallpapers.text = ''
# '';
# };
}

View File

@ -48,7 +48,7 @@
# List System Programs
environment.systemPackages = with pkgs; [
wget curl cmatrix lolcat neofetch htop btop libvirt
wget curl git cmatrix lolcat neofetch htop btop libvirt
polkit_gnome lm_sensors unzip unrar libnotify
v4l-utils ydotool wl-clipboard socat cowsay lsd
pkg-config meson hugo gnumake ninja go nodejs symbola
@ -66,7 +66,7 @@
enable = true;
package = inputs.hyprland.packages.${pkgs.system}.hyprland;
};
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
programs.mtr.enable = true;

View File

@ -20,7 +20,7 @@
gitEmail = "tylerzanekelley@gmail.com";
theLocale = "en_US.UTF-8";
theTimezone = "America/Chicago";
theme = "catppuccin-mocha";
theme = "catppuccin-frappe";
browser = "firefox";
wallpaperGit = "https://gitlab.com/Zaney/my-wallpapers.git";
wallpaperDir = "/home/${username}/Pictures/Wallpapers";