You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Move config directory (& state?) to XDG paths #144
(Thanks for writing gmailctl and releasing it as open source!)
The proliferation of dot files/directories in users' home directories, the poor portability of paths like ".app" as well as the mixing of config and state are problems that are being addressed by the (now ubiquitous) freedesktop.org XDG base directory specification. This specifies directories like ~/.config/gmailctl (and possibly ~/.local/share/token.json) on Linux systems, and equivalent paths on OS X & Windows, unless overriden by environment variables. It'd be great if gmailctl moved its paths to match the XDG specification.
The implementation should be easy enough, but there are multiple Go libraries implementing this as well¹:
I agree that this would be an improvement for new users.
The problem is the migration path for existing installations. I would avoid moving their files around, as many use symlinks or rely on the config directory to not change. Perhaps the only safe way to do this would be to always check if $HOME/.gmailctl is empty, and if so use the new path.
In theory it could be improved by using a library, but it's only a 4 additional lines of code to avoid the primary issue of requiring a folder directly in the home directory. Seeing as this issue has the most upvotes, I think it would be a welcome improvement over the existing behaviour!
I'm inclined at this point to say that this is a nice to have but will probably not be implemented. The risk of breaking existing users, plus introducing a weird behavior by which in certain situations the old directory is considered and in others we get the standard behavior, for me are not worth the trouble.
This can also be easily solved by the end user by simply aliasing gmailctl:
alias gmailctl='gmailctl --config=$HOME/.config/gmailctl'
I'll keep this open for now as I want to take another look in case there's an easy and clear to understand solution I'm missing.
Reacted by Bill Kaguru Wanjohi, Aditya Narayan, Peter Hoeg and Lucas Garron
This remains the most upvoted issue by over a factor of 2, so I think it's fair to say quite a few of us nerds who like to keep our email config clean also like to keep our home directory clean.
Activity
[-]Move config director (& state?) to XDG paths[/-][+]Move config directory (& state?) to XDG paths[/+]mbrt commentedon Sep 29, 2020
I agree that this would be an improvement for new users.
The problem is the migration path for existing installations. I would avoid moving their files around, as many use symlinks or rely on the config directory to not change. Perhaps the only safe way to do this would be to always check if
$HOME/.gmailctlis empty, and if so use the new path.Default to `~/.config/gmailctl` for the config dir.
Default to `~/.config/gmailctl` for the config dir.
Default to `~/.config/gmailctl` for newly created config dirs
Default to `~/.config/gmailctl` for newly created config dirs
lgarron commentedon Mar 21, 2024
I've submitted a PR for this: #393
In theory it could be improved by using a library, but it's only a 4 additional lines of code to avoid the primary issue of requiring a folder directly in the home directory. Seeing as this issue has the most upvotes, I think it would be a welcome improvement over the existing behaviour!
Default to `~/.config/gmailctl` for newly created config dirs
mbrt commentedon Mar 23, 2024
I'm inclined at this point to say that this is a nice to have but will probably not be implemented. The risk of breaking existing users, plus introducing a weird behavior by which in certain situations the old directory is considered and in others we get the standard behavior, for me are not worth the trouble.
This can also be easily solved by the end user by simply aliasing
gmailctl:I'll keep this open for now as I want to take another look in case there's an easy and clear to understand solution I'm missing.
Default to `~/.config/gmailctl` for newly created config dirs
Default to `~/.config/gmailctl` for the config dir (unless `~/.gmailc…
Default to ~/.config/gmailctl for newly created config dirs.
lgarron commentedon Jun 17, 2026
This remains the most upvoted issue by over a factor of 2, so I think it's fair to say quite a few of us nerds who like to keep our email config clean also like to keep our home directory clean.
I've rebased and updated #393 at #455
Default to ~/.config/gmailctl for newly created config dirs.
Default to ~/.config/gmailctl for newly created config dirs. (#455)