“Bins” for Windows 7 is *Bleeping* Awesome

I have a problem. I can’t fit all the icons I would like on my taskbar because I end up with 2 rows of icons when I’m undocked. There are ugly-workarounds like putting the taskbar into small (read ugly) icon mode or waste space with a double-high taskbar. I have to pick my most favoritest apps to pin on the taskbar and put the rest that I used slightly less frequently into the start menu ghetto. I like that icons don’t jump around on me on the Windows 7 taskbar but I always wished it had some smooth icon scaling like in OS X.

I just found something better, though. It’s called “Bins” and it allows you to group icons on the taskbar together just like folders in iOS or Lion’s “Launch Pad”.

taskbar-bins

It works exactly like you would want. You can choose one of the apps in a bin as the default icon. The default app is the one that gets launched if you just click the "bin" or middle-click the bin to launch a new instance. To launch any other app in the bin you roll over and click it. The rollover is super-fast and smooth. Aero peek still works. Jump-list gestures are gone but they do work by right-clicking on an icon in a bin.

bins-peek

As a bonus, Bins also lets me pin the recycle bin to the task bar just like in OS X, although I pinned it to the leftmost position. I can just drag stuff onto that taskbar icon to trash them and it never gets covered up. You can also pin Explorer shortcuts to the Explorer bin to get one-click access to your favorite folders.

taskbar-recycle-bin

I was easily able to fit everything on my taskbar that was previously exiled to the Start Menu ghetto.

This little app is awesome. It’s well worth the $5 asking price and, by the way, Microsoft should just acquire this company and incorporate the concept into Windows 8. Get it at oneupindustries.com.

via lifehacker

Update

After about 2 weeks with Bins, I uninstalled the product. While it does make the taskbar much more compact and is great for launching apps, it is not as good for task switching. What I found is that it requires quite a bit more manual dexterity to switch windows. I tend to have a lot of apps open simultaneously, so the task switching turned out to be a deal killer for me. Scott Hanselman has named Bins one of his 5 absolutely essential utilities, though.

Advertisements

A Better Telnet for Windows

console telnet in semi-transparent console2 powershell sessionThere’s no really nice way to say it: the telnet client in Windows is a little strange at best. I mostly use telnet to debug text-based TCP services. The Microsoft telnet implementation isn’t very good for this. I have used a PowerShell script to fill the gap by piping stdin and stdout to the console but sometimes I actually want telnet. I don’t want to go on a tirade about its problems here but telnet doesn’t work the way I want. What I really want is the telnet from GNU inetutils but compiled for Win32 with no extra runtime requirements. I don’t want to have to install Cygwin or MSys or SUA in order to get telnet.

I looked into this a little bit and it seems like inetutils has a lot of dependencies that make it hard to compile to run directly on Win32 without any POSIX layer. I also found an abandoned project on SourceForge called Console Telnet for Win32 which is under GPL, supports ANSI color codes and seems to have quite good VT100 emulation. The last code drop is from October 2000 and was originally written for old versions of Visual C++ or Borland C++, but it looked promising.

I spent a little time fixing up headers and a few functions here and there to get the code to compile with Visual Studio 2010. It works and it works pretty much like the GNU inetutils version of telnet except that it is annoyingly chatty about printing out info about its configuration on every connection so I put the chatty stuff behind an #IFDEF CHATTY and compiled without that CHATTY symbol defined which pretty much gave me what I wanted. It works by piping stdin/stdout to the TCP connection and doesn’t do any crazy erasing of your entire console scrollback buffer the way that Microsoft’s telnet does. It also doesn’t crash Console2.

I haven’t done extensive testing but everything seems to be working on my computer. I watched as much of Star Wars as I could stand at towel.blinkenlights.nl (“telnet towel.blinkenlights.nl”) and I’ve passed a bunch of HTML GET queries and responses through it.

Get the Code and Binary

Here’s the source code and compiled binary. You need to have telnet.exe, telnet.cfg and telnet.ini together in a directory for it to run correctly.

Copy and Paste with Clipboard from PowerShell

Many times I want to use PowerShell to manipulate some text that I have in something else like email or a text editor or some such or conversely, I do something at the command line and I want to paste the output into a document of some kind.

I’m not sure why there is no cmdlet for outputting to clipboard.

PS> get-command out-*

CommandType     Name             Definition                                         
-----------     ----             ----------                                         
Cmdlet          Out-Default      Out-Default [-InputObject <PSObject>] [-Verbose]...
Cmdlet          Out-File         Out-File [-FilePath] <String> [[-Encoding] <Stri...
Cmdlet          Out-GridView     Out-GridView [-InputObject <PSObject>] [-Title <...
Cmdlet          Out-Host         Out-Host [-Paging] [-InputObject <PSObject>] [-V...
Cmdlet          Out-Null         Out-Null [-InputObject <PSObject>] [-Verbose] [-...
Cmdlet          Out-Printer      Out-Printer [[-Name] <String>] [-InputObject <PS...
Cmdlet          Out-String       Out-String [-Stream] [-Width <Int32>] [-InputObj...

Fortunately, though Windows ships with a native clip.exe for piping text to clipboard. You can alias it to out-clipboard or just pipe to “clip”.

new-alias  Out-Clipboard $env:SystemRoot\system32\clip.exe

Now you can just pipe to Out-Clipboard or clip just like the other Out-* cmdlets.

The larger issue is that PowerShell doesn’t expose a way to paste text from the clipboard. However, the WinForms API of the .NET Framework has a GetText() static method on the System.Windows.Forms.Clipboard class. There is a catch, though:

The Clipboard class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your Main method is marked with the STAThreadAttribute attribute.

This is unfortunate because PowerShell runs in a multithreaded apartment by default which means that the workaround is to spin up a new PowerShell process which is slow.

function Get-ClipboardText()
{
	$command =
	{
	    add-type -an system.windows.forms
	    [System.Windows.Forms.Clipboard]::GetText()
	}
	powershell -sta -noprofile -command $command
}

A slightly less obvious approach is to paste the text from the clipboard into a non-visual instance of the System.Windows.Forms.Textbox control and then emit the text of the control to the console. This works fine in a standard PowerShell process and is substantially faster than spinning up a new process.

function Get-ClipboardText()
{
	Add-Type -AssemblyName System.Windows.Forms
	$tb = New-Object System.Windows.Forms.TextBox
	$tb.Multiline = $true
	$tb.Paste()
	$tb.Text
}

The TextBox method is about 500 times faster than the sub-process method. On my system, it takes 0.501 seconds to do spin up the sub-process and emit the text from the clipboard versus 0.001 seconds to use the TextBox control in the current process.

I also alias this function to “paste”. The commands I actually type and remember are “clip” and “paste”.

When using paste, I generally am setting a variable or inserting my pasted text into a pipeline within parens.

CAVEAT: Whenever you capture a value without any {CR}{LF}, the clipboard will add it. You may need to trim the newline to get the behavior you expect when pasting into a pipeline.

Here’s some one-liners to illustrate. I have dig from BIND in my path and I have Select-String aliased to grep. Notice how when I paste the IP address I captured to the clipboard from the one-liner gets pasted back with an extra blank line.

PS> ((dig google.com) | grep '^google\.com') -match '(\d+\.\d+\.\d+\.\d+)$' | out-null; $matches[0]
72.14.235.104
PS> ((dig google.com) | grep '^google\.com') -match '(\d+\.\d+\.\d+\.\d+)$' | out-null; $matches[0] | clip
PS> paste
72.14.235.104

PS> ping (paste)
Ping request could not find host 72.14.235.104
. Please check the name and try again.
PS> ping (paste).trim()

Pinging 72.14.235.104 with 32 bytes of data:
Reply from 72.14.235.104: bytes=32 time=192ms TTL=51
Reply from 72.14.235.104: bytes=32 time=208ms TTL=51
Reply from 72.14.235.104: bytes=32 time=212ms TTL=51
Reply from 72.14.235.104: bytes=32 time=210ms TTL=51

Ping statistics for 72.14.235.104:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 192ms, Maximum = 212ms, Average = 205ms

Prettify 7-Zip

icons7-zip is a great, free and open source archive utility for Windows. It comes in x86 and x64 flavors with GUI and command-line interface and supports a ton of archive formats.

  • Packing / unpacking: 7z, ZIP, GZIP, BZIP2 and TAR
  • Unpacking only: ARJ, CAB, CHM, CPIO, DEB, DMG, HFS, ISO, LZH, LZMA, MSI, NSIS, RAR, RPM, UDF, WIM, XAR and Z.

Unfortunately, the GUI is not the prettiest and the associated file icons are 32×32 and 16×16 8 and 4 –bit color. Extremely, way retro.

There is a nifty theme manager for 7-zip that scripts Resourcer to replace the icons embedded in the 7-zip executable with new icons of your choice.

There are a ton of filetype and toolbar icon sets in 7-zip Theme Manager but the most complete and consistent pairing is the "Tango 2" toolbar icons with the "Tango 1" filetype icons from the Tango project.

Here’s what the Tango-ized 7-Zip looks like.

tangoized-7zip

%d bloggers like this: