-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No images renderd for icons #48
Comments
Huh, running the example from https://github.com/uriegel/systemicons/ fails, so maybe the bug is not specific to this crate? Any special dependency that I should keep in mind in this context? |
The example's failure seem unrelated, since it's actually SEGFAULT'ing. |
I'm able to replicate this on my Sway machine too. COSMIC Files is no longer using the crate above but instead using features exposed by In any case, I tested all of this with a quick program that you can try too: use std::{fs, path::Path};
use cosmic::widget::icon;
use xdg_mime::SharedMimeInfo;
fn main() {
let path_arg = std::env::args().nth(1).unwrap();
let path = Path::new(&path_arg);
let mime_info = SharedMimeInfo::new();
let mimes = if path.is_file() {
mime_info.get_mime_types_from_file_name(&path_arg)
} else {
let mut mimes = vec![];
for entry in fs::read_dir(path).unwrap() {
let entry = entry.unwrap().path();
let path = entry.to_str().unwrap();
mimes.extend(mime_info.get_mime_types_from_file_name(path));
}
mimes
};
let theme = std::env::args().nth(2).unwrap_or_else(|| "Adwaita".into());
for mime in mimes {
println!("{mime}");
for name in mime_info.lookup_icon_names(&mime) {
let path = icon::from_name(name.clone()).path();
println!("\t[libcosmic] {name} => {path:?}");
let path = freedesktop_icons::lookup(&name).with_theme(&theme).find();
println!("\t[freedesktop-icons] {name} => {path:?}")
}
}
for theme in freedesktop_icons::list_themes() {
println!("Theme: {theme}");
}
} And [package]
name = "mimetest"
version = "0.1.0"
edition = "2021"
[dependencies]
freedesktop-icons = "0.2"
xdg-mime = "0.3"
[dependencies.libcosmic]
git = "https://github.com/pop-os/libcosmic.git"
features = ["desktop"] I tried it on a few folders on my main computer. Every path was EDIT: I updated the example code above. I made progress with it too. |
Fixes: pop-os#48 This PR implements a last resort fallback to the default GTK icon theme if COSMIC's theme is missing. The user is warned if COSMIC's themes aren't available since a correct installation should have them much like GTK should always have Adwaita.
I can only say at the moment, I've run |
@michalfita Make sure you have installed the cosmic-icon-theme as well. |
First of all, I'll clarify that I'm not using cosmic desktop; I'm trying to use cosmic-files under swaywm.
I'm trying out
cosmic-files
, and files don't render icons. The console output reads lots of lines like:A quick glace at the code indicates that this is in
src/mime_icon.rs
,MimeIconCache::get
callssystemicons::get_icon
. I looked at its code and it seems to use Gtk under the hood. I'm usingnemo
(gtk3) as a file manager and icons for it render fine, so I'm fairly certain that a theme is properly installed and configured.The text was updated successfully, but these errors were encountered: