mirror of
https://github.com/Swarsel/.dotfiles.git
synced 2026-04-14 13:19:09 +02:00
chore: change to native nix scripts
This commit is contained in:
parent
80c08a6d19
commit
7ad9d84109
42 changed files with 2071 additions and 2102 deletions
|
|
@ -1,6 +1,18 @@
|
|||
{ self, name, writeShellApplication, jq }:
|
||||
{ name, writeShellApplication, jq, ... }:
|
||||
writeShellApplication {
|
||||
inherit name;
|
||||
runtimeInputs = [ jq ];
|
||||
text = builtins.readFile "${self}/files/scripts/${name}.sh";
|
||||
text = ''
|
||||
WORKSPACE=$(niri msg -j workspaces | jq -r '.[] | select(.is_focused == true) | .id')
|
||||
|
||||
COUNT=$(niri msg -j windows | jq --argjson ws "$WORKSPACE" -r '.[] | select(.workspace_id == $ws and .is_floating == false) | .app_id' | wc -l)
|
||||
|
||||
while [[ $COUNT == "0" || $COUNT == "2" ]]; do
|
||||
COUNT=$(niri msg -j windows | jq --argjson ws "$WORKSPACE" -r '.[] | select(.workspace_id == $ws and .is_floating == false) | .app_id' | wc -l)
|
||||
done
|
||||
|
||||
if [[ $COUNT == "1" ]]; then
|
||||
niri msg action maximize-column
|
||||
fi
|
||||
'';
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue