From 1320c34d7186ad3ec01789933ac628d420f00360 Mon Sep 17 00:00:00 2001 From: Frantisek Bohacek Date: Sat, 25 May 2024 12:25:07 +0200 Subject: [PATCH] feat: make wlr portal working for screenshare --- home/modules/profiles/desktop/dwl/default.nix | 32 +++++++++++++++---- nixos/modules/profiles/desktop/default.nix | 8 +++++ 2 files changed, 33 insertions(+), 7 deletions(-) diff --git a/home/modules/profiles/desktop/dwl/default.nix b/home/modules/profiles/desktop/dwl/default.nix index e54962b..2766a31 100644 --- a/home/modules/profiles/desktop/dwl/default.nix +++ b/home/modules/profiles/desktop/dwl/default.nix @@ -50,6 +50,18 @@ in { systemctl stop --user graphical-session.target ''; + home.file.".sessions/start-dwl-temp".source = pkgs.writeShellScript "start-dwl-temp" '' + export XDG_CURRENT_DESKTOP=wlroots XDG_BACKEND=wayland QT_QPA_PLATFORM=wayland MOZ_ENABLE_WAYLAND=1 _JAVA_AWT_WM_NONREPARENTING=1 + $HOME/doc/projects/mine/nix/dwm/result/bin/dwl -s "${pkgs.writeShellScript "dwl-internal" '' + dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP DISPLAY + systemctl start --user wlr-session.target + ''}" & + pid=$! + # Put something here + wait $pid + systemctl stop --user graphical-session.target + ''; + home.file.".config/dwl/scripts/brightness.sh".source = ../qtile/config/brightness.sh; home.file.".config/dwl/scripts/print.sh".source = pkgs.writeShellScript "print.sh" '' #!/bin/sh -e @@ -95,17 +107,23 @@ in { src = pkgs.fetchFromGitHub { owner = "Rutherther"; repo = "dwl"; - rev = "3f0c3849948e160019f63af2a1384dd449a0f949"; - hash = "sha256-BjzaXJNoq8tZFrxxQVOxjdMDV9pTxpCnkEhx5jMvknM="; + rev = "9a5f91a3a9b64e97f1049ab34f838f4778604ac6"; + hash = "sha256-iMAs3pe9gtABg4v5Ho2CVeDX+uRV/VS7Ypbd9tIgsEc="; }; })) ]; - xdg.portal = { - enable = true; - configPackages = [ pkgs.xdg-desktop-portal-wlr ]; - extraPortals = [ pkgs.xdg-desktop-portal-wlr ]; - }; + # xdg.portal = { + # enable = true; + # configPackages = [ + # pkgs.xdg-desktop-portal-wlr + # pkgs.xdg-desktop-portal-gtk + # ]; + # extraPortals = [ + # pkgs.xdg-desktop-portal-wlr + # pkgs.xdg-desktop-portal-gtk + # ]; + # }; programs = { swaylock = { diff --git a/nixos/modules/profiles/desktop/default.nix b/nixos/modules/profiles/desktop/default.nix index a5cd34e..4c7844c 100644 --- a/nixos/modules/profiles/desktop/default.nix +++ b/nixos/modules/profiles/desktop/default.nix @@ -18,6 +18,14 @@ pkgs.xkblayout-state ]; + xdg.portal = { + wlr.enable = true; + extraPortals = [ + pkgs.xdg-desktop-portal-gtk + ]; + config.wlroots.deafult = lib.mkDefault [ "wlr" "gtk" ]; + }; + services = { libinput.enable = true; xserver = { -- 2.48.1