I Thunar How to write python GUI widget (pygtk + glade)

The problem is this:
Everything originated in a compressed file of garbage ...
Windows code really do whatever they want, so Linux this unruly little fool surprise:

tried too many GUI-decompression software, peazip, Engrampa, xarchiver etc. etc., as well as 360 domestic compression, no one can solve the garbage problem.

When in fact it, many command-line tool that can be passed through the encoding parameters to solve this problem, but there are always people lazy, even though hard as I am no exception, and sometimes went to get a touch pad mouse ah ah ah point point the (mainly to see a compressed package also enter the command line in addition to equipment looks very realistic inefficient ah ...)
pulled too much nonsense, continue to pull for a while.
I found a particularly useful tool: lsar. lsar not pass any parameters can automatically determine the encoding:

In fact, it is a pair and unar (unar before Thunar self-defined menu's essays have said), they are The Unarchiver command line version.
The Unarchiver is designed for Mac GUI solution with a compression tool, but only for windows and Linux provides a command-line version.
(Have to say a lot of tools for the Mac platform user experience is very good here ... too many complaints omitted Linux ecosystem to pass the buck and not the product manager)

Well, the question comes:
how to write a plugin Thunar, you can call the right mouse button lsarto preview the contents of the compressed package?

答:
这种工作最适合python这种语言了,结合pygtk,调用lsar获取结果传入gtk显示就可以了。
使用glade还可以快速画个gtk界面,省去一堆python里创建和绑定的代码。
代码上传到github了。
Thunar里自然少不了加个自定义选项:

效果:

q或者ctrl+w可以退出预览。

界面不是很好看,没时间就这样吧
About窗口也只是有个框(好像并不需要about窗口)

Guess you like

Origin www.cnblogs.com/dylanchu/p/11126807.html