diff --git a/home/desktop/niri.nix b/home/desktop/niri.nix index 9a9037d..d1fa64f 100644 --- a/home/desktop/niri.nix +++ b/home/desktop/niri.nix @@ -1,6 +1,27 @@ { config, lib, pkgs, inputs, ... }: let + pip-handler = pkgs.writeShellScriptBin "pip-handler" '' + # Listen to Niri window events continuously + niri msg event-stream | while read -r line; do + # Check if a new window event fired + if echo "$line" | grep -q '"WindowOpened"'; then + + # Give the window a split second to populate its title metadata + sleep 0.1 + + # Use nirius or niri msg to evaluate the currently focused window title + # If it matches Picture-in-Picture, invoke nirius toggle-follow-mode + WINDOW_TITLE=$(niri msg focused-window | grep "Title:" | sed 's/Title: //') + + if [[ "$WINDOW_TITLE" =~ [Pp]icture[-\ ]in[-\ ][Pp]icture ]]; then + # Executes nirius follow mode trigger + nirius toggle-follow-mode --policy always + fi + fi + done + ''; + launch-lisgd = pkgs.writeShellScriptBin "launch-lisgd" '' # Search for the capacitive touch layer and extract its event number. # UPDATE 'Touchscreen' below to match the unique word you found in step 1. @@ -128,9 +149,9 @@ in window-rule { match title="(?i)picture.in.picture" open-floating true - default-column-width { fixed 480; } - default-window-height { fixed 270; } - default-floating-position x=25 y=25 relative-to="top-right" + default-column-width { fixed 240; } + default-window-height { fixed 185; } + default-floating-position x=8 y=8 relative-to="top-right" } window-rule { diff --git a/home/jashton.nix b/home/jashton.nix index f37fa4c..5a5adea 100644 --- a/home/jashton.nix +++ b/home/jashton.nix @@ -56,6 +56,7 @@ in kicad libreoffice librewolf + nirius pdftk picom prismlauncher @@ -223,21 +224,6 @@ in ''; }; - systemd.user.services.lan-mouse = { - Unit = { - Description = "Lan Mouse Daemon"; - After = [ "graphical-session.target" ]; - PartOf = [ "graphical-session.target" ]; - }; - Install = { - WantedBy = [ "graphical-session.target" ]; - }; - Service = { - # The --daemon flag ensures it runs silently in the background without opening the GUI - ExecStart = "${pkgs.lan-mouse}/bin/lan-mouse --daemon"; - }; - }; - programs.opencode = { enable = true;