Switchcraft watches GNOME's light/dark preference and runs your shell commands when the theme changes.
- Watches
org.gnome.desktop.interface color-schemeand executes commands instantly. - Polished libadwaita interface with light/dark pages, icons, and header-bar actions.
- Add, edit, enable/disable, or remove commands per theme.
- Define reusable constants for common variables in commands.
- Independent background monitoring - separate bash script runs even when GUI is closed.
- Keyboard shortcuts (Ctrl+N to add, Ctrl+Q to quit) plus About and Shortcuts dialogs from the menu.
Command Examples (click to open)
- Change legacy theme to dark:
gsettings set org.gnome.desktop.interface gtk-theme 'adw-gtk3-dark'
- Change icon theme to light:
gsettings set org.gnome.desktop.interface icon-theme 'MacTahoe-light'
- Set constants:
D2DL_SCHEMADIR="$HOME/.local/share/gnome-shell/extensions/[email protected]/schemas"
D2DL_SCHEMA="org.gnome.shell.extensions.dash2dock-lite"
- Change Dash 2 Dock Lite background based on theme and using constants
Light theme:
gsettings --schemadir $D2DL_SCHEMADIR set $D2DL_SCHEMA background-color '(0.063, 0.1216, 0.1882, 1.0)'
Dark theme:
gsettings --schemadir $D2DL_SCHEMADIR set $D2DL_SCHEMA background-color '(0.3373, 0.4392, 0.5294, 1.0)'
- GNOME 40+ (GTK 4 and libadwaita)
- GLib 2.66+
- Vala compiler (for building)
- Meson build system
- jq (for JSON parsing in monitor script)
- ruby, rubygems, rpmbuild, appimagetool and chrpath (for packaging only)
Install dependencies (click to open)
Debian/Ubuntu:
sudo apt install meson valac libgtk-4-dev libadwaita-1-dev libjson-glib-dev jq ruby ruby-dev rubygems build-essential
gem install --user-install fpmFedora:
sudo dnf install meson vala gtk4-devel libadwaita-devel json-glib-devel jq ruby rubygems rpmbuild chrpath
gem install --user-install fpmArch:
sudo pacman -S meson vala gtk4 libadwaita json-glib jq ruby
gem install --user-install fpmAppImageTool
Download from here and copy to $PATH
Download latest release rpm, deb or AppImage. For seemless AppImage installation Gear lever app is recommended.
Details (click to open)
# Configure for user installation
meson setup builddir --prefix="$HOME/.local"
# Compile
meson compile -C builddir
# Install to ~/.local
ninja -C builddir install
# Uninstall
ninja -C builddir remove# Configure for system installation
meson setup builddir --prefix=/usr/local
# Compile
meson compile -C builddir
# Install system-wide
sudo ninja -C builddir install
# Uninstall
sudo ninja -C builddir removeDetails (click to open)
All runtime configuration lives under ~/.config/switchcraft/.
commands.json- per-theme command lists. Example:
{
"dark": [{ "command": "notify-send 'Dark mode enabled'", "enabled": true }],
"light": [{ "command": "notify-send 'Light mode enabled'", "enabled": true }]
}constants.json- reusable variables referenced inside commands using$NAMEor${NAME}.
Example:
{
"D2DL_SCHEMADIR": "$HOME/.local/share/gnome-shell/extensions/[email protected]/schemas",
"D2DL_SCHEMA": "org.gnome.shell.extensions.dash2dock-lite"
}settings.json- app settings (e.g.,monitoring_enabled). The UI saves changes automatically.
When monitoring is enabled:
~/.local/bin/switchcraft-monitor.sh- The monitoring script (installed automatically)~/.config/autostart/switchcraft-monitor.desktop- Autostart entry for login persistence
- AppImages are standalone applications and does it have install/uninstall function. Because of this if you not disable monitoring before removing AppImage background script will continue running. You can temove it manually from
~/.config/autostartand~/.local/bin.
This project is provided under the terms in LICENSE.