<!DOCTYPE html> <head> <meta charset="utf-8" /> <style> pre { white-space: pre-wrap; } </style> </head> <h1>DeaDvey's domain</h1> <pre> <a href="/">Home</a> <a href="/blog/">Blogs</a> <a href="/projects/">Projects</a> <hr/> <b>Waybar theme switcher for home manager:</b> I made this basic script for changing my home manager theme and mode settings: <div class="indent code">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</div> which I can run like <div class="code">./theme-switcher.sh gruvbox dark</div> then it writes the theme to my home manager configuration and reloads home manager. I can then have several waybar modules like such: <div class="code indent"> "custom/gruvbox" = { on-click = "$HOME/scripts/theme-switcher.sh gruvbox \${MODE}"; format = ""; }; </div> 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.<br/>Fly You High - DeaDvey <i>Published: 15d/7e8 at a857</i> <a href='/blog/76.html'><-- Home Manager automatically changing dark/light mode at sunrise/set</a> <a href='/blog/78.html'>themedweb firefox extension--></a> <a href="/blog/ricing.html">ricing</a><br/><a href="/blog/nixos.html">nixos</a><br/><a href="/blog/theme changer.html">theme changer</a><br/><a href="/blog/guide.html">guide</a><br/><a href="/blog/bash scripting.html">bash scripting</a><br/><a href="/blog/nix.html">nix</a><br/> <img width="200" src="/images/rice.png"> </pre> <style> pre { white-space: pre-wrap; } </style>