You are not logged in.
I'm setting up some keyboard shortcuts in MATE.
I'd like a certain combination to launch text editor, but it's not among the default ones.
I want it to be dependent on default application preferences, and not just a pluma command.
So I tought to set the command to something like xdg-mime query default text/plain | sed 's/.desktop//'.
I'm pretty sure there's a simpler way, but didn't figure out.
However this is just echo-ing the current default app, and does nothing if used where intended.:
lennart@xps-15-arch:~$ xdg-mime query default text/plain | sed 's/.desktop//'
pluma
While
lennart@xps-15-arch:~$ $(xdg-mime query default text/plain | sed 's/.desktop//')
### pluma starts and gives some output... ^C
and
lennart@xps-15-arch:~$ exec $(xdg-mime query default text/plain | sed 's/.desktop//') &
### pluma starts and gives some output... ^C
actually launch the editor correctly in a terminal, but give a popup window error if used for the keyboard shortcuts:
Error while trying the action
...
associated to <Bla><Bla><Bla>
[Close]
My i18n is Italian so this is not exactly what it reports, but that's the meaning.
Q: how can I set a keyboard shortcut to launch a default mime-type app and not a specified fixed one?
Last edited by l3nn4rt (2017-09-15 14:35:33)
Offline
This is happening because of how MATE is trying to parse the command string.
Easy way out: put it in an executable sh file and set the shortcut to invoke that file
Offline
I hoped there's a way to avoid a script for just one line.
That's the actual workaround, but I created a directory just for these micro scripts and I find it a bit ridiculous.
However thank you
Offline
If you're ever embarrassed about making a one-line script, think of it this way: files are very, very cheap.
Offline