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

Plasma Integration + Krunner + system / get browser tabs?

Tags: None
(comma "," separated)
witoldor
Registered Member
Posts
10
Karma
0
Hello awesome guys :),

I. I would like to ask if there is a way to narrow search results in krunner to only show browser tabs?
like:

Code: Select all
browsertabs:slack


I would like to narrow categories only to browser tabs

I know there is the way which I found here but it opens "other instance of krunner already narrowed"
link to this new instance of krunner is here:
https://wiki.archlinux.org/title/KRunne ... ve_windows

II. is there anyway to recieve from konsole / terminal information of opened tabs in chrome via command?
I m a little bit greenhorn but I assume that plasma integration stores somewhere in system this info.
However I m greenhorn and can't read source code :(.

I would like to create script which toggle slack in chrome.

I know bash scripting and xdotool so only thing from you guys is if there is way to get opened tabs via plasma integration in terminal using qdbus or
sth like this?


the example script, would work like this:

1. checks if "slack" is opened in one of chrome tabs
2. if it is -> go to chrome tab with opened slack
3. if its not than open chrome with slack's url

but the case with the slack script is out of scope. The main question is "if there's the way to get tab info using plasma integration"

Thanks in advance, you're doing awesome job!
dzon
Registered Member
Posts
493
Karma
3
Not even sure if I understand this question. If I get it right, you actually just want a shortcut to Slack? If so, you can create that as /usr/bin/chrome /url/.
Or, if you want it cleaner, you can have that as a ssb ( in web app form). https://imgur.com/a/FJ5n1Se, or create a desktop app in Chrome itself.


This realm's name is Maya. And she speaks Hertz. But Ahamkara makes a fuzz about it.
witoldor
Registered Member
Posts
10
Karma
0
@dzon

Thanks for suggestions! it probably can be done with ur solution also :)

More in depth explanation in image:
https://i.imgur.com/PG1PlkH.png

I managed to achieve that some arround way but hey, it works xD

I hacked this using this shell script (chrome extensions: plasma integration needs to be installed in order it to work ):
Code: Select all
#!/bin/bash

# this line fixing my PATH cuase linuxbrew overwrittes some of needed kde packages. Don't mind this
export PATH="/usr/bin:$HOME/.local/bin:$PATH:$HOME/phpstorm/PhpStorm-223.7571.212/bin/"

# I need to check how to get data about opened tabs via command line to check if slack exists
# this one opens slack in chrome browser if slack is opened
qdbus org.kde.krunner /App querySingleRunner browsertabs 'Frontkom - Slack'
xdotool key Return

sleep 1
# this checks if krunner still runs, if runs it means that there is no slack tab window
isSlack=$(xdotool search --all --onlyvisible --classname "krunner")
if [ ! -z $isSlack ]; then
   wmctrl -c "krunner"   
   google-chrome "https://app.slack.com/client/T02NCLXV2/D01PGAK30Q3" &2>/dev/null &
fi

# this commend is just a "console.log" helps quickly debugging whats going on ;)
# notify-send "hello from krunner process"



Than bind this script to "custom shortkeys" for example into Super_L+s
`xdotool keyup Supler_L+s ; sh /path/to/toggle/script`


However thank You for this idea with "app in window".
Whats the abbreviation called "ssb"?
Do you know quick way to create this "web apps" based on links?
dzon
Registered Member
Posts
493
Karma
3
Ssb means site specific browser. I use it for a bunch of reasons. For instance, security/privacy. Due to fingerprinting and such, it is wise not to open certain sites in the same browser. Especially in browsers like self entitled privacy safe firefox which doesn't randomize profiles to begin with. Brave, for example, does. Chrome is a total disaster, but that's another story. Anyhow, I open certain sites separate, especially firefox ( to which I even add an arkenfox user.js and a temporary container addon). The second reason is that I often switch to a tiled layout. Having ssb's saves screen real estate since there is no browser..um..toolbar and such. A third reason is that it can function as, how to say, a replacement for an application. For instance. A note taker. Besides for the quick notes and such for which I use the to-do widget, I think there isn't a single good note app available. At least, not for what I need. Now, since I have an android phone, I have a google account and as such a couple of Google apps. Keep and Drive being one of them. For me, keep is ideal since I can drag 'n drop whatever, do whatever and as a bonus I have it synced to my phone. Same with Drive. I don't need a google account on my computer, nore a drive section in my file manager. I can simply drag stuff in the ssb window. Easy peasy.
Now, ssb itself. It's pretty much the same as creating an application from within your browser. But better, cleaner. And with some additional options that are not available when created with the browser itself. Back in the day, it was Peppermint OS that first integrated it into their desktop as Ice. Linux mint adapted it and it's now available from their repos. I always install it as a deb and I'm not sure if it's available in another format. Flatpak, appimg....I dunno.
In either case, ssb most certainly have advantages in terms of privacy, praticality...etc. As a sidenote. Say you run, for example, YouTube, as an ssb, you'll have no backbutton. Same happens with the extension "open as pop up" btw. So, myself, I created a back button desktop application with xdotool. It's that laptop icon in my panel. In the second picture you'll see the tool ( webapp-manager). In the third panel you'll see a firefox ssb (with a toolbar as option) and a regular brave window with the "open as popup" extension ( which, by no means is the same thing as ssb).https://imgur.com/a/ijv9f9d


This realm's name is Maya. And she speaks Hertz. But Ahamkara makes a fuzz about it.
dzon
Registered Member
Posts
493
Karma
3
Forgot to mention. Of course they "install" as desktop application, reside in ~/.local/share/applications, so you can put them on a panel, menu....https://imgur.com/a/yMmOdUG


This realm's name is Maya. And she speaks Hertz. But Ahamkara makes a fuzz about it.
dzon
Registered Member
Posts
493
Karma
3
Seems to me that that script is a bit...overload. Anywho...if you want that, you could make an application just for that. Something like:

[Desktop Entry]
Comment=Slack
Exec=your xdotool command
GenericName=Slack
Icon=some icon
MimeType=
Name=Slack
NoDisplay=false
Path=
StartupNotify=true
Terminal=false
TerminalOptions=
Type=Application
X-DBUS-ServiceName=
X-DBUS-StartupType=
X-KDE-SubstituteUID=false
X-KDE-Username=


This realm's name is Maya. And she speaks Hertz. But Ahamkara makes a fuzz about it.
dzon
Registered Member
Posts
493
Karma
3
One more thing. Since you're using Chrome and you want to install an extension in such a web app, you need to open a new tab ( ctrl+t). That will open a regular default browser window by with you can go to the webstore and get the particular extension. For example, gmail dark: https://imgur.com/a/EEKzcJL
Keep in mind though that Chromiums and Firecrap alike are about to use the manifest v3. That means that certain stuff like adblockers will no longer work. Has nothing to do with the webapp, but with the browser itself.
That in itself is another good reason to use an ssb. Whilst it will not block ads ( and other snooping) on certain webapp url's, the fingerprinting across tabs is non existing since there are none. And thus no favicon fingerprinting as well.
And as far as self proclaimed privacy browser firecrap goes, you can install an arkenfox user.js in the profile you'll find in ~/.local/share/ice/firefox/. If you do that, the firefox webapp will look a bit strange in the sense that the actual page will not touch the browser. That's because of a setting in the user.js that blocks canvas fingerprinting ( aka, tracking by canvas size). Depending if you created a firefox webapp with a toolbar or not, hitting alt will open the menubar at which point you can install addons.
Here's an example of such a site in a firecrap webapp with a custom user.js.https://imgur.com/a/EnrWAOw


This realm's name is Maya. And she speaks Hertz. But Ahamkara makes a fuzz about it.
witoldor
Registered Member
Posts
10
Karma
0
@dzon Thanks a lot for your excessive answet. Sorry it took me so long :(

I like this ssb approach u mentioned! It's the best. Also nice tilling you got there :).
I tried tiling its not for me I prefer to map my apps with superbutton+<whatever key to app> and toggle them when I need them.
I m a pianist so I quickly remember all key combinations. And I prefer to have one app per screen.

Long things short.. For those who wonder how to create ssb applications:
1. go to chrome / brave
2. go to website you want to add as ssb for example youtube.com
3. click 3 dots
4. more tools
5. create shortcut

Here is an image of how:
https://imgur.com/PfuRdf8


For adblockers dzon I heared about this however I m using VPN. I wonder if VPN also will stop working?
For youtube I bought premium cause my family using it on TV via smart Chrome device and I didnt find a way to block there ads on TV :(.
dzon
Registered Member
Posts
493
Karma
3
You're welcome. Yeah, you can create a specific app via a chromium browser. But ssb's have advantages. 1) Firefox doesn't support the feature natively (it used to) 2)you can't make incognitos via browser 3)everytime you make an app via the browser, the page (window) you made will be loaded with all the extensions that are on the browser. Personally, I don't need all the extensions on every app-url at all. For instance, I don't need the simple tab order extension on them. I also don't need youtube tweaks, open as popup and some....And it works vice versa. I might need an extension on a specific ssb but not on my browser. Just sayin'.
No, vpn as such will not disappear. But Google's implementing yet another scam to 1) force as much ads 2) have more control. Google has a ....specific agenda. Certain search terms will not work ( you can check that by doing certain searches in different search engines), that's a fact. Besides that ( depending on your country), typing certain words in, say, google docs, will not work. It will constantly pop up a window with an alternative. That's a fact. They're also planning to block certain content you want to share via drive and even gmail. All facts. That drive and gmail blocking is not yet implemented ( at least, not here) but it'll happen. That has nothing to do with a vpn though.
Google's greedy megalomaniacal fat fingering is everywhere and their ad pushing is...
I have this "search picture on the internet" service menu. Good stuff, but the google entry has gone useless since they switched their picture page to....google lens which is nearly all commercial.
So, for one, it's because of this increasing bias on the lot of them, I run heavily hardened ssb's with firefox, the self proclaimed privacy respecting browser ( total bollocks of course).
https://imgur.com/a/mpriOA2


This realm's name is Maya. And she speaks Hertz. But Ahamkara makes a fuzz about it.


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Google [Bot], Yahoo [Bot]