jzbor / marswm

A modern window manager featuring dynamic tiling (rusty successor to moonwm).
https://jzbor.de/marswm/
MIT License
47 stars 3 forks source link

Don't hardcode paths #8

Closed 0323pin closed 1 year ago

0323pin commented 1 year ago

Linux mostly uses /usr/bin with some exceptions that use /usr/local/bin, FreeBSD and OpenBSD use /usr/local/bin.

But, we (NetBSD) believe that /usr/local/bin should be what it says on the label, i.e. a place where you can install things you build yourself, think opt on Linux. Therefor, our packages are installed into /usr/pkg/bin.

So, let's not hardcode ${PATH} and let's assume the package is installed to the correct path, independently of what system we are installing on.

jzbor commented 1 year ago

Hi, this file was intended as an example for a manual installation rather than for direct distribution via repos. However changing the line might make sense nevertheless to avoid confusion. I am not sure why Linux distros tend to use the whole path, but I guess it is to avoid the wrong program being executed...

0323pin commented 1 year ago

Hi

:Hi, this file was intended as an example for a manual installation rather than for direct distribution via repos.

In this case it makes sense. Although, I guess there's a risk that others will think the same as me.

However changing the line might make sense nevertheless to avoid confusion.

If one is installing with cargo wouldn't it make sense to have Exec=/home/${USER}/.cargo/bin/marswm?

I am not sure why Linux distros tend to use the whole path, but I guess it is to avoid the wrong program being execute

On most cases it's simply unnecessary but yes, I believe that's the reason.

All in all, I'm fine with your explanation. Feel free to close this PR. I won't include the .desktop file in the package. Or, I could still do it using sed -e 's,/usr/local,${PREFIX},g' as a pre-install step. If you'd wonder why I can do this, it's because, pkgsrc uses ${PREFIX} as a variable that can be defined by the user and it's set when bootstraping pkgsrc.

jzbor commented 1 year ago

Hi, I have thought about it a little and decided to provide a somewhat portable desktop file. This way distributions can reuse it, while users doing a manual installation may still use it as an example. For packagers a simple sed command should do the job to adjust the path.

Let me know, what you think of it...

0323pin commented 1 year ago

Hi, I'm fine with it. But, I'm fine if you keep /usr/local also, it's just a different argument to sed :)