aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tom Willemse2022-06-05 22:52:01 -0700
committerGravatar Tom Willemse2022-06-05 22:52:01 -0700
commitdeda13603d44e0a0aaab5a5f94f103864c64f257 (patch)
tree60a494e0923a0c530353bdbefc80db99a8b6228e
parente2747a706d0653220e70246c925a60cd55b612d1 (diff)
downloadhlwm-run-or-raise-deda13603d44e0a0aaab5a5f94f103864c64f257.tar.gz
hlwm-run-or-raise-deda13603d44e0a0aaab5a5f94f103864c64f257.zip
Make sure there are enough windows before trying to pick the next
-rwxr-xr-xhlwm-run-or-raise3
1 files changed, 2 insertions, 1 deletions
diff --git a/hlwm-run-or-raise b/hlwm-run-or-raise
index 0657088..6fe23c8 100755
--- a/hlwm-run-or-raise
+++ b/hlwm-run-or-raise
@@ -39,7 +39,8 @@ exec scsh -s "$0" "$@"
(if (not (null? window-ids))
(let ((next-window
- (if (member current-window-id window-ids)
+ (if (and (> (length window-ids) 1)
+ (member current-window-id window-ids))
(cadr (pull-element-to-front current-window-id window-ids))
(car window-ids))))
(run (hlwm-switch-to-window ,next-window)))