Skip to content

Instantly share code, notes, and snippets.

@probonopd
Last active May 19, 2024 04:40
Show Gist options
  • Save probonopd/9feb7c20257af5dd915e3a9f2d1f2277 to your computer and use it in GitHub Desktop.
Save probonopd/9feb7c20257af5dd915e3a9f2d1f2277 to your computer and use it in GitHub Desktop.
Think twice about Wayland. It breaks everything!

Think twice before abandoning Xorg. Wayland breaks everything!

Hence, if you are interested in existing applications to "just work" without the need for adjustments, then you may be better off avoiding Wayland.

Wayland solves no issues I have but breaks almost everything I need. Even the most basic, most simple things (like xkill) - in this case with no obvious replacement. And usually it stays broken, because the Wayland folks mostly seem to care about Automotive, Gnome, maybe KDE - and alienating everyone else (e.g., people using just an X11 window manager or something like GNUstep) in the process.

Wayland proponents make it seem like Wayland is "the successor" of Xorg, when in fact it is not. It is merely an incompatible alternative, and not even one that has (nor wants to have) feature parity (missing features). And unlike X11 (the X Window System), Wayland protocol designers actively avoid the concept of "windows" (making up incomprehensible words like "xdg_toplevel" instead).

DO NOT USE A WAYLAND SESSION! Let Wayland not destroy everything and then have other people fix the damage it caused. Or force more Red Hat/Gnome components (glib, Portals, Pipewire) on everyone!

Please add more examples to the list.

Wayland seems to be made by people who do not care for existing software. They assume everyone is happy to either rewrite everything or to just use Gnome on Linux (rather than, say, twm with ROX Filer on NetBSD).

Edit: When I wrote the above, I didn't really realize what Wayland even was, I just noticed that some distributions (like Fedora) started pushing it onto me and things didn't work properly there. Today I realize that you can't "install Wayland", because unlike Xorg, there is not one "Wayland display server" but actually every desktop envrironment has its own. And maybe "the Wayland folks" don't "only care about Gnome", but then, any fix that is done in Gnome's Wayland implementation isn't automatically going to benefit all users of Wayland-based software, and possibly isn't even the implementation "the Wayland folks" would necessarily recommend.

Edit 12/2023: If something wants to replace X11 for desktop computers (such as professional Unix workstations), then it better support all needed features (and key concepts, like windows) for that use case. That people also have displays on their fridge doesn't matter the least bit in that context of discussion. Let's propose the missing Wayland protocols for full X11 feature parity.

Wayland is broken by design

  • A crash in the window manager takes down all running applications
  • You cannot run applications as root
  • You cannot do a lot of things that you can do in Xorg by design
  • There is not one /usr/bin/wayland display server application that is desktop environment agnostic and is used by everyone (unlike with Xorg)
  • It offloads a lot of work to each and every window manager. As a result, the same basic features get implemented differently in different window managers, with different behaviors and bugs - so what works on desktop environment A does not necessarily work in desktop environment B (e.g., often you hear that something "works in Wayland", even though it only really works on Gnome and KDE, not in all Wayland implementations). This summarizes it very well: https://gitlab.freedesktop.org/wayland/wayland/-/issues/233

Apparently the Wayland project doesn't even want to be "X.org 2.0", and doesn't want to provide a commonly used implementation of a compositor that could be used by everyone: https://gitlab.freedesktop.org/wayland/wayland/-/issues/233. Yet this would imho be required if they want to make it into a worthwile "successor" that would have any chance of ever fixing the many Wayland issues at the core.

Wayland breaks screen recording applications

  • MaartenBaert/ssr#431 ❌ broken since 24 Jan 2016, no resolution ("I guess they use a non-standard GNOME interface for this")
  • https://github.com/mhsabbagh/green-recorder ❌ ("I am no longer interested in working with things like ffmpeg/wayland/GNOME's screencaster or solving the issues related to them or why they don't work")
  • vkohaupt/vokoscreenNG#51 ❌ broken since at least 7 Mar 2020. ("I have now decided that there will be no Wayland support for the time being. Reason, there is no budget for it. Let's see how it looks in a year or two.") - This is the key problem. Wayland breaks everything and then expects others to fix the wreckage it caused on their own expense.
  • obsproject/obs-studio#2471 ❌ broken since at least 7 Mar 2020. ("Wayland is unsupported at this time", "There isn't really something that can just be easily changed. Wayland provides no capture APIs")
  • There is a workaround for OBS Studio that requires a obs-xdg-portal plugin (which is known to be Red Hat/Flatpak-centric, GNOME-centric, "perhaps" works with other desktops)
  • phw/peek#1191 ❌ broken since 14 Jan 2023. Peek, a screen recording tool, has been abandoned by its developerdue to a number of technical challenges, mostly with Gtk and Wayland ("Many of these have to do with how Wayland changed the way applications are being handled")

As of February 2024, screen recording is still broken utterly on Wayland with the vast majority of tools. Proof

Workaround: Find a Wayland compositor that supports the wlr-screencopy-unstable-v1 protocol and use wf-recorder -a. The default compositor in Raspberry Pi OS (Wayfire) does, but the default compositor in Ubuntu doesn't. (That's the worst part of Wayland: Unlike with Xorg, it always depends on the particular Wayand compositor what works and what is broken. Is there even one that supports everything?)

Wayland breaks screen sharing applications

  • jitsi/jitsi-meet#2350 ❌ broken since 3 Jan 2018
  • jitsi/jitsi-meet#6389 ❌ broken since 24 Jan 2016 ("Closing since there is nothing we can do from the Jitsi Meet side.") See? Wayland breaks stuff and leaves application developers helpless and unable to fix the breakage, even if they wanted.

NOTE: As of November 2023, screen sharing in Chromium using Jitsi Meet is still utterly broken, both in Raspberry Pi OS Desktop, and in a KDE Plasma installation, albeit with different behavior. Note that Pipewire, Portals and whatnot are installed, and even with them it does not work.

Wayland breaks automation software

sudo pkg install py37-autokey

This is an X11 application, and as such will not function 100% on 
distributions that default to using Wayland instead of Xorg.

Wayland breaks Gnome-Global-AppMenu (global menus for Gnome)

Wayland broke global menus with KDE platformplugin

Good news: According to this report global menus now work with KDE platformplugin as of 4/2022

Wayland breaks global menus with non-KDE Qt platformplugins

Wayland breaks AppImages that don't ship a special Wayland Qt plugin

  • https://blog.martin-graesslin.com/blog/2018/03/unsetting-qt_qpa_platform-environment-variable-by-default/ ❌ broke AppImages that don't ship a special Wayland Qt plugin. "This affects proprietary applications, FLOSS applications bundled as appimages, FLOSS applications bundled as flatpaks and not distributed by KDE and even the Qt installer itself. In my opinion this is a showstopper for running a Wayland session." However, there is a workaround: "AppImages which ship just the XCB plugin will automatically fallback to running in xwayland mode" (see below).

Wayland breaks Redshift

Update: Some Wayland compositors (such as Wayfire) now support wlr_gamma_control_unstable_v1, see https://github.com/WayfireWM/wayfire/wiki/Tutorial#configuring-wayfire and jonls/redshift#663. Does it work in all Wayland compositors though?

Wayland breaks global hotkeys

Wayland does not work for Xfce?

See below.

Wayland does not work properly on NVidia hardware?

Apparently Wayland relies on nouveau drivers for NVidia hardware. The nouveau driver has been giving unsatisfactory performance since its inception. Even clicking on the application starter icon in Gnome results in a stuttery animation. Only the proprietary NVidia driver results in full performance.

See below.

Wayland does not work properly on Intel hardware

Wayland prevents GUI applications from running as root

  • https://bugzilla.redhat.com/show_bug.cgi?id=1274451 ❌ broken since 22 Oct 2015 ("No this will only fix sudo for X11 applications. Running GUI code as root is still a bad idea." I absolutely detest it when software tries to prevent me from doing what some developer thinks is "a bad idea" but did not consider my use case, e.g., running truss for debugging on FreeBSD needs to run the application as root. https://bugzilla.mozilla.org/show_bug.cgi?id=1323302 suggests it is not possible: "These sorts of security considerations are very much the way that "the Linux desktop" is going these days".)

Suggested solution

Wayland is biased toward Linux and breaks BSD

  • https://blog.netbsd.org/tnf/entry/wayland_on_netbsd_trials_and ❌ broken since 28 Sep 2020 ("Wayland is written with the assumption of Linux to the extent that every client application tends to #include <linux/input.h> because Wayland's designers didn't see the need to define a OS-neutral way to get mouse button IDs. (...) In general, Wayland is moving away from the modularity, portability, and standardization of the X server. (...) I've decided to take a break from this, since it's a fairly huge undertaking and uphill battle. Right now, X11 combined with a compositor like picom or xcompmgr is the more mature option."

Wayland complicates server-side window decorations

  • https://blog.martin-graesslin.com/blog/2018/01/server-side-decorations-and-wayland/ ❌ FUD since at least 27 January 2018 ("I heard that GNOME is currently trying to lobby for all applications implementing client-side decorations. One of the arguments seems to be that CSD is a must on Wayland. " ... "I’m burnt from it and are not interested in it any more.") Server-side window decorations are what make the title bar and buttons of all windows on a system consistent. They are a must have_ for a consistent system, so that applications written e.g., Gtk will not look entirely alien on e.g., a Qt based desktop, and to enforce that developers cannot place random controls into window titles where they do not belong. Client-side decorations, on the other hand, are destroying uniformity and consistency, put additional burden on application and toolkit developers, and allow e.g., GNOME developers to put random controls (that do not belong there) into window titles (like buttons), hence making it more difficult to achieve a uniform look and feel for all applications regardless of the toolkit being used.

Wayland breaks windows rasing/activating themselves

Wayland breaks RescueTime

Wayland breaks window managers

Apparently Wayland (at least as implemented in KWin) does not respect EWMH protocols, and breaks other command line tools like wmctrl, xrandr, xprop, etc. Please see the discussion below for details.

Wayland requires JWM, TWM, XDM, IceWM,... to reimplement Xorg-like functionality

  • Screen recording and casting
  • Querying of the mouse position, keyboard LED state, active window position or name, moving windows (xdotool, wmctrl)
  • Global shortcuts
  • System tray
  • Input Method support/editor (IME)
  • Graphical settings management (i.e. tools like xranrd)
  • Fast user switching/multiple graphical sessions
  • Session configuration including but not limited to 1) input devices 2) monitors configuration including refresh rate / resolution / scaling / rotation and power saving 3) global shortcuts
  • HDR/deep color support
  • VRR (variable refresh rate)
  • Disabling input devices (xinput alternative)

As it currently stands minor WMs and DEs do not even intend to support Wayland given the sheer complexity of writing all the code required to support the above features. You do not expect JWM, TWM, XDM or even IceWM developers to implement all the featured outlined in ^1.

Wayland breaks _NET_WM_STATE_SKIP_TASKBAR protocol

  • https://github.comelectron/electron#33226 ("skipTaskbar has no effect on Wayland. Currently Electron uses _NET_WM_STATE_SKIP_TASKBAR to tell the WM to hide an app from the taskbar, and this works fine on X11 but there's no equivalent mechanism in Wayland." Workarounds are only available for some desktops including GNOME and KDE Plasma.) ❌ broken since March 10, 2022

Wayland breaks NoMachine NX

Wayland breaks xclip

xclip is a command line utility that is designed to run on any system with an X11 implementation. It provides an interface to X selections ("the clipboard"). Apparently Wayland isn't compatible to the X11 clipboard either.

This is another example that the Wayland requires everyone to change components and take on additional work just because Wayland is incompatible to what we had working for all those years.

Wayland breaks SUDO_ASKPASS

Wayland breaks X11 atoms

X11 atoms can be used to store information on windows. For example, a file manager might store the path that the window represents in an X11 atom, so that it (and other applications) can know for which paths there are open file manager windows. Wayland is not compatible to X11 atoms, resulting in all software that relies on them to be broken until specifically ported to Wayland (which, in the case of legacy software, may well be never).

Possible workaround (to be verified): Use the (Qt proprietary?) Extended Surface Wayland protocol casually mentioned in https://blog.broulik.de/2016/10/global-menus-returning/ "which allows you to set (and read?) arbitrary properties on a window". Is it the set_generic_property from https://github.com/qt/qtwayland/blob/dev/src/extensions/surface-extension.xml?

Wayland breaks games

Games are developed for X11. And if you run a game on Wayland, performance is subpar due to things like forced vsync. Only recently, some Wayland implementations (like KDE KWin) let you disable that.

Wayland breaks xdotool

(Details to be added; apparently no 1:1 drop-in replacement available?)

Wayland breaks xkill

xkill (which I use on a regular basis) does not work with Wayland applications.

What is the equivalent for Wayland applications?

Wayland breaks screensavers

Is it true that Wayland also breaks screensavers? https://www.jwz.org/blog/2023/09/wayland-and-screen-savers/

Wayland breaks setting the window position

Other platforms (Windows, Mac, other destop environments) can set the window position on the screen, so all cross-platform toolkits and applications expect to do the same on Wayland, but Wayland can't (doesn't want to) do it.

  • PCSX2/pcsx2#10179 PCX2 (Playstation 2 Emulator) ❌ broken since 2023-10-25 ("Disables Wayland, it's super broken/buggy in basically every scenario. KDE isn't too buggy, GNOME is a complete disaster.")

Wayland breaks color mangement

Apparently color management as of 2023 (well over a decade of Wayland development) is still in the early "thinking" stage, all the while Wayland is already being pushed on people as if it was a "X11 successor".

https://gitlab.freedesktop.org/pq/color-and-hdr/-/blob/main/doc/color-management-model.md

Wayland breaks DRM leasing

According to Valve, "DRM leasing is the process which allows SteamVR to take control of your VR headset's display in order to present low-latency VR content".

Wayland breaks In-home Streaming

Wayland breaks NetWM

Extended Window Manager Hints, a.k.a. NetWM, is an X Window System standard for the communication between window managers and applications

Wayland breaks window icons

Wayland breaks drag and drop

Workarounds

  • Users: Refuse to use Wayland sessions. Uninstall desktop environments/Linux distributions that only ship Wayland sessions. Avoid Wayland-only applications (such as PreSonus Studio One) (potential workaround: run in https://github.com/cage-kiosk/cage)
  • Application developers: Enforce running applications on X11/XWayland (like LibrePCB does as of 11/2023)

Examples of Wayland being forced on users

This is exactly the kind of behavior this gist seeks to prevent.

References

@binex-dsk
Copy link

Fortunately only one of these actually works, so only one implementation is needed.

You're American, you need only one keyboard layout, no surprise you somehow believe Sway "works".

I'd gladly believe you if all three of your points were correct. Also, wlroots is more than sway... I've used other wlroots WMs (KwinFT mostly) and they work just as well. Layout switching has worked well for me through a simple rofi script.

@bodqhrohro
Copy link

wlroots is more than sway

That's the point: there is still no generic mechanism. Wayfire has implemented it by reloading its config at runtime. Nice solution, hehe.

@bodqhrohro
Copy link

I'm delving through the Pango source code to hunt a bug and discovered there are areas which remain unchanged since 00s:
2024-05-14-041410_1920x1200_scrot
Hilariously, the only modern change there by modern GOOME developers is for migrating to the new documentation generator. The one which requires JS, unlike the old static HTML one, which still isn't a complete replacement, and which they manage to put down from time to time which already caused butthurt to me and totally not just to me.

I doubt there still is even a single person who remembers how this code works. Still, no one seems to whine that Pango is dying like X.Org, because of bitrot. Think about it.

@Consolatis
Copy link

Still, no one seems to whine that Pango is dying like X.Org, because of bitrot. Think about it.

You know what else was likely not changed in forever? The yes command. Think about it.

@binex-dsk
Copy link

wlroots is more than sway

That's the point: there is still no generic mechanism. Wayfire has implemented it by reloading its config at runtime. Nice solution, hehe.

wlroots supports it natively and wayfire's solution is stupid.

@bodqhrohro
Copy link

wlroots supports it natively

What do you mean exactly? The aforementioned environment variable mechanism is not dynamic.

The yes command

Nice derailing attempt, but Pango is definitely way more complex. And text rendering is not cast in stone since 00s, at least combined emojis appeared since then. BTW, the genmon plugin for xfce4-panel has drastically increased RAM usage several years ago when I upgraded Pango to a version supporting fonts with embedded colourful images.

@Consolatis
Copy link

The yes command

Nice derailing attempt, but Pango is definitely way more complex. And text rendering is not cast in stone since 00s, at least combined emojis appeared since then. BTW, the genmon plugin for xfce4-panel has drastically increased RAM usage several years ago when I upgraded Pango to a version supporting fonts with embedded colourful images.

Yes, that was exactly my point. You were comparing Pango to X11.

@binex-dsk
Copy link

What do you mean exactly? The aforementioned environment variable mechanism is not dynamic.

Keyboard layout switching is supported in wlroots natively, not through whatever Wayfire does. It supports XKB and can switch at runtime for 7 years now.

@zDEFz
Copy link

zDEFz commented May 15, 2024

A fellow user just reported running a highly demanding patched game with an old lwjgl version runs pretty poorly on wayland KDE plasma6. Switched to X11 and it was immediately playable.
So much for backwards compatibility.

I knew already, X11 performs better for such an old game, but now I got confirmation.

@bodqhrohro
Copy link

Seems like the return of blackouts in Ukraine would finally motivate me to pay more attention to Wayland, huh?
2024-05-17-024024_1920x1200_scrot
20240517_02h40m39s_grim
BTW, I wondered if my anti-GUI ideology and the belief (justification, rather) that the text mode is beneficial in terms of power consumption is still relevant on modern video cards which don't support the text mode natively anymore. Back then, one of primary reasons of my migration to GNU/Linux was the deprecation of text mode in Windows: Alt+Enter doesn't work in CMD.EXE with WDDM anymore, and later (in Windows 10?) they replaced it with a fake fullscreen mode. Back in my student years, I had spent a lot of time in the framebuffer console, being one of the few text mode idelogists on L.O.R. (the other one was saahriktu), and installed a lot of tools like fbi/fim/fimgs/fbterm (Vim/elinks work there "for free") to survive there without having to make a sluggish switch to the X.Org VT. (Wayland totally wasn't ready to use in any form on bare hardware that years.)

And you know what? the consumption is also around 9W when in a text TTY, hehe. X.Org (or Compiz?) consumes energy merely by repaints, so having it in a separate inactive VT doesn't matter much.

(I wonder what would happen if I launch that many windows in Wayfire session, hehe. Or replace Compiz with some lighter WM with no compositing. Wait for more tests.)

@bodqhrohro
Copy link

2024-05-17-030001_1920x1200_scrot
The consumption barely changed when I replaced Compiz with Openbox. But it dropped to 9W too when I minimized (almost) all the windows, hehe.

@bodqhrohro
Copy link

Yeah, just launched Chromium and it's like this:
20240517_03h11m33s_grim
Case closed, it's not X11, it's GUI apps who are greedy.

@ctrlcctrlv
Copy link

I have no idea how anyone is continuing to follow this discussion,* so I decided to ask one of those large neural networks for some help.†

Queries

I've attached 500 comments on a controversial blog post about Wayland vs Xorg. Summarize both sides of the debate.

Based on the 500 comments, there seem to be two main sides to the debate around Wayland vs Xorg:

Arguments critical of Wayland:

  • Wayland breaks compatibility with many existing Linux applications and tools that were built for Xorg, requiring them to be ported or patched to work with Wayland compositors. This places a burden on application developers.
  • Wayland lacks some features and capabilities that Xorg has, like global hotkeys, controlling mouse cursor position, screen capture/sharing in some cases, color management, etc. Implementing these often requires using additional libraries or Wayland protocol extensions.
  • Wayland compositors lack consistency - things that work on GNOME's Mutter may not work the same way on KDE's Kwin or Sway. More standardization is needed.
  • Some see Wayland as being biased towards or controlled by GNOME/Red Hat/Fedora and not caring about other environments.
  • As a newer, less mature protocol, Wayland may have more undiscovered security issues compared to the battle-tested Xorg.

Arguments in favor of Wayland:

  • Xorg is old, archaic and has accumulated a lot of bloat over the years with its many extensions. It has fundamental architectural limitations that are hard to change. A fresh, modern protocol is needed.
  • Wayland has some technical advantages over Xorg, like better performance, smoother graphics, easier HiDPI and mixed refresh rate support, more secure architecture.
  • Many of the lacking features can be implemented as Wayland protocol extensions without the core protocol getting bloated. Libraries like wlroots make it easier to implement compositors.
  • With toolkits like GTK and Qt supporting Wayland and projects like PipeWire, XDG desktop portals providing key functionality, most applications work fine on Wayland now with a few exceptions. XWayland provides backwards compatibility for X11 apps.
  • As Wayland matures and gains adoption, remaining issues and gaps in functionality will get ironed out. But this is a gradual transition and some breakage is inevitable in the process of replacing something as entrenched as Xorg.

In summary, opponents see Wayland as immature, not respecting existing ecosystem/workflows, and trying to force change for change's sake. Proponents see it as a necessary modernization step for the Linux graphics stack to overcome Xorg's legacy limitations, even if the transition is painful. The debate is often quite heated and emotional on both sides.

Here are the last 100 comments. What issues remain to be resolved among the participants—or is the debate simply running in circles?

Based on the last 100 comments, it seems the debate is largely running in circles at this point, with a few new specific issues being raised but no real progress or consensus being reached.

The main recurring points of contention appear to be:

  1. Wayland's readiness and feature-completeness compared to X11. Critics argue it is still lacking key functionality and consistency across implementations, while proponents say it is usable for most people's needs now.

  2. The fragmentation of Wayland implementations across different desktop environments and the lack of universal standards for certain features. This is seen as a regression from X11's uniformity.

  3. Whether the architectural changes in Wayland are justified improvements or needlessly disruptive changes that burden application developers. There is disagreement on how much of an improvement Wayland actually provides over X11.

  4. The influence/control of GNOME, Red Hat, and other major corporate players over the direction of Wayland and surrounding technologies like systemd, compared to the more decentralized development of X11.

  5. Some debate over the backwards compatibility story - how well Wayland supports legacy X11 applications and workflows.

A few new specific pain points were brought up, like issues with screen sharing, VNC remote access, color management, keyboard layout switching, and performance regressions for some games. But in general, the discussion seems to be rehashing earlier arguments rather than reaching any new understanding or agreement.

Both sides appear quite entrenched in their views at this stage. The Wayland critics see it as an immature, over-hyped and politically driven change that is shattering the X11 ecosystem to serve corporate/GNOME interests. The Wayland advocates argue it is a overdue modernization of the Linux graphics stack that is already usable and will only get better, and that X11 is an unmaintainable legacy system holding back progress.

Some frustration and animosity is evident between the camps, with accusations of shilling, trolling and spreading FUD. But no clear resolution seems in sight, as the debate has deadlocked into restating grievances rather than finding common ground. The intractability of some architectural differences between X11 and Wayland makes compromise challenging.

Code for this

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import github
from github import Github

import json

from util import *

def serialize_datetime(dt):
    return dt.strftime('%Y-%m-%d %H:%M:%S')

def serialize_user(user):
    if hasattr(user, 'login'):
        return {
            'login': user.login,
            'id': user.id,
            'avatar_url': user.avatar_url,
            'html_url': user.html_url
        }
    elif user is not None:
        return {
            'deleted': True,
            'raw_extra_data': dict(user)
        }
    else:
        return {
            'deleted': True
        }

class SerializableGistComment:
    def __init__(self, comment):
        self.comment = comment

    def serialize(self):
        return {
            'id': self.comment.id,
            'body': self.comment.body,
            'created_at': serialize_datetime(self.comment.created_at),
            'updated_at': serialize_datetime(self.comment.updated_at),
            'user': serialize_user(self.comment.user)
        }

    def to_json(self):
        return self.serialize()

class Gist:
    def __init__(self, username, gist_id, token=None):
        if token:
            self.g = Github(token)
        else:
            self.g = Github()
        self.username = username
        self.gist_id = gist_id
        self.gist = None
        self.comments = None
        self.get()

    def get_gist(self):
        self.gist = self.g.get_gist(self.gist_id)
        eprint('Got gist:', self.gist.description)

    def get_comments(self, max_comments=None):
        self.comments = []
        i = 1
        for comment in self.gist.get_comments():
            comment = SerializableGistComment(comment)
            self.comments.append(comment)
            eprint("Got comment №{}: {}".format(i, comment.comment.body))
            i = i + 1
            if max_comments is not None and max_comments > -1 and i > max_comments:
                eprint('Gist has more than {} comments, stopping'.format(max_comments))
                break
        eprint('Got {} comments'.format(len(self.comments)))


    def get(self):
        self.get_gist()
        self.get_comments()

    def serialize(self):
        return {
            'id': self.gist_id,
            'description': self.gist.description,
            'files': {name: {'language': file.language, 'content': file.content, 'filename': file.filename, 'size': file.size, 'raw_url': file.raw_url}
                      for name, file in self.gist.files.items()},
            'comments': self.comments,
            'created_at': serialize_datetime(self.gist.created_at),
            'updated_at': serialize_datetime(self.gist.updated_at),
            'owner': serialize_user(self.gist.owner),
            'html_url': self.gist.html_url,
            'public': self.gist.public,
            'comments_count': len(self.comments)
        }

    def to_json(self):
        return json.dumps(self.serialize(), indent=4, default=gist_comment_serializer)

def gist_comment_serializer(obj):
    if hasattr(obj, 'serialize'):
        return obj.serialize()
    else:
        raise TypeError('Object of type {} is not serializable'.format(type(obj)))

if __name__ == '__main__':
    import os
    import sys

    get_github_token_from_env_file_if_exists()

    assert len(sys.argv) == 3, 'Usage: {} <username> <gist_id>'.format(sys.argv[0])
    username, gist_id = sys.argv[1], sys.argv[2]

    token = os.getenv('GITHUB_TOKEN')
    if token is None:
        eprint('Warning: GITHUB_TOKEN is not set, you may encounter rate limit.')

    gist = Gist(username, gist_id, token)

    print(gist.to_json())
python getgist/gist.py probonopd 9feb7c20257af5dd915e3a9f2d1f2277 > 9feb7c20257af5dd915e3a9f2d1f2277.json
jq -r '.comments[]|[.user.login, .body]|@tsv' < 9feb7c20257af5dd915e3a9f2d1f2277.json > 9feb7c20257af5dd915e3a9f2d1f2277_comments.tsv

Notes

* Even loading the whole thing is proving impossible, so I had to use GitHub's API's to put it all in one large Markdown file which I could then attempt to read.
† “Claude AI Opus 3”, it'll probably be out of date by tomorrow so that's not important.

@zarlo
Copy link

zarlo commented May 17, 2024

10/10 method name get_github_token_from_env_file_if_exists i hope it does what it says

@ctrlcctrlv
Copy link

Good catch, I forgot to attach util.py, but you'll be glad to know it does:

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

# getgist utilities

import os
import sys
import warnings
from pathlib import Path

def eprint(*args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)

def get_github_token_from_env_file_if_exists():
    env_file = Path('.env')
    if env_file.exists():
        with env_file.open() as f:
            for line in f:
                key, value = line.strip().split('=', 1)
                if key == 'GITHUB_TOKEN':
                    os.environ['GITHUB_TOKEN'] = value
                else:
                    warnings.warn('Unknown key in .env file: {}'.format(key))
    return None

@fredvs
Copy link

fredvs commented May 17, 2024

Okay, okay, got it, Wayland matters and we widget developers need to adapt.
From our side, a "pure Wayland with wlroots" target is on the way, but moving from Form X11 to Wayland is not "out of the box" and will take time.

So, one of our solutions to become "pure Wayland" would be to use SDL (we already have this target working):
https://jan.newmarch.name/Wayland/SDL/

What do you think about SDL-Wayland, does it work well and can it be called a “pure Wayland” application?

@Espionage724
Copy link

What do you think about SDL-Wayland, does it work well and can it be called a “pure Wayland” application?

The concept sounds like a slow wrapper for a whole layer of wrappers. I want stuff as-close-to-bare-metal as possible, and Wayland is already further away than Xorg with stuff like libinput -> evdev vs just evdev. SDL as I understand is a giant compatibility library for targeting cross-platform (like Unity engine), and not raw-performance.

Of course if it just works well enough to not be noticed, I guess it could be cool :p

As for running stuff with SDL on Wayland, the only two games I played that use it (RuneScape/NXT, Dota 2) crashed on-start and needed forced-Xwayland earlier this year.

@Espionage724
Copy link

...and Ubuntu wins easily (thanks to Wayland and Snap). Typing this from Windows 11. So sad.

Come on, you have to know what's inferior by now :p Why are you typing that from W11 and not W10 LTSC?

@ctrlcctrlv
Copy link

My personal migration plan for when or if the day comes that I buy graphics hardware which is supported in the Linux kernel, but which is not supported by Xorg, due to abandonment of its development on GNU/Linux more broadly, is to just run fullscreen Xwayland with some Xorg supporting window manager.

Is there some reason of which I'm unaware that makes this unworkable? If not, I'm not sure what all of the fuss is about, really. :) !

@binex-dsk
Copy link

Come on, you have to know what's inferior by now :p Why are you typing that from W11 and not W10 LTSC?

Why would you not use Spectre if you're using Windows?

@Espionage724
Copy link

Come on, you have to know what's inferior by now :p Why are you typing that from W11 and not W10 LTSC?

Why would you not use Spectre if you're using Windows?

Because I like my operating system coming from legit sources and patching with legit updates; I can't imagine using someone else's modified Windows image in an age of ransomware and coin miners. Plus I know how to tweak my OS probably beyond whatever Spectre does :p https://github.com/Espionage724/Windows

@zDEFz
Copy link

zDEFz commented May 18, 2024

Come on, you have to know what's inferior by now :p Why are you typing that from W11 and not W10 LTSC?

Why would you not use Spectre if you're using Windows?

Because I like my operating system coming from legit sources and patching with legit updates; I can't imagine using someone else's modified Windows image in an age of ransomware and coin miners. Plus I know how to tweak my OS probably beyond whatever Spectre does :p https://github.com/Espionage724/Windows

What a headache

@Espionage724
Copy link

Come on, you have to know what's inferior by now :p Why are you typing that from W11 and not W10 LTSC?

Why would you not use Spectre if you're using Windows?

Because I like my operating system coming from legit sources and patching with legit updates; I can't imagine using someone else's modified Windows image in an age of ransomware and coin miners. Plus I know how to tweak my OS probably beyond whatever Spectre does :p https://github.com/Espionage724/Windows

What a headache

I'll need more than 3 words and implied snark to know what that means, but if it's too-confusing, sorry but you'll probably be better using Spectre or some other mega-script pre-tweaked thing :p

@zDEFz
Copy link

zDEFz commented May 18, 2024

Come on, you have to know what's inferior by now :p Why are you typing that from W11 and not W10 LTSC?

Why would you not use Spectre if you're using Windows?

Because I like my operating system coming from legit sources and patching with legit updates; I can't imagine using someone else's modified Windows image in an age of ransomware and coin miners. Plus I know how to tweak my OS probably beyond whatever Spectre does :p https://github.com/Espionage724/Windows

What a headache

I'll need more than 3 words and implied snark to know what that means, but if it's too-confusing, sorry but you'll probably be better using Spectre or some other mega-script pre-tweaked thing :p

Windows goes in a isolated environment anyways.
Nah, I am not against complexity. It's just that, with Windows, its inconsistent.
I would not even be sure if the next update reverses stuff I did before.

@dm17
Copy link

dm17 commented May 19, 2024

Nice job @ctrlcctrlv! Would you mind asking it what it thinks a reasonable amount of years to catch up would be? Or if there should be a cut off or due date before another option is considered?

@bodqhrohro
Copy link

Because I like my operating system coming from legit sources and patching with legit updates; I can't imagine using someone else's modified Windows image in an age of ransomware and coin miners.

I find it a totally weird idea to trust an obviously evil corporation which puts spyware, paidware, remote control, DRM and advertent malware into its products more than tinkerers who strip all this crap away and publish their results for other users like them. And installing updates from the evil untrusted C° are an obvious way to ruin all their efforts. While for a big&evil C° reputational blows are nothing, for such a small tinkerer they're devastating. So small tinkerers are interested to care for their reputation and avoid putting malware into their releases. Same goes in Dark Web: as everyone has to be paranoidly anonymous, reputation matters a lot, as it's the only measure of trust.

I had probably mentioned in this thread already that reputation of Mail.Ru (now VK Group) was littered with myriads of vans of shit since the very early 00s, for pretty objective and sound reasons, like bombing mailboxes of their own users by thousands of "officially approved" spam messages a day, even those whose addressed were never published anywhere. Nevertheless, it's still a big and successful company which influence only grows with years. Because when a corporation has money, those money can be used to compensate for reputational blows and get even more money. Same goes for all those abhorrent FAANGs, and big TNCs in general, beyond IT too. If users lack enough dignity to stay away from them, then some big powers have to intrude and stop that. And among such powers, I only see EU; Russia and China also do that, but not for moral reasons of protecting the users, just for protecting their own companies.

I find it hilarious how TikTok gets prosecuted due to being owned by a Chinese company, but the same time there are zero objections against domestic companies if they go in line with US government and hold responsibility to it. And objections to TikTok would also be alleviated if it's sold to a US-based owner, regardless of the whole immoral user-manipulating and kid-corrupting nature of the app. Tell me how does US differ in principle from USSR then, if surveillance on their citizens (and almost the rest of the world polluted by US technologies) is justified via "private" companies which are in fact responsible to the government agencies? Just the same state capitalism.

@Consolatis
Copy link

If users lack enough dignity to stay away from them

Says the person who just exposed themselves as somebody running completely untrustable proprietary code. And a windows user. wow.

@bodqhrohro
Copy link

And a windows user

I wonder if I do even have a single unmodified MSDN image downloaded. I find them totally useless. Maybe in the XP Mode VM, if I haven't wiped it yet; and I clearly remember downloading gigabytes of updates onto it after installation. So I could see what the pure XP before service packs is, at least; bootlegs typically contain all the updates up to their release date, and I haven't seen bootlegs older than 2009.

@Espionage724
Copy link

Espionage724 commented May 19, 2024

I find it a totally weird idea to trust an obviously evil corporation which puts spyware, paidware, remote control, DRM and advertent malware into its products more than tinkerers who strip all this crap away and publish their results for other users like them. And installing updates from the evil untrusted C° are an obvious way to ruin all their efforts. While for a big&evil C° reputational blows are nothing, for such a small tinkerer they're devastating. So small tinkerers are interested to care for their reputation and avoid putting malware into their releases. Same goes in Dark Web: as everyone has to be paranoidly anonymous, reputation matters a lot, as it's the only measure of trust.

Yeah I'll trust the corporation that's providing the most usable OS and has no reason to be doing nefarious things with my data (I'm in the US, they're in the US), vs some YouTube pre-tweaked "speed" distro that might be calling home to some out-of-country server or have it's own security holes or backdoors. I'm not wasting time verifying some proprietary OS that someone else modified, nor going by random wannabe-influencers vouching for it :p I at least know what my tweaks are doing to a stock OS, and most importantly I'm fine with the results. If I don't trust the main OS, why would I trust a fork of it?

I've used Windows since 95, and even tamed 11 enough to go to it if I ever find a benefit.

@bodqhrohro
Copy link

bodqhrohro commented May 19, 2024

I at least know what my tweaks are doing to a stock OS

No problem if you're skilled enough to tame it. Ordinary Windows audience isn't.

has no reason to be doing nefarious things with my data

Pff. Tell that to the composer whose own .WAV files were deleted by iTunes: https://web.archive.org/web/20160505014358/https://blog.vellumatlanta.com/2016/05/04/apple-stole-my-music-no-seriously/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment