Aylur/ags

X11 support

musjj opened this issue · 6 comments

musjj commented

Any possibility of supporting X11? Since it's GTK-based, I'd assume that X11 support shouldn't be impossible.

I've been looking for something better than eww, so I took a cursory glance through the wiki and examples and I'm already loving it (real icons!!!).

I'm stuck on an old machine with a legacy nvidia card, making wayland a non-option, so X11 support would be absolutely wonderful.

Aylur commented

It is possible and I would love to add support, but I have no idea how x11 works and would take me some time to figure it out.

musjj commented

I don't have much GUI experience, but I'd be happy to help contribute/test things out.

At a glance, it seems that the only Wayland-specific stuff so far is Hyprland.ts. I'll try to see if I can make one for EWMH, which should support most X11 WMs.

Some projects that might be useful for reference:

Aylur commented

It is using gtk-layer-shell to tell the window manager where to place windows which is for wayland only.
For x11 it has to set hints manually, which is what I am not familiar with. I will look into it.

I played with x11 a bit, and I have come to the conclusion that I will leave it alone.
For now, this is a not so fulfilling solution I have come up with

// x11window.js
import Widget from 'resource:///com/github/Aylur/ags/widget.js';
import GObjcet from 'gi://GObject';
import Gtk from 'gi://Gtk?version=3.0';
import Gdk from 'gi://Gdk?version=3.0';

class X11Window extends Gtk.Window {
    static { GObjcet.registerClass(this); }

    constructor({ x = 0, y = 0, width = 50, height = 50, ...rest }) {
        super(rest);

        this.set_type_hint(Gdk.WindowTypeHint.DOCK);
        this.show_all();
        this.window.move_resize(x, y, width, height);
    }
}

export default params => Widget({
    type: X11Window,
    ...params,
});
// config.js
import X11Window from './x11window.js';

const win = X11Window({
  name: 'name-of-window',
  x: 0, // x position
  y: 0, // y position
  width: 1920,
  height: 30,
  child: Widget.Box({
    // children
  }),
});

export default {
  windows: [win],
};

This will just place the window at x,y with set size, but won't reserve space for itself, nor will it be interactable, meaning Entry widget won't work, but buttons do. If x or y is more than the size of the monitor, it will render over to the other monitor in that direction, so according to the monitor layout

To be honest, I have no desire to figure these out, but if someone does, PRs are welcome

Any possibility of supporting X11? Since it's GTK-based, I'd assume that X11 support shouldn't be impossible.

I've been looking for something better than eww, so I took a cursory glance through the wiki and examples and I'm already loving it (real icons!!!).

I'm stuck on an old machine with a legacy nvidia card, making wayland a non-option, so X11 support would be absolutely wonderful.

what you could do is probably use nouveau drivers i think because they prioritize older cards, idk but maybe that'll work probably, i have a old card, and nouveau works fine.

I'm using nvidia 1050, nouveau/nvidia still workable on wayland, so dont worry about it.