LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 05-28-2009, 02:26 PM   #1
BslBryan
LQ Newbie
 
Registered: May 2009
Distribution: Ubuntu
Posts: 3

Rep: Reputation: 1
How To: Gedit with the Click of a Button (GNOME)


Hello, everyone. I'm visiting over from the Ubuntu forums, and I'd like to share this quick tutorial with all of you.

Have you ever found yourself dealing with editing several files, and sighing at having to type out different "gedit" or "vi" commands in the terminal?

If I correctly described an experience that you've had, the following tutorial is a must. My tutorial allows you to add "Open with gedit" to the Right-click menu, making it easy to gedit anything!

First, we need to run this command in the terminal, making the file that will hold our script:

Code:
gedit ~/.gnome2/nautilus-scripts/Open\ with\ gedit
Now, a blank document in the text editor should open. Copy and paste these contents:

Code:
#!/bin/bash
#
# Nautilus script -> open gedit
#
filesall=""
while [ $# -gt 0 ]
do
files=`echo "$1″ | sed 's/ /\?/g'`
filesall="$files $filesall"
shift
done
gedit $filesall&
Now click save, and close the text editor.

Finally, we need to make the previous script executable. So let's run this command:

Code:
chmod u+x ~/.gnome2/nautilus-scripts/Open\ with\ gedit
And that's it! Open up the file browser, and right-click on any file to test it out!

I hope I've helped to make someone's life a lot easier. Enjoy, everyone.
 
Old 05-29-2009, 11:44 PM   #2
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
On my system, in nautilius text files are associated with gedit by default.
 
  


Reply

Tags
gedit, gnome, tutorial


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
No Back Button on right click or browser qplumb Linux Mint 1 09-05-2009 06:04 PM
middle click the maximise button to maximise vertically in gnome? dasy2k1 Linux - Newbie 1 05-10-2009 08:58 PM
Gedit, right click to change language General Linux - Software 1 05-17-2006 11:23 PM
make thumb button/third button double-click taboom Linux - Hardware 0 03-20-2006 02:39 PM
Gnome 2.6.1: Single Click acts like Double Click Der_tolle_Emil Linux - Software 2 09-13-2004 08:59 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 03:06 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration