Code Monkey home page Code Monkey logo

pywm's Introduction

pywm - backend for newm

Unfortunately, newm as well as pywm are currently unmaintained.

pywm is an abstraction layer for newm encapsulating all c code.

Basically this is a very tiny compositor built on top of wlroots, making all the assumptions that wlroots does not. On the Python side pywm exposes Wayland clients (XDG and XWayland) as so-called views and passes along all input. This way, handling the positioning of views, animating their movement, ... based on keystrokes or touchpad inputs (i.e. the logical, not performance-critical part of any compositor) is possible Python-side, whereas rendering and all other performance-critical aspects are handled by c code.

Check the Python class PyWM and c struct wm_server for a start, as well as newms Layout.

See also pywm-fullscreen for a trivial implementation opening one application in fullscreen.

Attention

v0.3 with a better renderer implementation supporting blur has been merged into master. There are still some bugs around but I consider it an alpha stage.

Installing

If you install newm via the AUR, pywm is installed automatically.

Prerequisites

Prerequisites for PyWM, apart from Python, are given by wlroots:

  • python and pip
  • gcc, meson and ninja
  • pkg-config
  • wayland
  • wayland-protocols
  • xorg-xwayland
  • EGL
  • GLESv2
  • libdrm
  • GBM
  • libinput
  • xkbcommon
  • udev
  • pixman
  • libseat

Install

Compilation is handled by meson and started automatically via pip (you need to install prerequisites first):

pip3 install git+https://github.com/jbuchermn/pywm

In case of issues, clone the repo and execute meson build && ninja -C build in order to debug.

Configuration

Configuration is handled via key-value pairs given to the PyWM contructor:

Key Default Description
enable_xwayland False Boolean: Start XWayland
xkb_model String: Keyboard model (xkb)
xkb_layout String: Keyboard layout (xkb)
xkb_variant String: Keyboard variant (xkb)
xkb_options String: Keyboard options (xkb)
outputs List of dicts: Output configuration (see next lines)
output.name "" String: Name of output to attach config to actual output
output.scale 1.0 Number: HiDPI scale of output
output.width 0 Integer: Output width (or zero to use preferred)
output.height 0 Integer: Output height (or zero to use preferred)
output.mHz 0 Integer: Output refresh rate in milli Hertz (or zero to use preferred)
output.pos_x None Integer: Output position x in layout (or None to be placed automatically)
output.pos_y None Integer: Output position y in layout (or None to be placed automatically)
xcursor_theme String: XCursor theme (if not set, read from; if set, exported to XCURSOR_THEME)
xcursor_size 24 Integer: XCursor size (if not set, read from; if set, exported to XCURSOR_SIZE)
tap_to_click True Boolean: On tocuhpads use tap for click enter
natural_scroll True Boolean: On touchpads use natural scrolling enter
focus_follows_mouse True Boolean: Focus window upon mouse enter
contstrain_popups_to_toplevel False Boolean: Try to keep popups contrained within their window
encourage_csd True Boolean: Encourage clients to show client-side-decorations (see wlr_server_decoration_manager)
debug False Boolean: Loglevel debug plus output debug information to stdout on every F1 press
texture_shaders basic String: Shaders to use for texture rendering (see src/wm/shaders/texture)
renderer_mode pywm String: Renderer mode, pywm (enable pywm renderer, and therefore blur), wlr (disable pywm renderer)

Troubleshooting

seatd

Be aware that current wlroots requires seatd under certain circumstances. Example systemd service (be sure to place your user in group _seatd):

[Unit]
Description=Seat management daemon
Documentation=man:seatd(1)

[Service]
Type=simple
ExecStart=seatd -g _seatd
Restart=always
RestartSec=1

[Install]
WantedBy=multi-user.target

pywm's People

Contributors

jbuchermn avatar zphixon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

pywm's Issues

Is the proc_blur branch usable?

Hi, I usually keep up with updates to newm and pywm, I currently use version 3 of both. A few days ago I saw this branch and I was wondering what its characteristics were and if it is possible to use newm v3 and pywm proc_blur? Thanks in advance and excellent work you do

Run-time dependency libseat found: NO

Hello, I am trying to install pywm with pip in a Debian sid machine. However, I get the following error. I have libseat and libseat-dev already installed at the version 0.7.0, so I am not sure what the problem is. I would be happy if someone could help.

Collecting git+https://github.com/jbuchermn/pywm
  Cloning https://github.com/jbuchermn/pywm to /tmp/pip-req-build-4ppusefq
  Running command git clone --filter=blob:none --quiet https://github.com/jbuchermn/pywm /tmp/pip-req-build-4ppusefq
  Resolved https://github.com/jbuchermn/pywm to commit 6cd58ed216fe5b7448e1dd9321dfc05f591b0fe5
  Running command git submodule update --init --recursive -q
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [8 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-req-build-4ppusefq/setup.py", line 9, in <module>
          raise Exception("Fatal: Error executing 'meson build': \n%r\n%r" % (stdout, stderr))
      Exception: Fatal: Error executing 'meson build':
      b'The Meson build system\nVersion: 0.62.2\nSource dir: /tmp/pip-req-build-4ppusefq\nBuild dir: /tmp/pip-req-build-4ppusefq/build\nBuild type: native build\nProject name: pywm\nProject version: 0.1.0\nC compiler for the host machine: cc (gcc 11.3.0 "cc (Debian 11.3.0-3) 11.3.0")\nC linker for the host machine: cc ld.bfd 2.38.50.20220622\nHost machine cpu family: x86_64\nHost machine cpu: x86_64\nFound pkg-config: /usr/bin/pkg-config (0.29.2)\nRun-time dependency wayland-server found: YES 1.20.0\nRun-time dependency wayland-client found: YES 1.20.0\nRun-time dependency wayland-cursor found: YES 1.20.0\nRun-time dependency wayland-egl found: YES 18.1.0\nRun-time dependency wayland-protocols found: YES 1.25\nRun-time dependency xkbcommon found: YES 1.4.0\nRun-time dependency libinput found: YES 1.21.0\nRun-time dependency pixman-1 found: YES 0.40.0\nFound CMake: /usr/bin/cmake (3.23.2)\nRun-time dependency xwayland found: NO (tried pkgconfig and cmake)\nLibrary pthread found: YES\nLibrary m found: YES\n\nExecuting subproject wlroots \n\nwlroots| Project name: wlroots\nwlroots| Project version: 0.16.0\nwlroots| C compiler for the host machine: cc (gcc 11.3.0 "cc (Debian 11.3.0-3) 11.3.0")\nwlroots| C linker for the host machine: cc ld.bfd 2.38.50.20220622\nwlroots| Compiler for C supports arguments -Wundef: YES\nwlroots| Compiler for C supports arguments -Wlogical-op: YES\nwlroots| Compiler for C supports arguments -Wmissing-include-dirs: YES\nwlroots| Compiler for C supports arguments -Wold-style-definition: YES\nwlroots| Compiler for C supports arguments -Wpointer-arith: YES\nwlroots| Compiler for C supports arguments -Winit-self: YES\nwlroots| Compiler for C supports arguments -Wstrict-prototypes: YES\nwlroots| Compiler for C supports arguments -Wimplicit-fallthrough=2: YES\nwlroots| Compiler for C supports arguments -Wendif-labels: YES\nwlroots| Compiler for C supports arguments -Wstrict-aliasing=2: YES\nwlroots| Compiler for C supports arguments -Woverflow: YES\nwlroots| Compiler for C supports arguments -Wmissing-prototypes: YES\nwlroots| Compiler for C supports arguments -Walloca: YES\nwlroots| Compiler for C supports arguments -Wno-missing-braces: YES\nwlroots| Compiler for C supports arguments -Wno-missing-field-initializers: YES\nwlroots| Compiler for C supports arguments -Wno-unused-parameter: YES\nwlroots| Compiler for C supports arguments -fmacro-prefix-map=/prefix/to/hide=: YES\nwlroots| Dependency wayland-server found: YES 1.20.0 (cached)\nwlroots| Run-time dependency libdrm found: YES 2.4.110\nwlroots| Run-time dependency gbm found: YES 22.0.5\nwlroots| Dependency xkbcommon found: YES 1.4.0 (cached)\nwlroots| Run-time dependency libudev found: YES 251\nwlroots| Dependency pixman-1 found: YES 0.40.0 (cached)\nwlroots| Library m found: YES\nwlroots| Library rt found: YES\nwlroots| Dependency wayland-protocols found: YES 1.25 (cached)\nwlroots| Found pkg-config: /usr/bin/pkg-config (0.29.2)\nwlroots| Build-time dependency wayland-scanner found: YES 1.20.0\nwlroots| Program /usr/bin/wayland-scanner found: YES (/usr/bin/wayland-scanner)\nwlroots| Run-time dependency egl found: YES 1.5\nwlroots| Run-time dependency glesv2 found: YES 3.2\nwlroots| Run-time dependency vulkan found: NO (tried pkgconfig and system)\nwlroots| Message: Required for vulkan renderer support.\nwlroots| Message: Required for vulkan renderer support.\nwlroots| Dependency pixman-1 found: YES 0.40.0 (cached)\nwlroots| Checking for function "gbm_bo_get_fd_for_plane" with dependency gbm: YES\nwlroots| Dependency libinput found: YES 1.21.0 (cached)\nwlroots| Run-time dependency xcb found: YES 1.14\nwlroots| Run-time dependency xcb-dri3 found: NO (tried pkgconfig and cmake)\nwlroots| Message: Required for X11 backend support.\nwlroots| Message: Required for X11 backend support.\nwlroots| Dependency wayland-client found: YES 1.20.0 (cached)\nwlroots| Run-time dependency libseat found: NO (tried pkgconfig and cmake)\nwlroots| Looking for a fallback subproject for the dependency libseat\n\nsubprojects/wlroots/backend/session/meson.build:1:0: ERROR: Neither a subproject directory nor a seatd.wrap file was found.\n\nA full log can be found at /tmp/pip-req-build-4ppusefq/build/meson-logs/meson-log.txt\n'
      b''
      [end of output]

Error: Dependency "wayland-server" not found

I am on Nobara 36(Fedora based distro)
I get meson.build:33:0: ERROR: Dependency "wayland-server" not found, tried pkgconfig and cmake when running pip3 install --user git+https://github.com/jbuchermn/pywm even when libwayland-server is installed

Fails to build without xwayland

$ meson build

...
wlroots 0.15.0

    drm-backend     : YES
    x11-backend     : YES
    libinput-backend: YES
    xwayland        : NO
    gles2-renderer  : YES
    vulkan-renderer : YES
    xcb-errors      : NO

pywm 0.1.0

  Subprojects
    wlroots: YES

$ ninja -C build

ninja: Entering directory `build'
[1/1] Linking target pywm
FAILED: pywm 
cc  -o pywm pywm.p/src_wm_wm.c.o pywm.p/src_wm_wm_server.c.o pywm.p/src_wm_wm_renderer.c.o pywm.p/src_wm_wm_seat.c.o pywm.p/src_wm_wm_keyboard.c.o pywm.p/src_wm_wm_pointer.c.o pywm.p/src_wm_wm_cursor.c.o pywm.p/src_wm_wm_layout.c.o pywm.p/src_wm_wm_output.c.o pywm.p/src_wm_wm_content.c.o pywm.p/src_wm_wm_view.c.o pywm.p/src_wm_wm_view_xdg.c.o pywm.p/src_wm_wm_view_layer.c.o pywm.p/src_wm_wm_view_xwayland.c.o pywm.p/src_wm_wm_widget.c.o pywm.p/src_wm_wm_config.c.o pywm.p/src_wm_wm_idle_inhibit.c.o pywm.p/src_wm_wm_drag.c.o pywm.p/src_main.c.o -Wl,--as-needed -Wl,--no-undefined -Wl,-rpath,/usr/local/lib/x86_64-linux-gnu -Wl,-rpath-link,/usr/local/lib/x86_64-linux-gnu -Wl,--start-group subprojects/wlroots/libwlroots.a protocols/libserver_protos.a /usr/lib/x86_64-linux-gnu/libwayland-server.so /usr/lib/x86_64-linux-gnu/libwayland-client.so /usr/lib/x86_64-linux-gnu/libdrm.so /usr/lib/x86_64-linux-gnu/libgbm.so /usr/lib/x86_64-linux-gnu/libxkbcommon.so /usr/lib/x86_64-linux-gnu/libudev.so /usr/lib/x86_64-linux-gnu/libpixman-1.so -lm -lrt /usr/lib/x86_64-linux-gnu/libEGL.so /usr/lib/x86_64-linux-gnu/libGLESv2.so /usr/lib/x86_64-linux-gnu/libvulkan.so /usr/lib/x86_64-linux-gnu/libinput.so /usr/lib/x86_64-linux-gnu/libxcb.so /usr/lib/x86_64-linux-gnu/libxcb-dri3.so /usr/lib/x86_64-linux-gnu/libxcb-present.so /usr/lib/x86_64-linux-gnu/libxcb-render.so /usr/lib/x86_64-linux-gnu/libxcb-render-util.so /usr/lib/x86_64-linux-gnu/libxcb-shm.so /usr/lib/x86_64-linux-gnu/libxcb-xfixes.so /usr/lib/x86_64-linux-gnu/libxcb-xinput.so /usr/local/lib/x86_64-linux-gnu/libseat.so -lpthread -Wl,--end-group
/usr/bin/ld: pywm.p/src_wm_wm_server.c.o: in function `handle_new_xwayland_surface':
/home/user/Downloads/pywm/build/../src/wm/wm_server.c:131: undefined reference to `wlr_xwayland_surface_ping'
/usr/bin/ld: pywm.p/src_wm_wm_server.c.o: in function `wm_server_init':
/home/user/Downloads/pywm/build/../src/wm/wm_server.c:298: undefined reference to `wlr_xwayland_create'
/usr/bin/ld: /home/user/Downloads/pywm/build/../src/wm/wm_server.c:316: undefined reference to `wlr_xwayland_set_seat'
/usr/bin/ld: pywm.p/src_wm_wm_server.c.o: in function `wm_server_destroy':
/home/user/Downloads/pywm/build/../src/wm/wm_server.c:390: undefined reference to `wlr_xwayland_destroy'
/usr/bin/ld: pywm.p/src_wm_wm_server.c.o: in function `wm_server_reconfigure':
/home/user/Downloads/pywm/build/../src/wm/wm_server.c:615: undefined reference to `wlr_xwayland_set_cursor'
/usr/bin/ld: pywm.p/src_wm_wm_view_xwayland.c.o: in function `child_handle_request_configure':
/home/user/Downloads/pywm/build/../src/wm/wm_view_xwayland.c:102: undefined reference to `wlr_xwayland_surface_configure'
/usr/bin/ld: pywm.p/src_wm_wm_view_xwayland.c.o: in function `handle_request_configure':
/home/user/Downloads/pywm/build/../src/wm/wm_view_xwayland.c:131: undefined reference to `wlr_xwayland_surface_configure'
/usr/bin/ld: pywm.p/src_wm_wm_view_xwayland.c.o: in function `wm_view_xwayland_request_size':
/home/user/Downloads/pywm/build/../src/wm/wm_view_xwayland.c:289: undefined reference to `wlr_xwayland_surface_configure'
/usr/bin/ld: pywm.p/src_wm_wm_view_xwayland.c.o: in function `wm_view_xwayland_request_close':
/home/user/Downloads/pywm/build/../src/wm/wm_view_xwayland.c:295: undefined reference to `wlr_xwayland_surface_close'
/usr/bin/ld: pywm.p/src_wm_wm_view_xwayland.c.o: in function `wm_view_xwayland_set_fullscreen':
/home/user/Downloads/pywm/build/../src/wm/wm_view_xwayland.c:342: undefined reference to `wlr_xwayland_surface_set_fullscreen'
/usr/bin/ld: pywm.p/src_wm_wm_view_xwayland.c.o: in function `wm_view_xwayland_set_maximized':
/home/user/Downloads/pywm/build/../src/wm/wm_view_xwayland.c:346: undefined reference to `wlr_xwayland_surface_set_maximized'
/usr/bin/ld: pywm.p/src_wm_wm_view_xwayland.c.o: in function `wm_view_xwayland_set_activated':
/home/user/Downloads/pywm/build/../src/wm/wm_view_xwayland.c:350: undefined reference to `wlr_xwayland_surface_activate'
/usr/bin/ld: /home/user/Downloads/pywm/build/../src/wm/wm_view_xwayland.c:352: undefined reference to `wlr_xwayland_surface_restack'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.

‘frame_number’ is deprecated

@jbuchermn Hi, sorry to bother you, I know you're very busy lately, I hope you're well. First of all thanks for this amazing project.
When trying to build it throws the following error

Screenshot from 2023-04-21 at 19_42_08 435139885

text plain;

ninja: Entering directory `build'
[1/2] Compiling C object subprojects/wlroots/examples/dmabuf-capture.p/dmabuf-capture.c.o
FAILED: subprojects/wlroots/examples/dmabuf-capture.p/dmabuf-capture.c.o
cc -Isubprojects/wlroots/examples/dmabuf-capture.p -Isubprojects/wlroots/examples -I../subprojects/wlroots/examples -Isubprojects/wlroots/protocol -I/usr/include/libdrm -fdiagnostics-color=always - D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Werror -std=c11 -O0 -g -DWLR_USE_UNSTABLE -DWLR_LITTLE_ENDIAN=1 -DWLR_BIG_ENDIAN=0 -Wundef -Wlogical-op -Wmissing-include-dirs -Wold-style-definition - Wpointer-arith -Winit-self -Wstrict-prototypes -Wimplicit-fallthrough=2 -Wendif-labels -Wstrict-aliasing=2 -Woverflow -Wmissing-prototypes -Walloca -Wno-missing-braces -Wno-missing-field-initializers - Wno-unused-parameter -fmacro-prefix-map=../subprojects/wlroots/= -DHAS_GBM_BO_GET_FD_FOR_PLANE=1 -DLIBINPUT_HAS_HOLD_GESTURES=1 '-DICONDIR="/usr/local/share/icons"' -DHAS_XCB_ERRORS=1 -pthread - MD -MQ subprojects/wlroots/examples/dmabuf-capture.p/dmabuf-capture.c.o -MF subprojects/wlroots/examples/dmabuf-capture.p/dmabuf-capture.c.o.d -o subprojects/wlroots/examples/dmabuf-capture .p/dmabuf-capture.c.o -c ../subprojects/wlroots/examples/dmabuf-capture.c
../subprojects/wlroots/examples/dmabuf-capture.c: In the function 'vid_encode_thread':
../subprojects/wlroots/examples/dmabuf-capture.c:524:33: error: 'frame_number' is deprecated [-Werror=deprecated-declarations]
   524 | ctx->avctx->frame_number, get_fifo_size(&ctx->vid_frames));
       | ^~~
In the included file from ../subprojects/wlroots/examples/dmabuf-capture.c:2:
/usr/include/libavcodec/avcodec.h:1076:9: note: declared here
  1076 | int frame_number;
       | ^~~~~~~~~~~~
cc1: all warnings are treated as errors
ninja: build stopped: subcommand failed.

Tried Installing on Pop OS, getting this error

I tried installing on Pop OS 22.04 with
pip3 install --user git+https://github.com/jbuchermn/pywm

and getting this error:

Collecting git+https://github.com/jbuchermn/pywm
  Cloning https://github.com/jbuchermn/pywm to /tmp/pip-req-build-1wc7rr0h
  Running command git clone --filter=blob:none --quiet https://github.com/jbuchermn/pywm /tmp/pip-req-build-1wc7rr0h
  Resolved https://github.com/jbuchermn/pywm to commit 8171cd7055465544333bab0d3ac22b68da718d48
  Running command git submodule update --init --recursive -q
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [8 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-req-build-1wc7rr0h/setup.py", line 9, in <module>
          raise Exception("Fatal: Error executing 'meson build': \n%r\n%r" % (stdout, stderr))
      Exception: Fatal: Error executing 'meson build':
      b'The Meson build system\nVersion: 0.61.2\nSource dir: /tmp/pip-req-build-1wc7rr0h\nBuild dir: /tmp/pip-req-build-1wc7rr0h/build\nBuild type: native build\nProject name: pywm\nProject version: 0.1.0\nC compiler for the host machine: cc (gcc 11.2.0 "cc (Ubuntu 11.2.0-19ubuntu1) 11.2.0")\nC linker for the host machine: cc ld.bfd 2.38\nHost machine cpu family: x86_64\nHost machine cpu: x86_64\n\nExecuting subproject wlroots \n\nwlroots| Project name: wlroots\nwlroots| Project version: 0.15.0\nwlroots| C compiler for the host machine: cc (gcc 11.2.0 "cc (Ubuntu 11.2.0-19ubuntu1) 11.2.0")\nwlroots| C linker for the host machine: cc ld.bfd 2.38\nwlroots| Compiler for C supports arguments -Wundef: YES\nwlroots| Compiler for C supports arguments -Wlogical-op: YES\nwlroots| Compiler for C supports arguments -Wmissing-include-dirs: YES\nwlroots| Compiler for C supports arguments -Wold-style-definition: YES\nwlroots| Compiler for C supports arguments -Wpointer-arith: YES\nwlroots| Compiler for C supports arguments -Winit-self: YES\nwlroots| Compiler for C supports arguments -Wstrict-prototypes: YES\nwlroots| Compiler for C supports arguments -Wimplicit-fallthrough=2: YES\nwlroots| Compiler for C supports arguments -Wendif-labels: YES\nwlroots| Compiler for C supports arguments -Wstrict-aliasing=2: YES\nwlroots| Compiler for C supports arguments -Woverflow: YES\nwlroots| Compiler for C supports arguments -Wmissing-prototypes: YES\nwlroots| Compiler for C supports arguments -Walloca: YES\nwlroots| Compiler for C supports arguments -Wno-missing-braces: YES\nwlroots| Compiler for C supports arguments -Wno-missing-field-initializers: YES\nwlroots| Compiler for C supports arguments -Wno-unused-parameter: YES\nwlroots| Compiler for C supports arguments -fmacro-prefix-map=/prefix/to/hide=: YES\nwlroots| Found pkg-config: /usr/bin/pkg-config (0.29.2)\nwlroots| Found CMake: /usr/bin/cmake (3.22.1)\nwlroots| Run-time dependency wayland-server found: NO (tried pkgconfig and cmake)\nwlroots| Looking for a fallback subproject for the dependency wayland-server\n\nsubprojects/wlroots/meson.build:101:0: ERROR: Neither a subproject directory nor a wayland.wrap file was found.\n\nA full log can be found at /tmp/pip-req-build-1wc7rr0h/build/meson-logs/meson-log.txt\n'
      b''
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

Not able to understand the issue. What could be the problem? What are the possible steps to mitigate it?

Error in arch when running ninja -C build

This error is related to this error jbuchermn/newm#71

the error is the following:
[345/471] Compiling C object subprojects/wlroots/examples/dmabuf-capture.p/dmabuf-capture.c.o
FAILED: subprojects/wlroots/examples/dmabuf-capture.p/dmabuf-capture.c.o
cc -Isubprojects/wlroots/examples/dmabuf-capture.p -Isubprojects/wlroots/examples -I../subprojects/wlroots/examples -Isubprojects/wlroots/protocol -I/usr/include/libdrm -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Werror -std=c11 -g -DWLR_USE_UNSTABLE -DWLR_LITTLE_ENDIAN=1 -DWLR_BIG_ENDIAN=0 -Wundef -Wlogical-op -Wmissing-include-dirs -Wold-style-definition -Wpointer-arith -Winit-self -Wstrict-prototypes -Wimplicit-fallthrough=2 -Wendif-labels -Wstrict-aliasing=2 -Woverflow -Wmissing-prototypes -Walloca -Wno-missing-braces -Wno-missing-field-initializers -Wno-unused-parameter -fmacro-prefix-map=../subprojects/wlroots/= -DHAS_GBM_BO_GET_FD_FOR_PLANE=1 -DLIBINPUT_HAS_HOLD_GESTURES=1 '-DICONDIR="/usr/local/share/icons"' -DHAS_XCB_ERRORS=1 -pthread -MD -MQ subprojects/wlroots/examples/dmabuf-capture.p/dmabuf-capture.c.o -MF subprojects/wlroots/examples/dmabuf-capture.p/dmabuf-capture.c.o.d -o subprojects/wlroots/examples/dmabuf-capture.p/dmabuf-capture.c.o -c ../subprojects/wlroots/examples/dmabuf-capture.c
../subprojects/wlroots/examples/dmabuf-capture.c:60:9: error: nombre de tipo ‘AVCodecContext’ desconocido
60 | AVCodecContext *avctx;
| ^~~~~~~~~~~~~~
../subprojects/wlroots/examples/dmabuf-capture.c: En la función ‘frame_ready’:
../subprojects/wlroots/examples/dmabuf-capture.c:389:35: error: petición del miembro ‘time_base’ en algo que no es una estructura o unión
389 | ctx->avctx->time_base);
| ^~
../subprojects/wlroots/examples/dmabuf-capture.c: En la función ‘vid_encode_thread’:
../subprojects/wlroots/examples/dmabuf-capture.c:483:23: error: declaración implícita de la función ‘avcodec_send_frame’; ¿quiso decir ‘avcodec_get_name’? [-Werror=implicit-function-declaration]
483 | err = avcodec_send_frame(ctx->avctx, f);
| ^~~~~~~~~~~~~~~~~~
| avcodec_get_name
../subprojects/wlroots/examples/dmabuf-capture.c:494:35: error: declaración implícita de la función ‘avcodec_receive_packet’ [-Werror=implicit-function-declaration]
494 | int ret = avcodec_receive_packet(ctx->avctx, pkt);
| ^~~~~~~~~~~~~~~~~~~~~~
../subprojects/wlroots/examples/dmabuf-capture.c:523:43: error: petición del miembro ‘frame_number’ en algo que no es una estructura o unión
523 | ctx->avctx->frame_number, get_fifo_size(&ctx->vid_frames));
| ^~
../subprojects/wlroots/examples/dmabuf-capture.c: En la función ‘set_hwframe_ctx’:
../subprojects/wlroots/examples/dmabuf-capture.c:579:43: error: petición del miembro ‘pix_fmt’ en algo que no es una estructura o unión
579 | frames_ctx->sw_format = ctx->avctx->pix_fmt;
| ^~
../subprojects/wlroots/examples/dmabuf-capture.c:580:39: error: petición del miembro ‘width’ en algo que no es una estructura o unión
580 | frames_ctx->width = ctx->avctx->width;
| ^~
../subprojects/wlroots/examples/dmabuf-capture.c:581:40: error: petición del miembro ‘height’ en algo que no es una estructura o unión
581 | frames_ctx->height = ctx->avctx->height;
| ^~
../subprojects/wlroots/examples/dmabuf-capture.c:593:27: error: petición del miembro ‘pix_fmt’ en algo que no es una estructura o unión
593 | ctx->avctx->pix_fmt = frames_ctx->format;
| ^~
../subprojects/wlroots/examples/dmabuf-capture.c:594:27: error: petición del miembro ‘hw_frames_ctx’ en algo que no es una estructura o unión
594 | ctx->avctx->hw_frames_ctx = av_buffer_ref(ctx->mapped_frames_ref);
| ^~
../subprojects/wlroots/examples/dmabuf-capture.c:595:32: error: petición del miembro ‘hw_frames_ctx’ en algo que no es una estructura o unión
595 | if (!ctx->avctx->hw_frames_ctx) {
| ^~
../subprojects/wlroots/examples/dmabuf-capture.c: En la función ‘init_encoding’:
../subprojects/wlroots/examples/dmabuf-capture.c:622:30: error: la inicialización descarta el calificador ‘const’ del tipo del destino del puntero [-Werror=discarded-qualifiers]
622 | AVCodec *out_codec = avcodec_find_encoder_by_name(ctx->encoder_name);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
../subprojects/wlroots/examples/dmabuf-capture.c:627:40: error: asignación de miembro ‘video_codec’ en objeto de sólo-lectura
627 | ctx->avf->oformat->video_codec = out_codec->id;
| ^
../subprojects/wlroots/examples/dmabuf-capture.c:630:22: error: declaración implícita de la función ‘avcodec_alloc_context3’; ¿quiso decir ‘avio_alloc_context’? [-Werror=implicit-function-declaration]
630 | ctx->avctx = avcodec_alloc_context3(out_codec);
| ^~~~~~~~~~~~~~~~~~~~~~
| avio_alloc_context
../subprojects/wlroots/examples/dmabuf-capture.c:630:20: error: la asignación a ‘int ’ desde ‘int’ crea un puntero desde un entero sin una conversión [-Werror=int-conversion]
630 | ctx->avctx = avcodec_alloc_context3(out_codec);
| ^
../subprojects/wlroots/examples/dmabuf-capture.c:634:19: error: petición del miembro ‘opaque’ en algo que no es una estructura o unión
634 | ctx->avctx->opaque = ctx;
| ^~
../subprojects/wlroots/examples/dmabuf-capture.c:635:19: error: petición del miembro ‘bit_rate’ en algo que no es una estructura o unión
635 | ctx->avctx->bit_rate = (int)ctx->out_bitrate
1000000.0f;
| ^~
../subprojects/wlroots/examples/dmabuf-capture.c:636:19: error: petición del miembro ‘pix_fmt’ en algo que no es una estructura o unión
636 | ctx->avctx->pix_fmt = ctx->software_format;
| ^~
../subprojects/wlroots/examples/dmabuf-capture.c:637:19: error: petición del miembro ‘time_base’ en algo que no es una estructura o unión
637 | ctx->avctx->time_base = (AVRational){ 1, 1000 };
| ^~
../subprojects/wlroots/examples/dmabuf-capture.c:638:19: error: petición del miembro ‘compression_level’ en algo que no es una estructura o unión
638 | ctx->avctx->compression_level = 7;
| ^~
../subprojects/wlroots/examples/dmabuf-capture.c:639:19: error: petición del miembro ‘width’ en algo que no es una estructura o unión
639 | ctx->avctx->width = find_output(ctx, ctx->target_output, 0)->width;
| ^~
../subprojects/wlroots/examples/dmabuf-capture.c:640:19: error: petición del miembro ‘height’ en algo que no es una estructura o unión
640 | ctx->avctx->height = find_output(ctx, ctx->target_output, 0)->height;
| ^~
../subprojects/wlroots/examples/dmabuf-capture.c:643:27: error: petición del miembro ‘flags’ en algo que no es una estructura o unión
643 | ctx->avctx->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
| ^~
../subprojects/wlroots/examples/dmabuf-capture.c:643:38: error: ‘AV_CODEC_FLAG_GLOBAL_HEADER’ no se declaró aquí (primer uso en esta función)
643 | ctx->avctx->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
../subprojects/wlroots/examples/dmabuf-capture.c:643:38: nota: cada identificador sin declarar se reporta sólo una vez para cada función en el que aparece
../subprojects/wlroots/examples/dmabuf-capture.c:647:35: error: petición del miembro ‘time_base’ en algo que no es una estructura o unión
647 | st->time_base = ctx->avctx->time_base;
| ^~
../subprojects/wlroots/examples/dmabuf-capture.c:656:15: error: declaración implícita de la función ‘avcodec_open2’; ¿quiso decir ‘avio_open2’? [-Werror=implicit-function-declaration]
656 | err = avcodec_open2(ctx->avctx, out_codec, &ctx->encoder_opts);
| ^~~~~~~~~~~~~
| avio_open2
../subprojects/wlroots/examples/dmabuf-capture.c:663:13: error: declaración implícita de la función ‘avcodec_parameters_from_context’; ¿quiso decir ‘avcodec_parameters_free’? [-Werror=implicit-function-declaration]
663 | if (avcodec_parameters_from_context(st->codecpar, ctx->avctx) < 0) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| avcodec_parameters_free
../subprojects/wlroots/examples/dmabuf-capture.c: En la función ‘uninit’:
../subprojects/wlroots/examples/dmabuf-capture.c:897:9: error: declaración implícita de la función ‘avcodec_close’; ¿quiso decir ‘avio_close’? [-Werror=implicit-function-declaration]
897 | avcodec_close(ctx->avctx);
| ^~~~~~~~~~~~~
| avio_close
cc1: todos los avisos se tratan como errores
[350/471] Compiling C object subprojects/wlroots/examples/toplevel-decoration.p/toplevel-decoration.c.o
ninja: build stopped: subcommand failed.

Missing dependency: wayland-server

I keep getting the same error message on both Fedora and Voidlinux.
error: subprocess-exited-with-error

× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [8 lines of output]
Traceback (most recent call last):
File "", line 2, in
File "", line 34, in
File "/tmp/pip-req-build-xb39bncm/setup.py", line 9, in
raise Exception("Fatal: Error executing 'meson build': \n%r\n%r" % (stdout, stderr))
Exception: Fatal: Error executing 'meson build':
b'The Meson build system\nVersion: 0.62.2\nSource dir: /tmp/pip-req-build-xb39bncm\nBuild dir: /tmp/pip-req-build-xb39bncm/build\nBuild type: native build\nProject name: pywm\nProject version: 0.1.0\nC compiler for the host machine: cc (gcc 10.2.1 "cc (GCC) 10.2.1 20201203")\nC linker for the host machine: cc ld.bfd 2.35.1\nHost machine cpu family: x86_64\nHost machine cpu: x86_64\nFound pkg-config: /usr/bin/pkg-config (0.29.2)\nFound CMake: /usr/bin/cmake (3.22.2)\nRun-time dependency wayland-server found: NO (tried pkgconfig and cmake)\n\nmeson.build:33:0: ERROR: Dependency "wayland-server" not found, tried pkgconfig and cmake\n\nA full log can be found at /tmp/pip-req-build-xb39bncm/build/meson-logs/meson-log.txt\n'
b''
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

On both of the machines I have Gnome and other Wayland WMs installed and made sure that all listed dependencies are pulled in. I also checked both repos, and neither contains a package calles 'wayland-server'. Is there a fix to this, as I would really love to give Newm a shot :)

Consider adding a .clang-format configuration file

When exploring the C code of pywm, I noticed my text editor would reformat the code to its defaults instead of trying to respect the existing code. A .clang-format file at the root of the project should fix that. This should also ensure a consistent visual coding style across the C files.

It is possible to easily generate one using for instance this website.

I propose the following .clang-format file:

---
BasedOnStyle: LLVM
AlignConsecutiveMacros: 'true'
AllowAllArgumentsOnNextLine: 'true'
ColumnLimit: '80'
DerivePointerAlignment: 'true'
IncludeBlocks: Regroup
IndentWidth: '4'
PointerAlignment: Right
ReflowComments: 'true'
SortIncludes: 'true'
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: 'false'
SpacesInParentheses: 'false'
SpacesInSquareBrackets: 'false'
TabWidth: '4'

...

Getting an error of Runtime Dependency of Wayland-Server

I am on Debian Testing and was trying to build PyWM.
I cd into pywm directory after cloning the project and run meson build, but getting this error
Screenshot from 2022-04-27 01-59-15

reading the Readme.md again, I concluded that I need to install Wayland (don't know if I am right).
but running apt install wayland says that this package is not available in the repos.
Wasn't able to find xorg-xwayland and ninja too.
What could be the possible steps that could be taken here to solve this problem?

Docs

Hi! Is it possible to make our own compositor with pywm? I find wlroots incredibly hard to understand and if this can help then I'm more than interested in trying it out.

Is there any possibility that documentation/examples will be added ?

Pip is not able to install

I was trying to install NEWM on Pop OS (21.10) via Pip and it failed to install Pywm as a dependency.

This is the output of the terminal:
Collecting git+https://github.com/jbuchermn/pywm Cloning https://github.com/jbuchermn/pywm to /tmp/pip-req-build-mr5b_g0w Running command git clone -q https://github.com/jbuchermn/pywm /tmp/pip-req-build-mr5b_g0w Running command git submodule update --init --recursive -q ERROR: Command errored out with exit status 1: command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-mr5b_g0w/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-mr5b_g0w/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-epasqyxo cwd: /tmp/pip-req-build-mr5b_g0w/ Complete output (9 lines): Traceback (most recent call last): File "<string>", line 1, in <module> File "/tmp/pip-req-build-mr5b_g0w/setup.py", line 6, in <module> proc = subprocess.Popen(["meson", "build"], stdout=subprocess.PIPE, stderr=subprocess.PIPE) File "/usr/lib/python3.9/subprocess.py", line 951, in __init__ self._execute_child(args, executable, preexec_fn, close_fds, File "/usr/lib/python3.9/subprocess.py", line 1821, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) FileNotFoundError: [Errno 2] No such file or directory: 'meson' ---------------------------------------- WARNING: Discarding git+https://github.com/jbuchermn/pywm. Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output. ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

Segfaults on animations

Getting segfaults here after 1-2 minutes of the program being open. A bit of a pattern I've noticed is that normally, an animation is played at some point between animation queues. Whenever there's a segfault, there are two animations queued with no animation played between. I uploaded this part of the log here.

Mesa: 21.3.7-2 on Intel Tiger Lake (Xe) Graphics

Originally posted by @carterisonline in jbuchermn/newm#91 (comment)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.