From 8218f368d771fb763bb53a5c91add4d278a67dae Mon Sep 17 00:00:00 2001 From: sefidel Date: Wed, 15 Nov 2023 23:26:23 +0900 Subject: feat(home/gui): sway: use displaylink patch on laptop --- home/profiles/gui/default.nix | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'home') diff --git a/home/profiles/gui/default.nix b/home/profiles/gui/default.nix index 2fbb505..56b9b04 100644 --- a/home/profiles/gui/default.nix +++ b/home/profiles/gui/default.nix @@ -1,4 +1,4 @@ -{ config, lib, inputs, pkgs, self, ... }: +{ config, options, lib, inputs, pkgs, self, ... }: let cfg = config.profiles.gui; @@ -103,6 +103,17 @@ in wayland.windowManager.sway = { enable = true; + package = + if cfg.laptop.enable then + options.wayland.windowManager.sway.package.default.override + (prev: { + sway-unwrapped = prev.sway-unwrapped.override (s-prev: { + wlroots = s-prev.wlroots.overrideAttrs { + patches = [ ../../../overlays/patches/wlroots-displaylink/DisplayLink_v2.patch ]; + }; + }); + }) else options.wayland.windowManager.sway.package.default; + wrapperFeatures = { base = true; gtk = true; @@ -201,8 +212,8 @@ in [{ # 10m (desktop only) timeout = 600; - command = "${pkgs.sway}/bin/swaymsg 'output * dpms off'"; - resumeCommand = "${pkgs.sway}/bin/swaymsg 'output * dpms on'"; + command = "${config.wayland.windowManager.sway.package}/bin/swaymsg 'output * dpms off'"; + resumeCommand = "${config.wayland.windowManager.sway.package}/bin/swaymsg 'output * dpms on'"; }] ++ [ { # 10m on laptops, 15m on desktop -- cgit 1.4.1