Prevent screen switching on emulationstation

This commit is contained in:
rocknix
2025-10-30 20:54:45 +00:00
parent 9fca186d7a
commit 7b99bb08e5

View File

@@ -2,12 +2,20 @@
source /etc/profile
# Get the active app_id
ACTIVE_APPID=$(swaymsg -t get_tree | awk '
/"focused": true/ {focused=1}
focused && /app_id/ {gsub(/.*"app_id": *"/,""); gsub(/".*/,""); print; exit}
focused && /"app_id":/ {
gsub(/.*"app_id": *"/,""); gsub(/".*/,""); print; exit
}
')
UDSI=$(swaymsg -t get_tree | jq -r '.. | objects | select(.type == "output" and .name != "__i3") | select(.nodes[].nodes | length == 0) | .name')
UDSI=$(swaymsg -t get_tree | jq -r '
.. | objects
| select(.type == "output" and .name != "__i3")
| select(.nodes[].nodes | length == 0)
| .name
')
swaymsg [app_id=\"${ACTIVE_APPID}\"] move window to output ${UDSI}
if [[ -n "$ACTIVE_APPID" && "$ACTIVE_APPID" != "emulationstation" && -n "$UDSI" ]]; then
swaymsg "[app_id=\"${ACTIVE_APPID}\"]" move window to output "${UDSI}"
fi