AppVPM application not loading shell env

I have Installed in an appVM:

zsh
kitty
neovim
nvm+node

I have created a .desktop file for neovim:

[Desktop Entry]
Version=1
Name=IDE
GenericName=Code Editor
Exec=zsh -c 'kitty nvim'
Terminal=false
Type=Application
Icon=gvim

If I start kitty from the qube menu and then launch neovim from within kitty, nvm+node is found in my path. If I start neovim from the qube menu (using the .desktop file), nvm+node is not in the path, even though zsh is loaded first.

Why aren’t my .zshrc files being sourced? I’ve tried multiple variations of the Exec= key to launch it, but always the same results.

1 Like

It’s not an issue with the shortcut appearing in the menu, but the way the application is being executed, the proper environment variables set by the .zshrc are not being loaded.

Thanks for taking a look though.

.zshrc is for interactive shells, but zsh -c is non-interactive.

https://man.archlinux.org/man/zsh.1#STARTUP/SHUTDOWN_FILES

1 Like

I was referring to What if my application is shown in app menu, but doesn’t run anything?

But @rustybird is pointing you to a better direction.

That was the piece I was missing, I have it working by changing the command to:

Exec=kitty nvim | zsh

There may be a more appropriate way, but, it seems to be working so far. Thank you.

I figured out the “right” way.

In the template as user, change the default terminal:

sudo update-alternatives --install /usr/bin/x-terminal-emulator x-terminal-emulator /usr/bin/kitty 50

sudo update-alternatives --config x-terminal-emulator
There are 5 choices for the alternative x-terminal-emulator (providing /usr/bin/x-terminal-emulator).

  Selection    Path                 Priority   Status
------------------------------------------------------------
* 0            /usr/bin/kitty        50        auto mode
  1            /usr/bin/kitty        50        manual mode
  2            /usr/bin/koi8rxterm   20        manual mode
  3            /usr/bin/lxterm       30        manual mode
  4            /usr/bin/uxterm       20        manual mode
  5            /usr/bin/xterm        20        manual mode

Press <enter> to keep the current choice[*], or type selection number: 0

Verify the change with x-terminal-emulator. kitty should open.

Create the /usr/share/applications/nvim.desktop file:

[Desktop Entry]
Version=1
Name=IDE
GenericName=Code Editor
Exec=kitty nvim
Terminal=false
Type=Application
Icon=gvim

Refresh the applications in the appVM and the new IDE shortcut should now open nvim in its own kitty window running zsh.