我已经配置了键盘快捷键,以便Alt +左侧将我带到工作空间左侧,Alt +右侧将我带到工作空间右侧,但我宁愿有一组键可循环。理想情况下,就像
workspace 1 + Alt + tab ---> worskspace 2
workspace 2 + Alt + tab ---> worskspace 3
workspace 3 + Alt + tab ---> worskspace 4
workspace 4 + Alt + tab ---> worskspace 1问题是最后一行。我看不出有什么方法可以从工作空间4回到工作空间1。如何移动到正确的模块4?
发布于 2016-03-05 14:51:21
使用一个小脚本,可以很好地浏览工作区(实际上是视图):

(如果到达最后一个视图端口,脚本将移动到第一个视图)

(如果到达第一个视图端口,脚本将移动到最后一个视图)
#!/usr/bin/env python3
import subprocess
import sys
move = sys.argv[1]
# get the needed info from wmctrl -d
wsdata = subprocess.check_output(["wmctrl", "-d"]).decode("utf-8").split()
# retrieve total size of workspace
ws = [int(n) for n in wsdata[3].split("x")]
# panel/launcher height/width
pans = [int(n) for n in wsdata[7].split(",")]
# work area
wa = [int(n) for n in wsdata[8].split("x")]
# x/y resolution
res_h = pans[0]+wa[0]; res_v = pans[1]+wa[1]
# current position in the spanning workspace
VP = [int(n) for n in wsdata[5].split(",")]
def last_h():
# test if we are on the last viewport horizontally
return VP[0]+res_h == ws[0]
def first_h():
# test if we are on the first viewport horizontally
return VP[0] == 0
def last_v():
# test if we are on the last viewport vertically
return VP[1]+res_v == ws[1]
def first_v():
# test if we are on the first viewport vertically
return VP[1] == 0
if move == "next":
if last_h() == False:
command = str(VP[0]+res_h)+","+str(VP[1])
elif last_v() == True:
command = "0,0"
else:
command = "0,"+str(VP[1]+res_v)
if move == "prev":
if first_h() == False:
command = str(VP[0]-res_h)+","+str(VP[1])
elif first_v() == True:
command = str(ws[0]-res_h)+","+str(ws[1]-res_v)
else:
command = str(ws[0]-res_h)+","+str(VP[1]-res_v)
subprocess.Popen(["wmctrl", "-o", command])through_viewports.py+并将这两个命令添加到您喜欢的快捷方式。就是这样,脚本检测如何设置视图并循环它们。
在“统一”中,视图被排列在一个大矩阵中,这些矩阵共同构成了统一桌面存在的单个工作区。
使用以下命令:
wmctrl -d在输出中,我们可以读取我们需要的所有信息,以找出我们目前在矩阵中的位置。
0 * DG: 5120x2400 VP: 0,0 WA: 65,24 1215x776 N/A5120x2400是所有视图的总大小(矩阵)。0,0是当前视图在矩阵中的x/y位置(左上角,像素)。WA: 65,24 1215x776中我们可以得到屏幕的分辨率(65,24是发射器/面板的宽度/高度,1215x776是剩余的区域)获得正确信息后,脚本将计算矩阵中的目标位置,并使用命令设置目标位置:
wmctrl -o x,y发布于 2016-09-24 19:48:40
在12.04,我用gconf编辑器编辑了一个键,解决了这个问题,但是在16.04中没有相同的键,所以下面是对我有用的方法:
sudo apt-get install compizconfig-settings-manager,然后安装GUI高级设置实用程序。
ccsm发射它。然后我去了桌面墙>查看端口切换>允许包裹和复选框。
https://askubuntu.com/questions/740823
复制相似问题