1
0
Fork 0
knowledge-base/KB/Linux/Desktop/Theming Qt and Gtk.md

80 lines
6 KiB
Markdown
Raw Normal View History

2022-09-04 12:54:22 +00:00
---
creation date: 2022-01-08
tags: [note,qt,gtk,linux,archlinux]
---
2022-09-04 13:51:53 +00:00
Based on [ArchLinux Wiki](https://wiki.archlinux.org/title/Uniform_look_for_Qt_and_GTK_applications).
2022-09-04 12:54:22 +00:00
2022-09-04 13:51:53 +00:00
Unify Qt5/Qt6 and GTK2/GTK3/GTK4 design.
2022-09-04 12:54:22 +00:00
Of course, this depends on your personal preference. If you pick
2022-09-04 13:51:53 +00:00
* GNOME the default _Adwaita (dark)_ theme is very pleasing (also applied to Qt and Gtk3) and
* for all other scenarios, _Arc (Darker)_ looks great, but of course, depends on your personal preferences.
2022-09-04 12:54:22 +00:00
## Theme
2022-09-04 13:51:53 +00:00
To unify look in GTK and Qt applications GTK and Qt applications need to be themed in the same way. To have the most unified look afterwards, it's recommended that you look up if your theme of choice supports GTK2, GTK3, GTK4, Qt5 and Qt6. The Qt variants with `kvantum` or an explicit Qt theme for it.
2022-09-04 12:54:22 +00:00
2022-09-04 13:51:53 +00:00
On ArchLinux most _kvantum_ themes are in the AUR and prefixed with `kvantum-theme-...`.
2022-09-04 12:54:22 +00:00
2022-09-04 13:51:53 +00:00
### Qt applications
2022-09-04 12:54:22 +00:00
2022-09-04 13:51:53 +00:00
In any environment (your shell env and probably `envvars` of `environment.d`) source, e.g. `.zshenv`, set `export QT_QPA_PLATFORMTHEME="qt5ct"` (which is also forward compatible with `qt6ct`).
2022-09-04 12:54:22 +00:00
2022-09-04 13:51:53 +00:00
| Variant | Plain Adwaita | Backported Adwaita (Gtk3) + Qt5/6 | Any other theme, example Arc Darker |
|:------------------------------------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Required packages | <div><span style="background-color: var(--background-primary); color: var(--text-normal); font-family: var(--font-interface);">qt5ct</span><br></div><div>qt6ct<br><div>adwaita-qt5</div><div>adwaita-qt6</div></div> | <div><span style="background-color: var(--background-primary); color: var(--text-normal); font-family: var(--font-interface);">qt5ct</span><br></div><div>qt6ct</div><div>adw-gtk3<br><div>kvantum</div></div><div>kvantum-theme-libadwaita-git</div> | <div><span style="background-color: var(--background-primary); color: var(--text-normal); font-family: var(--font-interface);">qt5ct</span><br></div><div>qt6ct<br><div>kvantum</div></div><div>kvantum-theme-arc</div><div>arc-gtk-theme</div> |
| Instructions&nbsp; in qt5ct / qt6ct | Set Adwaita as theme | Set kvantum or kvantum-dark as theme | Set kvantum or kvantum-dark as theme |
| Instructions in Kvantum | - | Select KvAdwaita or KvAdwaitaDark | Select KvArcDarker |
2022-09-04 12:54:22 +00:00
2022-09-04 13:51:53 +00:00
Depending on your personal preference, you can also instruct `qt5ct` / `qt6ct` to use GTK style dialogs.
2022-09-04 12:54:22 +00:00
2022-09-04 13:51:53 +00:00
### Gtk 2 and Gtk 3 applications
2022-09-04 12:54:22 +00:00
2022-09-04 13:51:53 +00:00
Set your proper theme via respective utilities like `nwg-look` (also works for [[KB/Linux/Desktop/sway]]) and/or GNOME Tweaks for GTK 4.
2022-09-04 12:54:22 +00:00
2022-09-04 13:51:53 +00:00
If your theme doesn't support Gtk 2, you might need to look for the correct theme first!
2022-09-04 12:54:22 +00:00
## Font
2022-09-04 13:51:53 +00:00
_Noto Sans Regular (11)_ seems great. Set it everywhere:
2022-09-04 12:54:22 +00:00
2022-09-04 13:51:53 +00:00
* `qt5ct` for Qt 5
* `qt6ct` for Qt 6
* `nwg-look` and/or GNOME Tweaks for GTK
2022-09-04 12:54:22 +00:00
2022-09-04 13:51:53 +00:00
In addition, you can adapt your `fontconfig/` folder contents. See [[KB/Linux/Desktop/Fonts]].
2022-09-04 12:54:22 +00:00
## Icons
`papirus-icon-theme` looks great, but you should also install some fallbacks.
```shell
papirus-icon-theme
arc-icon-theme
adwaita-icon-theme
```
2022-09-04 13:51:53 +00:00
Set it everywhere:
* `qt5ct` for Qt 5
* `qt6ct` for Qt 6
* `nwg-look` and/or GNOME Tweaks for GTK
2022-09-04 12:54:22 +00:00
## Application specifics
* rofi: Dark
* In Firefox install theme and use
* In Thunderbird disable/enable system theme if changes are not applied
* JetBrains products
* Default or Dracula Official
* Don't set anything in Appearance fonts
* Change editor to Noto Mono with 15px and 1.3 line height
* Visual Studio Code
* Default or Dracula Official
* 16px font size everywhere
* Alacritty
* base16-atelier-forest
* GNOME Terminal
* Prefer dark