Skip to content

XDG Directory Structures

Hey guys,

So I've really come to enjoy the XDG way of saving configuration files.

e.g. ~/.i3/config (less preferred, standard) ~/.config/i3/config (preferred, xdg)

My question is... how compatible is this with other configuration files?

Is it possible to move the configuration files below into xdg structure preferred?

  • ~/.bashrc
  • ~/.fehbg
  • ~/.Xresources
  • ~/.zshrc
  • ~/.xinitrc
14 points5 comments
Open on Reddit
About this post
Posted
Archived
Score
14 · 100% up
Kind
Text
ID
54ebmk

Author

7
posts
41
comments
0
media
View profile

6 comments

You could place them there and create a symlink to what the application usually looks for. But that wouldn't really clean up your directory at all... :/ Sadly, a lot of applications are just not yet XDG compliant.

10 points
unknown author

Deleted before we saved it.

2 points

For some it's not even a matter of time. For instance, the tmux core contributor refuses to add support.

1 points

.bashrc

Bash doesn't support XRDB; I resolve it by having symlinks

.bashrc      -> .config/bash/rc.sh
.bash_login  -> .config/bash/login.sh
.bash_logout -> .config/bash/logout.sh

I also have it put HISTFILE in an XDG location:

HISTFILE=${XDG_CACHE_HOME}/bash/history
mkdir -p "${HISTFILE%/*}"

.xinitrc

Neither xinit nor Xorg support XDG. I resolve it by having a pair of symlinks:

.xinitrc   -> .config/X11/clientrc # for xinit
.xserverrc -> .config/X11/serverrc # for Xorg

.Xresources

To quote Archwiki ([annotation] mine):

  • Most Display managers will load the ~/.Xresources file [via xrdb] on login.
  • The older ~/.Xdefaults file is read when an X11 program starts, but only if xrdb has not been used in the current session.

Now, you've implied that you use xinit instead of a proper XDM. If that's the case, it's just a matter of adjusting the xrdb command in your xinitrc. I have it use the command

xrdb -merge "${XDG_CONFIG_HOME}/X11/resources"
1 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.