Skip to content

rayanamal/kde-app-dynamic-theme

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A theme switcher to automatically change application themes based on KDE global theme.

Currently, only alacritty terminal emulator and micro text editor are supported.

theme-switcher.mp4
Alacritty theme syncing with the global theme.

You can define custom KDE theme - app theme mappings as you wish.

Installation

For traditional Linux users

For traditional Linux users

  1. Download Nushell v0.104 from here.
  2. Clone this repository:
git clone https://github.com/rayanamal/kde-app-dynamic-theme.git
  1. Extract the binary (the file named 'nu') from the archive, and put it somewhere, preferably into the repo you just cloned.
  2. Open theme-switcher.nu in your text editor.
  • Edit the constants at the start if you need to, as explained in the file.
  • Edit the KDE theme -> app theme mappings to match your preferences.
  1. Open theme-switcher.service file in your editor, and put in the location of the nu binary and the script, as explained.
  2. Create ~/.config/systemd/user/ directory if it doesn't exist.
  3. Put theme-switcher.path and theme-switcher.service into ~/.config/systemd/user/:
mv theme-switcher.path theme-switcher.service ~/.config/systemd/user/
  1. Run these commands:
systemctl --user daemon-reload
systemctl --user enable theme-switcher.path
systemctl --user start theme-switcher.path
  1. Enjoy. If it didn't work for you, open an issue, and I'll do my best.
For NixOS users

For NixOS users

  1. Download theme-switcher.nu script.
curl -LO https://raw.githubusercontent.com/rayanamal/kde-app-dynamic-theme/refs/heads/main/theme-switcher.nu
  1. Open theme-switcher.nu in your text editor.
  • Edit the constants at the start if you need to, as explained in the file.
  • Edit the KDE theme -> app theme mappings to match your preferences.
  1. Add the below to your configuration.nix. Fix the part in FIXME:
  systemd.user.paths.theme-switcher = {
   	wantedBy = [ "default.target" ];
   	pathConfig.PathChanged="%h/.config/kdeglobals";
  };
  
  systemd.user.services.theme-switcher = {
    ## FIXME fix the path to point to the real location of the script.
   	script = "/home/username/.config/nushell/scripts/theme-switcher.nu";
   	path = [ pkgs.nushell ];
  };
  1. Enjoy. If it didn't work for you, open an issue, and I'll do my best.

Note that this doesn't guarantee nu version will stay same, and thus may break in the future.

Contributing

I welcome contributions.

About

A script to automatically switch programs' (alacritty, micro) theme based on KDE global theme.

Topics

Resources

License

Stars

Watchers

Forks