小编Igo*_*bia的帖子

使用wmcrtl在同一应用程序的Windows之间循环

我正在配置xbindkeys来使用快捷方式更改窗口焦点。例如,我设法创建了一个快捷方式来专注于一个应用程序窗口,比如说一个终结器窗口:

wmctrl -xa terminator
Run Code Online (Sandbox Code Playgroud)

不幸的是,它总是聚焦在相同的终结器窗口上,使我无法在终结器窗口中循环。

您能否建议我将命令集中在终结器窗口上,如果再次按下,将在所有终结器窗口中循环显示吗?

更新2013年3月30日

我修改了此脚本 http://lars.st0ne.at/blog/switch%20between%20windows%20within%20the%20same%20application, 以使脚本

script.sh NAME
Run Code Online (Sandbox Code Playgroud)

关注NAME应用程序,或者在NAME的所有窗口中循环浏览(如果某个窗口已经聚焦),但是无法正常工作。

这是脚本

win_class=$1 # 'terminator' # $1

# get list of all windows matching with the class above
win_list=$(wmctrl -x -l | grep -i $win_class | awk '{print $1}' )

# get id of the focused window
active_win_id=$(xprop -root | grep '^_NET_ACTIVE_W' | awk -F'# 0x' '{print $2}')

# get next window to focus on, removing id active
switch_to=$(echo $win_list | sed s/.*$active_win_id// | awk '{print $1}')

# …
Run Code Online (Sandbox Code Playgroud)

linux window-managers focus keyboard-shortcuts console-application

4
推荐指数
1
解决办法
1317
查看次数