Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installer should respect XDG_USER_DIRS on Linux #157

Open
modelmat opened this issue Jan 18, 2021 · 1 comment
Open

Installer should respect XDG_USER_DIRS on Linux #157

modelmat opened this issue Jan 18, 2021 · 1 comment

Comments

@modelmat
Copy link

On Linux the installer installs to ~/Desktop always. https://github.com/wpilibsuite/WPILibInstaller-Avalonia/blob/master/WPILibInstaller-Avalonia/ViewModels/InstallPageViewModel.cs#L742

If xdg-user-dirs is used to place it somewhere else, the installer creates the ~/Desktop directory and puts it in there. Ideally it should use xdg-user-dir DESKTOP to find the location of the desktop, then default to ~/Desktop. (note that the environment variables are not always set and may need to be fetched from ~/.config/user-dirs.dirs)

@PeterJohnson
Copy link
Member

PeterJohnson commented Jan 18, 2021

It's been pointed out that xdg-user-dir is not installed by default, so it will be necessary to implement its logic, potentially by embedding (part of) this as a /bin/sh command line.

#!/bin/sh

test -f ${XDG_CONFIG_HOME:-~/.config}/user-dirs.dirs && . ${XDG_CONFIG_HOME:-~/.config}/user-dirs.dirs
if [ "x$1" = "xDESKTOP" ]; then
  eval echo \${XDG_${1}_DIR:-$HOME/Desktop}
else
  eval echo \${XDG_${1}_DIR:-$HOME}
fi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants