Improve configs
This commit is contained in:
parent
fdefb7037b
commit
eb3067ff29
13 changed files with 67 additions and 20 deletions
|
@ -4,10 +4,31 @@
|
|||
ws_media="[08]"
|
||||
ws_voip="[09]"
|
||||
|
||||
_handler_check_ws_media_empty() {
|
||||
has_zero_windows=$(hyprctl workspaces -j | jq ".[] | select(.name == \"$ws_media\") | .windows == 0")
|
||||
ws_media_at="[ 0, 0 ]"
|
||||
|
||||
_handler_check_ws_media_empty() {
|
||||
|
||||
# split at ">>" and get the second part and take first part of that
|
||||
win_id=$(echo "$1" | cut -d'>' -f3 | cut -d',' -f1)
|
||||
|
||||
media_got_emptied="false"
|
||||
|
||||
is_on_media_ws=$(hyprctl clients -j | jq ".[] | select(.address == \"0x$win_id\") | .workspace.name == \"$ws_media\"")
|
||||
if [ "$is_on_media_ws" == "true" ]; then
|
||||
media_got_emptied="true"
|
||||
fi
|
||||
|
||||
was_on_media_ws=$(hyprctl clients -j | jq ".[] | select(.address == \"0x$win_id\") | .at == $ws_media_at")
|
||||
if [ "$was_on_media_ws" == "true" ]; then
|
||||
media_got_emptied="true"
|
||||
fi
|
||||
|
||||
has_zero_windows=$(hyprctl workspaces -j | jq ".[] | select(.name == \"$ws_media\") | .windows == 0")
|
||||
if [ "$has_zero_windows" == "true" ]; then
|
||||
media_got_emptied="true"
|
||||
fi
|
||||
|
||||
if [ "$media_got_emptied" == "true" ]; then
|
||||
hyprctl dispatch workspace "$ws_voip"
|
||||
fi
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue