pschmitt / pia-tools

Shell script to automate privateinternetaccess port forwarding and starting/stopping transmission when connected/disconnected and other stuff
https://aur.archlinux.org/packages/pia-tools
GNU General Public License v3.0
132 stars 23 forks source link

Default Transmission Config File to the User's $XDG_CONFIG_HOME or $HOME/.config #31

Open noctuid opened 8 years ago

noctuid commented 8 years ago

The previous pull request I made for this does in fact work when pia-tools is run as root. logname can be used to get the name of the logged in user. For example,

sudo -i -u $(logname) echo \$XDG_CONFIG_HOME

If XDG_CONFIG_HOME isn't set, it could fall back to $HOME/.config/transmission-daemon/settings.json.