<?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/"
><channel><title>Arunrocks &#187; launchy</title> <atom:link href="http://www.arunrocks.com/blog/archives/category/launchy/feed/" rel="self" type="application/rss+xml" /><link>http://www.arunrocks.com/blog</link> <description>Representing Anti-monotonistic Tendencies</description> <lastBuildDate>Tue, 27 Jul 2010 14:41:38 +0000</lastBuildDate> <generator>http://wordpress.org/?v=2.8.6</generator> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <item><title>Work Faster in Windows With Launchy and a few Python Scripts</title><link>http://www.arunrocks.com/blog/archives/2007/12/04/work-faster-in-windows-with-launchy-and-a-few-python-scripts/</link> <comments>http://www.arunrocks.com/blog/archives/2007/12/04/work-faster-in-windows-with-launchy-and-a-few-python-scripts/#comments</comments> <pubDate>Tue, 04 Dec 2007 05:39:23 +0000</pubDate> <dc:creator>Arun Bhai</dc:creator> <category><![CDATA[General]]></category> <category><![CDATA[Python]]></category> <category><![CDATA[launchy]]></category> <category><![CDATA[productivity]]></category><guid
isPermaLink="false">http://www.arunrocks.com/blog/archives/2007/12/04/work-faster-in-windows-with-launchy-and-a-few-python-scripts/</guid> <description><![CDATA[Launchy is a great productivity tool and a cool way to impress your friends. You can launch any application by pressing a hotkey (say Alt+Space) and the first few letters of the application for eg: typing &#8216;gi&#8217; will display the GIMP icon and pressing Enter will launch GIMP. You can download Launchy from its website [...]]]></description> <content:encoded><![CDATA[<p><img
src="http://farm1.static.flickr.com/133/414218839_e89ef7791d_m_d.jpg" width="240" height="160" alt="Eating the Mouse" class="alignright" /></p><p><a
href="http://www.launchy.net/">Launchy</a> is a great productivity tool and a cool way to impress your friends. You can launch any application by pressing a hotkey (say Alt+Space) and the first few letters of the application for eg: typing &#8216;gi&#8217; will display the GIMP icon and pressing Enter will launch GIMP. You can <a
href="http://downloads.sourceforge.net/launchy/LaunchySetup125.exe?modtime=1177060449&amp;big_mirror=0">download Launchy</a> from its website and its <a
href="http://www.launchy.net/LaunchySetup199_1.exe">beta</a> is pretty stable (and gorgeous) on my XP laptop too.</p><p>Using Launchy gets pretty addictive and soon you will hate using the Start menu or even Explorer on Windows for opening applications or files. So I took the red pill and started automating the following things with a little help from Python:</p><ul><li>Launching Intranet applications inside Internet Explorer (even if Firefox is your default browser)</li><li>Bringing minimized or overlapped windows to the foreground</li></ul><h3>Some Necessary Evil</h3><p>Don&#8217;t get me wrong, I hate IE as much as you do. But the fact of life is that many web apps out there &#8220;Work best when viewed in IE&#8221; (TM). Even if you have launchy plugins to launch the web app, if your default browser is Firefox, it might show incorrectly. Here is the solution:</p><ol><li>Install <a
href="http://www.python.org/download/releases/">Python</a> and <a
href="http://sourceforge.net/project/platformdownload.php?group_id=78018">Pywin32</a></li><li>Copy the following script to the Utilities directory (it will be in the path where you installed Launchy) and save it with a <strong>.pyw</strong> extension not a <strong>.py</strong> extension</li></ol><p>Python:</p><pre><code>from win32com.client import Dispatch
ie = Dispatch("InternetExplorer.Application")
ie.Visible = True
ie.Navigate(r"http://intranetapp/home")
</code></pre><p>In the above code replace the URL <strong>http://intranetapp/home</strong> with the URL of your choice.</p><p>Finally, open Launchy, right-click and say &#8216;Rebuild Index&#8217;.</p><h3>No more Alt-Tabbing around</h3><p>If you are like me, you&#8217;ll have a lot of windows open at the same time. I have tried increasing the task bar height and grouping similar windows feature in XP to manage them. But I always wish I could invoke commonly used open applications like my chat window in just a few keystrokes. Launchy doesn&#8217;t index open programs by default, but with some python magic I can show you how to bring some commonly used windows to the foreground:</p><ol><li>As before, install <a
href="http://www.python.org/download/releases/">Python</a> and <a
href="http://sourceforge.net/project/platformdownload.php?group_id=78018">Pywin32</a></li><li>Copy the following script to the Utilities directory (it will be in the path where you installed Launchy) and save it with a <strong>.pyw</strong> extension not a <strong>.py</strong> extension</li></ol><p>Python:</p><pre><code>import sys
from win32gui import GetWindowText, EnumWindows, ShowWindow, SetForegroundWindow
from win32con import SW_RESTORE, SW_SHOW

TITLE_MATCH = "Microsoft Excel - Expenses.xls"

def listWindowsHandles():
    res = []
    def callback(hwnd, arg):
        res.append(hwnd)
    EnumWindows(callback, 0)
    return res

def listWindowsNamesAndHnd():
    return [(hwnd, GetWindowText(hwnd)) for hwnd in listWindowsHandles()]

def unminimizeWindow(a_hwnd):
    ShowWindow(a_hwnd, SW_RESTORE)
    SetForegroundWindow(a_hwnd)

def finder1():
    for hwnd, title in listWindowsNamesAndHnd():
        if TITLE_MATCH in title:
            unminimizeWindow(hwnd)

finder1()
</code></pre><p>In the above code change the string <strong>Microsoft Excel &#8211; Expenses.xls</strong> with the title the window you would like to summon.</p><p>Finally, open Launchy, right-click and say &#8216;Rebuild Index&#8217;.</p><p>This works even if the window was minimized.</p><p>I hope, finally you can throw your mouse away. Ah&#8230; What a bliss!</p> ]]></content:encoded> <wfw:commentRss>http://www.arunrocks.com/blog/archives/2007/12/04/work-faster-in-windows-with-launchy-and-a-few-python-scripts/feed/</wfw:commentRss> <slash:comments>14</slash:comments> </item> </channel> </rss><!--
This site's performance optimized by W3 Total Cache. Dramatically improve the speed and reliability of your blog!

Learn more about our WordPress Plugins: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (user agent is rejected)
Database Caching 6/12 queries in 0.006 seconds using disk

Served from: mshawking.asmallorange.com @ 2010-07-31 11:27:39 -->