Saturday, June 4, 2011

Hide the resize grip in Ubuntu 11.04

In Ubuntu 11.04, they added a gray box/triangle to the lower right hand corner of GTK windows (to help people who were trying to resize by dragging it, I guess). For those of us that use Alt+Right Mouse Button to resize their windows, it's pretty obnoxious. Hide it by putting the following in your .gtkrc-2.0 file:

style "default-style"
{
GtkWindow::resize-grip-height = 0
GtkWindow::resize-grip-width = 0
}

class "GtkWidget" style "default-style"


See here for more info.

EDIT: It looks like the .gtkrc-2.0 file will be overwritten by Gnome every time you change your theme. However, it will always include the contents of .gtkrc.mine, if it exists. I recommend putting the above in there instead.

Saturday, April 9, 2011

Disable volume OSD in gnome (workaround)

By default, when you use the media keys to change the volume in Gnome, an On Screen Display (OSD) appears, telling you what the volume is. This is distracting when you're trying to watch full screen video (especially in flash), and can cause other problems with full screen apps.

There doesn't seem to be a good way to turn it off, but here's a way to work around it:

  1. In Gnome's "Keyboard Shortcuts" dialog, use "Add" to add 3 custom shortcut

    • Increase volume: amixer -c 0 sset Master,0 1+ unmute

    • Decrease volume: amixer -c 0 sset Master,0 1- unmute

    • Toggle mute: amixer -c 0 sset Master,0 toggle



  2. Assign these to the media keys

The keys should do the same thing they did before, without showing the OSD. (If you want to change volume more quickly, use 2+, 3-, 4+, etc instead of 1)

Friday, March 25, 2011

Disable flashing notification in Windows

Use regedit to set HKEY_CURRENT_USER\Control Panel\Desktop\ForegroundFlashCount to 1 (more info here)

There's also ForegroundLockTimeout, I'm not quite sure what that does.

Be sure to log out for the changes to take effect.

Tuesday, February 1, 2011

Center mouse after aero snap keyboard shortcut (auto hotkey)

True X-Mouse has a few problems. The most noticeable (for me) is that if the window the mouse is over moves (ie: you use the Aero Snap keyboard shortcuts, practically my favorite command in Windows 7), the window focus changes to the window below it. (This can really mess with your muscle memory!)

Turns out AutoHotKey can remedy the situation (I'm new to AutoHotKey, so there's probably a more elegant way to do this):

; Aero-Snap Mouse
; Move mouse to center of windows that are aero-snapped (True X-Mouse won't do this)
CenterMouseInWindow(Title)
{
WinActivate, %Title% ; True X-Mouse may have taken focus away when we moved
WinGetPos, X, Y, width, height, %Title%
center_x:=width/2
center_y:=height/2
MouseMove,center_x,center_y
return
}

#Left::
WinGetTitle, Title, A
SendInput #{Left}
CenterMouseInWindow(Title)
return

#+Left::
WinGetTitle, Title, A
SendInput #+{Left}
CenterMouseInWindow(Title)
return

#Right::
WinGetTitle, Title, A
SendInput #{Right}
CenterMouseInWindow(Title)
return

#+Right::
WinGetTitle, Title, A
SendInput #+{Right}
CenterMouseInWindow(Title)
return

#Up::
WinGetTitle, Title, A
SendInput #{Up}
CenterMouseInWindow(Title)
return

#Down::
WinGetTitle, Title, A
SendInput #{Down}
CenterMouseInWindow(Title)
return



This captures the aero snap shortcuts, gets the title for the current window, sends the aero snap shortcut to windows (which moves the window), then re-activates the old window and centers the mouse.

It's not instant (even with MoveMouse speed=0, I tried it), so you can't do Win+Shift+Left/Right rapid fire, but it works pretty well other than that.

Wednesday, January 26, 2011

Focus follows mouse for Windows

True X-Mouse does a good job of focus-follows-mouse in Windows. It's *really* nice for switching focus from remote desktop to local windows, since alt-tab is (intentionally) eaten by the remote machine

It also does some clip-board stuff to simulate X-Windows cut/copy/paste behavior, which I don't really care about (but so far hasn't gotten in my way).

Saturday, January 1, 2011

Wednesday, November 24, 2010

Easily sleep/restart/shutdown Windows via remote desktop

To easily shutdown/restart/sleep a windows machine via remote desktop, click on the desktop and press Alt+F4. This will bring up the standard Windows shutdown prompt (where you can choose shutdown, restart, sleep, etc). (I didn't know that!)

More info here.