A simple script that detects changes in the system theme mode (dark mode) and runs additional scripts when it does.
Works for MacOS, Windows and Linux.
- Add the script to your path (I use
$HOME/.local/bin
) - After that, add the script to your shell's prompt command. I use Fish, so following the documentation for Fish Event Handlers, create an additional file _systemThemeHandler.fish in your conf.d directory (Default location: ~/.config/fish/conf.d)
That's it! Now changes to the system theme will be detected when you reload your shell.