Skip to content

Personal systemd service to change color theme in the terminal when changing it in Gnome

License

Notifications You must be signed in to change notification settings

christianfosli/on-colorscheme-changed

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

On colorscheme changed

Rust-based service to listen on DBUS for color scheme changing (e.g. when toggling light/dark mode in the menubar in Gnome 42+), and updating the theme for terminal emulators / terminal editors accordingly.

Usage

Prerequisites:

  • Install rust and cargo. See rust-lang.org/tools/install.

  • You'll need to be running a linux distribution which uses systemd, and where the desktop environment notifies about color scheme changing on D-Bus. I know Gnome does, KDE probably does too 😄

git clone <this repo>
cd on-colorscheme-changed
# open src/main.rs in your favorite editor and adjust the `on_colorscheme_changed` function
# to your liking.

# If you want to run it in the foreground to try it out
cargo run

# If you want to run it in the background with systemd
cargo install --locked --path . # also ensure ~/.cargo/bin is in $PATH
systemctl --user enable ./on-colorscheme-changed.service
# The above command only works nicely on Fedora 39.
# Otherwise you can copy or symlink it to ~/.config/systemd/user
# See https://wiki.archlinux.org/title/Systemd/User 

systemctl --user start on-colorscheme-changed

Blog post

I wrote a blog post about this here.

About

Personal systemd service to change color theme in the terminal when changing it in Gnome

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages