added biri on PC, created helper scripts

This commit is contained in:
greyweather committed 2026-09-04 13:07:04 +01:00
1 parent f508d6aa54
commit 41c967538a
2 files changed
+50 -7

No files matched your search

+25 -1
View File
@@ -72,7 +72,6 @@
extraPackages = with pkgs; [
nix-init
github-desktop
self.packages.${stdenv.hostPlatform.system}.biri
];
shellScripts = let
@@ -118,6 +117,31 @@
increase-brightness = mkBrightnessScript "+";
decrease-brightness = mkBrightnessScript "-";
niri-scratch-workspace-toggle = ''
if niri msg --json workspaces-with-hidden | jq -e '.[] | select(.name=="x") | .is_hidden' >/dev/null; then
niri msg action unhide-workspace --focus=false "x"
OUTPUT=$(niri msg --json focused-output | jq '.name' | sed 's/"//g')
echo "OUTPUT=$OUTPUT"
niri msg action move-workspace-to-monitor --reference "x" "$OUTPUT"
echo "moved scratch workspace: $(niri msg --json workspaces | jq '.[] | select(.name=="x") | .output')"
niri msg action focus-workspace "x"
else
niri msg action hide-workspace "x"
fi
'';
niri-listen-for-scratch-workspace-change = ''
niri msg --json event-stream | while read -r event; do
if echo $event | jq -e '.WorkspaceActivated.focused' >/dev/null; then
if niri msg --json workspaces | jq -e '.[] | select(.name=="x") | .is_active==false' >/dev/null; then
niri msg action hide-workspace "x"
fi
elif echo $event | jq -e '.WorkspacesChanged.workspaces.[] | select(.name=="x") | .is_active==false' >/dev/null; then
niri msg action hide-workspace "x"
fi
done
'';
};
};
};