Visar inlägg med etikett windows. Visa alla inlägg
Visar inlägg med etikett windows. Visa alla inlägg

2013-06-08

Productivity and workflow improvements in a Windows environment

Today I decided that I should focus on improving my workflow by teaching myself some windows keyboard short keys similar to Win+E, Win+D, Win+R.

On Microsoft's support site they have a pretty updated and complete version of what keyboard shortcuts that exists and what they do and it taught me a couple of cool tricks. The most amazing one is definitely WIN + arrow keys.

What these macros do is that they resize/realign the current active window in many different ways. Left and Right aligns the window to the screen(s) and makes it possible to get items that are outside of displays to be moved into view again (OH BOY, FINALLY!!!). This also makes it easier to align windows next to one other since the window when moved snaps to the edges of the display. The Up and Down buttons are used to maximize/restore/minimize the current active window. Here I have only found use for Maximize/Restore-functionality.

Two other cool thing that I didn't know about prior to today is that:

  • alt+ print screen screen captures only current active window to clipboard
  • win+[1-9] starts/activates the program in the respective "pinned to taskbar"-slot
What I really was searching for today though, is functionality to minimize the current active window. It turns out that this was pretty easy by pressing alt+space+n/m (depending on OS-language). Unfortunately this wasn't really what I wanted and hence the search continued. 

And it didn't take long before I ran into an amazing program called AutoHotkey which makes it possible to pretty much rebind any input in Windows to do whatever you want. And it can also generate other keypresses/mousepresses for you depending on what you tell it to do.

It took me a while to get into the syntax and flow of the program but after just an hour I got it to do a much better minimize functionality than what was offered by stock windows. 

My version of minimize stores last minimized window and any additional click during a certain timeframe on that shortkey will restore the last minimized window. Next thing to use AutoHotkey for, is to make it generate boilerplate code for me whenever pressed :) (Also, I made win+c start calculator by writing #c:: Run calc.exe).

Link to AutoHotkey and here's the code to minimize/restore a window:


#SingleInstance force

time_before_reset := 1000
title := "foobar"
press_counter := 0

#m::
if press_counter = 0
{
WinGetTitle, title, A
WinMinimize,%title%
;MsgBox Minimizing %title%
press_counter := 1
SetTimer, reset_state, %time_before_reset%
return
} else {
;MsgBox Maximizing %title%
WinRestore, %title%
Gosub, reset_state
return
}

reset_state:
SetTimer, reset_state, off
press_counter := 0
return

2012-06-20

grep in windows

Yesterday I grew tired of browsing through a log file in windows, you know having it open in Notepad++, then when it's updated, you reload it and go to the last line and search "upwards" to see the last entries.

After looking through some help files for command line I realized that it's possible to chain commands in windows, just as it is in UNIX-style operative systems.

following little neat items is hence something I use constantly
cd \tools\wamp32_bit\logs
type apache_error.log | findstr "time:"


Now, when I looked at the findstr help, it seemed as if I could use regular expressions in conjunction with it, and yes, you can, kinda.... The only issue is that it doesn't really allow many options that you would like to have. Say that I in the above search option would like to find any rows where the time is "bigger than 100ms(time:201.1010)". In a normal regex-world, I'd do something like findstr "time:[0-9]{3,}". This however, doesn't work in the regular expression matcher found in "findstr".

Well... I guess there are some advantages for using a non-windows OS after all :-\

*edit:
Also, if you want to have a larger command prompt window. There is the option of editing this in the command prompt window by "RMB on window border"\Properties\layout

and then change the screen buffer size (I use 235:500)