##// END OF EJS Templates
swapped to meson
Tsuki -
r1:60e13e940ee8 default
parent child Browse files
Show More
@@ -0,0 +1,143
1 project(
2 'swindle',
3 'c',
4 version: '0.1',
5 default_options: [
6 'c_std=c11',
7 'buildtype=debugoptimized',
8 ],
9 )
10
11 cc = meson.get_compiler('c')
12
13 add_project_arguments(
14 '-DWLR_USE_UNSTABLE',
15 '-D_POSIX_C_SOURCE=200809L',
16 '-DVERSION="0.1"',
17 '-Wall',
18 '-Wextra',
19 '-Wno-unused-parameter',
20 '-Wno-stringop-truncation',
21 language: 'c',
22 )
23
24 xwayland_opt = get_option('xwayland')
25
26 wayland_server = dependency('wayland-server')
27 wayland_client = dependency('wayland-client')
28 wayland_protocols = dependency('wayland-protocols')
29 wayland_scanner_dep = dependency('wayland-scanner', native: true)
30 wlroots = dependency('wlroots-0.20')
31 xkbcommon = dependency('xkbcommon')
32 libinput = dependency('libinput')
33 lua = dependency('lua5.4')
34 m_dep = cc.find_library('m', required: false)
35
36 swindle_deps = [
37 wayland_server,
38 wlroots,
39 xkbcommon,
40 libinput,
41 lua,
42 m_dep,
43 ]
44
45 if xwayland_opt
46 swindle_deps += dependency('xcb')
47 swindle_deps += dependency('xcb-icccm')
48 add_project_arguments('-DXWAYLAND', language: 'c')
49 endif
50
51 wayland_scanner = find_program(
52 wayland_scanner_dep.get_variable('wayland_scanner'),
53 native: true,
54 )
55 wl_protocol_dir = wayland_protocols.get_variable('pkgdatadir')
56
57 wayland_scanner_server = generator(
58 wayland_scanner,
59 output: '@[email protected]',
60 arguments: ['server-header', '@INPUT@', '@OUTPUT@'],
61 )
62
63 wayland_scanner_private = generator(
64 wayland_scanner,
65 output: '@[email protected]',
66 arguments: ['private-code', '@INPUT@', '@OUTPUT@'],
67 )
68
69 wayland_scanner_enum = generator(
70 wayland_scanner,
71 output: '@[email protected]',
72 arguments: ['enum-header', '@INPUT@', '@OUTPUT@'],
73 )
74
75 cursor_shape_xml = wl_protocol_dir / 'staging/cursor-shape/cursor-shape-v1.xml'
76 pointer_constraints_xml = wl_protocol_dir / 'unstable/pointer-constraints/pointer-constraints-unstable-v1.xml'
77 xdg_shell_xml = wl_protocol_dir / 'stable/xdg-shell/xdg-shell.xml'
78
79 layer_shell_xml = 'protocols/wlr-layer-shell-unstable-v1.xml'
80 output_power_xml = 'protocols/wlr-output-power-management-unstable-v1.xml'
81 dwl_ipc_xml = 'protocols/dwl-ipc-unstable-v2.xml'
82 ext_workspace_xml = 'protocols/ext-workspace-v1.xml'
83
84 cursor_shape_h = wayland_scanner_enum.process(cursor_shape_xml)
85 pointer_constraints_h = wayland_scanner_enum.process(pointer_constraints_xml)
86 layer_shell_h = wayland_scanner_enum.process(layer_shell_xml)
87 output_power_h = wayland_scanner_server.process(output_power_xml)
88 xdg_shell_h = wayland_scanner_server.process(xdg_shell_xml)
89
90 dwl_ipc_h = wayland_scanner_server.process(dwl_ipc_xml)
91 dwl_ipc_c = wayland_scanner_private.process(dwl_ipc_xml)
92 ext_workspace_h = wayland_scanner_server.process(ext_workspace_xml)
93 ext_workspace_c = wayland_scanner_private.process(ext_workspace_xml)
94
95 protocol_headers = [
96 cursor_shape_h,
97 pointer_constraints_h,
98 layer_shell_h,
99 output_power_h,
100 xdg_shell_h,
101 ]
102
103 swindle_sources = [
104 'src/swindle.c',
105 'src/util.c',
106 'src/wlr_ext_workspace_v1.c',
107 'parser/parser.c',
108 dwl_ipc_c,
109 dwl_ipc_h,
110 ext_workspace_c,
111 ext_workspace_h,
112 ]
113
114 executable(
115 'swindle',
116 swindle_sources + protocol_headers,
117 include_directories: include_directories('.', 'include', 'src', 'parser'),
118 dependencies: swindle_deps,
119 install: true,
120 )
121
122 smsg_dwl_ipc_h = custom_target(
123 'smsg-dwl-ipc-unstable-v2-protocol-h',
124 input: dwl_ipc_xml,
125 output: 'dwl-ipc-unstable-v2-protocol.h',
126 command: [wayland_scanner, 'client-header', '@INPUT@', '@OUTPUT@'],
127 )
128
129 smsg_dwl_ipc_c = custom_target(
130 'smsg-dwl-ipc-unstable-v2-protocol-c',
131 input: dwl_ipc_xml,
132 output: 'dwl-ipc-unstable-v2-protocol.c',
133 command: [wayland_scanner, 'private-code', '@INPUT@', '@OUTPUT@'],
134 )
135
136 executable(
137 'smsg',
138 ['smsg/smsg.c', smsg_dwl_ipc_c, smsg_dwl_ipc_h],
139 dependencies: [wayland_client],
140 install: true,
141 )
142
143 install_subdir('example', install_dir: get_option('sysconfdir') / 'swindle', strip_directory: true)
@@ -0,0 +1,6
1 option(
2 'xwayland',
3 type: 'boolean',
4 value: true,
5 description: 'Enable XWayland support',
6 )
@@ -1,20 +1,21
1 1 syntax: glob
2 2 swindle
3 3 smsg/smsg
4 4 *.o
5 5 *-protocol.c
6 6 *-protocol.h
7 7 smsg/*-protocol.c
8 8 smsg/*-protocol.h
9 9 result
10 10 result-*
11 11 .direnv/
12 12 .vscode/
13 13 .idea/
14 14 .cache/
15 15 compile_commands.json
16 16 tags
17 17 *.swp
18 18 *.swo
19 19 *~
20 20 include/lua5.4/*
21 build/
@@ -1,56 +1,58
1 1 ## Swindle
2 2
3 3
4 4
5 5 > "It's so bad it's not even funny!" -kantiankant, 2026
6 6
7 7
8 8 Swindle is a fork of [dwl](https://codeberg.org/dwl/dwl) that was designed from the start with one goal: to make it feel like the poor man's Hyprland. It has the following:
9 9
10 10 * NO cool vfx
11 11 * nearly NO documentation
12 12 * ZERO good original code
13 13 * only ONE tiling layout (dwindle)
14 14
15 15 > Fun fact: I actually took some parts of [MangoWM](https://github.com/mangowm/mango) (such as the ext-workspaces implementation). hence why the LICENSE.mangowm exists
16 16
17 17 ## Dependencies
18 18
19 19 * libinput
20 20 * wayland
21 21 * wlroots-0.20 (compiled with the libinput backend)
22 22 * xkbcommon
23 23 * wayland-protocols (compile-time only)
24 24 * pkg-config (compile-time only)
25 * meson (compile-time only)
26 * ninja (compile-time only)
25 27
26 28 Install these (and their `-devel` versions if your distro has separate
27 29 development packages) and run `make` followed by `doas/sudo make install`, if you wish to install it (installs to /usr/local/bin/ by default).
28 30
29 31 ## Things that are good to have
30 32
31 33 * [foot](https://codeberg.org/dnkl/foot)
32 34
33 35
34 36 ## Known Issues
35 37
36 38 N/A
37 39
38 40 ## Configuration
39 41
40 42 read example/config.lua. It should give you a basic idea of how configuring swindle works.
41 43
42 44 > note: it's best to copy /etc/swindle/config.lua into XDG_HOME_DIR/.config/swindle/ before you attempt to
43 45 start swindle because it (swindle) won't start without it
44 46
45 47 ## Checklist
46 48
47 49 - [ ] separate the trackpad scroll from the mousee scroll
48 50 - [x] Add ability to change your keymap
49 51 - [ ] Add animations via [scenefx](https://github.com/wlrfx/scenefx) when 0.5 drops (in another branch)
50 52 - [ ] Add the ability for the compositor to read a custom path for configs
51 53 - [ ] Add /etc/swindle/config.lua as a fallback path if $HOME/.config/swindle/config.lua is not found
52 54
53 55
54 56 ## License
55 57
56 58 GPL-v3, probably
@@ -1,61 +1,61
1 1 {
2 2 "nodes": {
3 3 "flake-utils": {
4 4 "inputs": {
5 5 "systems": "systems"
6 6 },
7 7 "locked": {
8 8 "lastModified": 1731533236,
9 9 "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
10 10 "owner": "numtide",
11 11 "repo": "flake-utils",
12 12 "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
13 13 "type": "github"
14 14 },
15 15 "original": {
16 16 "owner": "numtide",
17 17 "repo": "flake-utils",
18 18 "type": "github"
19 19 }
20 20 },
21 21 "nixpkgs": {
22 22 "locked": {
23 "lastModified": 1786106723,
24 "narHash": "sha256-zDSUbpoeo/9ZmD2+wXnzxoo1+uhL8vxc0b8yuYMKYq0=",
23 "lastModified": 1786599213,
24 "narHash": "sha256-yNJd40f11EzXBjSByCB7IPpeFFAdeoSKKM67dGkfFoU=",
25 25 "owner": "NixOS",
26 26 "repo": "nixpkgs",
27 "rev": "f13ff45afd1bb73e640eaa08a7066dbed07e3238",
27 "rev": "0e251e24a4f24e036a084b6b4b2d2491af4167f4",
28 28 "type": "github"
29 29 },
30 30 "original": {
31 31 "owner": "NixOS",
32 32 "ref": "nixos-unstable",
33 33 "repo": "nixpkgs",
34 34 "type": "github"
35 35 }
36 36 },
37 37 "root": {
38 38 "inputs": {
39 39 "flake-utils": "flake-utils",
40 40 "nixpkgs": "nixpkgs"
41 41 }
42 42 },
43 43 "systems": {
44 44 "locked": {
45 45 "lastModified": 1681028828,
46 46 "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
47 47 "owner": "nix-systems",
48 48 "repo": "default",
49 49 "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
50 50 "type": "github"
51 51 },
52 52 "original": {
53 53 "owner": "nix-systems",
54 54 "repo": "default",
55 55 "type": "github"
56 56 }
57 57 }
58 58 },
59 59 "root": "root",
60 60 "version": 7
61 61 }
@@ -1,65 +1,51
1 1 {
2 2 description = "swindle: a dwl fork with Lua config, IPC, and ext-workspace support, plus its smsg client";
3
4 3 inputs = {
5 4 nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
6 5 flake-utils.url = "github:numtide/flake-utils";
7 6 };
8
9 7 outputs = { self, nixpkgs, flake-utils }:
10 8 flake-utils.lib.eachDefaultSystem (system:
11 9 let
12 10 pkgs = nixpkgs.legacyPackages.${system};
13 11 in
14 12 {
15 13 packages.default = pkgs.stdenv.mkDerivation rec {
16 14 pname = "swindle";
17 15 version = "0.1";
18
19 16 src = self;
20
21 17 nativeBuildInputs = with pkgs; [
22 18 pkg-config
23 19 wayland-scanner
24 20 wayland-protocols
21 meson
22 ninja
25 23 ];
26
27 24 buildInputs = with pkgs; [
28 25 wayland
29 26 wlroots_0_20
30 27 pixman
31 28 libxkbcommon
32 29 libinput
33 30 lua5_4
34 31 libxcb
35 32 libxcb-wm
36 33 ];
37
38 34 enableParallelBuilding = true;
39
40 postPatch = ''
41 substituteInPlace Makefile \
42 --replace '$(DESTDIR)/etc/swindle' '$(DESTDIR)$(PREFIX)/etc/swindle'
43 '';
44
45 makeFlags = [ "PREFIX=${placeholder "out"}" ];
46
35 mesonFlags = [ "-Dxwayland=true" ];
47 36 meta = with pkgs.lib; {
48 37 description = "A dwl fork with Lua configuration, IPC support, and ext-workspace-v1";
49 38 license = with licenses; [ gpl3Only mit isc ];
50 39 platforms = platforms.linux;
51 40 mainProgram = "swindle";
52 41 };
53 42 };
54
55 43 devShells.default = pkgs.mkShell {
56 44 inputsFrom = [ self.packages.${system}.default ];
57 45 packages = with pkgs; [ pkg-config gdb ];
58 46 };
59
60 47 apps.default = flake-utils.lib.mkApp {
61 48 drv = self.packages.${system}.default;
62 49 };
63 50 });
64 51 }
65
1 NO CONTENT: file was removed
1 NO CONTENT: file was removed
General Comments 0
You need to be logged in to leave comments. Login now