Hi there;
I'd like to be able to run my aliases from my .bashrc in the "Run Application" dialog that comes up when you hit Alt+F2 in Ubuntu/Gnome.
Does anyone know how to do this?
Hi there;
I'd like to be able to run my aliases from my .bashrc in the "Run Application" dialog that comes up when you hit Alt+F2 in Ubuntu/Gnome.
Does anyone know how to do this?
http://www.freedesktop.org/wiki/Specifications is probably a good place to start. I find these quite hard to follow most of the time, but sometimes you can figure it out. Specifically, the "Desktop Entry Specification".
Also, I don't think you'll be able to use any aliases from .bashrc
, at least not without writing some kind of wrapper script. I think it needs to be an executable file. Of course, you could just use the good old symlinks- to- same + what's- my- name trick...
(Which, for reference, goes like this:
Some casual investigation reveals that creating these is fairly simple if you use Nautilus, (at least the version I have):
xterm -e 'bash -c "unzip -l %f; sleep 5"'
rm -rf
)~/.local/share/applications/
called xterm-usercreated.desktop
Here at least, I get the follow file:
[Desktop Entry]
Encoding=UTF-8
Name=xterm
MimeType=application/zip;
Exec=xterm -e 'bash -c "unzip -l %f; sleep 5"' %f
Type=Application
Terminal=false
NoDisplay=true
4: Looking at the system xterm .desktop I find this:
[Desktop Entry]
Type=Application
Encoding=UTF-8
Name=XTerm
GenericName=
Comment=XTerm: terminal emulator for X
Icon=/usr/share/pixmaps/xterm-color_32x32.xpm
Exec=xterm
Terminal=false
Categories=X-Debian-Applications-Terminal-Emulators;
5: Editing the .usercreated.desktop file to this:
[Desktop Entry]
Type=Application
Encoding=UTF-8
Name=xtermz
Exec=xterm -e 'bash -c "unzip -l %f; sleep 5"' %f
Terminal=false
Categories=X-Local-WTF
6: Run xdg-desktop-menu forceupdate --mode user
7: "xtermz" now shows up in the list... Success!
8: Yuck! This also makes it appear in the main menu, under "Other". Weird!
xdg-desktop-menu
and friends (notably xdg-icon-resource
) live in the xdg-utils
package..desktop
file from scratch..desktop
file using xdg-desktop-menu install
blah blahThanks for the great post.... I'd been doing the script that calls an alias named after itself trick, but this is great to know too!
Thanks again for the help...
Brad.
I couldn't get the aliases working, so I did this instead:
Created a shell script to do what I want and put it in my home dir
Put a link to my shell script in /usr/bin:
It works!
I couldn't get the aliases working, so I did this instead:
Created a shell script to do what I want and put it in my home dir
Put a link to my shell script in /usr/bin:
e.g sudo ln -s ~/bin/MyShellScript.sh /usr/bin/MyShortcutName It works!
It works because /usr/bin is in your path variable. a better alternative would be to create a hidden directory in your home, like ~/.scripts/
and then add this directory to your path. you can now put all your scripts in that dir.