2024-11-26 17:26:20 -05:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
focused_workspace=$(hyprctl activeworkspace -j | jq '.id')
|
|
|
|
|
2024-12-03 19:08:27 -05:00
|
|
|
foot_window_count=$(hyprctl clients -j | jq --argjson workspace "$focused_workspace" '[.[] |select(.workspace.id == $workspace and .class == "foot")] |length')
|
2024-11-26 17:26:20 -05:00
|
|
|
|
|
|
|
next_session=$((focused_workspace * 10))
|
|
|
|
|
2024-12-03 19:08:27 -05:00
|
|
|
if [ "$foot_window_count" -gt 0 ]
|
2024-11-26 17:26:20 -05:00
|
|
|
then
|
2024-12-03 19:08:27 -05:00
|
|
|
next_session=$((next_session + foot_window_count))
|
2024-11-26 17:26:20 -05:00
|
|
|
fi
|
|
|
|
|
2024-12-02 23:17:01 -05:00
|
|
|
foot tmux new-session -A -s ${next_session}
|