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 let
theme = config.colorScheme.colors; 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 # Install Packages For The User
@ -12,7 +13,8 @@
(import ./../scripts/emopicker9000.nix { inherit pkgs; }) (import ./../scripts/emopicker9000.nix { inherit pkgs; })
(import ./../scripts/task-waybar.nix { inherit pkgs; }) (import ./../scripts/task-waybar.nix { inherit pkgs; })
(import ./../scripts/squirtle.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/themechange.nix { inherit pkgs; inherit flakeDir; })
(import ./../scripts/theme-selector.nix { inherit pkgs; }) (import ./../scripts/theme-selector.nix { inherit pkgs; })
]; ];

View File

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

View File

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

View File

@ -1,4 +1,4 @@
{ pkgs, wallpaperDir, }: { pkgs, username, wallpaperDir, wallpaperGit, ... }:
pkgs.writeShellScriptBin "wallsetter" '' pkgs.writeShellScriptBin "wallsetter" ''
TIMEOUT=720 TIMEOUT=720
@ -9,7 +9,10 @@ TRANSITION4="--transition-type outer --transition-pos 0.3,0.8 --transition-step
TRANSITION5="--transition-type wipe --transition-angle 270 --transition-step 30" TRANSITION5="--transition-type wipe --transition-angle 270 --transition-step 30"
WALLPAPER=$(find ${wallpaperDir}/* -type f | shuf -n 1) WALLPAPER=$(find ${wallpaperDir}/* -type f | shuf -n 1)
PREVIOUS=$WALLPAPER PREVIOUS=$WALLPAPER
rm -rf ${wallpaperDir}
${pkgs.git}/bin/git clone ${wallpaperGit} ${wallpaperDir}
sleep 1
chown -R ${username}:users ${wallpaperDir}
while true; while true;
do do
if [ $WALLPAPER == $PREVIOUS ] if [ $WALLPAPER == $PREVIOUS ]

View File

@ -2,15 +2,8 @@
wallpaperGit, username, ... }: wallpaperGit, username, ... }:
{ {
system.activationScripts = { # system.userActivationScripts = {
gitwallpapers.text = '' # 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
'';
};
} }

View File

@ -48,7 +48,7 @@
# List System Programs # List System Programs
environment.systemPackages = with pkgs; [ 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 polkit_gnome lm_sensors unzip unrar libnotify
v4l-utils ydotool wl-clipboard socat cowsay lsd v4l-utils ydotool wl-clipboard socat cowsay lsd
pkg-config meson hugo gnumake ninja go nodejs symbola pkg-config meson hugo gnumake ninja go nodejs symbola

View File

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