feat: reserve classroom shell and restore dock interaction
This commit is contained in:
@@ -1,11 +1,44 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
if pgrep -x chrome >/dev/null || pgrep -x google-chrome >/dev/null; then
|
||||
swaymsg '[app_id="google-chrome"] focus' >/dev/null 2>&1 || true
|
||||
APP_ID='google-chrome'
|
||||
HIDDEN_WS='__ekklesia_hidden'
|
||||
|
||||
if ! pgrep -x chrome >/dev/null 2>&1 &&
|
||||
! pgrep -x google-chrome >/dev/null 2>&1; then
|
||||
exec google-chrome \
|
||||
--ozone-platform=wayland \
|
||||
--start-maximized \
|
||||
https://app.wonderink.org/
|
||||
fi
|
||||
|
||||
focused_app="$(
|
||||
swaymsg -t get_tree -r |
|
||||
python3 -c '
|
||||
import json, sys
|
||||
|
||||
tree = json.load(sys.stdin)
|
||||
|
||||
def find_focused(node):
|
||||
if node.get("focused"):
|
||||
return node
|
||||
for child in node.get("nodes", []) + node.get("floating_nodes", []):
|
||||
result = find_focused(child)
|
||||
if result:
|
||||
return result
|
||||
return None
|
||||
|
||||
node = find_focused(tree)
|
||||
print((node or {}).get("app_id") or "")
|
||||
'
|
||||
)"
|
||||
|
||||
if [ "$focused_app" = "$APP_ID" ]; then
|
||||
swaymsg '[app_id="google-chrome"] move container to workspace __ekklesia_hidden' >/dev/null
|
||||
exit 0
|
||||
fi
|
||||
|
||||
exec google-chrome \
|
||||
--ozone-platform=wayland \
|
||||
--start-maximized \
|
||||
https://app.wonderink.org/
|
||||
swaymsg '[app_id="google-chrome"] move container to workspace current' >/dev/null 2>&1 || true
|
||||
swaymsg '[app_id="google-chrome"] focus' >/dev/null 2>&1 || true
|
||||
swaymsg '[app_id="google-chrome"] fullscreen disable' >/dev/null 2>&1 || true
|
||||
swaymsg '[app_id="google-chrome"] floating disable' >/dev/null 2>&1 || true
|
||||
|
||||
Reference in New Issue
Block a user