-
-
Notifications
You must be signed in to change notification settings - Fork 180
Use xdg-user-dir to respect user-defined XDG directories #437
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
base: master
Are you sure you want to change the base?
Conversation
is xdg-user-dir native to fresh arch install? |
Oh, you're right... I think that the (It’s available in the official Arch repositories via: The purpose of To make the this work, it might be helpful to check whether |
I don't mind adding it as default. But do debian have xdg-user-dirs as an official package? @Senshi111 Will this break debian ? @richen604 How about in nix? This should add another "safe" layer on xdg stuff so I would like to add it upstream. @Metalhearf If both distros approved this add the package in Scripts/pkg_core.lst |
Debian have |
yes, although hydenix/nix configs xdg separately (i dont use in general i like this, @Metalhearf you should also include fish's config in case fish users delete |
@Metalhearf Add check if the package is installed. It might return an error message into the variable. |
Ops I have a major concern. I realized we will do a multiple subshell calls. Are we sure to add this into the init of phase of the shell? |
I admit I’m not sure what the full implications of this are.
|
@Metalhearf Then we might want to do this format The overall latency is around 3.2 ms with xdg-user-dir. Even though it's ms it should still be noticeable because we added a lot of variables. This can be fixed by the above proposal. Though when we adapt UWSM soon this will setup the xdg env var so xdg-user-dir will act as a redundancy which sounds good for me. |
Use xdg-user-dir to respect user-defined XDG directories
Description
This pull request addresses an issue with HyDE's handling of user-defined XDG directories, i.e. the directory for pictures (
XDG_PICTURES_DIR
). Previously, the configuration used hardcoded paths (like$HOME/Pictures
), which ignored user customizations that may have been defined in the~/.config/user-dirs.dirs
file.The Problem with a custom "/home/user/Images" Directory
The issue I faced was that I had customized my
XDG_PICTURES_DIR
to point to/home/user/Images
instead of the defaultPictures
directory. This was done by editing the~/.config/user-dirs.dirs
file, which is where users can define custom locations for various directories (Documents, Pictures, Music, etc.).However, in the previous version of HyDE, the path to the pictures directory was hardcoded as
$HOME/Pictures
in theConfigs/.zshenv
file. Because of this, even though I had setXDG_PICTURES_DIR
to/home/user/Images
in myuser-dirs.dirs
file, the system would still reference$HOME/Pictures
, which was not the directory I wanted to use. This caused a mismatch and the pictures were not being stored in the intended location. (I've found this issue while using the screenshot tool, which kept sending images to$HOME/Pictures/Screenshots
).Motivation for the Change
To address this, I modified the configuration so that HyDE would respect the user's custom directory settings. This solution uses the
xdg-user-dir
command, which automatically fetches the user-defined directory paths, ensuring that the correct directories are used based on what is configured in~/.config/user-dirs.dirs
.By making this change, my issue went away. Now, HyDE correctly uses the customized directories like
XDG_PICTURES_DIR
, regardless of whether they are set to the default or custom values, such as my/home/user/Images
.Type of change
Checklist
Please put an
x
in the boxes that apply:Additional context
This change ensures compatibility with users who have customized their directory structure. It dynamically fetches directories like
XDG_PICTURES_DIR
from the user’s environment configuration, making it flexible for any user setup.