Nushell is a project that I’m really excited about. I won’t be going into detail about what makes it so great here, as I want to do it proper justice. However, suffice to say that it’s worth considering as your new shell. Scott Hanselman explains what a Shell is really well, in case you’re wondering..

The Problem

I use Linux as my daily driver, and use Sway as a Window Manager. It’s written in C, but is quite nice regardless, much like Linux. However, Sway is a pretty minimal solution, and requires some separate programs to be usable. For example, I use wldash to launch programs.

When I switched to Nushell from Bash, I noticed that wldash couldn’t detect flatpak apps!

Seems to be related to this: https://github.com/flatpak/flatpak/issues/3109

So it seems like Nushell doesn’t pick up the XDG_DATA_DIRS environment variable properly, which means that I don’t get to run my flatpak apps. :(

TL;DR

A kind soul explained that you could set the XDG environment variables. I modified it slightly to include the folders that flatpak complained about:

# /etc/security/pam_env.conf
# XDG DIRECTORIES
XDG_RUNTIME_DIR DEFAULT=/var/tmp/xdg
XDG_DATA_DIRS   DEFAULT=/usr/local/share:/usr/share:/var/lib/flatpak/exports/share:@{HOME}/.local/      share/flatpak/exports/share
XDG_CACHE_HOME  DEFAULT=@{HOME}/.cache
XDG_CONFIG_HOME DEFAULT=@{HOME}/.config
XDG_DATA_HOME   DEFAULT=@{HOME}/.local/share
XDG_STATE_HOME  DEFAULT=@{HOME}/.local/state