-3

I would like to create a file with: name:

Hyper

command run:

"/opt/Hyper/hyper" %U

or name:

Google Chrome

command run:

/usr/bin/google-chrome-stable --no-sandbox

( when we click in this icon,it would open Google Chrome)

or name:

FileZilla

command run:

filezilla

"touch" command can help us to create a file, but I don't know how can I define command to run for every created files

this file is like desktop icon, or icons in menu bar ( or Application bar ) when we create icon in desktop with ln -s, we create a Symbolic Link but this is not basically our program link.

Of course, we can copy any program icons to another path but we don't know where is our programs basically.

I would like to create icon for my installed programs to other path for example when we open Application menu we can see leafpad icon and this icon name is:

leafpad and command to run leafpad is: leafpad %f

I would like to create any program icons like icons in Application menu to any folder that I need it.

I hope my explain was enough.

thanks ahead

  • Possible duplicate of How to create a file with pre-inserted text inside with bash? – muru Sep 25 '19 at 23:13
  • Though unix.stackexchange.com/questions/84686/… is probably what you want – muru Sep 25 '19 at 23:14
  • Do you want to run those commands from the shell (command line) or via your desktop environment (if so: which one are you using)? – Philippos Sep 26 '19 at 6:02
  • @Philippos I would like to do it via desktop, like shortcut, but not exactly ln -s to create shortcut icon, i would like to create starter icon in every folder that i need for my linux programs, like firefox or chrome or metasploit or another programs, – Red Science Sep 26 '19 at 7:21
1

The easiest way to do this is to create bash aliases; there's no need to create new files. Aliases can be added to your ~/.bashrc file, which is sourced every time you open a new terminal. For example, here's an alias for Hyper:

alias Hyper='/opt/Hyper/hyper %U'

To see the changes, re-source your ~/.bashrc, like this: source ~/.bashrc

| improve this answer | |
  • this is not what do i need, i need like shortcut icon, but this is not exactly shortcut with ln -s, and I would like create them in every folder – Red Science Sep 26 '19 at 7:13
0

I found that, my problem resolve is:

create file like file.desktop and write content like this within it:

[Desktop Entry]
Version=1.0
Type=Application
Name=Sublime Text
GenericName=Text Editor
Comment=Sophisticated text editor for code, markup and prose
Exec=/opt/sublime_text/sublime_text %F
Terminal=false
MimeType=text/plain;
Icon=sublime-text
Categories=TextEditor;Development;
StartupNotify=true
Actions=Window;Document;

[Desktop Action Window]
Name=New Window
Exec=/opt/sublime_text/sublime_text -n
OnlyShowIn=Unity;

[Desktop Action Document]
Name=New File
Exec=/opt/sublime_text/sublime_text --command new_file
OnlyShowIn=Unity;

this sample was for Sublime Text

we can use another samples to another programs like this

thanks for your attention

| improve this answer | |

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.