diff --git a/flake.lock b/flake.lock index 5d0f7aa..7ebefdc 100644 --- a/flake.lock +++ b/flake.lock @@ -132,6 +132,40 @@ "type": "github" } }, + "flake-parts_4": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib_5" + }, + "locked": { + "lastModified": 1693611461, + "narHash": "sha256-aPODl8vAgGQ0ZYFIRisxYG5MOGSkIczvu2Cd8Gb9+1Y=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "7f53fdb7bdc5bb237da7fefef12d099e4fd611ca", + "type": "github" + }, + "original": { + "id": "flake-parts", + "type": "indirect" + } + }, + "flake-parts_5": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib_6" + }, + "locked": { + "lastModified": 1693611461, + "narHash": "sha256-aPODl8vAgGQ0ZYFIRisxYG5MOGSkIczvu2Cd8Gb9+1Y=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "7f53fdb7bdc5bb237da7fefef12d099e4fd611ca", + "type": "github" + }, + "original": { + "id": "flake-parts", + "type": "indirect" + } + }, "flake-utils": { "inputs": { "systems": "systems" @@ -428,6 +462,42 @@ "type": "github" } }, + "nixpkgs-lib_5": { + "locked": { + "dir": "lib", + "lastModified": 1693471703, + "narHash": "sha256-0l03ZBL8P1P6z8MaSDS/MvuU8E75rVxe5eE1N6gxeTo=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "3e52e76b70d5508f3cec70b882a29199f4d1ee85", + "type": "github" + }, + "original": { + "dir": "lib", + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-lib_6": { + "locked": { + "dir": "lib", + "lastModified": 1693471703, + "narHash": "sha256-0l03ZBL8P1P6z8MaSDS/MvuU8E75rVxe5eE1N6gxeTo=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "3e52e76b70d5508f3cec70b882a29199f4d1ee85", + "type": "github" + }, + "original": { + "dir": "lib", + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "nixpkgs-stable": { "locked": { "lastModified": 1678872516, @@ -494,11 +564,11 @@ }, "nixpkgs_4": { "locked": { - "lastModified": 1695644571, - "narHash": "sha256-asS9dCCdlt1lPq0DLwkVBbVoEKuEuz+Zi3DG7pR/RxA=", + "lastModified": 1695830400, + "narHash": "sha256-gToZXQVr0G/1WriO83olnqrLSHF2Jb8BPcmCt497ro0=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "6500b4580c2a1f3d0f980d32d285739d8e156d92", + "rev": "8a86b98f0ba1c405358f1b71ff8b5e1d317f5db2", "type": "github" }, "original": { @@ -551,12 +621,16 @@ "pywlroots": { "inputs": { "flake-parts": "flake-parts_3", - "nixpkgs": "nixpkgs_4", - "pywlroots-src": "pywlroots-src" + "nixpkgs": [ + "qtile", + "nixpkgs" + ], + "pywlroots-src": "pywlroots-src", + "scenefx": "scenefx" }, "locked": { "lastModified": 1, - "narHash": "sha256-W8zExI9+M6/4XcyncAFpnLvr+lNgDXMTZ1Nfb6JtkIU=", + "narHash": "sha256-UWrgMhmt1I9du1arlBji6l0ijm/33L1B7J3mi68n4oc=", "path": "pywlroots", "type": "path" }, @@ -588,11 +662,12 @@ "nixpkgs" ], "pywlroots": "pywlroots", - "qtile-src": "qtile-src" + "qtile-src": "qtile-src", + "scenefx": "scenefx_2" }, "locked": { "lastModified": 1, - "narHash": "sha256-tldqXihJfgtVFVvUKNfa01TnMfN9+1/8RMoHfczYsKY=", + "narHash": "sha256-gHjQFJhVXzDanky68EkmfRp07oOO/fDsynukTcVbc0M=", "path": "flakes/qtile", "type": "path" }, @@ -604,11 +679,11 @@ "qtile-src": { "flake": false, "locked": { - "lastModified": 1695682843, - "narHash": "sha256-8Dqe2OoFND6n9d++uxgEcUffVT8V5/g9fXqszJ/IpEU=", + "lastModified": 1695927044, + "narHash": "sha256-Z0EpAYJu01lH1BOJXONynGZmSk7nEqmPj15JXflkGaE=", "owner": "qtile", "repo": "qtile", - "rev": "ad5d0538c51c7ba57ef8520b45b2728fe6caa3a3", + "rev": "17f20d65920502d9e4920eae50c036984fd49a25", "type": "github" }, "original": { @@ -681,6 +756,75 @@ "type": "github" } }, + "scenefx": { + "inputs": { + "flake-parts": "flake-parts_4", + "nixpkgs": "nixpkgs_4", + "scenefx-src": "scenefx-src" + }, + "locked": { + "lastModified": 1, + "narHash": "sha256-MjNre2IVsdGHgumTqojSngsCKSZQPcri01ZikXbyTqQ=", + "path": "../scenefx", + "type": "path" + }, + "original": { + "path": "../scenefx", + "type": "path" + } + }, + "scenefx-src": { + "flake": false, + "locked": { + "lastModified": 1691347738, + "narHash": "sha256-c/zRWz6njC3RsHzIcWpd5m7CXGprrIhKENpaQVH7Owk=", + "owner": "wlrfx", + "repo": "scenefx", + "rev": "b929a2bbadf467864796ad4ec90882ce86cfebff", + "type": "github" + }, + "original": { + "owner": "wlrfx", + "repo": "scenefx", + "type": "github" + } + }, + "scenefx-src_2": { + "flake": false, + "locked": { + "lastModified": 1691347738, + "narHash": "sha256-c/zRWz6njC3RsHzIcWpd5m7CXGprrIhKENpaQVH7Owk=", + "owner": "wlrfx", + "repo": "scenefx", + "rev": "b929a2bbadf467864796ad4ec90882ce86cfebff", + "type": "github" + }, + "original": { + "owner": "wlrfx", + "repo": "scenefx", + "type": "github" + } + }, + "scenefx_2": { + "inputs": { + "flake-parts": "flake-parts_5", + "nixpkgs": [ + "qtile", + "nixpkgs" + ], + "scenefx-src": "scenefx-src_2" + }, + "locked": { + "lastModified": 1, + "narHash": "sha256-MjNre2IVsdGHgumTqojSngsCKSZQPcri01ZikXbyTqQ=", + "path": "scenefx", + "type": "path" + }, + "original": { + "path": "scenefx", + "type": "path" + } + }, "systems": { "locked": { "lastModified": 1681028828, diff --git a/flakes/qtile/flake.lock b/flakes/qtile/flake.lock index 50754d3..4236214 100644 --- a/flakes/qtile/flake.lock +++ b/flakes/qtile/flake.lock @@ -36,13 +36,47 @@ "type": "github" } }, + "flake-parts_3": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib_3" + }, + "locked": { + "lastModified": 1693611461, + "narHash": "sha256-aPODl8vAgGQ0ZYFIRisxYG5MOGSkIczvu2Cd8Gb9+1Y=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "7f53fdb7bdc5bb237da7fefef12d099e4fd611ca", + "type": "github" + }, + "original": { + "id": "flake-parts", + "type": "indirect" + } + }, + "flake-parts_4": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib_4" + }, + "locked": { + "lastModified": 1693611461, + "narHash": "sha256-aPODl8vAgGQ0ZYFIRisxYG5MOGSkIczvu2Cd8Gb9+1Y=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "7f53fdb7bdc5bb237da7fefef12d099e4fd611ca", + "type": "github" + }, + "original": { + "id": "flake-parts", + "type": "indirect" + } + }, "nixpkgs": { "locked": { - "lastModified": 1695644571, - "narHash": "sha256-asS9dCCdlt1lPq0DLwkVBbVoEKuEuz+Zi3DG7pR/RxA=", + "lastModified": 1695830400, + "narHash": "sha256-gToZXQVr0G/1WriO83olnqrLSHF2Jb8BPcmCt497ro0=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "6500b4580c2a1f3d0f980d32d285739d8e156d92", + "rev": "8a86b98f0ba1c405358f1b71ff8b5e1d317f5db2", "type": "github" }, "original": { @@ -88,13 +122,49 @@ "type": "github" } }, - "nixpkgs_2": { + "nixpkgs-lib_3": { "locked": { - "lastModified": 1695644571, - "narHash": "sha256-asS9dCCdlt1lPq0DLwkVBbVoEKuEuz+Zi3DG7pR/RxA=", + "dir": "lib", + "lastModified": 1693471703, + "narHash": "sha256-0l03ZBL8P1P6z8MaSDS/MvuU8E75rVxe5eE1N6gxeTo=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "6500b4580c2a1f3d0f980d32d285739d8e156d92", + "rev": "3e52e76b70d5508f3cec70b882a29199f4d1ee85", + "type": "github" + }, + "original": { + "dir": "lib", + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-lib_4": { + "locked": { + "dir": "lib", + "lastModified": 1693471703, + "narHash": "sha256-0l03ZBL8P1P6z8MaSDS/MvuU8E75rVxe5eE1N6gxeTo=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "3e52e76b70d5508f3cec70b882a29199f4d1ee85", + "type": "github" + }, + "original": { + "dir": "lib", + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1695830400, + "narHash": "sha256-gToZXQVr0G/1WriO83olnqrLSHF2Jb8BPcmCt497ro0=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "8a86b98f0ba1c405358f1b71ff8b5e1d317f5db2", "type": "github" }, "original": { @@ -107,12 +177,15 @@ "pywlroots": { "inputs": { "flake-parts": "flake-parts_2", - "nixpkgs": "nixpkgs_2", - "pywlroots-src": "pywlroots-src" + "nixpkgs": [ + "nixpkgs" + ], + "pywlroots-src": "pywlroots-src", + "scenefx": "scenefx" }, "locked": { "lastModified": 1, - "narHash": "sha256-W8zExI9+M6/4XcyncAFpnLvr+lNgDXMTZ1Nfb6JtkIU=", + "narHash": "sha256-UWrgMhmt1I9du1arlBji6l0ijm/33L1B7J3mi68n4oc=", "path": "pywlroots", "type": "path" }, @@ -140,11 +213,11 @@ "qtile-src": { "flake": false, "locked": { - "lastModified": 1695682843, - "narHash": "sha256-8Dqe2OoFND6n9d++uxgEcUffVT8V5/g9fXqszJ/IpEU=", + "lastModified": 1695927044, + "narHash": "sha256-Z0EpAYJu01lH1BOJXONynGZmSk7nEqmPj15JXflkGaE=", "owner": "qtile", "repo": "qtile", - "rev": "ad5d0538c51c7ba57ef8520b45b2728fe6caa3a3", + "rev": "17f20d65920502d9e4920eae50c036984fd49a25", "type": "github" }, "original": { @@ -158,7 +231,76 @@ "flake-parts": "flake-parts", "nixpkgs": "nixpkgs", "pywlroots": "pywlroots", - "qtile-src": "qtile-src" + "qtile-src": "qtile-src", + "scenefx": "scenefx_2" + } + }, + "scenefx": { + "inputs": { + "flake-parts": "flake-parts_3", + "nixpkgs": "nixpkgs_2", + "scenefx-src": "scenefx-src" + }, + "locked": { + "lastModified": 1, + "narHash": "sha256-MjNre2IVsdGHgumTqojSngsCKSZQPcri01ZikXbyTqQ=", + "path": "../scenefx", + "type": "path" + }, + "original": { + "path": "../scenefx", + "type": "path" + } + }, + "scenefx-src": { + "flake": false, + "locked": { + "lastModified": 1691347738, + "narHash": "sha256-c/zRWz6njC3RsHzIcWpd5m7CXGprrIhKENpaQVH7Owk=", + "owner": "wlrfx", + "repo": "scenefx", + "rev": "b929a2bbadf467864796ad4ec90882ce86cfebff", + "type": "github" + }, + "original": { + "owner": "wlrfx", + "repo": "scenefx", + "type": "github" + } + }, + "scenefx-src_2": { + "flake": false, + "locked": { + "lastModified": 1691347738, + "narHash": "sha256-c/zRWz6njC3RsHzIcWpd5m7CXGprrIhKENpaQVH7Owk=", + "owner": "wlrfx", + "repo": "scenefx", + "rev": "b929a2bbadf467864796ad4ec90882ce86cfebff", + "type": "github" + }, + "original": { + "owner": "wlrfx", + "repo": "scenefx", + "type": "github" + } + }, + "scenefx_2": { + "inputs": { + "flake-parts": "flake-parts_4", + "nixpkgs": [ + "nixpkgs" + ], + "scenefx-src": "scenefx-src_2" + }, + "locked": { + "lastModified": 1, + "narHash": "sha256-MjNre2IVsdGHgumTqojSngsCKSZQPcri01ZikXbyTqQ=", + "path": "scenefx", + "type": "path" + }, + "original": { + "path": "scenefx", + "type": "path" } } }, diff --git a/flakes/qtile/flake.nix b/flakes/qtile/flake.nix index a513eb3..b91a809 100644 --- a/flakes/qtile/flake.nix +++ b/flakes/qtile/flake.nix @@ -11,6 +11,12 @@ pywlroots = { url = "path:pywlroots"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + scenefx = { + url = "path:scenefx"; + inputs.nixpkgs.follows = "nixpkgs"; }; }; @@ -38,14 +44,14 @@ src = inputs.qtile-src; SETUPTOOLS_SCM_PRETEND_VERSION = "0.23.0"; postPatch = '' - substituteInPlace libqtile/pangocffi.py \ - --replace libgobject-2.0.so.0 ${pkgs.glib.out}/lib/libgobject-2.0.so.0 \ - --replace libpangocairo-1.0.so.0 ${pkgs.pango.out}/lib/libpangocairo-1.0.so.0 \ - --replace libpango-1.0.so.0 ${pkgs.pango.out}/lib/libpango-1.0.so.0 - substituteInPlace libqtile/backend/x11/xcursors.py \ - --replace libxcb-cursor.so.0 ${pkgs.xcb-util-cursor.out}/lib/libxcb-cursor.so.0 - substituteInPlace libqtile/backend/wayland/cffi/cairo_buffer.py \ - --replace drm_fourcc.h libdrm/drm_fourcc.h + substituteInPlace libqtile/pangocffi.py \ + --replace libgobject-2.0.so.0 ${pkgs.glib.out}/lib/libgobject-2.0.so.0 \ + --replace libpangocairo-1.0.so.0 ${pkgs.pango.out}/lib/libpangocairo-1.0.so.0 \ + --replace libpango-1.0.so.0 ${pkgs.pango.out}/lib/libpango-1.0.so.0 + substituteInPlace libqtile/backend/x11/xcursors.py \ + --replace libxcb-cursor.so.0 ${pkgs.xcb-util-cursor.out}/lib/libxcb-cursor.so.0 + substituteInPlace libqtile/backend/wayland/cffi/cairo_buffer.py \ + --replace drm_fourcc.h libdrm/drm_fourcc.h substituteInPlace libqtile/backend/wayland/cffi/build.py \ --replace /usr/include/pixman-1 ${lib.getDev pkgs.pixman}/include \ --replace /usr/include/libdrm ${lib.getDev pkgs.libdrm}/include/libdrm @@ -76,6 +82,7 @@ libdrm wayland xorg.xcbutilwm + inputs'.scenefx.packages.default (wlroots.overrideAttrs (wf: wp: { postPatch = wp.postPatch @@ -84,6 +91,7 @@ ''; })) ]; + # patches = [./scenefx.patch]; makeWrapperArgs = [ "--suffix PATH : ${lib.makeBinPath [mypy]}" ]; diff --git a/flakes/qtile/pywlroots/flake.lock b/flakes/qtile/pywlroots/flake.lock index 8fa428e..81b0700 100644 --- a/flakes/qtile/pywlroots/flake.lock +++ b/flakes/qtile/pywlroots/flake.lock @@ -18,13 +18,30 @@ "type": "github" } }, + "flake-parts_2": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib_2" + }, + "locked": { + "lastModified": 1693611461, + "narHash": "sha256-aPODl8vAgGQ0ZYFIRisxYG5MOGSkIczvu2Cd8Gb9+1Y=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "7f53fdb7bdc5bb237da7fefef12d099e4fd611ca", + "type": "github" + }, + "original": { + "id": "flake-parts", + "type": "indirect" + } + }, "nixpkgs": { "locked": { - "lastModified": 1695644571, - "narHash": "sha256-asS9dCCdlt1lPq0DLwkVBbVoEKuEuz+Zi3DG7pR/RxA=", + "lastModified": 1695830400, + "narHash": "sha256-gToZXQVr0G/1WriO83olnqrLSHF2Jb8BPcmCt497ro0=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "6500b4580c2a1f3d0f980d32d285739d8e156d92", + "rev": "8a86b98f0ba1c405358f1b71ff8b5e1d317f5db2", "type": "github" }, "original": { @@ -52,6 +69,40 @@ "type": "github" } }, + "nixpkgs-lib_2": { + "locked": { + "dir": "lib", + "lastModified": 1693471703, + "narHash": "sha256-0l03ZBL8P1P6z8MaSDS/MvuU8E75rVxe5eE1N6gxeTo=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "3e52e76b70d5508f3cec70b882a29199f4d1ee85", + "type": "github" + }, + "original": { + "dir": "lib", + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1695830400, + "narHash": "sha256-gToZXQVr0G/1WriO83olnqrLSHF2Jb8BPcmCt497ro0=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "8a86b98f0ba1c405358f1b71ff8b5e1d317f5db2", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "pywlroots-src": { "flake": false, "locked": { @@ -72,7 +123,41 @@ "inputs": { "flake-parts": "flake-parts", "nixpkgs": "nixpkgs", - "pywlroots-src": "pywlroots-src" + "pywlroots-src": "pywlroots-src", + "scenefx": "scenefx" + } + }, + "scenefx": { + "inputs": { + "flake-parts": "flake-parts_2", + "nixpkgs": "nixpkgs_2", + "scenefx-src": "scenefx-src" + }, + "locked": { + "lastModified": 1, + "narHash": "sha256-MjNre2IVsdGHgumTqojSngsCKSZQPcri01ZikXbyTqQ=", + "path": "../scenefx", + "type": "path" + }, + "original": { + "path": "../scenefx", + "type": "path" + } + }, + "scenefx-src": { + "flake": false, + "locked": { + "lastModified": 1691347738, + "narHash": "sha256-c/zRWz6njC3RsHzIcWpd5m7CXGprrIhKENpaQVH7Owk=", + "owner": "wlrfx", + "repo": "scenefx", + "rev": "b929a2bbadf467864796ad4ec90882ce86cfebff", + "type": "github" + }, + "original": { + "owner": "wlrfx", + "repo": "scenefx", + "type": "github" } } }, diff --git a/flakes/qtile/pywlroots/flake.nix b/flakes/qtile/pywlroots/flake.nix index d6acd7a..1c22d5e 100644 --- a/flakes/qtile/pywlroots/flake.nix +++ b/flakes/qtile/pywlroots/flake.nix @@ -4,6 +4,8 @@ flake-parts.url = "github:hercules-ci/flake-parts"; + scenefx.url = "path:../scenefx"; + pywlroots-src = { url = "github:flacjacket/pywlroots"; flake = false; @@ -44,6 +46,7 @@ xorg.xcbutilwm udev wayland + inputs'.scenefx.packages.default ((wlroots_0_16.override { xwayland = xwayland; enableXWayland = true; @@ -65,6 +68,11 @@ postBuild = '' ${python3.pythonForBuild.interpreter} wlroots/ffi_build.py ''; + # patches = [./scenefx.patch]; + # postPatch = '' + # substituteInPlace wlroots/ffi_build.py \ + # --replace 'libraries=["wlroots"],' 'libraries=["wlroots","scenefx"],' + # ''; pythonImportsCheck = ["wlroots"]; passthru.test = {inherit qtile;}; diff --git a/flakes/qtile/pywlroots/scenefx.patch b/flakes/qtile/pywlroots/scenefx.patch new file mode 100644 index 0000000..b88072b --- /dev/null +++ b/flakes/qtile/pywlroots/scenefx.patch @@ -0,0 +1,34 @@ +diff --git a/wlroots/ffi_build.py b/wlroots/ffi_build.py +index ec01f8b..cac6dd8 100755 +--- a/wlroots/ffi_build.py ++++ b/wlroots/ffi_build.py +@@ -1891,6 +1891,12 @@ void wlr_scene_buffer_set_dest_size(struct wlr_scene_buffer *scene_buffer, + void wlr_scene_buffer_set_transform(struct wlr_scene_buffer *scene_buffer, + enum wl_output_transform transform); + ++void wlr_scene_buffer_set_opacity(struct wlr_scene_buffer *scene_buffer, ++ float opacity); ++ ++void wlr_scene_buffer_set_corner_radius(struct wlr_scene_buffer *scene_buffer, ++ int radii); ++ + void wlr_scene_buffer_send_frame_done(struct wlr_scene_buffer *scene_buffer, + struct timespec *now); + +diff --git a/wlroots/wlr_types/scene.py b/wlroots/wlr_types/scene.py +index 3a99d2f..2f3d5ba 100755 +--- a/wlroots/wlr_types/scene.py ++++ b/wlroots/wlr_types/scene.py +@@ -170,6 +170,12 @@ class SceneBuffer(Ptr): + region_ptr = region._ptr if region else ffi.NULL + lib.wlr_scene_buffer_set_buffer_with_damage(self._ptr, buffer_ptr, region_ptr) + ++ def set_opacity(self, opacity: float) -> None: ++ lib.wlr_scene_buffer_set_opacity(self._ptr, opacity) ++ ++ def set_corner_radius(self, radii: int) -> None: ++ lib.wlr_scene_buffer_set_corner_radius(self._ptr, radii) ++ + + T = TypeVar("T") + BufferCallback = Callable[[SceneBuffer, int, int, T], None] diff --git a/flakes/qtile/scenefx.patch b/flakes/qtile/scenefx.patch new file mode 100644 index 0000000..f03abd5 --- /dev/null +++ b/flakes/qtile/scenefx.patch @@ -0,0 +1,67 @@ +diff --git a/libqtile/backend/wayland/window.py b/libqtile/backend/wayland/window.py +index 8f2c12a..563cc83 100644 +--- a/libqtile/backend/wayland/window.py ++++ b/libqtile/backend/wayland/window.py +@@ -114,6 +114,7 @@ class Window(typing.Generic[S], _Base, base.Window, HasListeners): + self.x = 0 + self.y = 0 + self._opacity: float = 1.0 ++ self._rounding: int = 0 + self._wm_class: str | None = None + self._idle_inhibitors_count: int = 0 + self._urgent = False +@@ -389,16 +390,43 @@ class Window(typing.Generic[S], _Base, base.Window, HasListeners): + + @opacity.setter + def opacity(self, opacity: float) -> None: +- if opacity < 1.0: ++ if self.container.node: ++ buf = SceneBuffer.from_node(self.container.node) ++ if buf: ++ buf.set_opacity(opacity) ++ else: ++ logger.warning( ++ f"Failed to turn node {self.container.node} into a buffer!" ++ ) ++ else: + logger.warning( +- "Sorry, transparency is not yet supported by the wlroots API used by " +- "Qtile. Transparency can only be achieved if the client sets it." ++ "Sorry, opacity is not implemented for this window type." + ) + # wlroots' scene graph doesn't support setting the opacity of trees/nodes by + # the compositor. See: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3393 + # If/when that becomes supported, this warning can be removed. + self._opacity = opacity + ++ @property ++ def rounding(self) -> int: ++ return self._rounding ++ ++ @rounding.setter ++ def rounding(self, radii: int) -> None: ++ if self.container.node: ++ buf = SceneBuffer.from_node(self.container.node) ++ if buf: ++ buf.set_corner_radius(radii) ++ else: ++ logger.warning( ++ f"Failed to turn node {self.container.node} into a buffer!" ++ ) ++ else: ++ logger.warning( ++ "Sorry, rounding is not implemented for this window type." ++ ) ++ ++ + @property + def floating(self) -> bool: + return self._float_state != FloatStates.NOT_FLOATING +@@ -921,6 +949,7 @@ class Internal(_Base, base.Internal): + self._width: int = width + self._height: int = height + self._opacity: float = 1.0 ++ self._rounding: int = 0 + + # Store this object on the scene node for finding the window under the pointer. + self.wlr_buffer, self.surface = self._new_buffer(init=True) diff --git a/flakes/qtile/scenefx/flake.lock b/flakes/qtile/scenefx/flake.lock new file mode 100644 index 0000000..6a48e18 --- /dev/null +++ b/flakes/qtile/scenefx/flake.lock @@ -0,0 +1,80 @@ +{ + "nodes": { + "flake-parts": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1693611461, + "narHash": "sha256-aPODl8vAgGQ0ZYFIRisxYG5MOGSkIczvu2Cd8Gb9+1Y=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "7f53fdb7bdc5bb237da7fefef12d099e4fd611ca", + "type": "github" + }, + "original": { + "id": "flake-parts", + "type": "indirect" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1695830400, + "narHash": "sha256-gToZXQVr0G/1WriO83olnqrLSHF2Jb8BPcmCt497ro0=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "8a86b98f0ba1c405358f1b71ff8b5e1d317f5db2", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-lib": { + "locked": { + "dir": "lib", + "lastModified": 1693471703, + "narHash": "sha256-0l03ZBL8P1P6z8MaSDS/MvuU8E75rVxe5eE1N6gxeTo=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "3e52e76b70d5508f3cec70b882a29199f4d1ee85", + "type": "github" + }, + "original": { + "dir": "lib", + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-parts": "flake-parts", + "nixpkgs": "nixpkgs", + "scenefx-src": "scenefx-src" + } + }, + "scenefx-src": { + "flake": false, + "locked": { + "lastModified": 1691347738, + "narHash": "sha256-c/zRWz6njC3RsHzIcWpd5m7CXGprrIhKENpaQVH7Owk=", + "owner": "wlrfx", + "repo": "scenefx", + "rev": "b929a2bbadf467864796ad4ec90882ce86cfebff", + "type": "github" + }, + "original": { + "owner": "wlrfx", + "repo": "scenefx", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flakes/qtile/scenefx/flake.nix b/flakes/qtile/scenefx/flake.nix new file mode 100644 index 0000000..44b3ae5 --- /dev/null +++ b/flakes/qtile/scenefx/flake.nix @@ -0,0 +1,75 @@ +{ + description = "scenefx"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + + scenefx-src = { + url = "github:wlrfx/scenefx"; + flake = false; + }; + }; + + outputs = inputs @ {flake-parts, ...}: + flake-parts.lib.mkFlake {inherit inputs;} { + imports = [ + # To import a flake module + # 1. Add foo to inputs + # 2. Add foo as a parameter to the outputs function + # 3. Add here: foo.flakeModule + ]; + systems = ["x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin"]; + perSystem = { + config, + self', + inputs', + pkgs, + system, + ... + }: { + # Per-system attributes can be defined here. The self' and inputs' + # module parameters provide easy access to attributes of the same + # system. + + # Equivalent to inputs'.nixpkgs.legacyPackages.hello; + packages.default = with pkgs; + stdenv.mkDerivation rec { + pname = "scenefx"; + version = "unstable-${inputs.scenefx-src.lastModifiedDate}"; + src = inputs.scenefx-src; + nativeBuildInputs = [ + meson + ninja + cmake + pkg-config + ]; + buildInputs = [ + ((wlroots_0_16.override { + xwayland = xwayland; + enableXWayland = true; + }) + .overrideAttrs (wf: wp: { + postPatch = + wp.postPatch + + '' + substituteInPlace render/gles2/renderer.c --replace "glFlush();" "glFinish();" + ''; + })) + wayland + libdrm + libxkbcommon + udev + pixman + wayland-protocols + libGL + mesa + ]; + }; + }; + flake = { + # The usual flake attributes can be defined here, including system- + # agnostic ones like nixosModule and system-enumerating ones, although + # those are more easily expressed in perSystem. + }; + }; +} diff --git a/home/dots/qtile/config.py b/home/dots/qtile/config.py index a7153fa..f234046 100755 --- a/home/dots/qtile/config.py +++ b/home/dots/qtile/config.py @@ -8,6 +8,7 @@ import sys import os from typing import List +from libqtile.log_utils import logger from libqtile import bar, hook, layout, qtile, utils, widget from libqtile.backend import base from libqtile.lazy import lazy @@ -24,7 +25,7 @@ from libqtile.backend.wayland import InputConfig wl_input_rules = { "type:keyboard": InputConfig(kb_options="caps:escape"), - "*": InputConfig(accel_profile="flat", pointer_accel="0.0"), + "*": InputConfig(accel_profile="flat", pointer_accel=0.0), } mod = "mod4" @@ -182,6 +183,7 @@ bring_front_click = False cursor_warp = True focus_on_window_activation = "smart" auto_fullscreen = True +floats_kept_above = True floating_layout = layout.Floating(float_rules=[ *layout.Floating.default_float_rules, @@ -197,7 +199,8 @@ def autostart(): @hook.subscribe.client_new def float_firefox(client): - if "firefox" in client.get_wm_class() and client.name == "Library": + wm_class = client.get_wm_class() + if wm_class and "firefox" in wm_class and client.name == "Library": client.enable_floating() @hook.subscribe.client_new @@ -205,3 +208,11 @@ def fullscreen_wlogout(client): if client.name == "wlogout": client.enable_fullscreen() +# @hook.subscribe.client_new +# def round_and_transparent(client): +# logger.warning(client) +# logger.warning(type(client)) +# logger.warning(client.rounding) +# logger.warning(client.opacity) +# client.rounding = 8 +# client.opacity = 0.85 diff --git a/home/home.nix b/home/home.nix index 1f348bf..30115ca 100644 --- a/home/home.nix +++ b/home/home.nix @@ -85,9 +85,23 @@ in { services.udiskie.enable = true; - # TODO fix launch programs.vscode = { enable = true; + extensions = with pkgs.vscode-extensions; [ + rust-lang.rust-analyzer + serayuzgur.crates + jnoortheen.nix-ide + arrterian.nix-env-selector + mkhl.direnv + # silverquark.dancehelix + # gregoire.dance + ]; + mutableExtensionsDir = true; + userSettings = { + "window.titleBarStyle" = "custom"; + "editor.fontFamily" = "'${pkgs.rice.fonts.monospace.name}'"; + "editor.fontSize" = 12; + }; }; systemd.user.startServices = "sd-switch"; diff --git a/system/configuration.nix b/system/configuration.nix index b1444d4..7a1ea15 100644 --- a/system/configuration.nix +++ b/system/configuration.nix @@ -86,7 +86,7 @@ services.xserver.windowManager.qtile = { enable = true; backend = "wayland"; - package = inputs.qtile.packages.x86_64-linux.default; + package = inputs.qtile.packages.x86_64-linux.qtile; configFile = null; # using hm instead extraPackages = python3Packages: with python3Packages; [ @@ -115,7 +115,7 @@ enable = true; extraPortals = with pkgs; [ xdg-desktop-portal-gtk - xdg-desktop-portal-wlr + # xdg-desktop-portal-wlr ]; }; diff --git a/system/quiver.nix b/system/quiver.nix index 1ef64a9..4d5193e 100644 --- a/system/quiver.nix +++ b/system/quiver.nix @@ -42,6 +42,7 @@ hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; environment.sessionVariables = rec { + NIXOS_OZONE_WL = "1"; ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE = "fg=5"; WLR_NO_HARDWARE_CURSORS = "1"; # WLR_RENDERER = "vulkan";