Hi,
I’m trying to open a text file from command line, to be opened by default app.
I’m using both next variations:
- xdg-open example.txt
- gio open example.txt
(for "xdg-mime query default “text/plain”, the value is “org.gnome.TextEditor.desktop”)
The result of command depends on whether the text-editor app is already opened.
If it is not, then it will open and the tab of example.txt will be active.
If is already opened, with other files, then I only see a notification message:
“Text editor, example.txt is ready”, but the text editor is not activated/focused.
I was not sure if this is behavior of the shell or the text editor app, so I changed the default opener of txt files from default Text editor, to Codium.
The result is the same, so I assumed its related only to the shell.
And then changed default opener to Firefox.
In Firefox, it always activates the new tab.
So now I’m bit confused.
Is this behavior, of not focusing/activating, is shell only, or also app depending per it’s implementation (maybe obeying some “rule”?), or mix of both ?
Is there any way to change this behavior, so when opening new file, it will always be activated/focused ?
Maybe there is some flag of or configuration I’m missing ?
I know its possible if I use external extension to list all windows and interact with them via gdbus and force activate, but I’m checking for a simpler solution if exists.
Thanks for any help.
JD.