Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
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
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
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.