How do I get XDG_CONFIG_HOME from a shell script / command line?

Vi.

Is ${XDG_CONFIG_HOME:-${HOME}/.config} enough or there are more tricks to it?

Is there maybe some xdg-user-dir CONFIG or xdg-settings invocation that gives me where to expect programs' configs?

Gilles 'SO- stop being evil'

${XDG_CONFIG_HOME:-~/.config} is exactly how xdg-user-dirs does it (it's a shell script). It hasn't changed since 2008, so you can consider this to be stable.

Incidentally, you'd better not have whitespace or wildcard in the value of XDG_CONFIG_HOME. If XDG_CONFIG_HOME is unset, special characters in the home directory location are ok. Wildcards in the value of XDG_xxx_DIR also don't work, as do sequences of whitespace other than a single space.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How do I hold a file open (locked) from a Windows command-line shell script?

From Dev

How do I launch `spark-shell` from the command line?

From Dev

How do I safely kill xscreensaver from a script/the command line?

From Dev

How do I run this script with sudo from the command-line?

From Dev

How do I add a line to the shell script?

From Dev

How do I get the default font from the command line?

From Dev

How do I get the default font from the command line?

From Dev

How do I get my IP address from the command line?

From Dev

How to pass a command from Shell script to command line

From Dev

How can I determine the IP address I get from torify (tor) in shell command line (linux)?

From Dev

How can I pass a command line argument into a shell script?

From Dev

How to configure a new NetworkManager connection from a shell script/command line?

From Dev

How can I force all applications to use $XDG_CONFIG_HOME instead of ~/.APP?

From Dev

How can I force all applications to use $XDG_CONFIG_HOME instead of ~/.APP?

From Dev

How do I run a command in bash from zsh (or some other shell) in one line?

From Dev

How do I log every output from a PHP script from the command line?

From Dev

How do I stop multiple line output from command substitution from being concatenated in BASH script?

From Dev

How do I save a string of numbers from an ongoing command to a list in a shell script?

From Dev

get command line agrument by variable in shell script

From Dev

How do I run a shell script without using “sh” command?

From Dev

How do I execute a python script from the command line using custom commands?

From Dev

How do I fix "ReferenceError: System is not defined" when running script from command line?

From Dev

How do I execute a python script from the command line using custom commands?

From Dev

How do I open a new command line window from an sh script and then pass in multiple commands

From Dev

UNIX: How do I make my script return the sum of the numbers passed to it from the command line?

From Dev

How can I get a list of all repositories and PPAs from the command line into an install script?

From Dev

How can I get a Perl script to accept parameters from both STDIN and command line arguments?

From Dev

How can I get a list of all repositories and PPAs from the command line into an install script?

From Dev

How can I get a Perl script to accept parameters from both STDIN and command line arguments?

Related Related

  1. 1

    How do I hold a file open (locked) from a Windows command-line shell script?

  2. 2

    How do I launch `spark-shell` from the command line?

  3. 3

    How do I safely kill xscreensaver from a script/the command line?

  4. 4

    How do I run this script with sudo from the command-line?

  5. 5

    How do I add a line to the shell script?

  6. 6

    How do I get the default font from the command line?

  7. 7

    How do I get the default font from the command line?

  8. 8

    How do I get my IP address from the command line?

  9. 9

    How to pass a command from Shell script to command line

  10. 10

    How can I determine the IP address I get from torify (tor) in shell command line (linux)?

  11. 11

    How can I pass a command line argument into a shell script?

  12. 12

    How to configure a new NetworkManager connection from a shell script/command line?

  13. 13

    How can I force all applications to use $XDG_CONFIG_HOME instead of ~/.APP?

  14. 14

    How can I force all applications to use $XDG_CONFIG_HOME instead of ~/.APP?

  15. 15

    How do I run a command in bash from zsh (or some other shell) in one line?

  16. 16

    How do I log every output from a PHP script from the command line?

  17. 17

    How do I stop multiple line output from command substitution from being concatenated in BASH script?

  18. 18

    How do I save a string of numbers from an ongoing command to a list in a shell script?

  19. 19

    get command line agrument by variable in shell script

  20. 20

    How do I run a shell script without using “sh” command?

  21. 21

    How do I execute a python script from the command line using custom commands?

  22. 22

    How do I fix "ReferenceError: System is not defined" when running script from command line?

  23. 23

    How do I execute a python script from the command line using custom commands?

  24. 24

    How do I open a new command line window from an sh script and then pass in multiple commands

  25. 25

    UNIX: How do I make my script return the sum of the numbers passed to it from the command line?

  26. 26

    How can I get a list of all repositories and PPAs from the command line into an install script?

  27. 27

    How can I get a Perl script to accept parameters from both STDIN and command line arguments?

  28. 28

    How can I get a list of all repositories and PPAs from the command line into an install script?

  29. 29

    How can I get a Perl script to accept parameters from both STDIN and command line arguments?

HotTag

Archive