Use Autohotkey. The scripting language is non standard and can be difficult to learn, but if all you're wanting to do is reliably launch programs, its simple. Plus you can base shortcuts off the Windows key! Use following sample script and modify it to your needs. (Lines starting with ;
are comments.)
;win + alt + e ... unload ipod
#!E::
run d:\Downloads\Apps\deveject\eject ipod.bat
return
;win + w ... launch winamp
#w::
run c:\program files (x86)\winamp\winamp.exe
return
;win + a ... launch AS400
#a::
run C:\Program Files (x86)\IBM\Client Access\Emulator\Private\1.ws
return
;win + Shift a ... launch AS400 Printer
#+a::
run C:\Program Files (x86)\IBM\Client Access\Emulator\Private\3.ws
return
;win + ctrl + Shift a ... launch 2nd AS400
#^+a::
run C:\Program Files (x86)\IBM\Client Access\Emulator\Private\2.ws
return
Save this as a .ahk file on your desktop, install autohotkey and run it.
Every time you press any key combination, AutoHotkey will scan this script. If it matches any of the key combinations that preceed a ::
, it will execute the next command. If the return statement is missing, the AHK will continue to scan the script for matches after executing your statement. The key combinations are described below.
# = Windows Key
+ = Shift
^ = Control
! = Alt
You can use these in any combination with the letters of your keyboard. One combination I find extremely useful is as follows.
; ALT Backtick ... ctrl f4
!`::
Loop, parse, RcvCtrlW, `,
{
IfWinActive %A_LoopField%
{
sendinput ^w
Return
}
}
sendinput ^{f4}
return
; win Backtick ... alt f4
#`::
sendinput !{f4}
return
This is Alt + ` and Win + `. When this script is running and I press alt + `, the script sends ctrl + F4. Win + ` becomes alt + F4.
Autohotkey is basically its own programming language. I have scripts set up that simulate "Rocker Gestures" system wide. I have GMail like shortcuts for my email. If you spend the time to learn some of its tricks, you can get nuts with it. Lifehacker has a whole bunch of useful scripts for Autohotkey. Have Fun!
In Visual Studio 2010, the menu Tools > Options > Environment > Keyboard: Show Commands Containing:
type NextDocumentWindow
, lets you find and select the Window.NextDocumentWindow
in the list. It shows that the shortcut is Ctrl+F6
. This shortcut lets you cycle through currently open documents. Ctrl+Shift+F6
navigates in reverse order.
Edit: I tried also Ctrl+Alt+PgDown
and Ctrl+Alt+PgUp
shortcuts do about the same thing.
Hope that helps.
Best Answer
I often use
xdotool
withxprop
andxev
. They both give you a lot of window information.You could write a simple script that gets information about the window with
xprop
orxev
and implements the if-else block you've written. This is perhaps the most versatile solution, suitable not just for the task you're describing but for all things window management.Another great tool for tinkering with your window manager is
wmctrl
. It believe does what you want without scripting:wmctrl -r "My window name (or id)" -b toggle,hidden
The man page is pretty terse, I found this wmctrl user documentation more elucidating.
Mind that a lot depends on the window manager you use. These tools are EWMH comatible but it can differ a lot how windows are iconified, hidden, sticked, moved to other desktops etc.