Add "Open with gedit" to the right click menu in Ubuntu Adauga "Open with sudo" la meniul click dreapta în Ubuntu
The file browser in Ubuntu provides the ability to run scripts on a selected file. Browser-ul de fişiere în Ubuntu oferă posibilitatea de a executa scripturi pe un fişier selectat. These scripts can be used to do anything from opening a file to zipping or uploading, or anything that you can do from the command line. Aceste script-uri pot fi folosite pentru a face ceva de la deschiderea unui fişier pentru a zipping sau încărcarea, sau ceva pe care le puteţi face din linia de comandă.
To start off, we will need to open a terminal window and type in the following command, which will create a new script file in our nautilus scripts directory Pentru a începe, vom avea nevoie pentru a deschide o fereastră terminal şi tip în următoarea comandă, ceea ce va crea un nou fişier script în directorul nostru Nautilus script-uri
gedit ~/.gnome2/nautilus-scripts/Open\ with\ gedit gedit ~ / .gnome2/nautilus-scripts/Open \ cu \ gedit
Paste in the following script, found on the Lipiţi în următorul script, găsite pe G-Scripts site Site-ul G-Scripturi , which is a great resource for finding scripts. , Care este o mare resursa pentru găsirea script-uri.
#!/bin/bash #! / bin / bash
# #
# Nautilus script -> open gedit # Script Nautilus -> Open sudo
# #
# Owner : Largey Patrick from Switzerland # Proprietar: Largey Patrick din Elveţia
# patrick.largey@nazeman.org # Patrick.largey @ nazeman.org
# www.nazeman.org # Www.nazeman.org
# #
# Licence : GNU GPL # De licenţă: GNU GPL
# #
# Copyright (C) Nazeman # Copyright (C) Nazeman
# #
# Ver. # Ver. 0.9-1 Date: 16.02.2002 0.9-1 Data: 16-02-2002
# Add multiple file open in the same windows # Adauga multiple dosar deschis în acelaşi ferestre
# #
# Ver: 0.9 Date: 27.10.2001 # Ver: 0.9 Data: 27-10-2001
# Initial release # Initial release
# #
# Dependence : Nautilus (of course) # Dependenţă: Nautilus (desigur)
# Gnome-utils (gdialog) # Gnome-utils (gdialog)
# #
filesall=”" filesall = ""
while [ $# -gt 0 ] în timp ce [$ #-gt 0]
do face
files=`echo “$1″ | sed 's/ /\?/g'` fişiere = `echo" $ 1 "| sed 's / / \? / g'`
filesall=”$files $filesall” fişiere filesall = "$ $ filesall"
shift schimb
done făcut
gedit $filesall& gedit $ filesall &
Save and close the gedit window, and then execute the following command to make the script executable: Salvaţi şi închideţi fereastra gedit, şi apoi executaţi următoarea comandă pentru a face scriptul executabil:
chmod u+x ~/.gnome2/nautilus-scripts/Open\ with\ gedit u chmod + x ~ / .gnome2/nautilus-scripts/Open \ cu \ gedit
Note that tab completion really helps here =) Reţineţi că finalizarea tab-ul vă ajută într-adevăr aici =)
Now when you right click a file, you should see this: Acum, când dreapta clic pe un fişier, ar trebui să vedeţi acest lucru:

Tested on: Ubuntu Dapper, Ubuntu Edgy Eft Testat pe: Ubuntu Dapper, Ubuntu Edgy Eft

Daily Email Updates Daily Actualizări de email
You can get our how-to articles in your inbox each day for free. Aveţi posibilitatea să obţineţi modul nostru de-a articole în Inbox în fiecare zi pentru drum liber. Just enter your name and email below: Doar introduceţi numele dvs. şi e-mail de mai jos:



Typo: Typo:
The char after $1 is NOT an ASCII double quote (0×22) – it is a Unicode double prime U+2033 Char după 1 dolar NU este un citat ASCII dublu (0 × 22) - este o Unicode U dublu prim-2033
IS: IS:
files=`echo “$1″ | sed 's/ /\?/g'` fişiere = `echo" $ 1 "| sed 's / / \? / g'`
SHOULD BE: Trebuie să fie:
files=`echo “$1″ | sed 's/ /\?/g'` fişiere = `echo" $ 1 "| sed 's / / \? / g'`
when i open a file with gedit using the open with gedit script it doesnt display any text although it will if i open a text file within gedit. cînd i a deschide un fişier cu gedit folosind deschis cu script-ul gedit it doesnt afişa orice text cu toate că în cazul în care i se va deschide un fişier text în termen de gedit.
Try this: Try this:
######################### #########################
filesall=”" filesall = ""
while [ $# -gt 0 ] în timp ce [$ #-gt 0]
do face
files=`echo “$1″ | sed 's/ /\?/g'` fişiere = `echo" $ 1 "| sed 's / / \? / g'`
filesall=”$files $filesall” fişiere filesall = "$ $ filesall"
shift schimb
done făcut
gedit $filesall& gedit $ filesall &
######################### #########################
ThX mate,this is what i needed! Mate Thx, asta este ceea ce am nevoie!
I did not know you could do this. Nu stiam ai putea face acest lucru. I have to convert movie files from my flash video camera so they in a better playable format. Eu am pentru a converti fişierele de film de la camera mea Flash Video astfel încât acestea într-un format mai bine redate. I've been using the command line to do this. Am fost folosind linia de comandă pentru a face acest lucru. I'm going to use the same concept to make a right-click script to do this! Am de gând să utilizeze acelaşi concept de a face un script de clic-dreapta pentru a face acest lucru! Great post! Mare post!
for me worked with: pentru mine a lucrat cu:
gedit /home/user/.gnome2/nautilus-scripts/Open\ with\ gedit gedit / home/user/.gnome2/nautilus-scripts/Open \ cu \ gedit
8.04 8,04
Thanks again Geek,for another successful tip. Vă mulţumim din nou Geek, pentru un alt vîrf de succes. Used on Hardy Heron. Utilizate pe Hardy Heron.
or you can just “open with other application” -> choose “text editor” (which is gedit)….now you have open with gedit in your right click menu sau puteţi "doar deschis cu altă aplicaţie" -> alege "editor de text" (care este gedit) .... Acum ai deschis cu sudo în meniul de clic dreapta
#!/bin/bash #! / bin / bash
# #
# Nautilus script -> open gedit # Script Nautilus -> Open sudo
# #
gedit $NAUTILUS_SCRIPT_SELECTED_URIS gedit $ NAUTILUS_SCRIPT_SELECTED_URIS
In the interests of brevity the above code does exactly the same thing. Din motive de concizie codul de mai sus face exact acelasi lucru.
How to uninstall the script? Cum la spre uninstall script-ul?
Thanks HTG! Multumesc HTG! It worked perfectly for me. , Functioneaza perfect pentru mine.
@Michael @ Michael
just go to the file directory ~/.gnome2/nautilus-scripts. doar du-te la directorul fişierul ~ / .gnome2/nautilus-scripts.
Commands: Comenzi:
cd ~/.gnome2/nautilus-scripts: cd ~ / .gnome2/nautilus-scripts:
rm Openwithgedit Openwithgedit rm
Note: please make sure you deleted the correct file as there is no UNDO with the terminal (as I have learned) Notă: Vă rugăm asiguraţi-vă că aţi şters corect de fişier după cum nu există nici o UNDO cu terminal (cum v-am învăţat)
BloggerTinker BloggerTinker
Ubuntu 8.04.1 Ubuntu 8.04.1
Linux Complete Newbie Linux Newbie Complete
When I use “Open With gedit” from the right click menu in Ubuntu 9.04, nothing happens, any help. Când m-am folosi "Open With sudo" din meniul faceţi clic dreapta în Ubuntu 9.04, nu se întâmplă nimic, orice ajutor.
The problem with the code snippet is that the quotation marks are not correct. Problema cu fragmentul de cod este că ghilimele nu sunt corecte. You need to retype the quotes both single and double right through the entire script. Tu nevoie la spre retype ghilimele, atât unică şi dreptul de dublu, prin întregul script. Then it will work in 9.04. Apoi, acesta va lucra în 9.04. This is a bug with this web site. Aceasta este o problemă cu acest site web.