You are not logged in.
as header states i would like my script to open the desktops default text editor. I use xfce.
I currently have it set to open medit, however i want to be able to use script on other desktops
Last edited by orphius (2013-07-12 07:24:34)
Offline
export your EDITOR in .bashrc and then use $EDITOR in your scripts?
Offline
EDITOR will often not be the default desktop environment editor - it is usually limited to being a systemwide (and usually console-ready) editor.
xdg-open, or a related tool, can give you the desktop's text editor.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Yeah, I think that you should set up the correct MIME types and then open your text files with xdg-open. Try the 'xdg-mime default' command.
Offline
EDITOR will often not be the default desktop environment editor - it is usually limited to being a systemwide (and usually console-ready) editor.
xdg-open, or a related tool, can give you the desktop's text editor.
Truth. VISUAL is typically used for the graphical text editor.
So, to use VISUAL if it exists, but otherwise default to medit, do:
editor="${VISUAL:-medit}"
$editor foo.txt
Last edited by jakobcreutzfeldt (2013-07-11 07:09:02)
Offline
thank you jakobcreutzfeldt
that was just what i needed
Offline