vpn eww and eww crash
This commit is contained in:
@@ -4,6 +4,11 @@
|
||||
# The popup hosts every panel behind revealers, so switching panels while it
|
||||
# is open is just a variable update (animated, no scripts restarted). It is
|
||||
# only closed and re-opened when it has to move to another monitor.
|
||||
#
|
||||
# `eww open popup` takes longer than the client's 100 ms reply deadline, so
|
||||
# its exit status and error output are meaningless and ignored (the daemon
|
||||
# carries the command out anyway; the lib's eww wrapper makes sure a slow
|
||||
# reply can never spawn a second daemon).
|
||||
panel=$1
|
||||
[[ -n $panel ]] || exit 64
|
||||
|
||||
@@ -12,7 +17,7 @@ panel=$1
|
||||
exec 9>"${XDG_RUNTIME_DIR:-/tmp}/eww-panel-toggle.lock"
|
||||
flock -n 9 || exit 0
|
||||
|
||||
ew() { timeout 5 eww "$@" 9>&-; }
|
||||
ew() { eww "$@" 9>&-; }
|
||||
|
||||
current=$(ew get active-panel 2>/dev/null | tr -d '"')
|
||||
popup_screen=$(ew get popup-screen 2>/dev/null | tr -d '"')
|
||||
@@ -21,15 +26,16 @@ if ew active-windows 2>/dev/null | grep -qx 'popup: popup'; then open=1; else op
|
||||
|
||||
if ((open)) && [[ $current == "$panel" ]]; then
|
||||
ew update active-panel=
|
||||
ew close popup
|
||||
ew close popup 2>/dev/null
|
||||
elif ((open)) && [[ -n $screen && $popup_screen == "$screen" ]]; then
|
||||
ew update active-panel="$panel"
|
||||
else
|
||||
((open)) && ew close popup
|
||||
((open)) && ew close popup 2>/dev/null
|
||||
ew update active-panel="$panel" popup-screen="$screen"
|
||||
if [[ -n $screen ]]; then
|
||||
ew open popup --screen "$screen"
|
||||
ew open popup --screen "$screen" >/dev/null 2>&1
|
||||
else
|
||||
ew open popup
|
||||
ew open popup >/dev/null 2>&1
|
||||
fi
|
||||
fi
|
||||
exit 0
|
||||
|
||||
Reference in New Issue
Block a user