On Sat, Mar 02, 2019 at 09:32:38AM -0600, Daniel Allcock wrote:
> Thank you David. It seems, though, to be more complicated than that.
> 
> > On 3/1/19 8:54 PM, Daniel Allcock wrote:
> > > Hello,
> > > I would like to understand what to do to customize the icons
> > > that appear in the Q menu for template and app vms.
> > > The only way I have found that works is to overwrite icon
> > > files in /usr/share/icons/Adwaita/* in the template vm.
> > > chose that icon theme in xfce settings.  Everything just works.  
> > 
> > I don't know about Adwaita or anything, but Qubes OS adheres to the 
> > Freedesktop Standard [1] (I guess version 1.0 though).
> > 
> > So the entire menu incl. icons is managed by *.desktop and *.menu
> > files in dom0. Nothing is imported from within any VM.
> 
> the vm's do communicate their desktop files to dom0, and icons for
> them.  This is what populates the directories in dom0 that produce
> the Q menu.  Whenever you install software in a template vm using
> dnf, it says "notifying dom0 about newly installed applications..."
> Whenever you choose "refresh applications" in Qubes Manager, dom0
> fires up the underlying template and reimports the desktop and icon
> files.
> 
> The basic mechanism in the Freedesktop standard is that that each
> desktop file specifies an icon, eg "Icon=utilities-terminal".
> When it comes time to display an icon, the system looks in the user's
> selected icon theme for a file of that name (perhaps with a
> suffix like .svg or .png).  That icon theme may specify a fallback
> icon theme, where the system will look if it doesn't find an icon
> of that name.  The fallback can have fallbacks, etc, with "hicolor"
> being the icon theme of last resort. (This theme might not appear
> in menus, for example it doesn't appear in xfce's icon theme setting
> screen.  But it is present in /usr/share/icons.)
> 
> The point is that what icons are displayed has two inputs: the icon
> names in the desktop files, and the user's choice of icon theme, which
> maps those icon names to actual image files.  What I would like
> to understand is how qubes handles this.  It resolves the icon
> names to image files in some way, imports the icons to dom0,
> and colorizes them.  How does the resolution work?
> 
> I had two guesses, both
> seemingly reasonable but neither correct. (For each appvm, it might
> use the icon theme setting of the user account in that appvm.  Or,
> dom0 might use the theme in the appvm that has the same name
> as the theme chosen in dom0.)
> 
> At this point my hypothesis is that the
> communication-of-icons-to-dom0 process 
> (1) completely ignores appvms in favor of their underlying templates. 
> (2) completely ignores icon theme settings, just using Adwaita icons
> (from the template vm; it does not use, or perhaps uses at a lower
> priority, the Adwaita icons already present in dom0). 
> 
> Would appreciate any info, even just confirmation of this.
> 
> Thank you,
> Daniel
> 

Hi Daniel,

It's some time since I looked at this, but I had a quick look at the
code. Take any of this with a (large) pinch of salt, but it may help you
to get to the right place.

I think the magic happens in
/usr/lib/python3.5/site-packages/qubesappmenus/receive.py .
This is where the icon directory is created, and icons are picked up
from the templates.(Yes, as you  say, they come from the template).
appmenus in the template are parsed, and the contents written in to
appmenu templates in dom0.

The icon file is read from the desktop file referenced in the template,
and copied to dom0. This is done by a call to imgconverter.
You'll find there a function get_xdg_icon_from_vm which attempts to
copy and sanitise an icon image from the template.

For applications installed in qubes, have a look at:
https://www.qubes-os.org/doc/managing-appvm-shortcuts/

So I think  your hypothesis 1 is correct, and 2 is partly right.

hth

unman

-- 
You received this message because you are subscribed to the Google Groups 
"qubes-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to qubes-users+unsubscr...@googlegroups.com.
To post to this group, send email to qubes-users@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/qubes-users/20190302161740.bi4kcobu4a3lx37c%40thirdeyesecurity.org.
For more options, visit https://groups.google.com/d/optout.

Reply via email to