How to open the default GUI text editor in Ubuntu or Lubuntu via a script?
I have a script that uses gedit to open text file in Ubuntu. That script does not work under Lubuntu. What command is required to execute the default text editor?
I want to make the script usable under Ubuntu and Lubuntu.
lubuntu scripts gedit default-programs
add a comment |
I have a script that uses gedit to open text file in Ubuntu. That script does not work under Lubuntu. What command is required to execute the default text editor?
I want to make the script usable under Ubuntu and Lubuntu.
lubuntu scripts gedit default-programs
Do you have gedit installed in lubuntu?
– LnxSlck
Jan 28 '13 at 12:45
no, i do not have gedit installed in lubuntu
– UAdapter
Jan 28 '13 at 12:52
i got gedit by default on ubuntu 14
– Adi Prasetyo
Jul 21 '17 at 22:48
add a comment |
I have a script that uses gedit to open text file in Ubuntu. That script does not work under Lubuntu. What command is required to execute the default text editor?
I want to make the script usable under Ubuntu and Lubuntu.
lubuntu scripts gedit default-programs
I have a script that uses gedit to open text file in Ubuntu. That script does not work under Lubuntu. What command is required to execute the default text editor?
I want to make the script usable under Ubuntu and Lubuntu.
lubuntu scripts gedit default-programs
lubuntu scripts gedit default-programs
edited Jan 28 '13 at 16:47
user25656
asked Jan 28 '13 at 12:41
UAdapterUAdapter
5,147346693
5,147346693
Do you have gedit installed in lubuntu?
– LnxSlck
Jan 28 '13 at 12:45
no, i do not have gedit installed in lubuntu
– UAdapter
Jan 28 '13 at 12:52
i got gedit by default on ubuntu 14
– Adi Prasetyo
Jul 21 '17 at 22:48
add a comment |
Do you have gedit installed in lubuntu?
– LnxSlck
Jan 28 '13 at 12:45
no, i do not have gedit installed in lubuntu
– UAdapter
Jan 28 '13 at 12:52
i got gedit by default on ubuntu 14
– Adi Prasetyo
Jul 21 '17 at 22:48
Do you have gedit installed in lubuntu?
– LnxSlck
Jan 28 '13 at 12:45
Do you have gedit installed in lubuntu?
– LnxSlck
Jan 28 '13 at 12:45
no, i do not have gedit installed in lubuntu
– UAdapter
Jan 28 '13 at 12:52
no, i do not have gedit installed in lubuntu
– UAdapter
Jan 28 '13 at 12:52
i got gedit by default on ubuntu 14
– Adi Prasetyo
Jul 21 '17 at 22:48
i got gedit by default on ubuntu 14
– Adi Prasetyo
Jul 21 '17 at 22:48
add a comment |
5 Answers
5
active
oldest
votes
Use xdg-open it works in most linux distros.
example:
xdg-open /filepath/file.txt
Of all the answers, this method just works.
– u2n
Jan 27 '15 at 0:40
add a comment |
You might get somewhere with /usr/bin/gnome-text-editor
, as that's set using the alternatives system and points to the default editor under a gnome-ish environment. Not quite sure whether it is actually useful under lubuntu/kubuntu, but you could try.
Just to supplement Dennis' answer, with respect to Lubuntu 12.10, if one runs sudo update-alternatives --display gnome-text-editor
, the output is:
gnome-text-editor - auto mode
link currently points to /usr/bin/leafpad
/usr/bin/leafpad - priority 40
slave gnome-text-editor.1.gz: /usr/share/man/man1/leafpad.1.gz
Current 'best' version is '/usr/bin/leafpad'.
And, as Dennis suggested, /usr/bin/gnome-text-editor
does open Leafpad in Lubuntu.
1
it works under lubuntu. system does not allow me to accept your answer. it says I have to wait. the .... system
– UAdapter
Jan 28 '13 at 12:54
add a comment |
Or you can install gedit
sudo apt-get install gedit
Then:
- Right-click a text or php file
- Select "Properties"
- Select "Open with" tab
- Choose among the listed/installed text editors
- Click "Set as default"
- Click "Close"
but you need the superuser password to install any new software, and it requires a internet connection. Not something you want in a "general" script.
– Alvar
Jan 28 '13 at 12:56
You only have to do this one time. Then you can execute your script normally
– LnxSlck
Jan 28 '13 at 14:06
add a comment |
In addition to Dennis Kaarsemaker's answer, you could try using /usr/bin/editor
for something even more generic. This will likely lead to a terminal-based editor be launched, though.
Cf. the update-alternatives manpage.
1
Theupdate-alternatives --config editor
doesn't list any GUI text editors unfortunately.
– gertvdijk
Jan 28 '13 at 13:00
1
Hence the "This will likely lead to a terminal-based editor be launched, though." I forgot to mentionupdate-alternatives --config editor
, though. Thanks.
– Michael Biech
Jan 28 '13 at 13:02
add a comment |
Here is a list of Lubuntu
Apps. However, in 18.10
the editor has changed from Leafpad
to Featherpad
.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f248616%2fhow-to-open-the-default-gui-text-editor-in-ubuntu-or-lubuntu-via-a-script%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
5 Answers
5
active
oldest
votes
5 Answers
5
active
oldest
votes
active
oldest
votes
active
oldest
votes
Use xdg-open it works in most linux distros.
example:
xdg-open /filepath/file.txt
Of all the answers, this method just works.
– u2n
Jan 27 '15 at 0:40
add a comment |
Use xdg-open it works in most linux distros.
example:
xdg-open /filepath/file.txt
Of all the answers, this method just works.
– u2n
Jan 27 '15 at 0:40
add a comment |
Use xdg-open it works in most linux distros.
example:
xdg-open /filepath/file.txt
Use xdg-open it works in most linux distros.
example:
xdg-open /filepath/file.txt
edited Aug 16 '14 at 19:19
Parto
9,3461965103
9,3461965103
answered Aug 16 '14 at 18:49
andyandy
7111
7111
Of all the answers, this method just works.
– u2n
Jan 27 '15 at 0:40
add a comment |
Of all the answers, this method just works.
– u2n
Jan 27 '15 at 0:40
Of all the answers, this method just works.
– u2n
Jan 27 '15 at 0:40
Of all the answers, this method just works.
– u2n
Jan 27 '15 at 0:40
add a comment |
You might get somewhere with /usr/bin/gnome-text-editor
, as that's set using the alternatives system and points to the default editor under a gnome-ish environment. Not quite sure whether it is actually useful under lubuntu/kubuntu, but you could try.
Just to supplement Dennis' answer, with respect to Lubuntu 12.10, if one runs sudo update-alternatives --display gnome-text-editor
, the output is:
gnome-text-editor - auto mode
link currently points to /usr/bin/leafpad
/usr/bin/leafpad - priority 40
slave gnome-text-editor.1.gz: /usr/share/man/man1/leafpad.1.gz
Current 'best' version is '/usr/bin/leafpad'.
And, as Dennis suggested, /usr/bin/gnome-text-editor
does open Leafpad in Lubuntu.
1
it works under lubuntu. system does not allow me to accept your answer. it says I have to wait. the .... system
– UAdapter
Jan 28 '13 at 12:54
add a comment |
You might get somewhere with /usr/bin/gnome-text-editor
, as that's set using the alternatives system and points to the default editor under a gnome-ish environment. Not quite sure whether it is actually useful under lubuntu/kubuntu, but you could try.
Just to supplement Dennis' answer, with respect to Lubuntu 12.10, if one runs sudo update-alternatives --display gnome-text-editor
, the output is:
gnome-text-editor - auto mode
link currently points to /usr/bin/leafpad
/usr/bin/leafpad - priority 40
slave gnome-text-editor.1.gz: /usr/share/man/man1/leafpad.1.gz
Current 'best' version is '/usr/bin/leafpad'.
And, as Dennis suggested, /usr/bin/gnome-text-editor
does open Leafpad in Lubuntu.
1
it works under lubuntu. system does not allow me to accept your answer. it says I have to wait. the .... system
– UAdapter
Jan 28 '13 at 12:54
add a comment |
You might get somewhere with /usr/bin/gnome-text-editor
, as that's set using the alternatives system and points to the default editor under a gnome-ish environment. Not quite sure whether it is actually useful under lubuntu/kubuntu, but you could try.
Just to supplement Dennis' answer, with respect to Lubuntu 12.10, if one runs sudo update-alternatives --display gnome-text-editor
, the output is:
gnome-text-editor - auto mode
link currently points to /usr/bin/leafpad
/usr/bin/leafpad - priority 40
slave gnome-text-editor.1.gz: /usr/share/man/man1/leafpad.1.gz
Current 'best' version is '/usr/bin/leafpad'.
And, as Dennis suggested, /usr/bin/gnome-text-editor
does open Leafpad in Lubuntu.
You might get somewhere with /usr/bin/gnome-text-editor
, as that's set using the alternatives system and points to the default editor under a gnome-ish environment. Not quite sure whether it is actually useful under lubuntu/kubuntu, but you could try.
Just to supplement Dennis' answer, with respect to Lubuntu 12.10, if one runs sudo update-alternatives --display gnome-text-editor
, the output is:
gnome-text-editor - auto mode
link currently points to /usr/bin/leafpad
/usr/bin/leafpad - priority 40
slave gnome-text-editor.1.gz: /usr/share/man/man1/leafpad.1.gz
Current 'best' version is '/usr/bin/leafpad'.
And, as Dennis suggested, /usr/bin/gnome-text-editor
does open Leafpad in Lubuntu.
edited Jan 28 '13 at 17:14
user25656
answered Jan 28 '13 at 12:48
Dennis KaarsemakerDennis Kaarsemaker
5,7721736
5,7721736
1
it works under lubuntu. system does not allow me to accept your answer. it says I have to wait. the .... system
– UAdapter
Jan 28 '13 at 12:54
add a comment |
1
it works under lubuntu. system does not allow me to accept your answer. it says I have to wait. the .... system
– UAdapter
Jan 28 '13 at 12:54
1
1
it works under lubuntu. system does not allow me to accept your answer. it says I have to wait. the .... system
– UAdapter
Jan 28 '13 at 12:54
it works under lubuntu. system does not allow me to accept your answer. it says I have to wait. the .... system
– UAdapter
Jan 28 '13 at 12:54
add a comment |
Or you can install gedit
sudo apt-get install gedit
Then:
- Right-click a text or php file
- Select "Properties"
- Select "Open with" tab
- Choose among the listed/installed text editors
- Click "Set as default"
- Click "Close"
but you need the superuser password to install any new software, and it requires a internet connection. Not something you want in a "general" script.
– Alvar
Jan 28 '13 at 12:56
You only have to do this one time. Then you can execute your script normally
– LnxSlck
Jan 28 '13 at 14:06
add a comment |
Or you can install gedit
sudo apt-get install gedit
Then:
- Right-click a text or php file
- Select "Properties"
- Select "Open with" tab
- Choose among the listed/installed text editors
- Click "Set as default"
- Click "Close"
but you need the superuser password to install any new software, and it requires a internet connection. Not something you want in a "general" script.
– Alvar
Jan 28 '13 at 12:56
You only have to do this one time. Then you can execute your script normally
– LnxSlck
Jan 28 '13 at 14:06
add a comment |
Or you can install gedit
sudo apt-get install gedit
Then:
- Right-click a text or php file
- Select "Properties"
- Select "Open with" tab
- Choose among the listed/installed text editors
- Click "Set as default"
- Click "Close"
Or you can install gedit
sudo apt-get install gedit
Then:
- Right-click a text or php file
- Select "Properties"
- Select "Open with" tab
- Choose among the listed/installed text editors
- Click "Set as default"
- Click "Close"
edited Oct 26 '17 at 20:33
wjandrea
8,47842259
8,47842259
answered Jan 28 '13 at 12:50
LnxSlckLnxSlck
10.2k12949
10.2k12949
but you need the superuser password to install any new software, and it requires a internet connection. Not something you want in a "general" script.
– Alvar
Jan 28 '13 at 12:56
You only have to do this one time. Then you can execute your script normally
– LnxSlck
Jan 28 '13 at 14:06
add a comment |
but you need the superuser password to install any new software, and it requires a internet connection. Not something you want in a "general" script.
– Alvar
Jan 28 '13 at 12:56
You only have to do this one time. Then you can execute your script normally
– LnxSlck
Jan 28 '13 at 14:06
but you need the superuser password to install any new software, and it requires a internet connection. Not something you want in a "general" script.
– Alvar
Jan 28 '13 at 12:56
but you need the superuser password to install any new software, and it requires a internet connection. Not something you want in a "general" script.
– Alvar
Jan 28 '13 at 12:56
You only have to do this one time. Then you can execute your script normally
– LnxSlck
Jan 28 '13 at 14:06
You only have to do this one time. Then you can execute your script normally
– LnxSlck
Jan 28 '13 at 14:06
add a comment |
In addition to Dennis Kaarsemaker's answer, you could try using /usr/bin/editor
for something even more generic. This will likely lead to a terminal-based editor be launched, though.
Cf. the update-alternatives manpage.
1
Theupdate-alternatives --config editor
doesn't list any GUI text editors unfortunately.
– gertvdijk
Jan 28 '13 at 13:00
1
Hence the "This will likely lead to a terminal-based editor be launched, though." I forgot to mentionupdate-alternatives --config editor
, though. Thanks.
– Michael Biech
Jan 28 '13 at 13:02
add a comment |
In addition to Dennis Kaarsemaker's answer, you could try using /usr/bin/editor
for something even more generic. This will likely lead to a terminal-based editor be launched, though.
Cf. the update-alternatives manpage.
1
Theupdate-alternatives --config editor
doesn't list any GUI text editors unfortunately.
– gertvdijk
Jan 28 '13 at 13:00
1
Hence the "This will likely lead to a terminal-based editor be launched, though." I forgot to mentionupdate-alternatives --config editor
, though. Thanks.
– Michael Biech
Jan 28 '13 at 13:02
add a comment |
In addition to Dennis Kaarsemaker's answer, you could try using /usr/bin/editor
for something even more generic. This will likely lead to a terminal-based editor be launched, though.
Cf. the update-alternatives manpage.
In addition to Dennis Kaarsemaker's answer, you could try using /usr/bin/editor
for something even more generic. This will likely lead to a terminal-based editor be launched, though.
Cf. the update-alternatives manpage.
answered Jan 28 '13 at 12:53
Michael BiechMichael Biech
45124
45124
1
Theupdate-alternatives --config editor
doesn't list any GUI text editors unfortunately.
– gertvdijk
Jan 28 '13 at 13:00
1
Hence the "This will likely lead to a terminal-based editor be launched, though." I forgot to mentionupdate-alternatives --config editor
, though. Thanks.
– Michael Biech
Jan 28 '13 at 13:02
add a comment |
1
Theupdate-alternatives --config editor
doesn't list any GUI text editors unfortunately.
– gertvdijk
Jan 28 '13 at 13:00
1
Hence the "This will likely lead to a terminal-based editor be launched, though." I forgot to mentionupdate-alternatives --config editor
, though. Thanks.
– Michael Biech
Jan 28 '13 at 13:02
1
1
The
update-alternatives --config editor
doesn't list any GUI text editors unfortunately.– gertvdijk
Jan 28 '13 at 13:00
The
update-alternatives --config editor
doesn't list any GUI text editors unfortunately.– gertvdijk
Jan 28 '13 at 13:00
1
1
Hence the "This will likely lead to a terminal-based editor be launched, though." I forgot to mention
update-alternatives --config editor
, though. Thanks.– Michael Biech
Jan 28 '13 at 13:02
Hence the "This will likely lead to a terminal-based editor be launched, though." I forgot to mention
update-alternatives --config editor
, though. Thanks.– Michael Biech
Jan 28 '13 at 13:02
add a comment |
Here is a list of Lubuntu
Apps. However, in 18.10
the editor has changed from Leafpad
to Featherpad
.
add a comment |
Here is a list of Lubuntu
Apps. However, in 18.10
the editor has changed from Leafpad
to Featherpad
.
add a comment |
Here is a list of Lubuntu
Apps. However, in 18.10
the editor has changed from Leafpad
to Featherpad
.
Here is a list of Lubuntu
Apps. However, in 18.10
the editor has changed from Leafpad
to Featherpad
.
answered Dec 25 '18 at 12:10
TimoTimo
1707
1707
add a comment |
add a comment |
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f248616%2fhow-to-open-the-default-gui-text-editor-in-ubuntu-or-lubuntu-via-a-script%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Do you have gedit installed in lubuntu?
– LnxSlck
Jan 28 '13 at 12:45
no, i do not have gedit installed in lubuntu
– UAdapter
Jan 28 '13 at 12:52
i got gedit by default on ubuntu 14
– Adi Prasetyo
Jul 21 '17 at 22:48