Open Djaler opened 7 years ago
This is not that hard.
theme is chosen on this line of code https://github.com/KELiON/cerebro/blob/master/app/main/plugins/core/basic-apps/linux.js#L49
You can get default icon theme for gnome for example this way: THEME=$(gsettings get org.gnome.desktop.interface icon-theme | tr -d "'")
. This just get you currently enabled theme and not path, so you would have to figure out whether it's in /usr/share/
or in home directory.
But I doubt that developers would accept pull request which works just for gnome.
To be fair this command returns a correct GTK theme even on my ArchLinux ("Adwaita" in my case).
However, I can also see that on my linux none of the installed apps placed their icons in the /usr/share/icons/Adwaita/**/apps/
, they only placed them in /usr/share/icons/hicolor/**/apps/
folder.
I think it makes sense to accept a pull request which will look in the theme's folder in addition to the default hicolor
one. Just add the line to look in the theme's folder above the line mentioned by @pkajaba, so that it is considered first, but there is still a fallback to the default hicolor
.
@maximbaz that command is not about distribution but desktop. I doubt that gsettings
would work under KDE or anything what is not gnome.
It makes for all applications put their icons into hicolor
folder since it's default theme defined by freedesktop: https://specifications.freedesktop.org/icon-theme-spec/latest/ar01s03.html
This is quite funny thing since Settings
applications does not have icons inside hicolor
folder so it does not match anything.
Thanks for the hints, it was interesting to read about this. As it happens, I don't have gnome desktop environment installed, but I do have some bits and pieces of it on my box that were installed by other apps as dependencies (like gtk2
, gtk3
, and specifically glib2
which provides gsettings
binary).
In any case, if there will be a pull request, I would be happy to test it.
Ok, summarizing: looks like we can use gsettings get org.gnome.desktop.interface icon-theme | tr -d "'"
to get theme and after that look up for app icon in the same folders, that we use now + replace hicolor
with current theme.
Should be easy change! Thanks @pkajaba
@KELiON hicolor
should not be replaced, like I mentioned earlier all my app icons are in hicolor
despite the fact that my reported theme is Adwaita
. Just look in the theme folder first, and if the icon is not there, look in hicolor
.
It's bit messy, but to summarize it:
hicolor
is default by standard, it should everywhere. gsettings get org.gnome.desktop.interface icon-theme | tr -d "'"
will work just when you have some gnome packages installed (won't work everywhere)/usr/share
but it can be also in ~/.icons
The proper way how to tackle this is do some research how KDE
or other alternatives handle this and try all possible paths and when icon is not found fallback to 'hicolor'
Up
@KELiON, please :D
Hi all,
I would love, love, love to see this feature in cerebro. if anyone would be able to make cerebro use the theme of my choice, that would make me switch to cerebro as my go to app for starting, searching, and everything else.
Now, I still sort of switch between the system stuff (I'm using Linux Mint, cinnamon desktop) and cerebro.
Is there anything I could do to implement this feature?
It would be very cool if on Linux Cerebro will use app icons from active theme, not default.