💾 Archived View for gemini.ctrl-c.club › ~phoebos › logs › freenode-kisslinux-2020-07-13.txt captured on 2021-12-17 at 13:26:06.

View Raw

More Information

-=-=-=-=-=-=-

2020-07-13T15:50:21 #kisslinux <E5ten> himmalerin: I've looked through util-linux multiple times trying to figure out how it finds PARTUUID and I always end up giving up confused, I wish I could figure out how to get PARTUUID without libblkid
2020-07-13T15:51:03 #kisslinux <E5ten> illiliti: nice, you switched to the ioctl
2020-07-13T15:53:37 #kisslinux <E5ten> could you add support for touchscreens?
2020-07-13T16:00:02 #kisslinux <illiliti> i'll try
2020-07-13T16:06:25 #kisslinux <E5ten> from what I can gather I think you also have to use EVIOCGPROP or the properties sysfs file for additional information for checking if it's a touchscreen
2020-07-13T16:10:03 #kisslinux <illiliti> no, EVIOCGPROP is not necessary
2020-07-13T16:10:09 #kisslinux <illiliti> from kernel docs:
2020-07-13T16:10:10 #kisslinux <illiliti> Note: Historically a touch device with BTN_TOOL_FINGER and BTN_TOUCH was interpreted as a touchpad by userspace, while a similar device without BTN_TOOL_FINGER was interpreted as a touchscreen. For backwards compatibility with current userspace it is recommended to follow this distinction. In the future, this distinction will be deprecated and the device properties ioctl EVIOCGPROP, defined in
2020-07-13T16:10:16 #kisslinux <illiliti> linux/input.h, will be used to convey the device type.
2020-07-13T16:11:13 #kisslinux <illiliti> i.e device without BTN_TOOL_FINGER is touchscreen
2020-07-13T16:14:24 #kisslinux <illiliti> deprecation doesn't mean `it will not work in future`. kernel doesn't break userspace(c)
2020-07-13T16:17:55 #kisslinux <E5ten> makes sense
2020-07-13T16:37:14 #kisslinux <illiliti> pushed
2020-07-13T16:37:37 #kisslinux <illiliti> but i don't have a ability to test it...
2020-07-13T16:38:54 #kisslinux <illiliti> you can test it by using LD_LIBRARY_PATH
2020-07-13T16:39:19 #kisslinux <illiliti> e.g LD_LIBRARY_PATH=<repo> libinput list-devices
2020-07-13T16:51:45 #kisslinux <E5ten> I can just switch my config to an InputClass and see if I have a touchscreen when I start xorg lol
2020-07-13T17:10:46 #kisslinux <E5ten> doesn't seem to be adding ID_INPUT_TOUCHSCREEN to mine
2020-07-13T17:11:33 #kisslinux <E5ten> lemme double check that I didn't mess up and accidentally build with an older commit or something
2020-07-13T17:13:58 #kisslinux <E5ten> yeah nevermind, it's working, thanks
2020-07-13T17:15:38 #kisslinux <illiliti> nice
2020-07-13T17:55:41 #kisslinux <xzcvczx> i really hate xauth
2020-07-13T18:01:32 #kisslinux <illiliti> why do you need this crap? kill it with fire
2020-07-13T18:12:06 #kisslinux <himmalerin> Does busybox's `sed -E` not know about negating escaped characters? [^a] works but [^]] doesn't
2020-07-13T18:14:17 #kisslinux <himmalerin> The full command I'm trying to use is `sed -E 's|([)([^]]+)(])|a|gi' regex-test` with a file named "regex-test" containing just `[test]`
2020-07-13T18:14:34 #kisslinux <xzcvczx> kill xauth with fire? would be nice
2020-07-13T18:16:32 #kisslinux <E5ten> you don't escape the ] there, if you want to include [ or ] in the range, you make them the first characters after it opens (or after the ^ if you're negating)
2020-07-13T18:17:04 #kisslinux <E5ten> like [][] matches either [ or ]
2020-07-13T18:17:54 #kisslinux <E5ten> cuz it knows that there's nothing in between the opening [ and the first ], so it considers the ] part of the range instead of thinking it's the closing ]
2020-07-13T18:18:22 #kisslinux <xzcvczx> what does [[]] do?
2020-07-13T18:19:13 #kisslinux <E5ten> matches exactly [], because the [[] matches the only character in the range, '[', and then there's the ] at the end that isn't part of the range
2020-07-13T18:19:33 #kisslinux <xzcvczx> ah k
2020-07-13T18:20:26 #kisslinux <E5ten> I don't know why you put capture groups around all that stuff though if you're not using 1 etc.?
2020-07-13T18:21:01 #kisslinux <E5ten> sed -E 's|[[^]]+]|a|gi' would be the same wouldn't it?
2020-07-13T18:23:07 #kisslinux <himmalerin> I am, I just trimmed it out a replaced it with 'a' to try and simplify it when I was trying to figure out what was wrong, I use 2. `sed -E 's|[[^]]+]|a|gi'` doesn't seem to match anything
2020-07-13T18:23:40 #kisslinux <E5ten> you escape the [ and ] at the beginning and end, just not the one in the range
2020-07-13T18:23:58 #kisslinux <E5ten> I think my client ate the backslashes I put for the [ at the beginning and ] at the end lol
2020-07-13T18:25:09 #kisslinux <himmalerin> whoops! Yeah, the corrected backslash version seems to work!
2020-07-13T18:26:44 #kisslinux <himmalerin> Think I still need the original version though since I was using 2, but I simplified it down to [([^]]+)] and I switched to 1
2020-07-13T18:29:10 #kisslinux <himmalerin> `sed -E 's|[([^]])+]|1|gi'` gives me 't' (the first letter), whereas `sed -e 's|[[([^]]+)]]|1|gi'` gives me 'test'
2020-07-13T18:40:12 #kisslinux <E5ten> illiliti: wouldn't it be beneficial to get the EVIOCGPROP data for other device types you might add in the future, and for distinguishing devices that emit the same event types?
2020-07-13T18:56:50 #kisslinux <illiliti> E5ten: if someone need device that requires EVIOCPROP, i'll do that
2020-07-13T18:59:03 #kisslinux <illiliti> afaik only accelerometer can be detected via EVIOCGPROP
2020-07-13T18:59:28 #kisslinux <illiliti> i don't use accelerometer
2020-07-13T19:08:41 #kisslinux <E5ten> illiliti: also, I think a lot of functions that you don't have as static should be static? like anything that isn't a udev API function, because otherwise someone else could have a function named e.g. test_bit, link libudev-zero, and I think there'd be a conflict
2020-07-13T19:23:36 #kisslinux <illiliti> nope, i added '-fvisibility=hidden' . i.e all functions that doesn't have UDEV_EXPORT are hidden
2020-07-13T19:23:44 #kisslinux <illiliti> https://github.com/illiliti/libudev-zero/blob/master/Makefile#L6
2020-07-13T19:23:49 #kisslinux <E5ten> ah, I see
2020-07-13T19:25:00 #kisslinux <E5ten> but for functions not used outside of the file they're in, is there any reason not to mark them static?
2020-07-13T19:26:12 #kisslinux <illiliti> no reason, but there any reason to mark them static?
2020-07-13T19:26:37 #kisslinux <illiliti> i think it's senseless
2020-07-13T19:27:18 #kisslinux <E5ten> imo it'd be preferable if things worked as intended even if someone overrid -fvisibility=hidden or, compiled source files manually, etc.
2020-07-13T19:28:25 #kisslinux <illiliti> overriding -fvisibility=hidden breaks things
2020-07-13T19:31:23 #kisslinux <illiliti> also, 'static' breaks shared functions. see udev_list.c
2020-07-13T19:32:41 #kisslinux <illiliti> to properly use 'static' i need to combine all files into one which is horrible i guess...
2020-07-13T19:35:58 #kisslinux <illiliti> static provide less flexibility than visibility=hidden|default
2020-07-13T19:38:39 #kisslinux <E5ten> fair enough, but aside from udev_list stuff, you could still mark all other non-exported functions static and remove the headers that're only included by the corresponding .c, and that wouldn't take away from your ability to use -fvisibility=hidden or UDEV_EXPORT or anything
2020-07-13T19:47:58 #kisslinux <illiliti> pushed
2020-07-13T19:49:05 #kisslinux <illiliti> wow, gcc popups a lot of warnings while clang don't
2020-07-13T19:49:15 #kisslinux <illiliti> lol
2020-07-13T19:54:51 #kisslinux <E5ten> oh lol, what're the warnings, I use clang so I didn't get them
2020-07-13T19:55:13 #kisslinux <illiliti> me too, lmao
2020-07-13T19:56:17 #kisslinux <E5ten> do you mean new warnings cuz of the static stuff or just normal warnings you hadn't noticed till now cuz you don't use gcc?
2020-07-13T19:56:37 #kisslinux <illiliti> termbin.com/kkbo
2020-07-13T19:57:39 #kisslinux <E5ten> I guess you should make file PATH_MAX + 7 lol?
2020-07-13T19:58:52 #kisslinux <E5ten> I don't even understand the EVIOCGBIT ones
2020-07-13T20:05:22 #kisslinux <E5ten> I think the sys/sysmacros.h include in udev_enumerate.c isn't needed
2020-07-13T20:16:38 #kisslinux <E5ten> and this recommendation is definitely one I'd understand not wanting to do, cuz it's a lot more intrusive than just adding "static", but if you wanted to make it so one could have the correct symbols visible even if they built without -fvisibility=hidden you could move the unexported udev_list functions to udev_list.h from udev_list.c, and mark them static inline
2020-07-13T20:53:16 #kisslinux <illiliti> hmmm, those EVIOCGBIT warnings are really gcc shenanigans
2020-07-13T20:54:06 #kisslinux <illiliti> casting EVIOCGBIT macro to int fixes the warning
2020-07-13T22:56:04 #kisslinux <E5ten> I don't understand those warnings at all, why is it being converted to int at all when the arg to ioctl is unsigned long?
2020-07-13T23:10:42 #kisslinux <illiliti> ioctl(int fd, int req, ...)
2020-07-13T23:11:54 #kisslinux <E5ten> oh, I'm on glibc lol, that's why, I wonder why musl has int argument and glibc has unsigned long
2020-07-13T23:12:36 #kisslinux <E5ten> POSIX has int
2020-07-13T23:14:28 #kisslinux <illiliti> https://github.com/ensc/dietlibc/blob/master/include/sys/ioctl.h#L34
2020-07-13T23:14:46 #kisslinux <illiliti> https://github.com/wbx-github/uclibc-ng/blob/master/include/sys/ioctl.h#L41
2020-07-13T23:15:03 #kisslinux <E5ten> so it varies a lot then
2020-07-13T23:36:54 #kisslinux <illiliti> i wonder why this https://github.com/illiliti/libudev-zero/blob/master/udev_device.c#L324 doesn't trigger gcc truncation warning while this https://github.com/illiliti/libudev-zero/blob/master/udev_device.c#L463 does lol
2020-07-13T23:42:16 #kisslinux <E5ten> cuz there you're adding a char pointer with unspecified size, whereas with the other one you're printing a char array of PATH_MAX size, so it knows you're expecting to get up to PATH_MAX - 1 characters in the first char array, and if you got that many and then put that and "/uevent" in the second one it'd truncate
2020-07-13T23:45:13 #kisslinux <illiliti> ok, thanks