使用命令重新定位当前终端窗口

时间:2017-07-11 15:04:31

标签: bash

我尝试使用-geometry重新定位窗口但是这样创建了一个新窗口,这不是我想要的。一个适合我需要的命令是printf'\ e [3; 0; 0t'(移动屏幕左上角的窗口)不幸的是我需要窗口去屏幕的所有角落,但是我无法找到我需要的其他三个位置的ANSI转义码。有没有其他方法可以在没有外部工具的情况下移动当前窗口,如果没有,有人可以告诉我其他角落的ANSI转义码是什么?

1 个答案:

答案 0 :(得分:0)

您可以使用xdotool

将当前窗口移到左上角:

xdotool getactivewindow windowmove 0 0

要移到右上角(您可能需要更大的数字):

xdotool getactivewindow windowmove 2000 0

要移到右下角:

xdotool getactivewindow windowmove 2000 2000

向左下方移动:

xdotool getactivewindow windowmove 0 2000