You are not logged in.

#1 2014-02-05 07:23:43

cdelorme
Member
Registered: 2013-11-23
Posts: 18

gnome3 custom launcher howto include env variables and expand home?

Hello,

I need help with gnome3 if someone would be so kind as to point me in the right direction.

My questions are:

- How can I get gnome3 launchers to recognize my PATH environment variable?
- How can I expand environment variables or `~` from a launcher?
- Where can I put custom application icons so I can reference them without absolute paths from a custom launcher?

My configuration worked in other linux distros, but arch is ignoring my `~/.bashrc` (which "should" be loaded by my `~/.profile` according to the docs), which sets my `PATH` to include `~/bin`.  As an example, I have installed sublime text into my home directory and created a symlink in `~/bin/subl`.  I created my own custom launcher in `~/.local/share/applications/subl.desktop`, which contains:

    [Desktop Entry]
    Name=Sublime Text
    Exec=/home/cdelorme/bin/subl
    Type=Application
    Comment=Worlds Best Text Editor
    Icon=/home/cdelorme/applications/sublime_text/Icon/256x256/sublime_text.png

It displays automatically in my applications menu, as well it should, except that if/when I try changing `Exec` to use `subl` instead of the absolute path to the command it disappears, failing to recognize my PATH environment variable.  I want to remove absolute paths from the launcher so it can be applied more liberally, but using `~/bin/subl` also fails.  Please lend me a hand, what exactly am I missing in my configurations such that debian and fedora both expand my local path and include my environment variables in gnome3, while arch does not?

Offline

#2 2014-02-08 21:12:14

thesilentboatman
Member
From: Sweden
Registered: 2012-11-04
Posts: 18

Re: gnome3 custom launcher howto include env variables and expand home?

Hi!

I don't know how fedora and debian did it, but I got it to work by adding my local bin directory to the PATH variable globally. You do it in /etc/profile. And you have to add the absoute path, so '/home/myname/bin' instead of '~/bin'. I also had to reboot my computer for it to kick in.. After that I was able to set the 'Exec' field in my .desktop file to just the file name.

Regarding application icons, I got it to work by putting them in /usr/share/pixmaps/ .

Just for clarity, here's my .desktop file (I tested it with eclipse)

[Desktop Entry]
Name=Eclipse
Comment=Eclipse Platform
Exec=eclipse
Icon=icon.xpm
Terminal=0
Type=Application
Encoding=UTF-8
Categories=Application;Editor;
GenericName[en_US]=Eclipse IDE

Offline

#3 2014-02-08 22:38:06

ooo
Member
Registered: 2013-04-10
Posts: 1,638

Re: gnome3 custom launcher howto include env variables and expand home?

I'm pretty sure there are some differences about which ~/*profile files get sourced on login depending on which display manager/login method you're using.
I'd try moving the variables from .bashrc to .profile, and see if that works

Offline

Board footer

Powered by FluxBB