From c37c19d64aaf21a49e14b90d40dc59e66487bae3 Mon Sep 17 00:00:00 2001 From: I-Want-ToBelieve Date: Tue, 24 Oct 2023 06:55:50 +0800 Subject: [PATCH] Update README.md --- README.md | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a201e7c..bea8d07 100644 --- a/README.md +++ b/README.md @@ -21,5 +21,23 @@ ctrl + t ~/.config/swhkd/swhkdrc ```zsh ctrl + t - WAYLAND_DISPLAY=no KITTY_DISABLE_WAYLAND=1 tdrop -n tdrop_terminal --post-create-hook "autohide-tdrop &" -mta -h 60% -w 70% -x 15% -y 0 kitty --class tdrop_terminal + WAYLAND_DISPLAY_OLD=$WAYLAND_DISPLAY WAYLAND_DISPLAY=no KITTY_DISABLE_WAYLAND=1 tdrop -n tdrop_terminal --post-create-hook "autohide-tdrop &" -mta -h 60% -w 70% -x 15% -y 0 kitty --class tdrop_terminal ``` +You may need to restore the WAYLAND_DISPLAY environment variable in your shell-initialized hook. +using fish shell as an example: +```fish +# Hello, this is Bing. The following is the command in the fish shell to determine the value of the environment variable CCC to the environment variable BBB when the environment variable AAA is 1 and the environment variable BBB exists and is not empty: +# if test "$AAA" = "1" -a -n "$BBB" +# set -x CCC $BBB +# end +# Among them, the test command is used to test whether the condition is true, -a means logical and, -n means non-null. If the condition is true, use the set command to set the value of the environment variable CCC to the value of the environment variable BBB. +# Hope this helps! + +if test "$KITTY_DISABLE_WAYLAND" = "1" -a -n "$WAYLAND_DISPLAY_OLD" + echo $KITTY_DISABLE_WAYLAND + echo $WAYLAND_DISPLAY_OLD + set -x WAYLAND_DISPLAY $WAYLAND_DISPLAY_OLD + echo $WAYLAND_DISPLAY +end +``` +