commit 4c6585aa96f535f797da50d3d809180da18d942b parent 43a44f62fbe2feea73a69c1404871bf0b0c455a1 Author: Chris Bracken <chris@bracken.jp> Date: Wed, 22 Apr 2020 02:55:09 -0700 Work around a dmenu crasher when XMODIFIERS is set When XMODIFIERS is set, but the specified input manager isn't running, dmenu segfaults due to a bug. A fix has landed upstream but hasn't rolled out to all package repos yet. See: https://bugs.archlinux.com/task/61673 Diffstat:
M | .config/sway/exit_check.sh | | | 6 | +++++- |
M | .i3/exit_check.sh | | | 8 | ++++++-- |
2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/.config/sway/exit_check.sh b/.config/sway/exit_check.sh @@ -2,8 +2,12 @@ # Use dmenu to check if the user wants to exit i3. +# Work around dmenu crasher when XOpenIM() returns NULL. +# See: https://bugs.archlinux.com/task/61673 +unset XMODIFIERS + while [ "$choice" != "no" ] && [ "$choice" != "yes" ]; do - choice=$(/bin/echo -e 'no\nyes' | dmenu -fn "DejaVu Sans Mono-16" -p "Really exit?") + choice=$(echo -e 'no\nyes' | dmenu -fn "DejaVu Sans Mono-16" -p "Really exit?") done if [ "$choice" = "yes" ]; then swaymsg exit diff --git a/.i3/exit_check.sh b/.i3/exit_check.sh @@ -2,9 +2,13 @@ # Use dmenu to check if the user wants to exit i3. -while [ "$choice" != "no" -a "$choice" != "yes" ]; do +# Work around dmenu crasher when XOpenIM() returns NULL. +# See: https://bugs.archlinux.com/task/61673 +unset XMODIFIERS + +while [ "$choice" != "no" ] && [ "$choice" != "yes" ]; do choice=$(echo -e 'no\nyes' | dmenu -p "Really exit?") done -if [ "$choice" == "yes" ]; then +if [ "$choice" = "yes" ]; then i3-msg exit fi