DeaDvey's domain [Home page](/index.md) [Blogs](/blog/) [Projects](/projects/) [Contact](/contact/) --- [<-- Home Manager automatically changing dark/light mode at sunrise/set](/blog/74.md)[themedweb firefox extension-->](/blog/76.md) **Waybar theme switcher for home manager:** I made this basic script for changing my home manager theme and mode settings:
echo theme = $1 echo mode = $2 sed -i "s/THEME\ =\ ".*";/THEME\ =\ \"\${1}\";/" $HOME/.config/home-manager/home.nix sed -i "s/MODE\ =\ ".*";/MODE\ =\ \"\${2}\";/" $HOME/.config/home-manager/home.nix home-manager switch
which I can run like
./theme-switcher.sh gruvbox dark
then it writes the theme to my home manager configuration and reloads home manager.
I can then have several waybar modules like such:
"custom/gruvbox" = { on-click = "$HOME/scripts/theme-switcher.sh gruvbox \${MODE}"; format = ""; };
Which I can easily click to change themes Pretty basic, but I thought I'd share, also it takes about 10 seconds to change theme so it's not quite instant gratification.
Fly You High - DeaDvey *Published: 15d/7e8 at a857* [ricing](/blog/ricing.md) [nixos](/blog/nixos.md) [theme changer](/blog/theme changer.md) [guide](/blog/guide.md) [bash scripting](/blog/bash scripting.md) [nix](/blog/nix.md) ![An image without alt text](/images/rice.png)