Bug 486193

Summary: Activity overrides for kde-open
Product: [Plasma] kde-cli-tools Reporter: gudvinr+kde
Component: generalAssignee: Aleix Pol <aleixpol>
Status: REPORTED ---    
Severity: normal    
Priority: NOR    
Version First Reported In: 6.0.4   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description gudvinr+kde 2024-04-27 11:27:39 UTC
SUMMARY

Sometimes different workflows require different sets of applications that do the same.
Probably notable example is web browser.
It's so notable that people create workarounds like activity aware firefox (https://matija.suklje.name/introducing-activity-aware-firefox) to solve this issue.

Possible use cases where differentiate by activity can help:
- work and personal e-mail, chat, browser apps
- guest workspace where browser and other apps have disabled history
- creation workspace open .STL in blender, production will use 3D printing software
- dev workspace will open Kate, all other workspaces will use kwrite
- etc

De-facto standard of resolving URIs is xdg-open, which in turn runs kde-open in case if it detects KDE.
Since KDE is in control of what's being opened when an app requests file association, it is also possible to handle overrides in centralized way.

Thus, I'd suggest to add per-activity overrides for default apps:
- If user adds override for web browser in activity settings for activity A and is currently using this activity, kde-open will resolve web browser to value from this setting
- In any other case, e.g. if activity B has different override or doesn't have an override at all, kde-open will either default value or corresponding override

For current users and ones who don't need that nothing will change.

Potential downside is that KIO might have an additional dependency to access activities, but since you can get current activity using d-bus I don't think it's a huge dealbreaker.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 6.0.4
KDE Frameworks Version: 6.1.0
Qt Version: 6.7.0
Kernel Version: 6.6.28-1-lts (64-bit)
Graphics Platform: X11