On Sun, Sep 18, 2016 at 9:13 PM, Marek Marczykowski-Górecki <
marma...@invisiblethingslab.com> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> On Sun, Sep 18, 2016 at 09:09:58PM +0100, IX4 Svs wrote:
> > On Sat, Sep 17, 2016 at 11:41 PM, Marek Marczykowski-Górecki <
> > marma...@invisiblethingslab.com> wrote:
> >
> > > -----BEGIN PGP SIGNED MESSAGE-----
> > > Hash: SHA256
> > >
> > > On Sat, Sep 17, 2016 at 03:52:17PM +0100, IX4 Svs wrote:
> > > > On Wed, Sep 14, 2016 at 9:26 AM, Marek Marczykowski-Górecki <
> > > > marma...@invisiblethingslab.com> wrote:
> > > >
> > > > > -----BEGIN PGP SIGNED MESSAGE-----
> > > > > Hash: SHA256
> > > > >
> > > > > On Wed, Sep 07, 2016 at 11:38:55PM +0100, IX4 Svs wrote:
> > > > > > On Thu, Sep 1, 2016 at 8:41 AM, IX4 Svs <ix4...@gmail.com>
> wrote:
> > > > > >
> > > > > > > On Thu, Sep 1, 2016 at 2:21 AM, Andrew David Wong <
> > > a...@qubes-os.org>
> > > > > > > wrote:
> > > > > > >
> > > > > > >> -----BEGIN PGP SIGNED MESSAGE-----
> > > > > > >> Hash: SHA512
> > > > > > >>
> > > > > > >> On 2016-08-31 15:50, IX4 Svs wrote:
> > > > > > >> > On Wed, Aug 24, 2016 at 11:10 PM, Andrew David Wong <
> > > > > a...@qubes-os.org>
> > > > > > >> > wrote:
> > > > > > >> >
> > > > > > >> >>
> > > > > > >> >> On 2016-08-15 14:43, IX4 Svs wrote:
> > > > > > >> >>> On Mon, Aug 15, 2016 at 10:19 AM, Andrew David Wong <
> > > > > a...@qubes-os.org
> > > > > > >> >
> > > > > > >> >>> wrote:
> > > > > > >> >>>
> > > > > > >> >>>>
> > > > > > >> >>>> On 2016-08-14 15:22, IX4 Svs wrote:
> > > > > > >> >>>>> Just spent a few minutes to figure this out so I
> thought I'd
> > > > > > >> >>>>> share.
> > > > > > >> >>>>>
> > > > > > >> >>>>
> > > > > > >> >>>> Thanks, Alex! Would you mind if we added this to the
> docs at
> > > some
> > > > > > >> >>>> point?
> > > > > > >> >>>>
> > > > > > >> >>>>
> > > > > > >> >>> Not at all - especially if you improve my clumsy way of
> > > creating
> > > > > the
> > > > > > >> >> custom
> > > > > > >> >>> shortcut (steps 7-12) and use the proper Qubes way that
> > > Nicklaus
> > > > > > >> >>> linked to.
> > > > > > >> >>>
> > > > > > >> >>> Cheers,
> > > > > > >> >>>
> > > > > > >> >>> Alex
> > > > > > >> >>>
> > > > > > >> >>
> > > > > > >> >> Added:
> > > > > > >> >>
> > > > > > >> >> https://www.qubes-os.org/doc/signal/
> > > > > > >> >>
> > > > > > >> >>
> > > > > > >> > Andrew, thanks for adding this to the documentation.
> > > > > > >> >
> > > > > > >> > I'm afraid my DIY shortcut kludge does not survive
> > > some(potentially
> > > > > boot
> > > > > > >> > time) script and is wiped away from the taskbar, only to be
> > > > > replaced by
> > > > > > >> a
> > > > > > >> > default "Chrome browser" shortcut. I admit I don't quite
> > > comprehend
> > > > > what
> > > > > > >> > the actual implementation of
> > > > > > >> > https://www.qubes-os.org/doc/managing-appvm-shortcuts/#
> > > > > tocAnchor-1-1-1
> > > > > > >> > should be.
> > > > > > >>
> > > > > > >> Neither do I. I've always make my custom shortcuts the same
> > > general
> > > > > way
> > > > > > >> you do.
> > > > > > >>
> > > > > > >>
> > > > > > > Ah, we have a usability issue here then.
> > > > > > >
> > > > > > >
> > > > > > >> > A worked example that replaces all but the first step of
> the "
> > > > > Creating
> > > > > > >> a
> > > > > > >> > Shortcut in KDE" section of https://www.qubes-os.org/doc/
> > > signal/
> > > > > would
> > > > > > >> be
> > > > > > >> > very much welcome.
> > > > > > >> >
> > > > > > >>
> > > > > > >> Agreed.
> > > > > > >>
> > > > > > >
> > > > > > > Can someone who has figured out how to create one-click
> buttons to
> > > > > launch
> > > > > > > arbitrary applications in AppVMs chime in with an example
> please?
> > > I'll
> > > > > then
> > > > > > > test it and Andrew can stick it in the wiki for all Qubes
> users to
> > > > > benefit.
> > > > > > >
> > > > > >
> > > > > > I had a look myself and may have figured out the "proper" way of
> > > > > creating a
> > > > > > shortcut to launch Signal. By the way I submitted a pull request
> for
> > > the
> > > > > > documentation at https://www.qubes-os.org/doc/m
> > > > > > anaging-appvm-shortcuts/#tocAnchor-1-1-1 because its language is
> > > > > slightly
> > > > > > inaccurate.
> > > > > >
> > > > > > These instructions (after verification) should replace the
> shortcut
> > > > > kludge
> > > > > > of the signal page you created:
> > > > > >
> > > > > > My Signal AppVM uses the fedora-23 template, and I have renamed
> the
> > > > > > .desktop file that Chrome created on that AppVM's desktop to
> > > > > > signal.desktop. Now what?
> > > > > >
> > > > > > 1. Open a dom0 terminal, cd to /var/lib/qubes/vm-templates/
> > > fedora-23/
> > > > > > 2. Copy Signal:/home/user/Desktop/signal.desktop to
> > > > > > dom0:/var/lib/qubes/vm-templates/fedora-23/apps.
> > > templates/signal.desktop
> > > > > > 3. Lightly edit
> > > > > > dom0:/var/lib/qubes/vm-templates/fedora-23/apps.
> > > templates/signal.desktop
> > > > > to
> > > > > > be as follows:
> > > > > >
> > > > > > [Desktop Entry]
> > > > > > Version=1.0
> > > > > > Type=Application
> > > > > > Terminal=false
> > > > > > X-Qubes-VmName=%VMNAME%
> > > > > > Icon=%VMDIR%/apps.icons/signal.png
> > > > > > Name=%VMNAME%: Signal Private Messenger
> > > > > > GenericName=%VMNAME%: Signal
> > > > > > Comment=Private Instant Messenger
> > > > > > Exec=qvm-run -q --tray -a %VMNAME% -- 'qubes-desktop-run
> > > > > > /home/user/Desktop/Signal.desktop'
> > > > > >
> > > > > > 4. Copy
> > > > > > Signal:/rw/home/user/.local/share/icons/hicolor/48x48/
> > > > > apps/chrome-<long_string>-Default.png
> > > > > >  to
> > > > > > dom0:/var/lib/qubes/vm-templates/fedora-23/apps.
> > > > > templates/apps.icons/signal.png
> > > > > >
> > > > > > 5. Copy
> > > > > > dom0:/var/lib/qubes/vm-templates/fedora-23/apps.
> > > > > templates/apps.icons/signal.png
> > > > > > to
> > > > > > dom0:/var/lib/qubes/vm-templates/fedora-23/apps.
> > > > > templates/apps.tempicons/signal.png
> > > > > >
> > > > > > 6. At this point you should be all set. Ensure Qubes knows about
> the
> > > new
> > > > > > menu item you created by starting the fedora-23 template VM and
> then
> > > > > > running in a dom0 terminal: qvm-sync-appmenus fedora-23
> > > > > >
> > > > > > 7. You should now be able to go back to the GUI and from the Q
> menu:
> > > Q ->
> > > > > > Domain: Signal -> Signal: Add more shortcuts...
> > > > > > In the window that will appear, you should now have "Signal
> Private
> > > > > > Messenger" on the left list of available apps. I moved this to
> the
> > > > > > "Selected" list and hit OK, which put the entry in my Q menu.
> > > > > >
> > > > > > 8. Then I went to Q -> Domain: Signal. I right-clicked on
> > > "Signal:Signal
> > > > > > Private Messenger" and selected "Add to panel".
> > > > > >
> > > > > > 9. Success! I now have a button in my KDE panel with which I can
> > > launch
> > > > > > Signal with one click.
> > > > > >
> > > > > > Hope these steps get documented in the wiki (I'm not attempting a
> > > direct
> > > > > > edit lest I break something) and are helpful to people.
> > > > >
> > > > > Content of /var/lib/qubes/vm-templates/fedora-23/apps.templates
> (and
> > > > > other apps.* there) is generated based on /usr/share/applications
> and
> > > > > /usr/local/share/applications in the VM. This include removing from
> > > dom0
> > > > > files not present in the VM.
> > > > > So, instead of copying files manually to dom0, place them in one of
> > > > > those directories (I suggest /usr/share/applications, as it is
> shared
> > > > > with AppVMs), and then request synchronization to dom0:
> > > > >
> > > > >     qvm-sync-appmenus fedora-23
> > > > >
> > > >
> > > > Okay, this looks like a much more reasonable approach, but still no
> cigar
> > > > for me.
> > > >
> > > > I copied
> > > > SignalVM::/home/user/Desktop/chrome-bikioccmkafdpakkkcpdbppfkghcmi
> > > hk-Default.desktop
> > > > to fedora23::/usr/share/applications and then ran
> > > dom0::qvm-sync-appmenus
> > > > fedora-23
> > > >
> > > > It complained "Failed to get icon for
> > > > chrome-bikioccmkafdpakkkcpdbppfkghcmihk-Default.desktop: No icon
> > > received",
> > > > so I also copied
> > > > SignalVM::/home/user/.local/share/icons/hicolor/48x48/apps/chrome-
> > > bikioccmkafdpakkkcpdbppfkghcmihk-Default.png
> > > > to fedora23::/usr/share/icons/hicolor/48x48/ . I then re-ran
> > > > dom0::qvm-sync-appmenus fedora-23 and this time it did not complain.
> > > > Indeed, I now have a menu item with a nice icon available in all
> menus of
> > > > my AppVM.
> > > >
> > > > But enabling the menu item for the SignalVM and then clicking it,
> does
> > > not
> > > > actually launch the application - it has no visible effect, just a
> small
> > > > icon bouncing briefly, then no window. The SignalVM starts, but the
> > > > application doesn't.
> > > >
> > > > Clicking the original .desktop shortcut created inside SignalVM
> continues
> > > > to work fine.
> > > >
> > > >
> > > > Contents of the (working)
> > > > SignalVM:/home/user/Desktop/chrome-bikioccmkafdpakkkcpdbppfkghcmi
> > > hk-Default.desktop:
> > > > #!/usr/bin/env xdg-open
> > > > [Desktop Entry]
> > > > Version=1.0
> > > > Terminal=false
> > > > Type=Application
> > > > Name=Signal Private Messenger
> > > > Exec=/usr/lib64/chromium-browser/chromium-browser.sh
> > > > --profile-directory=Default --app-id=bikioccmkafdpakkkcpdbppfkghcmi
> hk
> > > > Icon=chrome-bikioccmkafdpakkkcpdbppfkghcmihk-Default
> > > > StartupWMClass=crx_bikioccmkafdpakkkcpdbppfkghcmihk
> > > >
> > > > Contents of the (non-working) dom0:/var/lib/qubes/vm-templates/
> > > > fedora-23/apps.templates/chrome-bikioccmkafdpakkkcpdbppfkghcmi
> > > hk-Default.desktop:
> > > > [Desktop Entry]
> > > > Version=1.0
> > > > Type=Application
> > > > Terminal=false
> > > > X-Qubes-VmName=%VMNAME%
> > > > Icon=%VMDIR%/apps.icons/chrome-bikioccmkafdpakkkcpdbppfkghcmi
> > > hk-Default.png
> > > > Name=%VMNAME%: Signal Private Messenger
> > > > Exec=qvm-run -q --tray -a %VMNAME% -- 'qubes-desktop-run
> > > > /usr/share/applications/chrome-bikioccmkafdpakkkcpdbppfkghcmi
> > > hk-Default.desktop'
> > > >
> > > > Have I done something wrong here, or has something been long in
> > > > "translation" by the qvm-sync-appmenus script?
> > >
> > > Both files looks ok. What happens when you execute that qvm-run command
> > > from dom0 terminal? Try adding --pass-io option to get more details.
> And
> > > replace %VMNAME% with actual VM name of course.
> > >
> >
> > It exits with status 1 after 0.3 seconds with:
> >
> > [user@dom0 ~]$ qvm-run -q --tray --pass-io -a Signal --
> 'qubes-desktop-run
> > /usr/share/applications/chrome-bikioccmkafdpakkkcpdbppfkghcmi
> hk-Default.desktop'
> > Traceback (most recent call last):
> >   File "/usr/bin/qubes-desktop-run", line 7, in <module>
> >     launch(*sys.argv[1:])
> >   File "/usr/lib64/python2.7/site-packages/qubes/xdg.py", line 8, in
> launch
> >     launcher = Gio.DesktopAppInfo.new_from_filename(desktop)
> > TypeError: constructor returned NULL
> > [user@dom0 ~]$
>
> Check if all required files do exists in Signal VM. This include
> .desktop file, and the one pointed by Exec= line. Maybe there is some
> broken symlink?
>

You're right. On Signal VM, /usr/share/applications/chrome-
bikioccmkafdpakkkcpdbppfkghcmihk-Default.desktop was simply not there. I
could swear I copied it there with
sudo cp <original shortcut> .

I copied it (I believe) again and it now works as expected - all shortcuts
launch Signal correctly. Thank you for the troubleshooting assistance. I
will document this in the wiki with Andrew's blessing.

Alex

-- 
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/CAEe-%3DTfFuBOjFG8WG-G0hHQmHr8B26%3Dis-jxNfX8E4%2BnW-TC9Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to