
答案1
您可以使用xdotool
取得目前滑鼠位置 ( ) 的窗口getmouselocation
,然後使用命令windowminimize
或windowactivate
+ key
。
我製作了一個小腳本~/bin/xdowindow
(並使用 使其可執行chmod +x
):
#!/bin/sh
[ "$1" = "Maximize" ] && set -- Up
eval $(xdotool getmouselocation --shell)
case $1 in
Minimize)
xdotool windowminimize "$WINDOW"
;;
Left|Right|Up)
xdotool windowactivate "$WINDOW" key --clearmodifiers super+$1
;;
*)
exit 1
;;
esac
設定自訂鍵盤快速鍵:
然後在logiops
設定中使用它們:
{
direction: "Right";
mode: "OnRelease";
action = {
type: "Keypress";
keys: [ "KEY_LEFTALT", "KEY_M" ]; // snap window to right
}
},
筆記:
xdotool
不會與wayland
,也許ydotool
可以使用。一旦我wayland
自己使用,我就會進行測試,或者其他人可能會介入並翻譯該工具。