Adding Theme Changing Script

This commit is contained in:
Tyler Kelley 2024-01-17 02:17:12 -06:00
parent 3bb920a1df
commit 78f5931d70
4 changed files with 19 additions and 3 deletions

View File

@ -76,6 +76,8 @@ env = QT_QPA_PLATFORM, wayland
env = QT_WAYLAND_DISABLE_WINDOWDECORATION, 1
env = QT_AUTO_SCREEN_SCALE_FACTOR, 1
env = MOZ_ENABLE_WAYLAND, 1
#env = WLR_NO_HARDWARE_CURSORS,1
#env = WLR_RENDERER_ALLOW_SOFTWARE,1
exec-once = dbus-update-activation-environment --systemd --all
exec-once = systemctl --user import-environment QT_QPA_PLATFORMTHEME WAYLAND_DISPLAY XDG_CURRENT_DESKTOP

View File

@ -0,0 +1,11 @@
{ pkgs, flakeDir, }:
pkgs.writeShellScriptBin "themechange" ''
if [[ ! $@ ]];then
echo "No Theme Given"
else
replacement="$1"
sed -i "/^\s*theme[[:space:]]*=[[:space:]]*\"/s/\"\(.*\)\"/\"$replacement\"/" ${flakeDir}/flake.nix
fi
''

View File

@ -22,8 +22,9 @@
theTimezone = "America/Chicago";
theme = "tokyo-night-storm";
browser = "firefox";
wallpaperDir = "/home/${username}/Pictures/Wallpapers";
wallpaperGit = "https://gitlab.com/Zaney/my-wallpapers.git";
wallpaperDir = "/home/${username}/Pictures/Wallpapers";
flakeDir = "/home/zaney/zaneyos";
pkgs = import nixpkgs {
inherit system;
@ -61,7 +62,7 @@
home-manager.nixosModules.home-manager {
home-manager.extraSpecialArgs = { inherit username;
inherit gitUsername; inherit gitEmail; inherit inputs; inherit theme;
inherit browser; inherit wallpaperDir; inherit wallpaperGit;
inherit browser; inherit wallpaperDir; inherit wallpaperGit; inherit flakeDir;
inherit (inputs.nix-colors.lib-contrib {inherit pkgs;}) gtkThemeFromScheme;
};
home-manager.useGlobalPkgs = true;

View File

@ -1,6 +1,7 @@
{ config, pkgs, inputs, username,
gitUsername, gitEmail, gtkThemeFromScheme,
theme, browser, wallpaperDir, wallpaperGit, ... }:
theme, browser, wallpaperDir, wallpaperGit,
flakeDir, ... }:
{
# Home Manager Settings
@ -68,6 +69,7 @@
(import ./config/scripts/task-waybar.nix { inherit pkgs; })
(import ./config/scripts/squirtle.nix { inherit pkgs; })
(import ./config/scripts/wallsetter.nix { inherit pkgs; inherit wallpaperDir; })
(import ./config/scripts/themechange.nix { inherit pkgs; inherit flakeDir; })
];