IBus Theme Tools
Welcome to contribute your translation on Weblate!
Pre-knowledge
IBus has its front-end based on GTK, and GNOME replace that front-end with its GJS version to make it more unified with GNOME.
As a result, in non-GNOME Shell desktop environment, the display effect of IBus is determined by the current GTK theme.
$HOME/.config/gtk-3.0/settings.ini defines the current GTK3 theme and font size.
Example of the content of the file is as follows:
[Settings]
gtk-theme-name=Materia-light
gtk-font-name=更纱黑体 SC 12
In the above content, gtk-theme-name specifies that the current GTK theme is material-light, gtk-font-name specifies that the current font is 更纱黑体 SC and the font size is `12 '.
The IBus font and font size can be changed by modifying the above documents.
As for the color scheme of IBus, you can specify that it uses specific GTK theme when IBus starts, and then customize the color matching of IBus.
Installation
You can directly use pip to install:
pip install ibus-theme-tools
ibus-theme-tools
Or just install manually:
git clone https://github.com/openSUSE/IBus-Theme-Tools.git
cd IBus-Theme-Tools && python3 setup.py install
ibus-theme-tools
If you use Arch Linux, you can also use AUR to install as a system extension:
yay -S ibus-theme-tools
Functionality
Non-GNOME desktop
Generate the IBus GTK theme in a non-GNOME Shell desktop environment and supporting to select a background picture or configure border radius.
Run ibus_theme_tools.py script, operate according to prompted message.
After generating the new theme, just select the theme in the system theme configuration.
If you install themes that support GNOME shell style, you can also choose to extract IBus style, but you can only use it on GNOME desktop.
Customize IBus colors (Create a GTK theme)
Create a GTK3 theme called ibus-custom-theme by running:
mkdir -p $HOME/.themes/ibus-custom-theme/gtk-3.0
$EDITOR $HOME/.themes/ibus-custom-theme/gtk-3.0/gtk.css
then edit the file content. An example can be:
* {
color: #0b141a; /* Font Color */
background-color: #ffffff; /* Background Color */
-gtk-secondary-caret-color: #d4d4d4; /* Highlight Background Color */
}
After that, run the program, then select the theme ibus-custom-theme which you just created.
GNOME desktop
Extracting IBus style from GNOME Shell theme, implement it using CSS parser library tinycss2 in Python. Additional IBus style sheets are generated for users to modify and test.
Run ibus_theme_tools.py script, operate according to prompted message.
When user chooses a theme from the list, this script will first read the theme CSS file, extract the IBus related style classes (.candidate-*), then write it to stylesheet.
Then use the Customize IBus GNOME Shell extension to import and apply themes.
Note: If your IBus style sheet has changed after application, please close and reopen the corresponding Starting from v69, now this extension support stylesheets hot reload, CSS changes will reflect in real-time.custom IME theme to make it effective.
Sample extracted stylesheet: exportedIBusTheme.css
Note
This project was part of the achievement of @HollowMan6 partipating the Google Summer of Code 2021 at OpenSUSE.
Release files for ibus-theme-tools 4.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ibus-theme-tools-4.2.0.tar.gz | 29.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ibus_theme_tools-4.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size:62.8 kB
Release files / ibus-theme-tools-4.2.0.tar.gz
| Download URL | ibus-theme-tools-4.2.0.tar.gz |
|---|---|
| Size | 29.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4abda0099d3204689ace6c220937b6e4a608a8871096036170c6fc44b0d31a19
|
|
BLAKE2b-256 checksum How to use checksums |
1dbea9ac484d386a7fba088f3eda56298ad1bcbfc992213a18587fba0e4fa829
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.5.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.8
|
Release files / ibus_theme_tools-4.2.0-py3-none-any.whl
| Download URL | ibus_theme_tools-4.2.0-py3-none-any.whl |
|---|---|
| Size | 33.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
eeeab5add598f842f1554d4c31548966fbbb5c94863a4fa7826c00e45ba412fb
|
|
BLAKE2b-256 checksum How to use checksums |
0a02b4ae3844ce7c82a556a8cf7c2dbb618602df17e40a2c50be1e62beb22517
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.5.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.8
|