LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-11-2010, 04:56 AM   #1
djmarian
LQ Newbie
 
Registered: Oct 2009
Location: Slatina, Romania
Distribution: mandriva
Posts: 16

Rep: Reputation: 0
open shortcut with leafpad


i have made a shortcut on my desktop with ls command
how do i make the shortcut open with leafpad?
with right click i can se it is set to executable file, and only when i click open with i can see leafpad
 
Old 07-11-2010, 11:19 AM   #2
amani
Senior Member
 
Registered: Jul 2006
Location: Kolkata, India
Distribution: Debian 64-bit GNU/Linux, Kubuntu64, Fedora QA, Slackware,
Posts: 2,766

Rep: Reputation: Disabled
what do you mean?

You have a short cut for leafpad ?

If it should open in a single click, then you need to change mouse settings
 
Old 07-11-2010, 05:10 PM   #3
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,510

Rep: Reputation: 2491Reputation: 2491Reputation: 2491Reputation: 2491Reputation: 2491Reputation: 2491Reputation: 2491Reputation: 2491Reputation: 2491Reputation: 2491Reputation: 2491
What is it a shortcut to, what program?
Is it just a text file? You should be able to right click the icon and set the option to open with leafpad.

Last edited by yancek; 07-12-2010 at 11:37 AM.
 
Old 07-12-2010, 02:54 AM   #4
djmarian
LQ Newbie
 
Registered: Oct 2009
Location: Slatina, Romania
Distribution: mandriva
Posts: 16

Original Poster
Rep: Reputation: 0
it´s a text file

it´s a text file

it cannot be ade to open with double click? i know the right click thing
 
Old 07-12-2010, 03:42 AM   #5
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
If it is an executable text file, then L-double clicking it can do one of two things:
1] Execute it
2] Open it with your text editor.

You care currently being asked which you would like to do.

This behaviour can be changed:

Places - Home directory - Edit - Preferences
Behaviour Tab: "Executable text files"
Make changes.
 
Old 07-12-2010, 04:40 AM   #6
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
A shortcut : You mean an "Icon" , a "desktop entry", I guess.

Reading it / opening with leafpad : $ leafpad <your-file>

..
 
Old 07-12-2010, 06:06 AM   #7
djmarian
LQ Newbie
 
Registered: Oct 2009
Location: Slatina, Romania
Distribution: mandriva
Posts: 16

Original Poster
Rep: Reputation: 0
other words

starting from the start
i want an icon on my desktop that when i double click it should open a text file from a ntfs partition
i tried with ls, but i have to right click and select leafpad
 
Old 07-12-2010, 11:16 AM   #8
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
Linux does NOT have such a thing as shortcuts. There are symlinks, which are kind of like Windows shortcuts but implemented at the filesystem level, and there are Desktop Files (they usually end with .desktop and are treated specially by most file maangers), that contain the name of the program, the path to the icon, and the command to execute.

For example, here is a desktop file that launches KWrite:

Code:
#!/usr/bin/env xdg-open
[Desktop Entry]
GenericName=Text Editor
GenericName[af]=Teks Redigeerder
GenericName[ar]=محرر نصوص
GenericName[as]=লিপি সম্পাদক
GenericName[be]=Тэкставы рэдактар
GenericName[be@latin]=Tekstavy redaktar
GenericName[bg]=Текстов редактор
GenericName[bn]=টেক্সট সম্পাদক
GenericName[bn_IN]=টেক্সট এডিটর
GenericName[br]=Aozer skrid
GenericName[ca]=Editor de text
GenericName[ca@valencia]=Editor de text
GenericName[cs]=Textový editor
GenericName[csb]=Tekstowi editora
GenericName[cy]=Golygydd Testun
GenericName[da]= Teksteditor
GenericName[de]=Texteditor
GenericName[el]=Επεξεργαστής κειμένου
GenericName[en_GB]=Text Editor
GenericName[eo]=Teksta redaktilo
GenericName[es]=Editor de texto
GenericName[et]=Tekstiredaktor
GenericName[eu]=Testu editorea
GenericName[fa]=ویرایشگر متن
GenericName[fi]=Tekstieditori
GenericName[fr]=Éditeur de texte
GenericName[fy]=Tekstbewurker
GenericName[ga]=Eagarthóir Téacs
GenericName[gl]=Editor de textos
GenericName[gu]=લખાણ સંપાદક
GenericName[he]=עורך טקסט
GenericName[hi]=पाठ संपादक
GenericName[hne]=पाठ संपादक
GenericName[hr]=Uređivač teksta
GenericName[hsb]=Wobdźěłar tekstow
GenericName[hu]=Szövegszerkesztő
GenericName[id]=Penyunting Teks
GenericName[is]=Textaritill
GenericName[it]=Editor di testi
GenericName[ja]=テキストエディタ
GenericName[ka]=ტექსტური რედაქტორი
GenericName[kk]=Мәтін редакторы
GenericName[km]=កម្មវិធី​និពន្ធ​​អត្ថបទ
GenericName[kn]=ಪಠ್ಯ ಸಂಪಾದಕ
GenericName[ko]=텍스트 편집기
GenericName[ku]=Edîtorę Nivîsan
GenericName[lt]=Teksto redaktorius
GenericName[lv]=Teksta redaktors
GenericName[mai]=पाठ संपादक
GenericName[mk]=Уредувач на текст
GenericName[ml]=ടെക്സ്റ്റ് എഴുത്തിടം
GenericName[mr]=पाठ्य संपादक
GenericName[ms]=Penyunting Teks
GenericName[nb]=Skriveprogram
GenericName[nds]=Texteditor
GenericName[ne]=पाठ सम्पादक
GenericName[nl]=Teksteditor
GenericName[nn]=Skriveprogram
GenericName[oc]=Editor de tčxt
GenericName[or]=ପାଠ୍ୟ ସମ୍ପାଦକ
GenericName[pa]=ਟੈਕਸਟ ਐਡੀਟਰ
GenericName[pl]=Edytor tekstu
GenericName[pt]=Editor de Texto
GenericName[pt_BR]=Editor de Texto
GenericName[ro]=Editor de text
GenericName[ru]=Текстовый редактор
GenericName[se]=Čállinprográmma
GenericName[si]=පෙළ සකසුව
GenericName[sk]=Textový editor
GenericName[sl]=Urejevalnik besedil
GenericName[sr]=Уређивач текста
GenericName[sr@ijekavian]=Уређивач текста
GenericName[sr@ijekavianlatin]=Uređivač teksta
GenericName[sr@latin]=Uređivač teksta
GenericName[sv]=Texteditor
GenericName[ta]=உரை தொகுப்பி
GenericName[te]=పాఠ్యము సరికూర్పరి
GenericName[tg]=Таҳриргари матн
GenericName[th]=โปรแกรมแก้ไขข้อความ
GenericName[tr]=Metin Düzenleyici
GenericName[uk]=Редактор текстів
GenericName[uz]=Matn tahrirchi
GenericName[uz@cyrillic]=Матн таҳрирчи
GenericName[vi]=Bộ soạn văn bản
GenericName[wa]=Aspougneu di tecse
GenericName[xh]=Umhleli Wombhalo
GenericName[x-test]=xxText Editorxx
GenericName[zh_CN]=文本编辑器
GenericName[zh_TW]=文字編輯器
Name=KWrite
Name[af]=Kskryf
Name[ar]=ك.رايت
Name[as]=KWrite
Name[be]=KWrite
Name[be@latin]=KWrite
Name[bg]=KWrite
Name[bn]=কে-রাইট
Name[bn_IN]=KWrite
Name[br]=KWrite
Name[ca]=KWrite
Name[ca@valencia]=KWrite
Name[cs]=KWrite
Name[csb]=KWrite
Name[cy]=KWrite
Name[da]=KWrite
Name[de]=KWrite
Name[el]=KWrite
Name[en_GB]=KWrite
Name[eo]=KWrite
Name[es]=KWrite
Name[et]=KWrite
Name[eu]=KWrite
Name[fi]=KWrite
Name[fr]=KWrite
Name[fy]=KWrite
Name[ga]=KWrite
Name[gl]=KWrite
Name[gu]=KWrite
Name[he]=KWrite
Name[hi]=के-राइट
Name[hne]=के-राइट
Name[hr]=KWrite
Name[hsb]=KWrite
Name[hu]=KWrite
Name[id]=KWrite
Name[is]=KWrite
Name[it]=KWrite
Name[ja]=KWrite
Name[ka]=რედაქტორი KWrite
Name[kk]=KWrite
Name[km]=KWrite
Name[kn]=ಕೆರೈಟ್
Name[ko]=KWrite
Name[ku]=KWrite
Name[lt]=KWrite
Name[lv]=KWrite
Name[mai]=के-राइट
Name[mk]=KWrite
Name[ml]=കെറൈറ്റ്
Name[mr]=केराइट
Name[ms]=KWrite
Name[nb]=KWrite
Name[nds]=KWrite
Name[ne]=केडीई राइट
Name[nl]=KWrite
Name[nn]=KWrite
Name[oc]=KWrite
Name[or]=KWrite
Name[pa]=ਕੇਲੇਖਕ
Name[pl]=KWrite
Name[pt]=KWrite
Name[pt_BR]=KWrite
Name[ro]=KWrite
Name[ru]=KWrite
Name[se]=KWrite
Name[si]=KWrite
Name[sk]=KWrite
Name[sl]=KWrite
Name[sr]=К‑писање
Name[sr@ijekavian]=К‑писање
Name[sr@ijekavianlatin]=K‑pisanje
Name[sr@latin]=K‑pisanje
Name[sv]=Kwrite
Name[ta]=KWrite
Name[te]=KWrite
Name[tg]=Таҳриргари KWrite
Name[th]=KWrite
Name[tr]=KWrite
Name[uk]=KWrite
Name[uz]=KWrite
Name[uz@cyrillic]=KWrite
Name[vi]=KWrite
Name[wa]=KWrite
Name[xh]=KWrite
Name[x-test]=xxKWritexx
Name[zh_CN]=KWrite
Name[zh_TW]=KWrite
MimeType=text/plain;
Exec=kwrite %U
X-KDE-StartupNotify=true
Icon=accessories-text-editor
X-DocPath=kwrite/index.html
Type=Application
Terminal=false
InitialPreference=8
X-DBUS-StartupType=Multi
X-DBUS-ServiceName=org.kate-editor.kwrite
Categories=Qt;KDE;Utility;TextEditor;
I tried to understand it best as I can, maybe try this:

Code:
#!/usr/bin/env xdg-open
[Desktop Entry]
GenericName=Text Editor
Name=Open a certain file in Leafpad
MimeType=text/plain;
Exec=leafpad /path/to/your/file
Icon=accessories-text-editor
Type=Application
Terminal=false
 
1 members found this post helpful.
  


Reply



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
How to make leafpad to print satimis Ubuntu 6 05-09-2021 08:40 AM
timestamp/datestamp in Leafpad? newbiesforever Linux - Software 0 05-22-2009 02:18 PM
why can't Leafpad open a file that is a K menu entry? newbiesforever Linux - Software 1 10-29-2008 11:34 PM
Shortcut to open bash Xzander Linux - Newbie 1 10-28-2007 10:29 AM
open office shortcut problem tamtam Linux - Newbie 4 07-23-2004 07:55 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:18 PM.

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