天天看点

Ubuntu 下对切屏幕的方法

Ubuntu 下对切屏幕的方法

<a target="_blank"></a>

<code>sudo apt-get install wmctrl</code>

<code>#!/bin/sh</code>

<code></code>

<code>set -- $(xwininfo -root| awk -f '[ :]+' '/ (width|height):/ { print $3 }')</code>

<code>width=$1</code>

<code>height=$2</code>

<code>win1=$(xwininfo| awk '/^xwininfo: w/ { print $4 }')</code>

<code>win2=$(xwininfo| awk '/^xwininfo: w/ { print $4 }')</code>

<code>wmctrl -i -r $win1 -e 0,0,0,$((width/2)),$height</code>

<code>wmctrl -i -r $win2 -e 0,$((width/2)),0,$((width/2)),$height</code>

执行脚本,点击选择 2 个窗口,就可以将 2 个窗口左右平铺整个屏幕。

根据这个脚本,其实你可以设计出更复杂的切分方案。

本文来自云栖社区合作伙伴“linux中国”,原文发布日期:2015-08-21

继续阅读