Astal icon indicating copy to clipboard operation
Astal copied to clipboard

X11 support

Open musjj opened this issue 2 years ago • 8 comments

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.

musjj avatar Jul 31 '23 19:07 musjj

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.

Aylur avatar Jul 31 '23 23:07 Aylur

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:

  • https://github.com/Philipp-M/ewmh-status-listener (what I currently use for eww)
  • https://github.com/santigimeno/node-ewmh
  • https://github.com/parkouss/pyewmh

musjj avatar Aug 01 '23 07:08 musjj

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.

Aylur avatar Aug 01 '23 09:08 Aylur

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

Aylur avatar Oct 27 '23 22:10 Aylur

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.

yosoof3 avatar Mar 02 '24 17:03 yosoof3

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

thyeun avatar Jun 27 '24 03:06 thyeun

Hello, did someone figure out a way for x11?

mimi0000oo avatar Aug 16 '24 19:08 mimi0000oo

The only alternative is to use weston for development use. Weston does not support Layer Shell protocol.

raluvy95 avatar Nov 17 '24 17:11 raluvy95