移动窗口到其它space

680阅读 0评论2014-12-12 duoerlee
分类:其他UNIX

!/usr/bin/ruby

require 'totalspaces2'

current_space = TotalSpaces2.current_space

windows = TotalSpaces2.window_list

if current_space < 4

dest_space = current_space + 1

else

dest_space = 1

end

if !windows.empty?

current_space_windows = windows.select {

|window| window[:space_number] == current_space

}

if current_space_windows[0]

TotalSpaces2.move_window_to_space(

current_space_windows[0][:window_id], dest_space)

if current_space_windows[1]

TotalSpaces2.set_front_window(current_space_windows[1][:window_id])

end

end

end

上一篇:Hidden Settings of MPlayerX
下一篇:移动指定窗口到当前space