Set default browser per workspace or application

Please post suggestions for improvement of Cinnamon on:
https://github.com/linuxmint/Cinnamon
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Post Reply
cbrevard
Level 1
Level 1
Posts: 34
Joined: Thu May 23, 2019 9:01 am

Set default browser per workspace or application

Post by cbrevard »

I know there's no easy way of doing this, but I thought I'd ask anyway, to get some potential leads for scripting a solution.

Ideally, I'd be able to click on links within applications (in a given Cinnamon workspace) and have those links open in the same browser (or be passed into a function that invokes a command). If that's not feasible, then it would be nice to be able to set a default browser for an application that presents links to the user (regardless of what workspace that application is in).

From what little I've read, it's xdg-open that handles the event that results from clicking a link in an application. Is this true for most applications? All of them?

Apart from xdg-open and the other utilities in the xdg-utils package, I'm familiar with wmctrl, but that's about it in terms of utilities or tools specific to this domain. Are there other workspace-specific, desktop environment, or window-manager specific utilities out there that might be of use?

Thanks,
CB
mikeflan
Level 16
Level 16
Posts: 6741
Joined: Sun Apr 26, 2020 9:28 am
Location: Houston, TX

Re: Set default browser per workspace or application

Post by mikeflan »

I don't know how to do that, but I will post some links while bumping your post:
https://blog.kagesenshi.org/2021/02/cus ... ndler.html
https://unix.stackexchange.com/question ... nvironment
cbrevard
Level 1
Level 1
Posts: 34
Joined: Thu May 23, 2019 9:01 am

Re: Set default browser per workspace or application

Post by cbrevard »

Thanks, @mikeflan, for the links. I'll take a look.
User avatar
JeremyS
Level 1
Level 1
Posts: 1
Joined: Wed Nov 29, 2023 10:22 am
Contact:

Re: Set default browser per workspace or application

Post by JeremyS »

You can try writing a script that uses xdg-open to open links in a specified browser. Additionally, you can use the update-alternatives command to set the default browser. Regarding xdg-open, yes, most applications use it to handle events of opening links. However, there may be exceptions, so testing is crucial for specific applications.
Post Reply

Return to “Cinnamon”