0

I'm still a complete noob as regards Unix/Linux/Ubuntu. Per that earlier question, I tried installing Ubuntu 4 years ago, but gave up when I couldn't even manage to configure my screen resolution.

I now have a new PC that came with Ubuntu 16.4 LTS pre-installed, and which I successfully updated to 17.10 by following instructions I found online. I'm sure I'll have lots of really basic questions over the coming months as I try to get to grips with it, but I have one particular problem already where I can't find any help online for what looks like a trivial issue.


I have a Dropbox file /home/mini/Dropbox/Public/notes.txt that I also view/edit from other (Windows-based) machines. Currently I can only access this file by navigating to it using the Ubuntu "file explorer" (Nautilus?).

The only file/icon on my desktop at the moment is something that I think is called Chromium Web Browser.Desktop, which appeared after I followed online instructions to install that as my default browser. What I want is another file/icon that will invoke Gedit on my notes.txt file.

I can invoke Gedit on the Chromium...desktop file, but I don't understand any of the contents, so I've no idea if it's even meaningful to treat that as a starting point for creating my own "shortcut".

On my Windows machines, I can just right-click on a "target" file and select Send to -> Desktop (create shortcut) to create an *.lnk file, or I can create an *.bat file containing the command line notepad \Users\Fumblefingers\Dropbox\Public\notes.txt, but I just can't figure out how to do something similar in Ubuntu.


To repeat - all I want is a desktop file/icon to invoke Gedit on my notes.txt file. I still find it hard to believe I can't figure this out for myself, but I'm sure someone here can explain things (in really simple terms please! :)

5

Create a new file and name it for example gedit-note.desktop in your desktop folder, then write the following inside

[Desktop Entry]
Name=gedit-notes
GenericName=Text Editor
Comment=Edit text files
Exec=gedit %U /home/mini/Dropbox/Public/notes.txt
Terminal=false
Type=Application
StartupNotify=true
MimeType=text/plain;
Icon=accessories-text-editor
Categories=GNOME;GTK;Utility;TextEditor;

This should open gedit with your specific file

  • Thank you so much! I had to Trust and launch the first time I clicked on the file I copied your text into, but now it just does exactly what I'd expect when I double-click on it. – FumbleFingers Jan 10 '18 at 16:05
  • @FumbleFingers As you are a relativelly new askubuntu user. Please do not forget to accept the answer. – Bruni Jan 10 '18 at 16:09
  • @Bruni: Ooops! I've been around on SO English Language for years, so I should know better! Answer "accepted" now, and thanks for the reminder (I don't suppose there's any point in waiting for a "better" one! :) – FumbleFingers Jan 10 '18 at 16:18
  • ;-) Maybe I should have bothered to look at the profile. – Bruni Jan 10 '18 at 16:21
  • 1
    @FumbleFingers you can read the article from gnome developer, you'll find what's required for a desktop file to actually work. There is also a description of each line... [developer.gnome.org/integration-guide/stable/… – Adel Kihal Jan 10 '18 at 20:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.