~mil/sxmo-tickets#582: 
deviceprofile should be manifested in INI files

Use INI inside /usr/share/sxmo/deviceprofile/ instead of /usr/bin/

P.S. When I first though of it, I thought of .desktop files, but it didn't make sense as INI is good enough and widely known.

Status
REPORTED
Submitter
~kohn
Assigned to
No-one
Submitted
8 months ago
Updated
8 months ago
Labels
No labels applied.

~kohn 8 months ago

Use INI files inside /usr/share/sxmo/deviceprofile/ instead of Shell files inside /usr/bin/

~noneofyourbusiness 8 months ago*

well-known but with various dialects, which one to choose?

Also this introduces yet another parser. See section 5 https://cr.yp.to/qmail/guarantee.html

~aren 8 months ago

What would the benefit of this be, especially considering ini files are a pain to parse from a shell script?

~kohn 8 months ago

Desktop files, maybe?

I'm not comfortable havnig such type of files, which I consider as configuration files, inside /usr/bin/, and it seems weird to me.

Make something else, or even keep the Bash files, but don't locate it under /usr/bin/, but rather under /usr/share/sxmo/deviceprofile/.

I'm not an expert.

~noneofyourbusiness 8 months ago

kohn: sxmo itself is already mostly written in POSIX shell script, introducing a config file format introduces more complexity, using environment variables ( https://man7.org/linux/man-pages/man7/environ.7.html ) is much easier.

Sure, one could write a program that just sets environment variables according to a plain-text file - but that's already the case with the deviceprofile scripts, mixing data and code.

Not using environment variables for this purpose? That would mean rewriting code with little benefit, and as far as I gather, POSIX shell is here to stay.

~noneofyourbusiness 8 months ago*

belonging under /usr/share/sxmo:

https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch04s11.html

disagrees, it's for architecture-independent data

https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch04s07.html

seems to put it under libexec

~kohn 8 months ago

sxmo itself is already mostly written in POSIX shell script, introducing a config file format introduces more complexity.

Thanks. I didn't know this.

I didn't understand your second comment.

~noneofyourbusiness 8 months ago

Second comment is about OS directory structure, what folders are for what purpose, according to someone else (LSB Workgroup). With these executable scripts that happen to just set variables, they can belong in multiple.

Since you mentioned not putting them in /usr/bin

Sxmo itself is supposed to be hackable[0] (easy to change), which is part of why it's written in shell scripts.

[0] https://man.sr.ht/~anjan/sxmo-docs-stable/

~kohn 8 months ago

And, of course, SXMO is soon expected to be portable to other OSs other than Alpine Linux.

In any case, it would be nice if there's a simple way to relocate to /usr/share/sxmo/.

I suggest to close this ticket, as raising this discussion is enough.

You, the developers will decide what to do with this.

~stacyharper 8 months ago

I'm in favor of moving the .sh files into a /usr/share/sxmo/deviceprofile or similar folder. If anyone would send a patch in this regard, it would be very much appreciated.

~aren 8 months ago

We don't hard code /usr/share we use XDG_DATA_DIRS, that was contributed like a year ago by wentam who was porting sxmo to nixos.

I'm also in favor of moving the scripts to /usr/share, it should be a simple patch if you'd like to try. You just need to move the files, and add the path in sxmo_init.sh.

Register here or Log in to comment, or comment via email.