jcnils/protonhax

XDG_RUNTIME_DIR instead of hardcoded /run/user/$UID

Closed this issue · 4 comments

phd=/run/user/$UID/protonhax

Should this not be using XDG_RUNTIME_DIR instead? Or prefer XDG_RUNTIME_DIR if it is set, e.g.:

   phd=${XDG_RUNTIME_DIR:-/run/user/$UID}/protonhax

I don't know. I am still learning bash script and environment variables.

I read a little about XDG_RUNTIME_DIR, and you are right, I will run some tests later today and update it.

Thank you very much for the guidance.

I pushed the changes to AUR. Thank you very much, and let me know if there are any more things that could be improved!

Now that you mention it, you need to change the #!/bin/sh to #!/bin/bash, because your script uses features that are not compatible with basic sh (such as dash, which is the sh used on Ubuntu), in particular "[[" is non-sh.

Thanks again, I did the change.

I started reading on how to make the script compatible across shells, like using "test" instead of "[[¨.
But then I got into a rabbit hole of shell and syntax.

#!/bin/bash will work well for this purpose.