Adding command to Alt + F2 menu

Please post suggestions for improvement of Cinnamon on:
https://github.com/linuxmint/Cinnamon
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
arevil

Adding command to Alt + F2 menu

Post by arevil »

Hi!

I manually installed a program and would like to be able to run in from Alt + F2 command menu. I edited /etc/bash.bashrc (added the folder containing binary to PATH variable) and I am able to run my program from terminal, however, the program is unknown to the Alt + F2 command menu.

I also created .desktop file:

Code: Select all

tomas@omnyx3 ~ $ cat /usr/share/applications/scalipse.desktop 
[Desktop Entry]
Name=scalipse
Comment=Scala IDE
Exec=scalipse
Icon=/opt/eclipse/icon.xpm
Terminal=false
Type=Application
StartupNotify=true
Categories=Scala;IDE;
Name[en_US]=scalipse

To sum it up. What should I do to add my own commands (aliases) to Alt + F2 menu.
Thanks in advance!
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Synzvato

Re: Adding command to Alt + F2 menu

Post by Synzvato »

Hey,

What I get from this is that you took the $PATH variable and added the directory containing the binary to it. You could add a symbolic link to the "/usr/bin" folder (which is already part of the $PATH variable) instead of adding more and more folders to it.

Here's what I'd do to get it done:

Code: Select all

sudo ln -s /path/to/your/program/program_binary /usr/bin/command_name
This solution works for me and I use both the pop up command window (ALT+F2) and the terminal.
arevil

Re: Adding command to Alt + F2 menu

Post by arevil »

Thank you very much! Works for me too.

Seems like Alt + F2 menu runs a shell that is not affected by /etc/bash.bashrc.

Have a nice day!
Synzvato

Re: Adding command to Alt + F2 menu

Post by Synzvato »

arevil wrote:Thank you very much! Works for me too.
You're very welcome, glad to hear it worked out for you!
maxkoryukov

Re: Adding command to Alt + F2 menu

Post by maxkoryukov »

Hello, here is many anwers (including my): http://stackoverflow.com/a/33930536/1115187
In short: the best way is to use bin in home dir.

First way: you could create there an symlink:

Code: Select all

ln -s /usr/bin/gnome-calculator ~/calc
Or, you could create a short shell script, like this:

Code: Select all


#!/bin/sh
firefox --private-window

The core advantage of this approach is portability (you could copy local ~/bin to any other linux PC), and possibility to backup your settings
Locked

Return to “Cinnamon”