| Crates.io | linux_theme |
| lib.rs | linux_theme |
| version | 0.2.1 |
| created_at | 2026-01-15 06:40:04.803565+00 |
| updated_at | 2026-01-15 19:16:10.886659+00 |
| description | 🦀🦀 Obtain the current color theme in your system! 🎨🎨 |
| homepage | |
| repository | https://github.com/elliotnash/linux_theme |
| max_upload_size | |
| id | 2044717 |
| size | 107,539 |
Obtain the current color theme in your system!
[!NOTE]
This crate is a republished version of the originalrusty_themyby natalia-asteria. The original repository has been deleted, so this crate has been republished with some changes under the namelinux_theme.
$ cargo add linux_theme
It's easy! Just enable the gtk feature and use
linux_theme::gtk::current::current()
You can see the example here!
cargo run --example current_theme --features gtk
The output will be a JSON dump of the colors that I hope, get applied by GTK for its applications.
(
{
...
"dialog_bg_color": RGBA(
RGBA {
red: 247,
green: 219,
blue: 239,
alpha: 255,
},
),
"light_4": RGBA(
RGBA {
red: 192,
green: 191,
blue: 188,
alpha: 255,
},
),
"red_4": RGBA(
RGBA {
red: 192,
green: 28,
blue: 40,
alpha: 255,
},
),
...
},
[ /* any errors go here */ ],
)
Custom colors that are defined by you will also be included! Not just the ones from GTK or Libadwaita.
Are you confused on what color to consume? Good place to start would be to visit the Libadwaita docs on Named Colors or play with the Gradience app!
Unfortunately, they are not supported yet.
But... feel free to make a PR!
Licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.