nix-config/pkgs/hyprslurp/default.nix
Greg Burd f3fd89af54
A fork of Misterio77 and his standard template.
Many thangs to the hard work and generous availability of:
git@github.com:Misterio77/nix-config.git
2023-09-15 10:53:38 -04:00

17 lines
457 B
Nix

{ writeShellApplication, hyprland, jq, slurp }:
writeShellApplication {
name = "hyprslurp";
runtimeInputs = [ hyprland jq slurp ];
text = ''
hyprctl clients -j | \
jq -r \
--argjson workspaces "$(\
hyprctl monitors -j | \
jq -r 'map(.activeWorkspace.id)'\
)" \
'map(select([.workspace.id] | inside($workspaces)))' | \
jq -r '.[] | "\(.at[0]),\(.at[1]) \(.size[0])x\(.size[1])"' | \
slurp "$@"
'';
}