aboutsummaryrefslogtreecommitdiff
path: root/hotspots
diff options
context:
space:
mode:
Diffstat (limited to 'hotspots')
-rwxr-xr-xhotspots54
1 files changed, 24 insertions, 30 deletions
diff --git a/hotspots b/hotspots
index af1f70d..af7278c 100755
--- a/hotspots
+++ b/hotspots
@@ -37,18 +37,18 @@ TR=("$SIZE" "$SIZE")
function onEnter {
ZONE=$1
case "$1" in
- 'T') sleep "$DELAY" && [ "$ZONE" == "T" ] && eww open status &>/dev/null ;;
- 'R') sleep "$DELAY" && [ "$ZONE" == "R" ] && eww open bar &>/dev/null ;;
+ 'T') sleep "$DELAY" && [ "$ZONE" == "T" ] && eww open status &>/dev/null ;;
+ 'R') sleep "$DELAY" && [ "$ZONE" == "R" ] && eww open bar &>/dev/null ;;
esac
}
function onExit {
ZONE=''
case "$1" in
- 'T') eww close status &>/dev/null ;;
- #'L') eww close panel &>/dev/null ;;
- 'R') eww close bar &>/dev/null ;;
- #'TR') cycleDesktops ;;
+ 'T') eww close status &>/dev/null ;;
+ #'L') eww close panel &>/dev/null ;;
+ 'R') eww close bar &>/dev/null ;;
+ #'TR') cycleDesktops ;;
esac
}
@@ -87,14 +87,8 @@ while :; do
elif [[ "$X" -gt "$W" ]]; then
onEnter BR
fi
- elif [[ "$Y" -lt "$SIZE" ]]; then
- if [[ "$X" -lt "$SIZE" ]]; then
- onEnter TL
- elif [[ "$X" -gt "$BX1" && "$X" -lt "$BX2" ]]; then
- onEnter T
- elif [[ "$X" -gt "$W" ]]; then
- onEnter TR
- fi
+ elif [[ "$Y" -lt "$SIZE" && "$X" -gt $((WIDTH / 3)) && "$X" -lt $((2 * WIDTH / 3)) ]]; then
+ onEnter T
elif [[ "$X" -lt "$SIZE" && "$Y" -gt "$LY1" && "$Y" -lt "$LY2" ]]; then
onEnter L
elif [[ "$X" -gt "$W" && "$Y" -gt "$RY1" && "$Y" -lt "$RY2" ]]; then
@@ -102,22 +96,22 @@ while :; do
fi
else
case "$ZONE" in
- 'B') [[ "$X" -lt "$BX1" || "$X" -gt "$BX2" || "$Y" -lt "$BY" ]] &&
- onExit B ;;
- 'L') [[ "$X" -ge "${L[0]}" || "$Y" -lt "$LY1" || "$Y" -gt "$LY2" ]] &&
- onExit L ;;
- 'R') [[ "$X" -le "$RX" || "$Y" -lt "$RY1" || "$Y" -gt "$RY2" ]] &&
- onExit R ;;
- 'T') [[ "$X" -lt "$BX1" || "$X" -gt "$BX2" || "$Y" -gt "${T[1]}" ]] &&
- onExit T ;;
- 'BL') [[ "$X" -ge "${BL[0]}" || "$Y" -lt "$BLY" ]] &&
- onExit BL ;;
- 'BR') [[ "$X" -le "$BRX" || "$Y" -lt "$BRY" ]] &&
- onExit BR ;;
- 'TL') [[ "$X" -ge "${TL[0]}" || "$Y" -ge "${TL[1]}" ]] &&
- onExit TL ;;
- 'TR') [[ "$X" -le "$TRX" || "$Y" -ge "${TR[1]}" ]] &&
- onExit TR ;;
+ 'B') [[ "$X" -lt "$BX1" || "$X" -gt "$BX2" || "$Y" -lt "$BY" ]] &&
+ onExit B ;;
+ 'L') [[ "$X" -ge "${L[0]}" || "$Y" -lt "$LY1" || "$Y" -gt "$LY2" ]] &&
+ onExit L ;;
+ 'R') [[ "$X" -le "$RX" || "$Y" -lt "$RY1" || "$Y" -gt "$RY2" ]] &&
+ onExit R ;;
+ 'T') [[ "$X" -lt "$BX1" || "$X" -gt "$BX2" || "$Y" -gt "${T[1]}" ]] &&
+ onExit T ;;
+ 'BL') [[ "$X" -ge "${BL[0]}" || "$Y" -lt "$BLY" ]] &&
+ onExit BL ;;
+ 'BR') [[ "$X" -le "$BRX" || "$Y" -lt "$BRY" ]] &&
+ onExit BR ;;
+ 'TL') [[ "$X" -ge "${TL[0]}" || "$Y" -ge "${TL[1]}" ]] &&
+ onExit TL ;;
+ 'TR') [[ "$X" -le "$TRX" || "$Y" -ge "${TR[1]}" ]] &&
+ onExit TR ;;
esac
fi
done