Compare commits
No commits in common. "master" and "freez" have entirely different histories.
@ -58,3 +58,36 @@ case $workspace_number in
|
|||||||
swaymsg input type:keyboard xkb_switch_layout 0
|
swaymsg input type:keyboard xkb_switch_layout 0
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
#
|
||||||
|
# Freeze manager
|
||||||
|
#
|
||||||
|
workspaces_data=$(swaymsg -t get_tree | jq --arg ws1 "$workspace_number" --arg ws2 "$last_workspace" '
|
||||||
|
.nodes[]
|
||||||
|
| select(.type == "output")
|
||||||
|
| .nodes[]
|
||||||
|
| select(.type == "workspace" and (.name == $ws1 or .name == $ws2))
|
||||||
|
| {
|
||||||
|
workspace: .name,
|
||||||
|
pids: [(.nodes[]?, .floating_nodes[]?) | select(has("pid")) | .pid]
|
||||||
|
}
|
||||||
|
')
|
||||||
|
pids_unfreeze=$(echo "$workspaces_data" | jq --arg ws "$workspace_number" '
|
||||||
|
select(.workspace == $ws) | .pids[]
|
||||||
|
' | tr '\n' ',')
|
||||||
|
|
||||||
|
if [ -n "$pids_unfreeze" ]; then
|
||||||
|
pkill -SIGCONT -g "${pids_unfreeze%,}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
case $last_workspace in
|
||||||
|
12) exit 0;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
pids_freeze=$(echo "$workspaces_data" | jq --arg ws "$last_workspace" '
|
||||||
|
select(.workspace == $ws) | .pids[]
|
||||||
|
' | tr '\n' ',')
|
||||||
|
|
||||||
|
if [ -n "$pids_freeze" ]; then
|
||||||
|
pkill -SIGSTOP -g "${pids_freeze%,}"
|
||||||
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user