From 692e3abc68fb6e1c0eda894b01221198a81ea280 Mon Sep 17 00:00:00 2001 From: speedie Date: Fri, 2 Jun 2023 18:37:51 +0200 Subject: [PATCH] Add experimental native Wayland support --- .gitignore | 2 + PKGBUILD | 30 +- README.html | 76 +- README.md | 52 +- code.html | 4 +- docs/docs.md | 41 +- docs/example.Xresources | 1 - docs/spmenu.conf | 7 +- keybinds.h | 78 + libs/arg.c | 6 +- libs/argv.c | 132 +- libs/colors.h | 48 +- libs/conf/config.c | 1610 ++++++------ libs/conf/config.h | 166 +- libs/draw.c | 219 +- libs/draw.h | 1 + libs/img.c | 4 +- libs/libdrw/drw.c | 225 +- libs/libdrw/drw.h | 31 +- libs/match.c | 11 +- libs/schemes.c | 71 +- libs/schemes.h | 22 - libs/stream.c | 10 +- libs/theme/theme.c | 78 +- libs/wl/inc.c | 6 + libs/wl/inc.h | 6 + libs/wl/init.c | 64 + libs/wl/init.h | 3 + libs/wl/shm.c | 43 + libs/wl/wayland.c | 666 +++++ libs/wl/wayland.h | 204 ++ ...-layer-shell-unstable-v1-client-protocol.h | 563 ++++ .../wl/wlr-layer-shell-unstable-v1-protocol.c | 81 + .../xdg-output-unstable-v1-client-protocol.h | 414 +++ libs/wl/xdg-output-unstable-v1-protocol.c | 68 + libs/wl/xdg-shell-client-protocol.h | 2290 +++++++++++++++++ libs/wl/xdg-shell-protocol.c | 173 ++ libs/x11/client.c | 68 +- libs/x11/client.h | 11 +- libs/x11/event.c | 6 +- libs/x11/event.h | 2 +- libs/x11/init.c | 70 +- libs/x11/init.h | 7 +- libs/x11/key.c | 4 +- libs/x11/key.h | 4 +- libs/x11/mouse.c | 16 +- libs/x11/mouse.h | 3 +- libs/x11/xresources.h | 1 - meson.build | 17 +- meson.options | 7 + mouse.h | 22 +- options.h | 6 +- protocols/wlr-layer-shell-unstable-v1.xml | 285 ++ protocols/xdg-output-unstable-v1.xml | 222 ++ protocols/xdg-shell.xml | 1361 ++++++++++ scripts/make/build.sh | 4 + scripts/make/generate-headers.sh | 31 + scripts/make/generate-pkg.sh | 2 +- scripts/spmenu_test | 4 +- spmenu.1 | 60 +- spmenu.c | 116 +- spmenu.html | 51 +- spmenu_run.1 | 2 +- 63 files changed, 8444 insertions(+), 1444 deletions(-) create mode 100644 libs/wl/inc.c create mode 100644 libs/wl/inc.h create mode 100644 libs/wl/init.c create mode 100644 libs/wl/init.h create mode 100644 libs/wl/shm.c create mode 100644 libs/wl/wayland.c create mode 100644 libs/wl/wayland.h create mode 100644 libs/wl/wlr-layer-shell-unstable-v1-client-protocol.h create mode 100644 libs/wl/wlr-layer-shell-unstable-v1-protocol.c create mode 100644 libs/wl/xdg-output-unstable-v1-client-protocol.h create mode 100644 libs/wl/xdg-output-unstable-v1-protocol.c create mode 100644 libs/wl/xdg-shell-client-protocol.h create mode 100644 libs/wl/xdg-shell-protocol.c create mode 100644 protocols/wlr-layer-shell-unstable-v1.xml create mode 100644 protocols/xdg-output-unstable-v1.xml create mode 100644 protocols/xdg-shell.xml create mode 100755 scripts/make/generate-headers.sh diff --git a/.gitignore b/.gitignore index df5fe98..ef6af8d 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,8 @@ *.o *zst* *sig* +*gz* +*tar* spmenu buildconf_dev buildconf diff --git a/PKGBUILD b/PKGBUILD index d69c62c..6433d59 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -3,21 +3,43 @@ pkgname=spmenu pkgver=VERSION pkgrel=1 -pkgdesc="Fancy dynamic menu, compatible with dmenu!" +pkgdesc="Fancy dynamic menu for X11 and Wayland, compatible with dmenu!" url="https://spmenu.speedie.site" arch=(i686 x86_64) license=(MIT) -depends=(sh libxinerama cairo pango libx11 imlib2 fribidi libconfig) -makedepends=(git meson ninja) +depends=( + sh + libxinerama + cairo + pango + wayland + wayland-protocols + libxkbcommon + libx11 + imlib2 + fribidi + libconfig +) + +makedepends=( + git + meson + ninja +) + provides=($pkgname) conflicts=($pkgname) source=( "$pkgname-$pkgver.tar.gz" "$pkgname-$pkgver.tar.gz.sig" #"https://ls.speedie.site/releases/$pkgname/$pkgname-$pkgver.tar.gz" + #"https://ls.speedie.site/releases/$pkgname/$pkgname-$pkgver.tar.gz.sig" ) -md5sums=(MD5SUM 'SKIP') +md5sums=( + MD5SUM + 'SKIP' +) build(){ cd $pkgname-$pkgver diff --git a/README.html b/README.html index 27b4abb..ec8b614 100644 --- a/README.html +++ b/README.html @@ -174,9 +174,9 @@

spmenu

What is spmenu?

-

spmenu is an X11 menu application which takes standard input, parses -it, and lets the user choose an option and sends the selected option to -standard output.

+

spmenu is a simple X11 and Wayland menu application which takes +standard input, parses it, lets the user choose an option and sends the +selected option to standard output.

In addition to this, it also serves as a run launcher through the included shell script spmenu_run, which handles both $PATH listing, .desktop entries and file listing.

@@ -185,10 +185,28 @@ dmenu, spmenu introduces many new features which can be useful in shell scripting. There are way too many to list, but spmenu has a wiki which goes through features in more detail.

+

It also serves as a dmenu replacement for Wayland users.

Dependencies