4个稳定版本
1.0.3 | 2023年12月6日 |
---|---|
1.0.2 | 2022年10月23日 |
#337 in Unix API
11KB
71 行
autohide-tdrop
100%纯Rust实现,当终端或其他由tdrop管理的应用程序失去焦点时,可以自动隐藏
安装
cargo install autohide-tdrop
用法
X11
~/.config/sxhkd/sxhkdrc
ctrl + t
tdrop -n tdrop_kitty --post-create-hook "autohide-tdrop &" -ma -h 60% -w 70% -x 15% -y 0 kitty --class=tdrop_kitty
wayland
~/.config/swhkd/swhkdrc
ctrl + t
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
您可能需要在shell初始化钩子中恢复WAYLAND_DISPLAY环境变量。以下是用fish shell作为示例:
# 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"
set -x WAYLAND_DISPLAY $WAYLAND_DISPLAY_OLD
end
依赖项
~8.5MB
~186K SLoC