This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Open Google Chrome profile in specific Plasma activity only

Tags: None
(comma "," separated)
johanz
Registered Member
Posts
7
Karma
0
System Configuration
Kubuntu 20.04
KDE Plasma 5.18.8
Linux kernel 5.4.0-105-generic

Background
I used KDE Menu Editor to create separate shortcuts to open three different Google Chrome profiles (i will refer to them as Work, University, and Home). I then added these shortcuts to my Application Launcher favourites so that they appear in three different Plasma Activities, one for each of Work, University, and Home. This all works fine.

Requirement
When I am in an activity, e.g. Home, and click on my Google Chrome Home profile shortcut in the Application Launcher, I want Google Chrome to only appear in the current Home activity.

Problem
When I click on a Google Chrome profile shortcut in the Application Launcher, Google Chrome is opened in all open activities, and not only in the current Plasma activity.

Request
Please help me find a way to configure the application shortcut so that a Google Chrome profile is only opened in the current Plasma activity.

Many thanks for your help.
dzon
Registered Member
Posts
493
Karma
3
Rightclick the desktop application>show in favorites>either tick "on all activities" or "on current activity". To give you an idea, somewhere around 6:10 https://www.youtube.com/watch?v=qAI2NDJadDM
As you see, doesn't need to be from within the menu. There are several ways to do it.


This realm's name is Maya. And she speaks Hertz. But Ahamkara makes a fuzz about it.
johanz
Registered Member
Posts
7
Karma
0
Thank you for your reply, @dzon.

The demonstration in the video does not address my problem. I am already able to show application shortcuts in specific activities. This works well. When I click on a Google Chrome application shortcut, however, it opens Chrome in all my activities, rather than in only the current activity. This does not happen with Dolphin, for example. When I click on a Dolphin application shortcut, it opens the application in the current activity only, and not in all open activities.

dzon wrote:Rightclick the desktop application>show in favorites>either tick "on all activities" or "on current activity". To give you an idea, somewhere around 6:10 https://www.youtube.com/watch?v=qAI2NDJadDM
As you see, doesn't need to be from within the menu. There are several ways to do it.
User avatar
claydoh
Registered Member
Posts
1170
Karma
9
OS
I don't think Chrome follows any sort of Activity settings at all, even after creating custom profile launchers for each profile I *think* I may have gotten this to work with Firefox in the past, but never with Chrome, even with custom window rules.

It has been a short while since I tried, though. Last August or so.


claydoh, proud to be a member of KDE forums since 2008-Oct, and KDE user since 2001
dzon
Registered Member
Posts
493
Karma
3
If that's the case with Chrome ( which I doubt really, don't use it myself), I suggest you create ssb's ( site specific browsers). It's more or less like google-chrome --app. You'd need something like Ice or Webapps (linux mint) to make them. Those will reside in ~/.local/share/applications as desktop apps. Like so: https://imgur.com/a/xhX79R8.
That's the mint webapp tool.


This realm's name is Maya. And she speaks Hertz. But Ahamkara makes a fuzz about it.
dzon
Registered Member
Posts
493
Karma
3
I use it extensively for a couple of reasons. I sometimes switch to a tiled layout at which point drag 'n drop between ssb's is dead easy workflow. I use it as a notes tool, since there is no proper note tool available in kde imo and use Google keep for that purpose. Furthermore, security. For example, on the very rare occasions I use Facecrap, I do that in an already Fort knox hardened firefox ssb, totally isolated from the browser itself. See link. https://imgur.com/a/YqPb00e


This realm's name is Maya. And she speaks Hertz. But Ahamkara makes a fuzz about it.
dzon
Registered Member
Posts
493
Karma
3
Btw. There is a difference between an ssb and a chrome app. The chrome app created in chrome will be like the calendar one in that screenshot. It'll kinda "drag" that currently used profile along ( by lack of better words). The webapp ( the gmail one) , on the other hand, not. It's isolated. https://imgur.com/a/AiMH5r1
As such, once the ssb is created and you launch it for the first time, you'll need to log in, regardless if you're already logged in on that same page in the actual browser.


This realm's name is Maya. And she speaks Hertz. But Ahamkara makes a fuzz about it.
johanz
Registered Member
Posts
7
Karma
0
Many thanks for your responses @claydoh and @dzon. For the moment I will accept that what I need is not possible with reasonable effort.

@dzon: Thanks for pointing me towards chrome apps and ssbs. I will look into these. For the moment, though, I just need chrome browser instances linked to different profiles existing in different activities without having to click around in the "show activities" menu to localise the browsers in the activities.

KDE Plasma and activities are still fantastic nonetheless! They help me remain sane while having to context switch many, many, many times a day.
koffeinfriedhof
Registered Member
Posts
608
Karma
4
OS
Hi!

Perhaps you could script a starter for Chrome that fetches the current activity. A skeleton could look like this
Code: Select all
#!/bin/bash
# get current activity uuid
cur=$(qdbus org.kde.ActivityManager /ActivityManager/Activities org.kde.ActivityManager.Activities.CurrentActivity)

# loop uuid for a match
case $cur in
  4e86aa4e-0a7c-4a4b-82b8-c6298a5a46f9)
    echo chromium --user-data-dir=/path/to/profile1
    ;;
  61e81dc2-1e42-45de-b233-5c8fcbcf5507)
    echo chromium --user-data-dir=/path/to/profile2
    ;;
  656d965f-f389-43b3-a593-f9fa97eedfb6)
    echo chromium --user-data-dir=/path/to/profile3
    ;;
  *)
    echo no default profile defined
    exit 1

esac

The uuids for activities are set in `~/.config/kactivitymanagerc`. Then create a .desktop-file in ~/.local/share/applications/ (or copy the existing one) and change the Exec-line to your script.
johanz
Registered Member
Posts
7
Karma
0
Thank you for the script, @koffeinfriedhof. I will give it a try.


Bookmarks



Who is online

Registered users: abc72656, Bing [Bot], daret, Google [Bot], Sogou [Bot], Yahoo [Bot]