In KDE plasma 5, how to I create standalone launchers/desktop shortcuts to web apps like gmail?

12,803

Solution 1

The Problem

The problem causing this issue is that KDE identifies applications for the show a launcher when not running feature by their X11 window class, and chrome does not change the X11 window class, but rather leaves it as google-chrome and instead changes the classname to a unique value.

The Solution

Thankfully, it's possible to force the gmail window to behave the way you want.

  1. Install an application called xdotool with your package manager.
  2. Open up the file manager and browse to ~/.local/share/applications/.
  3. Open the .desktop file there that chrome created for your gmail webapp with a text editor
  4. Note the value of StartupWmClass
  5. append the following to the Exec line: && xdotool search --sync --classname <value> set_window --class <value>, replacing <value> with the value of StartupWmClass.

Here's an example from another webapp I've edited this way:

[Desktop Entry]
Comment=
Exec=/opt/google/chrome/google-chrome --profile-directory=Default --app-id=hlomdbnjeagldabepchlcdhkaagfedim && xdotool search --sync --classname crx_hlomdbnjeagldabepchlcdhkaagfedim set_window --class crx_hlomdbnjeagldabepchlcdhkaagfedim
Icon=chrome-hlomdbnjeagldabepchlcdhkaagfedim-Default
Name=Outlook 365
NoDisplay=false
Path[$e]=
StartupNotify=true
StartupWMClass=crx_hlomdbnjeagldabepchlcdhkaagfedim
Terminal=0
TerminalOptions=
Type=Application
Version=1.0
X-KDE-SubstituteUID=false
X-KDE-Username=

That change will change the window class for the webapp to what KDE is expecting it to be. The app icon may briefly show as the normal chrome icon, but it will quickly be replaced by the proper icon as set in the .desktop file as soon as xdotool completes.

Solution 2

Try going to chrome://apps , rigth clicking and app and selecting "open as window"

Source: https://www.wikihow.com/Turn-Your-Favorite-Website-Into-Desktop-Apps-With-Google-Chrome

Share:
12,803

Related videos on Youtube

joelostblom
Author by

joelostblom

Updated on September 18, 2022

Comments

  • joelostblom
    joelostblom almost 2 years

    I use two operating systems daily: Ubuntu 15.04 with the Unity desktop environment and Manjaro with KDE-plasma-5 desktop. I spend a good chunk of time in my email and it is convenient for me to have it behave like a stanalone program, rather than a tab in chromium.

    On both systems, I can create a launcher for gmail, via the settings menu under "More tools". On Ubuntu/Unity, I can add this launcher to the panel and it will act as a standalone program with its own separate icon and keyboard shortcut. On Manjaro/KDE, I the gmail shortcut displays a unique icon, but as soon as the program is started, the gmail window will be recognized as a chromium window and it will be merged with existing chromium windows in the panel instead of retaining the icon that is displayed on the shortcut. I have also tried to create the shortcuts directly with command line flags as described in this rather old post, but the behavior is the same.

    How can I mimic the Unity behavior in KDE? Is it possible to get a webapp to behave like a standalone program or will it always merge into any existing open chromium window?

    • Admin
      Admin over 8 years
      So you just want to run a stand-alone instance of a web browser, separate from the regular browser's profile? Try a web search for that? Firefox works great with "-no-remote" and "-p"
    • Admin
      Admin over 8 years
      As I mentioned, I have tried running chrome with the command line flags for a single separate window (both app and url), but this is still merged with any open chrome window. I tried your firefox suggestion and they same thing happens, the window is grouped in the panel together with any other open firefox instance. Using your suggestions, I also have to choose the profile each time rather than having gmail open directly.
  • joelostblom
    joelostblom about 8 years
    Thanks for the answer! I have abandoned KDE since I asked this question, but it is good to know that there is a solution to this problem if I ever think about switching back.
  • hurikhan77
    hurikhan77 over 7 years
    I think this is fixed with Plasma 5.8, at least it works for me with Chrome (but not Chromium).
  • stonecrusher
    stonecrusher over 7 years
    @hurikhan77 interesting that chrome would work but not chromium. My kde desktop is down right now due to nouveau failings, but I hope you're right and this ugly hack isn't needed anymore!
  • Jesse
    Jesse over 7 years
    I tried with plasma 5.8.2 and chrome 54.0.2840.71, under archlinux, and it still doesn't work. It used to work even for chromium a few days ago, but it stopped, probably because of an update.
  • hurikhan77
    hurikhan77 over 7 years
    @Jesse Yes, with the latest upgrade this has changed back to the old behavior for me, too. I wonder which patch it is.
  • Toto
    Toto over 2 years
    While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review