Khameleon creates window rules and color themes for KDE to match the look of popular Linux apps.
Khameleon comes with two basic commands:
khameleon-update
generates any window rules basedkhameleon-daemon
waits for any config files to change and updates window rules on demand
- Python 3
pip3 install inotify
pip3 install dbus
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.
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.
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.
Yes. Simply run khameleon-update
whenever you want manually.
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 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 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.
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
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 |
Check if a program is installed essentially calls which program
to determine
if the command exists.