Skip to content

krisives/khameleon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Khameleon creates window rules and color themes for KDE to match the look of popular Linux apps.

Basic Usage

Khameleon comes with two basic commands:

  • khameleon-update generates any window rules based
  • khameleon-daemon waits for any config files to change and updates window rules on demand

Requirements

  • Python 3
  • pip3 install inotify
  • pip3 install dbus

FAQ

Will Khameleon work with my existing window rules?

Yes. Khameleon looks for for KDE window rules where the window class (wmclass) matching method is being used, which is how most window rules using the GUI are created when using the detector tool.

How can I easily remove all the rules created by Khameleon?

All rules Khameleon creates will contain the suffix (khameleon) making it easy to cleanup using the GUI tool if desired. There may be a companion helper script such as khameleon-cleanup or similar in the future.

Will Khameleon update window rules if I switch between dark and light themes?

Yes. Khameleon is designed to check if you are using a light or dark theme and then detect if supported apps are dark or light then update window rules such that they all match.

Can I use Khameleon without running the daemon?

Yes. Simply run khameleon-update whenever you want manually.

Add an App

Don't see your favorite app? Create a new file inside the plugins/ directory with contents like this:

def check_active(kha):
  return kha.check_installed('someapp')

def get_files(kha):
  return ['~/somefile']

def update(kha):
  # Do something cool here
  pass

In all of the functions declared here kha is a handle to the Khameleon object.

check_active(kha)

Check if an app is installed and therefor the plugin should be active. Most of the time this should end up calling kha.check_installed('something') where something is the Linux command that would run the app. This helps avoid creating window rules that aren't going to be used.

get_files(kha)

Get a list of files that if modified should cause this plugin to update. This is used by the khameleon-daemon to watch files and automatically update when configuration files are changed.

update(kha)

Load app-specific configuration files and determine the best color scheme to apply to match. Most plugins will want to end this with a call to Khameleon.rule() to apply a window rule

API

Khameleon.rule(self, **params)

Ensure a window rule exists with the given parameters, which can include:

Param Description
wmclass Match based on a window class
dark Set if the window should have the default dark theme
decocolor Set if you want to apply a specific color scheme

Khameleon.check_installed(self, program)

Check if a program is installed essentially calls which program to determine if the command exists.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages