<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Imdiot`s Blog</title>
	<atom:link href="http://imdiot.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://imdiot.wordpress.com</link>
	<description></description>
	<lastBuildDate>Sat, 10 Sep 2011 06:35:21 +0000</lastBuildDate>
	<language>zh-cn</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='imdiot.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Imdiot`s Blog</title>
		<link>http://imdiot.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://imdiot.wordpress.com/osd.xml" title="Imdiot`s Blog" />
	<atom:link rel='hub' href='http://imdiot.wordpress.com/?pushpress=hub'/>
		<item>
		<title>查看memcache所有key的小程序</title>
		<link>http://imdiot.wordpress.com/2011/09/10/%e6%9f%a5%e7%9c%8bmemcache%e6%89%80%e6%9c%89key%e7%9a%84%e5%b0%8f%e7%a8%8b%e5%ba%8f/</link>
		<comments>http://imdiot.wordpress.com/2011/09/10/%e6%9f%a5%e7%9c%8bmemcache%e6%89%80%e6%9c%89key%e7%9a%84%e5%b0%8f%e7%a8%8b%e5%ba%8f/#comments</comments>
		<pubDate>Sat, 10 Sep 2011 06:35:20 +0000</pubDate>
		<dc:creator>imdiot</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[memcache]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://imdiot.wordpress.com/?p=54</guid>
		<description><![CDATA[本地开发过程中经常要查看内容写没写到memcache中，一般看一下memcache中有没有想对应的key就好了，懒得用telnet连接memcache，自带的memcached-tool输出又不怎么方便阅读，so 写了一个简单的查看memcache中key的python小程序<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=imdiot.wordpress.com&amp;blog=21812031&amp;post=54&amp;subd=imdiot&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>本地开发过程中经常要查看内容写没写到memcache中，一般看一下memcache中有没有想对应的key就好了，懒得用telnet连接memcache，自带的memcached-tool输出又不怎么方便阅读，so 写了一个简单的查看memcache中key的python小程序</p>
<pre class="brush: python;">
# /usr/bin/env python
# -*- coding: utf-8 -*
import socket
import re

class MemcacheServer(object):
    def __init__(self):
        self.server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

    def connect(self, host=None, port=None):
        self.host = host
        self.port = port
        try:
            self.server.connect((host, port))
        except:
            print &quot;connect error ......&quot;

    def send(self, msg):
        self.server.send(msg)

    def get_msg(self):
        buf_len = 1024
        msg = u&quot;&quot;
        while True:
            buf = self.server.recv(buf_len)
            msg += buf
            if len(buf)!=buf_len:
                break
        return msg

if __name__ == &quot;__main__&quot;:
    ms = MemcacheServer()
    ms.connect(&quot;127.0.0.1&quot;, 11211)

    items = {}
    totalitems = 0
    ms.send(&quot;stats items\r\n&quot;)
    for line in ms.get_msg().splitlines():
        match = re.search(u&quot;^STAT items:(\d*):number (\d*)&quot;, line)
        if match:
            i, j = match.groups()
            items[int(i)] = int(j)
            totalitems += int(j)

    for buckets in sorted(items.keys()):
        ms.send(&quot;stats cachedump %d %d\r\n&quot; % (buckets, items[buckets]))
        for line in ms.get_msg().splitlines():
            match = re.search(u&quot;^ITEM (\S+) \[.* (\d+) s\]&quot;, line)
            if match:
                print match.groups()[0]
</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/imdiot.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/imdiot.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/imdiot.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/imdiot.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/imdiot.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/imdiot.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/imdiot.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/imdiot.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/imdiot.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/imdiot.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/imdiot.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/imdiot.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/imdiot.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/imdiot.wordpress.com/54/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=imdiot.wordpress.com&amp;blog=21812031&amp;post=54&amp;subd=imdiot&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://imdiot.wordpress.com/2011/09/10/%e6%9f%a5%e7%9c%8bmemcache%e6%89%80%e6%9c%89key%e7%9a%84%e5%b0%8f%e7%a8%8b%e5%ba%8f/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/372c6c324d57d74a200513eaecc7a9c1?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">akismet-372c6c324d57d74a200513eaecc7a9c1</media:title>
		</media:content>
	</item>
		<item>
		<title>更新了下Rhythmbox文件夹视图插件</title>
		<link>http://imdiot.wordpress.com/2011/05/31/%e6%9b%b4%e6%96%b0%e4%ba%86%e4%b8%8brhythmbox%e6%96%87%e4%bb%b6%e5%a4%b9%e8%a7%86%e5%9b%be%e6%8f%92%e4%bb%b6/</link>
		<comments>http://imdiot.wordpress.com/2011/05/31/%e6%9b%b4%e6%96%b0%e4%ba%86%e4%b8%8brhythmbox%e6%96%87%e4%bb%b6%e5%a4%b9%e8%a7%86%e5%9b%be%e6%8f%92%e4%bb%b6/#comments</comments>
		<pubDate>Tue, 31 May 2011 09:34:54 +0000</pubDate>
		<dc:creator>imdiot</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[rhythmbox]]></category>

		<guid isPermaLink="false">http://imdiot.wordpress.com/?p=46</guid>
		<description><![CDATA[本来想这个东西没什么用 烂尾了算了 谁知道有人发邮件提起这个东东 说喜欢用 可现在用不了了 那国外友人用的是F15 我装上Rhythmbox一看 这玩意蹦的也太快了吧 我好像才不用它也就几个月的时间吧 版本号直接从0.12蹦到了2.90 女大十八变啊……API都长大了……依稀还能辨认出模样 也用上GTK3了 细节地方各种不同啊…… 配置也改成dconf了 改了小两天 终于勉强能用了 欢迎大家各种使用各种围观~~~~ &#160; PS:项目地址也从google code搬到了github上,https://github.com/imdiot/rhythmbox_folder_view<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=imdiot.wordpress.com&amp;blog=21812031&amp;post=46&amp;subd=imdiot&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>本来想这个东西没什么用 烂尾了算了</p>
<p>谁知道有人发邮件提起这个东东 说喜欢用 可现在用不了了</p>
<p>那国外友人用的是F15</p>
<p>我装上Rhythmbox一看 这玩意蹦的也太快了吧</p>
<p>我好像才不用它也就几个月的时间吧 版本号直接从0.12蹦到了2.90</p>
<p>女大十八变啊……API都长大了……依稀还能辨认出模样</p>
<p>也用上GTK3了 细节地方各种不同啊……</p>
<p>配置也改成dconf了</p>
<p>改了小两天 终于勉强能用了</p>
<p>欢迎大家各种使用各种围观~~~~</p>
<p>&nbsp;</p>
<p><a href="http://imdiot.files.wordpress.com/2011/05/screenshot-rhythmbox.png"><img title="Screenshot-Rhythmbox" src="http://imdiot.files.wordpress.com/2011/05/screenshot-rhythmbox.png?w=600&#038;h=362" alt="" width="600" height="362" /></a></p>
<p>PS:项目地址也从google code搬到了github上,<a href="https://github.com/imdiot/rhythmbox_folder_view">https://github.com/imdiot/rhythmbox_folder_view</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/imdiot.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/imdiot.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/imdiot.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/imdiot.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/imdiot.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/imdiot.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/imdiot.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/imdiot.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/imdiot.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/imdiot.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/imdiot.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/imdiot.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/imdiot.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/imdiot.wordpress.com/46/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=imdiot.wordpress.com&amp;blog=21812031&amp;post=46&amp;subd=imdiot&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://imdiot.wordpress.com/2011/05/31/%e6%9b%b4%e6%96%b0%e4%ba%86%e4%b8%8brhythmbox%e6%96%87%e4%bb%b6%e5%a4%b9%e8%a7%86%e5%9b%be%e6%8f%92%e4%bb%b6/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/372c6c324d57d74a200513eaecc7a9c1?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">akismet-372c6c324d57d74a200513eaecc7a9c1</media:title>
		</media:content>

		<media:content url="http://imdiot.files.wordpress.com/2011/05/screenshot-rhythmbox.png" medium="image">
			<media:title type="html">Screenshot-Rhythmbox</media:title>
		</media:content>
	</item>
		<item>
		<title>来~让我们把gnome-shell中ibus的tray挪挪地儿~~~</title>
		<link>http://imdiot.wordpress.com/2011/04/23/%e6%9d%a5%e8%ae%a9%e6%88%91%e4%bb%ac%e6%8a%8agnome-shell%e4%b8%adibus%e7%9a%84tray%e6%8c%aa%e6%8c%aa%e5%9c%b0%e5%84%bf/</link>
		<comments>http://imdiot.wordpress.com/2011/04/23/%e6%9d%a5%e8%ae%a9%e6%88%91%e4%bb%ac%e6%8a%8agnome-shell%e4%b8%adibus%e7%9a%84tray%e6%8c%aa%e6%8c%aa%e5%9c%b0%e5%84%bf/#comments</comments>
		<pubDate>Sat, 23 Apr 2011 12:30:13 +0000</pubDate>
		<dc:creator>imdiot</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[gnome-shell]]></category>
		<category><![CDATA[ibus]]></category>

		<guid isPermaLink="false">http://imdiot.wordpress.com/?p=35</guid>
		<description><![CDATA[在很久很久以前 那时的gnome-shell的系统托盘还在右上角 不知从何时起 他们分成了status-icon和message-icon status-icon有了CSS的外衣住在了右上角 message-icon则搬到了右下角 但是因为底部的通知区域设计成了有消息才会有反应 例如dbus的一些通知什么的 因此产生了一些不爽的感觉 比如我想看一些程序tray的变化 我只能把鼠标挪到右下角才能看到 毕竟现在适合gnome-shell的这种通知模式的程序还很少 下面就以ibus为例 让ibus的tray挪挪窝： 打开statusIconDispatcher.js文件 我用的是arch+testing安装的gnome-shell，statusIconDispatcher.js文件在/usr/share/gnome-shell/js/ui目录下 如果是自己编译的gnome-shell那就应该在~/gnome-shell/install/share/gnome-shell/js/ui目录下 看到statusIconDispatcher.js中的STANDARD_TRAY_ICON_IMPLEMENTATIONS变量了吗 没错 这就是右上方status-icon的白名单~ 这个字典的key呢 则是程序tray的wm_class 大家看出来了吧 其实gnome-shell是想把ibus的tray放在右上方的status-icon区域的 可他们毕竟不是中国人 不用ibus………… 这个ibus-ui-gtk好像还是很久很久以前要装ibus-gtk、ibus-qt时候的东西呢吧？？？？ 现在ibus tray的wm_class没有设 是默认的main.py…… 所以我们只要吧ibus-ui-gtk改成main.py就大功告成啦~~~ 其实这根本就不是什么问题嘛 只要ibus的人和gnome-shell的人稍微沟通一些 下个版本大家一起做一两行的就该就OK了嘛 白名单加上statusIconDispatcher.js中的_onTrayIconAdded、_onTrayIconRemoved就可以随你挪啦~想挪谁挪谁 像以前那样放在一起都没问题~ PS: ibus extensions<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=imdiot.wordpress.com&amp;blog=21812031&amp;post=35&amp;subd=imdiot&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>在很久很久以前 那时的gnome-shell的系统托盘还在右上角</p>
<p>不知从何时起 他们分成了status-icon和message-icon</p>
<p>status-icon有了CSS的外衣住在了右上角 message-icon则搬到了右下角</p>
<p>但是因为底部的通知区域设计成了有消息才会有反应 例如dbus的一些通知什么的</p>
<p>因此产生了一些不爽的感觉</p>
<p>比如我想看一些程序tray的变化 我只能把鼠标挪到右下角才能看到</p>
<p>毕竟现在适合gnome-shell的这种通知模式的程序还很少</p>
<p>下面就以ibus为例 让ibus的tray挪挪窝：</p>
<p style="text-align:center;"><a href="http://imdiot.files.wordpress.com/2011/04/screenshot.png"><img class="size-full wp-image-36 aligncenter" title="Screenshot" src="http://imdiot.files.wordpress.com/2011/04/screenshot.png?w=600&#038;h=375" alt="" width="600" height="375" /></a></p>
<p>打开statusIconDispatcher.js文件</p>
<p>我用的是arch+testing安装的gnome-shell，statusIconDispatcher.js文件在/usr/share/gnome-shell/js/ui目录下</p>
<p>如果是自己编译的gnome-shell那就应该在~/gnome-shell/install/share/gnome-shell/js/ui目录下</p>
<p>看到statusIconDispatcher.js中的STANDARD_TRAY_ICON_IMPLEMENTATIONS变量了吗 没错 这就是右上方status-icon的白名单~</p>
<p>这个字典的key呢 则是程序tray的wm_class</p>
<p>大家看出来了吧 其实gnome-shell是想把ibus的tray放在右上方的status-icon区域的</p>
<p>可他们毕竟不是中国人 不用ibus………… 这个ibus-ui-gtk好像还是很久很久以前要装ibus-gtk、ibus-qt时候的东西呢吧？？？？</p>
<p>现在ibus tray的wm_class没有设 是默认的main.py……</p>
<p>所以我们只要吧ibus-ui-gtk改成main.py就大功告成啦~~~</p>
<p><a href="http://imdiot.files.wordpress.com/2011/04/screenshot-1.png"><img class="aligncenter size-full wp-image-37" title="Screenshot-1" src="http://imdiot.files.wordpress.com/2011/04/screenshot-1.png?w=600&#038;h=375" alt="" width="600" height="375" /></a></p>
<p>其实这根本就不是什么问题嘛 只要ibus的人和gnome-shell的人稍微沟通一些 下个版本大家一起做一两行的就该就OK了嘛</p>
<p>白名单加上statusIconDispatcher.js中的_onTrayIconAdded、_onTrayIconRemoved就可以随你挪啦~想挪谁挪谁 像以前那样放在一起都没问题~</p>
<p><a href="http://imdiot.files.wordpress.com/2011/04/screenshot-2.png"><img class="aligncenter size-full wp-image-38" title="Screenshot-2" src="http://imdiot.files.wordpress.com/2011/04/screenshot-2.png?w=600&#038;h=375" alt="" width="600" height="375" /></a></p>
<p>PS:</p>
<p>ibus extensions</p>
<pre class="brush: jscript;">
StatusIconDispatcher = imports.ui.statusIconDispatcher;

function main() {
    StatusIconDispatcher.STANDARD_TRAY_ICON_IMPLEMENTATIONS['main.py'] = 'ibus';
}
</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/imdiot.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/imdiot.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/imdiot.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/imdiot.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/imdiot.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/imdiot.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/imdiot.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/imdiot.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/imdiot.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/imdiot.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/imdiot.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/imdiot.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/imdiot.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/imdiot.wordpress.com/35/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=imdiot.wordpress.com&amp;blog=21812031&amp;post=35&amp;subd=imdiot&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://imdiot.wordpress.com/2011/04/23/%e6%9d%a5%e8%ae%a9%e6%88%91%e4%bb%ac%e6%8a%8agnome-shell%e4%b8%adibus%e7%9a%84tray%e6%8c%aa%e6%8c%aa%e5%9c%b0%e5%84%bf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/372c6c324d57d74a200513eaecc7a9c1?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">akismet-372c6c324d57d74a200513eaecc7a9c1</media:title>
		</media:content>

		<media:content url="http://imdiot.files.wordpress.com/2011/04/screenshot.png" medium="image">
			<media:title type="html">Screenshot</media:title>
		</media:content>

		<media:content url="http://imdiot.files.wordpress.com/2011/04/screenshot-1.png" medium="image">
			<media:title type="html">Screenshot-1</media:title>
		</media:content>

		<media:content url="http://imdiot.files.wordpress.com/2011/04/screenshot-2.png" medium="image">
			<media:title type="html">Screenshot-2</media:title>
		</media:content>
	</item>
		<item>
		<title>gnome-shell alt+tab 扩展</title>
		<link>http://imdiot.wordpress.com/2011/04/13/gnome-shell-alttab-%e6%89%a9%e5%b1%95/</link>
		<comments>http://imdiot.wordpress.com/2011/04/13/gnome-shell-alttab-%e6%89%a9%e5%b1%95/#comments</comments>
		<pubDate>Wed, 13 Apr 2011 14:36:19 +0000</pubDate>
		<dc:creator>imdiot</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[gnome-shell]]></category>
		<category><![CDATA[扩展]]></category>

		<guid isPermaLink="false">http://imdiot.wordpress.com/?p=27</guid>
		<description><![CDATA[详情见《小hack一下gnome-shell的alt+tab》and《GNOME Shell的“Alt＋Tab”革新》 听从TualatriX建议写成了个扩展 这可是我第一个gnome-shell扩展哦 刚开始看js 也刚耍上gnome-shell 用的也是最笨的方法……………… 使用方法： 在~/.local/share/gnome-shell/extensions/建立alt_tab_key_press@imdiot.wordpress.com文件夹 在alt_tab_key_press@imdiot.wordpress.com文件夹中建立两文件 extension.js: metadata.json:<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=imdiot.wordpress.com&amp;blog=21812031&amp;post=27&amp;subd=imdiot&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>详情见《<a rel="bookmark" href="http://imdiot.wordpress.com/2011/04/10/%e5%b0%8fhack%e4%b8%80%e4%b8%8bgnome-shell%e7%9a%84alttab/">小hack一下gnome-shell的alt+tab</a>》and《<a title="Permanent Link to GNOME Shell的“Alt＋Tab”革新" rel="bookmark" href="http://imtx.me/archives/1500.html">GNOME Shell的“Alt＋Tab”革新</a>》</p>
<p>听从<a href="http://imtx.me/">TualatriX</a>建议写成了个扩展</p>
<p>这可是我第一个gnome-shell扩展哦</p>
<p>刚开始看js 也刚耍上gnome-shell</p>
<p>用的也是最笨的方法………………</p>
<p>使用方法：</p>
<p>在~/.local/share/gnome-shell/extensions/建立alt_tab_key_press@imdiot.wordpress.com文件夹</p>
<p>在alt_tab_key_press@imdiot.wordpress.com文件夹中建立两文件</p>
<p><strong>extension.js:</strong></p>
<pre class="brush: jscript;">
const St = imports.gi.St;
const Mainloop = imports.mainloop;
const Shell = imports.gi.Shell;
const Clutter = imports.gi.Clutter;
const Meta = imports.gi.Meta;
const Lang = imports.lang;

const Main = imports.ui.main;
const AltTab = imports.ui.altTab;

function startAppSwitcher (shellwm, binding, window, backwards) {
    if (shellwm._workspaceSwitcherPopup != null)
        shellwm._workspaceSwitcherPopup.actor.hide();

    let tabPopup = new AltTab.AltTabPopup();
    tabPopup._keyPressEvent = function(actor, event) {
        let keysym = event.get_key_symbol();
        let event_state = Shell.get_event_state(event);
        let backwards = event_state &amp; Clutter.ModifierType.SHIFT_MASK;
        let action = global.screen.get_display().get_keybinding_action(event.get_key_code(), event_state);

        this._disableHover();

        if (action == Meta.KeyBindingAction.SWITCH_GROUP)
            this._select(this._currentApp, backwards ? this._previousWindow() : this._nextWindow());
        else if (keysym == Clutter.Escape)
            this.destroy();
        else if (this._thumbnailsFocused) {
            if (action == Meta.KeyBindingAction.SWITCH_WINDOWS)
                if (backwards) {
                    if (this._currentWindow == 0 || this._currentWindow == -1)
                        this._select(this._previousApp());
                    else
                        this._select(this._currentApp, this._previousWindow());
                } else {
                    if (this._currentWindow == this._appIcons[this._currentApp].cachedWindows.length - 1)
                        this._select(this._nextApp());
                    else
                        this._select(this._currentApp, this._nextWindow());
                }
            else if (keysym == Clutter.Left || keysym == Clutter.a)
                this._select(this._currentApp, this._previousWindow());
            else if (keysym == Clutter.Right || keysym == Clutter.d || keysym == 96)
                this._select(this._currentApp, this._nextWindow());
            else if (keysym == Clutter.Up || keysym == Clutter.w)
                this._select(this._currentApp, null, true);
        } else {
            if (action == Meta.KeyBindingAction.SWITCH_WINDOWS)
                this._select(backwards ? this._previousApp() : this._nextApp());
            else if (keysym == Clutter.Left || keysym == Clutter.a)
                this._select(this._previousApp());
            else if (keysym == Clutter.Right || keysym == Clutter.d)
                this._select(this._nextApp());
            else if (keysym == Clutter.Down || keysym == Clutter.s || keysym == 96)
                this._select(this._currentApp, 0);
        }

        return true;
    }

    if (!tabPopup.show(backwards, binding == 'switch_group'))
        tabPopup.destroy();
}

function main() {
    Main.wm.setKeybindingHandler('switch_windows', Lang.bind(Main.wm, startAppSwitcher));
}
</pre>
<p><strong>metadata.json:</strong></p>
<pre class="brush: jscript;">
{
    &quot;shell-version&quot;: [&quot;3.0.0.2&quot;],
    &quot;uuid&quot;: &quot;alt_tab_key_press@imdiot.wordpress.com&quot;,
    &quot;name&quot;: &quot;alt_tab_key_press&quot;,
    &quot;description&quot;: &quot;change alt+tab key press -&gt; begin alt+tab you can alt+w,s,a,d,` control&quot;,
    &quot;url&quot;: &quot;imdiot.wordpress.com&quot;
}
</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/imdiot.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/imdiot.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/imdiot.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/imdiot.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/imdiot.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/imdiot.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/imdiot.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/imdiot.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/imdiot.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/imdiot.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/imdiot.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/imdiot.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/imdiot.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/imdiot.wordpress.com/27/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=imdiot.wordpress.com&amp;blog=21812031&amp;post=27&amp;subd=imdiot&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://imdiot.wordpress.com/2011/04/13/gnome-shell-alttab-%e6%89%a9%e5%b1%95/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/372c6c324d57d74a200513eaecc7a9c1?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">akismet-372c6c324d57d74a200513eaecc7a9c1</media:title>
		</media:content>
	</item>
		<item>
		<title>小hack一下gnome-shell的alt+tab</title>
		<link>http://imdiot.wordpress.com/2011/04/10/%e5%b0%8fhack%e4%b8%80%e4%b8%8bgnome-shell%e7%9a%84alttab/</link>
		<comments>http://imdiot.wordpress.com/2011/04/10/%e5%b0%8fhack%e4%b8%80%e4%b8%8bgnome-shell%e7%9a%84alttab/#comments</comments>
		<pubDate>Sun, 10 Apr 2011 15:49:35 +0000</pubDate>
		<dc:creator>imdiot</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[gnome-shell]]></category>

		<guid isPermaLink="false">http://imdiot.wordpress.com/?p=11</guid>
		<description><![CDATA[TualatriX在《GNOME Shell的“Alt＋Tab”革新》中介绍了gnome-shell的alt+tab 那时我还没用过gnome-shell 虽说之后偶尔耍耍gnome-shell 但也是浅尝即止 这几天有时间好好玩了玩gnome-sehll 看过TualatriX的那篇文章后 发现自己的alt+tab的快捷键与那时的已经不一样了 可能是代码做了调整了 已经没有alt+`了 alt+a、w、s、d也变成了alt+上、下、左、右 感觉还没有`、a、w、s、d方便 所以就hack了一下alt+tab 具体的使用方式可以看TualatriX的文章<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=imdiot.wordpress.com&amp;blog=21812031&amp;post=11&amp;subd=imdiot&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://imtx.me/">TualatriX</a>在《<a title="Permanent Link to GNOME Shell的“Alt＋Tab”革新" rel="bookmark" href="http://imtx.me/archives/1500.html">GNOME Shell的“Alt＋Tab”革新</a>》中介绍了gnome-shell的alt+tab 那时我还没用过gnome-shell 虽说之后偶尔耍耍gnome-shell 但也是浅尝即止 这几天有时间好好玩了玩gnome-sehll</p>
<p>看过TualatriX的那篇文章后 发现自己的alt+tab的快捷键与那时的已经不一样了 可能是代码做了调整了 已经没有alt+`了 alt+a、w、s、d也变成了alt+上、下、左、右 感觉还没有`、a、w、s、d方便</p>
<p>所以就hack了一下alt+tab 具体的使用方式可以看TualatriX的文章</p>
<pre class="brush: jscript;">
[yangguang] [~/gnome-shell/install/share/gnome-shell/js/ui]
&gt; diff altTab.js ../../../../../source/gnome-shell/js/ui/altTab.js
253c253
&lt;             else if (keysym == Clutter.Left || keysym == Clutter.a)
---
&gt;             else if (keysym == Clutter.Left)
255c255
&lt;             else if (keysym == Clutter.Right || keysym == Clutter.d || keysym == 96)
---
&gt;             else if (keysym == Clutter.Right)
257c257
&lt;             else if (keysym == Clutter.Up || keysym == Clutter.w)
---
&gt;             else if (keysym == Clutter.Up)2
62c262
&lt;             else if (keysym == Clutter.Left || keysym == Clutter.a)
---
&gt;             else if (keysym == Clutter.Left)
264c264
&lt;             else if (keysym == Clutter.Right || keysym == Clutter.d)
---
&gt;             else if (keysym == Clutter.Right)
266c266
&lt;             else if (keysym == Clutter.Down || keysym == Clutter.s || keysym == 96)
---
&gt;             else if (keysym == Clutter.Down)
</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/imdiot.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/imdiot.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/imdiot.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/imdiot.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/imdiot.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/imdiot.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/imdiot.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/imdiot.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/imdiot.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/imdiot.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/imdiot.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/imdiot.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/imdiot.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/imdiot.wordpress.com/11/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=imdiot.wordpress.com&amp;blog=21812031&amp;post=11&amp;subd=imdiot&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://imdiot.wordpress.com/2011/04/10/%e5%b0%8fhack%e4%b8%80%e4%b8%8bgnome-shell%e7%9a%84alttab/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/372c6c324d57d74a200513eaecc7a9c1?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">akismet-372c6c324d57d74a200513eaecc7a9c1</media:title>
		</media:content>
	</item>
		<item>
		<title>整理垃圾小记</title>
		<link>http://imdiot.wordpress.com/2011/04/05/%e6%95%b4%e7%90%86%e5%9e%83%e5%9c%be%e5%b0%8f%e8%ae%b0/</link>
		<comments>http://imdiot.wordpress.com/2011/04/05/%e6%95%b4%e7%90%86%e5%9e%83%e5%9c%be%e5%b0%8f%e8%ae%b0/#comments</comments>
		<pubDate>Tue, 05 Apr 2011 15:10:51 +0000</pubDate>
		<dc:creator>imdiot</dc:creator>
				<category><![CDATA[生活]]></category>

		<guid isPermaLink="false">http://imdiot.wordpress.com/?p=6</guid>
		<description><![CDATA[家里把车库租出去了 买了一大堆没用的东西 还有一大堆搬上来的书本 说让我挑挑 看看还有没有什么有用的 因为曾经有次爸爸不小心把我的科幻世界奇幻版的创刊号卖掉了…… &#160; 搬个小椅子挑捡了半天 还真找出点不想卖的： 两个小本：破破烂烂的 翻开后才发现是奶奶以前的教书笔记 要知道奶奶今年已经85了 这可是老古董了 几本字帖：现在天天在键盘上敲来敲去的 字都快不会写了 感觉好像还没小学写字好了呢 留着吧 等什么时候闲下来练练字吧 关于莉莉周的一切：N年前 还相当崇拜文艺小青年时 花了N顿的饭前买的 结果翻了两页 发现自己不是当文艺青年的料 现在当成枕边书也不错 文史资料：爷爷去世前是离休干部 总有人送些书 什么密云史料啊 古北口传说故事啊 估计也算是绝版了吧 毕竟好像都没有出版过…… 韩寒：2006年韩寒出的专辑里面配的书 CD已经找不到了 我实在是很没手尾啊…… 张小娴散文：好像不是我的啊？？？看看看看 陶冶一下情操 康熙辞典：七几年的版本 纸若蚕丝 至今丝毫未损 质量可见一般 留着压箱底 我们的1980年代：……继续枕边书吧…… &#160;<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=imdiot.wordpress.com&amp;blog=21812031&amp;post=6&amp;subd=imdiot&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>家里把车库租出去了 买了一大堆没用的东西 还有一大堆搬上来的书本 说让我挑挑 看看还有没有什么有用的 因为曾经有次爸爸不小心把我的科幻世界奇幻版的创刊号卖掉了……</p>
<p>&nbsp;</p>
<p>搬个小椅子挑捡了半天 还真找出点不想卖的：</p>
<p>两个小本：破破烂烂的 翻开后才发现是奶奶以前的教书笔记 要知道奶奶今年已经85了 这可是老古董了</p>
<p>几本字帖：现在天天在键盘上敲来敲去的 字都快不会写了 感觉好像还没小学写字好了呢 留着吧 等什么时候闲下来练练字吧</p>
<p>关于莉莉周的一切：N年前 还相当崇拜文艺小青年时 花了N顿的饭前买的 结果翻了两页 发现自己不是当文艺青年的料 现在当成枕边书也不错</p>
<p>文史资料：爷爷去世前是离休干部 总有人送些书 什么密云史料啊 古北口传说故事啊 估计也算是绝版了吧 毕竟好像都没有出版过……</p>
<p>韩寒：2006年韩寒出的专辑里面配的书 CD已经找不到了 我实在是很没手尾啊……</p>
<p>张小娴散文：好像不是我的啊？？？看看看看 陶冶一下情操</p>
<p>康熙辞典：七几年的版本 纸若蚕丝 至今丝毫未损 质量可见一般 留着压箱底</p>
<p>我们的1980年代：……继续枕边书吧……</p>
<p>&nbsp;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/imdiot.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/imdiot.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/imdiot.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/imdiot.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/imdiot.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/imdiot.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/imdiot.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/imdiot.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/imdiot.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/imdiot.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/imdiot.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/imdiot.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/imdiot.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/imdiot.wordpress.com/6/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=imdiot.wordpress.com&amp;blog=21812031&amp;post=6&amp;subd=imdiot&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://imdiot.wordpress.com/2011/04/05/%e6%95%b4%e7%90%86%e5%9e%83%e5%9c%be%e5%b0%8f%e8%ae%b0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/372c6c324d57d74a200513eaecc7a9c1?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">akismet-372c6c324d57d74a200513eaecc7a9c1</media:title>
		</media:content>
	</item>
		<item>
		<title>Hello world!</title>
		<link>http://imdiot.wordpress.com/2011/04/03/hello-world/</link>
		<comments>http://imdiot.wordpress.com/2011/04/03/hello-world/#comments</comments>
		<pubDate>Sun, 03 Apr 2011 14:04:20 +0000</pubDate>
		<dc:creator>imdiot</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://imdiot.wordpress.com/?p=1</guid>
		<description><![CDATA[从这里来到这里<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=imdiot.wordpress.com&amp;blog=21812031&amp;post=1&amp;subd=imdiot&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h1>从<strong><a href="http://imdiot.appspot.com">这里</a></strong>来到这里</h1>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/imdiot.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/imdiot.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/imdiot.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/imdiot.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/imdiot.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/imdiot.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/imdiot.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/imdiot.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/imdiot.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/imdiot.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/imdiot.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/imdiot.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/imdiot.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/imdiot.wordpress.com/1/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=imdiot.wordpress.com&amp;blog=21812031&amp;post=1&amp;subd=imdiot&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://imdiot.wordpress.com/2011/04/03/hello-world/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/372c6c324d57d74a200513eaecc7a9c1?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">akismet-372c6c324d57d74a200513eaecc7a9c1</media:title>
		</media:content>
	</item>
	</channel>
</rss>
