From 2faa7303ac759c74cc147cc4754b5bf35be202cd Mon Sep 17 00:00:00 2001 From: Frantisek Bohacek Date: Fri, 19 Jul 2024 19:50:40 +0200 Subject: [PATCH] feat: update dwl to 0.7 --- pkgs/dwl/README.md | 21 ++++++++++ pkgs/dwl/config.h | 10 ++--- pkgs/dwl/default.nix | 97 ++++++++++++++++++++++++++++++++++++++++++-- 3 files changed, 119 insertions(+), 9 deletions(-) create mode 100644 pkgs/dwl/README.md diff --git a/pkgs/dwl/README.md b/pkgs/dwl/README.md new file mode 100644 index 0000000..7b79cff --- /dev/null +++ b/pkgs/dwl/README.md @@ -0,0 +1,21 @@ +# DWL +I use DWL version 0.7 now. + +## Patches +- singletagset +- singletagset-pertag +- singletagset-sticky + +- swallow +- movestack +- naturalscrolltrackpad +- namedscratchpads +- bottomstack +- accessnthmonitor +- accessnthmonitor-movemouse +- focusnthclient + +- ipc +- ipc-singletagset + +- keycodes diff --git a/pkgs/dwl/config.h b/pkgs/dwl/config.h index 903ba83..8d925a6 100644 --- a/pkgs/dwl/config.h +++ b/pkgs/dwl/config.h @@ -46,7 +46,7 @@ static const Layout layouts[] = { { "><>", NULL }, /* no layout function means floating behavior */ { "[M]", monocle }, { "TTT", bstack }, - { "|M|", centeredmaster } + /* { "|M|", centeredmaster } */ }; /* monitors */ @@ -83,9 +83,9 @@ static const TagRule tagrules[] = { /* }; */ static const struct xkb_rule_names xkb_rules = { - .layout = "us,cz", - .variant = ",qwerty", - .options = "compose:ralt,ctrl:nocaps,grp:shifts_toggle", + .layout = "cz", + .variant = "coder", + .options = "ctrl:nocaps", }; static const int repeat_rate = 25; @@ -193,7 +193,7 @@ static const Key keys[] = { { MODKEY|WLR_MODIFIER_SHIFT, Key_t, setlayout, {.v = &layouts[3]} }, { MODKEY, Key_f, setlayout, {.v = &layouts[1]} }, { MODKEY, Key_m, setlayout, {.v = &layouts[2]} }, - { MODKEY, Key_i, setlayout, {.v = &layouts[4]} }, + /* { MODKEY, Key_i, setlayout, {.v = &layouts[4]} }, */ { MODKEY|WLR_MODIFIER_SHIFT, Key_m, togglefullscreen, {0} }, { MODKEY, Key_space, setlayout, {0} }, diff --git a/pkgs/dwl/default.nix b/pkgs/dwl/default.nix index de68b15..b5e1c44 100644 --- a/pkgs/dwl/default.nix +++ b/pkgs/dwl/default.nix @@ -1,8 +1,97 @@ -{ dwl, libdrm, fcft, fetchFromGitHub }: +{ + dwl, + wayland-scanner, + wayland-protocols, + wayland, + wlroots, + libdrm, + fcft, + libffi, + libdisplay-info, + hwdata, + lcms2, + mesa, + fetchFromGitHub, + fetchFromGitLab, + fetchurl +}: -((dwl.override { +let + wayland-src = fetchFromGitLab { + domain = "gitlab.freedesktop.org"; + owner = "wayland"; + repo = "wayland"; + rev = "1.23.0"; + hash = "sha256-oK0Z8xO2ILuySGZS0m37ZF0MOyle2l8AXb0/6wai0/w="; + }; + + libdrm-git = libdrm.overrideAttrs rec { + pname = "libdrm"; + version = "2.4.122"; + + src = fetchurl { + url = "https://dri.freedesktop.org/${pname}/${pname}-${version}.tar.xz"; + hash = "sha256-2fUHm3d9/8qTAMzFaxCpNYjN+8nd4vrhEZQN+2KS8lE="; + }; + }; + + mesa-drm-git = mesa.override { + libdrm = libdrm-git; + }; + + wayland-scanner-git = wayland-scanner.overrideAttrs { + version = "1.23.0"; + patches = []; + src = wayland-src; + }; + + wayland-git = wayland.overrideAttrs { + version = "1.23.0"; + patches = []; + src = wayland-src; + }; + + wayland-protocols-git = (wayland-protocols.override { + wayland = wayland-git; + wayland-scanner = wayland-scanner-git; + }).overrideAttrs (old: rec { + pname = "wayland-protocols"; + version = "1.36"; + + src = fetchurl { + url = "https://gitlab.freedesktop.org/wayland/${pname}/-/releases/${version}/downloads/${pname}-${version}.tar.xz"; + hash = "sha256-cf1N4F55+aHKVZ+sMMH4Nl+hA0ZCL5/nlfdNd7nvfpI="; + }; + }); + + wlroots-0_18 = (wlroots.override { + wayland = wayland-git; + wayland-scanner = wayland-scanner-git; + wayland-protocols = wayland-protocols-git; + mesa = mesa-drm-git; + }).overrideAttrs (old: rec { + version = "0.18.0"; + src = fetchFromGitLab { + domain = "gitlab.freedesktop.org"; + owner = "wlroots"; + repo = "wlroots"; + rev = version; + hash = "sha256-LiRnvu7qCbfSg+ONWVCtWwdzxxFZHfbgmy7zApCIW40="; + }; + buildInputs = old.buildInputs ++ [ + lcms2 + hwdata + libdisplay-info + ]; + }); +in ((dwl.override { + wayland = wayland-git; + wayland-protocols = wayland-protocols-git; + wlroots = wlroots-0_18; + wayland-scanner = wayland-scanner-git; conf = ./config.h; }).overrideAttrs (oldAttrs: { + version = "0.7"; buildInputs = (oldAttrs.buildInputs or []) ++ [ libdrm fcft @@ -10,7 +99,7 @@ src = fetchFromGitHub { owner = "Rutherther"; repo = "dwl"; - rev = "8c82c67f151c78b6bbe895f4831b20e6d7875450"; - hash = "sha256-02j6T66gzYXkFql2NffujNJPQsaEFm00i+o4aazCn8U="; + rev = "366c7fc21f08ed3edca89810071d8c68fec952d1"; + hash = "sha256-rhPiq+Fd3axlwQHR46TYUX1wKKH5BvQ8vXSbExIcJPw="; }; })) -- 2.48.1