平铺窗口小脚本

sh/bash/dash/ksh/zsh等Shell脚本
回复
mato
帖子: 16
注册时间: 2010-12-26 22:07

平铺窗口小脚本

#1

帖子 mato » 2010-12-26 22:29

刚从XP转过来几个月...怀念窗口平铺功能...
正在学习shell脚本,只是个不大完善小作品,欢迎指正~ :em06

功能:将最上层的的两个窗口平铺(感觉多于2个窗口时看起来太小,故没有考虑...)

代码: 全选

#!/bin/bash
#to place the top 2 windows in order

#move the top window to (0,0) and resize it into 640x740
xdotool key alt+F5  #turn the window into normal size
xdotool getactivewindow windowmove 0 0 windowsize 640 740
#switch to the 2nd window
xdotool key --clearmodifiers alt+Tab
#move and resize the 2nd window
xdotool key alt+F5 
xdotool getactivewindow windowmove 641 0 windowsize 640 740
PS:在任务栏上加个执行按钮,配合使用...
上次由 mato 在 2010-12-27 13:20,总共编辑 1 次。
mato
帖子: 16
注册时间: 2010-12-26 22:07

Re: 平铺窗口小脚本

#3

帖子 mato » 2010-12-27 13:14

photor 写了:能不能告诉我windows里怎么实现窗口平铺? :em06
在XP下,右击任务栏就可以看到了。win7没怎么用过,没有仔细探寻...
头像
eexpress
帖子: 58428
注册时间: 2005-08-14 21:55
来自: 长沙

Re: 平铺窗口小脚本

#4

帖子 eexpress » 2010-12-27 15:06

你这只是纯模拟。
都没涉及到真正的wm控制。
● 鸣学
mato
帖子: 16
注册时间: 2010-12-26 22:07

Re: 平铺窗口小脚本

#5

帖子 mato » 2010-12-27 22:54

eexpress 写了:你这只是纯模拟。
都没涉及到真正的wm控制。
哈哈,KISS~ :em06

谢谢你的意见,我会继续学习的~

ps:KISS原则,别误会了... :em03
mato
帖子: 16
注册时间: 2010-12-26 22:07

Re: 平铺窗口小脚本

#6

帖子 mato » 2010-12-29 12:25

刚才发现直接改用平铺式窗口管理器就可以很方便的实现了,如Ion, XMonad, Awesome...
为何
为何(为何)
为何(为何(为何))
头像
bobo4548
帖子: 661
注册时间: 2007-07-17 22:52
来自: cn,shandong

Re: 平铺窗口小脚本

#7

帖子 bobo4548 » 2011-01-17 15:39

楼主脚本好厉害,请问那其中有需要单独安装的程式吗?
mato
帖子: 16
注册时间: 2010-12-26 22:07

Re: 平铺窗口小脚本

#8

帖子 mato » 2011-05-04 17:38

bobo4548 写了:楼主脚本好厉害,请问那其中有需要单独安装的程式吗?
xdotool,一个十分好用的鼠标键盘模拟软件。
为何
为何(为何)
为何(为何(为何))
回复