News for hackers. Stuff that matters.
Re:Show HN: AutoHotkey for Linux by chrismorgan on Tuesday August 30, 2022 @04:14PM (#32654500)
Isn’t it a bit late to do something like this tied to X? I get the impression almost all distributions now default to Wayland. This feels like something that would have been good a decade ago, but is too late now.

(Mind you, this would be a good deal harder to implement in Wayland, where possible at all, since Wayland is predicated around a security model where this kind of thing is deliberately not supported. You can either go with something compositor-specific, and I don’t know if this is possible for all compositors, though I get the impression that it should be possible for at least wlroots; or work more the way ydotool does, where possible, in basically providing a fake input device.)

Re:Show HN: AutoHotkey for Linux by yjftsjthsd-h on Tuesday August 30, 2022 @04:20PM (#32654565)
I mean, as you note, Wayland almost certainly can't provide this kind of functionality by design. It offers some ways to fake input, but AFAIK no way to hook/listen to input events without hoping that each compositor adds a way to do so. In contrast, X11 trivially enables read and write access to input events, as well as the ability to intercept input and rewrite it before applications see it. Also, while many distros now ship Wayland as the nominal default, last I'd seen it was actually used by a minority of users compared to Xorg (if we exclude ChromeOS, which seems reasonable for this conversation).
Re:Show HN: AutoHotkey for Linux by smartmic on Tuesday August 30, 2022 @05:01PM (#32655012)
> Also, while many distros now ship Wayland as the nominal default, last I'd seen it was actually used by a minority of users compared to Xorg

You touched a good point. The one and only metric to measure success in software is the number of active users. However, i do not know of any statistics Xorg vs. Wayland users. Personally, i have no reason to switch away from X11. In contrary, it was and is a loyal companion now already for decades. I trust the Lindy effect that X11 will stay relevant for a very long time. So kudos for the OP for creating this!

Re:Show HN: AutoHotkey for Linux by jhoechtl on Wednesday August 31, 2022 @04:55AM (#32659907)
So you are not using fractional scaling which is reason enough to switch to Wayland.
Re:Show HN: AutoHotkey for Linux by pantalaimon on Wednesday August 31, 2022 @06:01AM (#32660270)
This is a Gnome issue. It works in KDE (and there are patches to make it work in Gnome too)

https://wiki.archlinux.org/title/HiDPI#Xorg

Re:Show HN: AutoHotkey for Linux by yjftsjthsd-h on Wednesday August 31, 2022 @12:46PM (#32664867)
Different people care about different features. If you want fractional scaling and can't get it on X11, use Wayland. If you want AHK, use X11. Unfortunately, neither option currently has all the features of the other.
Re:Show HN: AutoHotkey for Linux by t-3 on Tuesday August 30, 2022 @10:52PM (#32657824)
Wayland has had very little traction outside of RH and other corp-heavy groups. It didn't work for too long, now it works and still requires an X server to do anything useful while having less applications, worse features, higher resource usage in the available systems. I haven't seen anything to motivate me to try to switch since the "new shiny" wore off a decade or so ago.
Re:Show HN: AutoHotkey for Linux by chrismorgan on Tuesday August 30, 2022 @11:27PM (#32658029)
I used i3 on older laptops, and decided to try switching to Sway when I got my current laptop 16 months ago. I’ve switched back to i3 on it on a few occasions for screen sharing in Zoom, and wow, I’d forgotten how bad the tearing is, and how not-great the management of inputs and outputs (though this is unlikely to affect full desktop environments like GNOME and KDE), and how annoying it is to not be able to use my XF86AudioMicMute key because its key code is 256 (it was a pain to get working in Sway, requiring xkb_file with a manually-tweaked keymap, but as far as I can tell it’s simply not possible under Xorg which has a hard limit of 255). Plus scaling simply doesn’t work at all well in X/i3, to say nothing of flat-out not supporting mixed scaling, whereas it all just works in Sway (the only apps I have to tweak are ones run via Xwayland, which sometimes but don’t always get it right out of the box).
Re:Show HN: AutoHotkey for Linux by freedomben on Tuesday August 30, 2022 @11:36PM (#32658092)
> I haven't seen anything to motivate me to try to switch since the "new shiny" wore off a decade or so ago.

I get some terrible screen tearing on X, especially when using OBS. On Wayland it's solid. With X/Wayland the best thing it can do is be invisible.

Re:Show HN: AutoHotkey for Linux by t-3 on Wednesday August 31, 2022 @12:01AM (#32658246)
I haven't seen screen tearing anywhere in more than a decade, so that doesn't have much weight with me, but I can see how it could be an issue for video editing (if OBS is what Google suggests it is). Now I'm interested in why X and Wayland would be different - screen tearing seems like it would be at a lower level (mesa?) than the display server? I don't understand how any of a modern graphics stack actually works though.
Re:Show HN: AutoHotkey for Linux by freedomben on Wednesday August 31, 2022 @10:52AM (#32662799)
Same, I've wanted to dig into the modern linux graphics stack for a while now but never seem to have time for it. So much complexity these days
Re:Show HN: AutoHotkey for Linux by halz on Tuesday August 30, 2022 @04:48PM (#32654847)
There is some rough functionality for operations with wlroots via wlrctl https://git.sr.ht/~brocellous/wlrctl and more generically (via uinput) ydotool https://github.com/ReimuNotMoe/ydotool
Re:Show HN: AutoHotkey for Linux by yyyk on Tuesday August 30, 2022 @08:30PM (#32656911)
>Isn’t it a bit late to do something like this tied to X?

At the moment, Wayland is used only by a minority of users, and most are still on X11. Sure, distros may often default to Wayland, yet almost no distro has switched the user's default upon upgrading.

Most users aren't new users or installing on new systems, and even for new users X is occasionally still default (e.g. every existing BSD, some KDE distros).

I estimate it's another 5 years before another new computer cycle and Wayland maturing will make X less relevant. 15-25-more years before we could even consider removing support.

Re:Show HN: AutoHotkey for Linux by phil294 on Tuesday August 30, 2022 @05:27PM (#32655339)
Wayland will be an interesting challenge, but I think there's still plenty of time before that happens.

If we figure out that this kind of automation is impossible on Wayland, I think it should still be possible to hook into the raw keyboard events with kbd and such, no? Requires root though.

Re:Show HN: AutoHotkey for Linux by viraptor on Tuesday August 30, 2022 @05:06PM (#32655061)
Re:Show HN: AutoHotkey for Linux by jcelerier on Wednesday August 31, 2022 @07:20AM (#32660738)
Reading that thread is infuriating and still full of the ridiculous idea that every single use case should be defined through specific protocols