torstai 19. joulukuuta 2013

Fix keyboard shortcuts in OS X dialogs

Go to System Preferences and change this setting

After doing this, you can use Tab to switch between options in dialogs:

Remember to press Space to select the option. Pressing Enter just selects the default option!

maanantai 22. lokakuuta 2012

Setting everything

I'll go through the steps I did to make my Macbook usable. All the applications that I use are(or were) free at the time of writing.


Window Management

Virtual desktops with the awesome Trackpad is a killer combination but some of the default actions are not so clever. First thing to do is to make sure that your workspace switching happens by swiping four fingers right or left. This can be set from System Preferences:
This leaves three finger swipes to app specific swipe shortcuts. More from them later.

App switcher(Cmd - Tab)

First I was annoyed by the Cmd - Tab behavior, but now I'm used to it. It is actually quite good, because there's usually only a few apps open compared to ~30 open windows. I binded Cmd - § to Move focus to next window. This can be done from System Preferences under Keyboard:
In my layout § key is the key above Tab. This is bearable but the window switching should work like the app switcher. There should be a "stack" of last used windows.
Now if I want to specific window, I first switch to the app and then find the correct window of the app.

Minimizing

When switching to a minimized app, workspace will be switched where the window should be, but the window stays minimized. Why? I would want it to be shown(unminimized?).

Use Cmd - Hto hide windows rather than minimize.

Maximizing

This button is a mystery. I thought it was the maximize button, but instead it's called 'zoom'. Apparently it tries to make the window bigger somehow. It doesn't work at all. The behavior isn't consistent between applications.

Download RightZoom.

Terminal

Download iTerm2, it is great.
Settings that I've changed:

Added ':' character to Characters considered part of word for selection.

Checked Unlimited scrollback. Changed Report Terminal Type to 'xterm-256color'.

I have Finnish keyboard layout so pressing Alt - 2 produces '@' character.
Therefore I changed only left Alt  to act as Meta.
It makes possible to switch channels in Irssi with left Alt


SSHFS

I explored a few options to edit remote files on my server via SSH:

After all I ended up using Macfusion. First you must install OSXFuse from https://github.com/osxfuse/osxfuse/downloads. Otherwise the Macfusion does not work. I have set the mountpoint to Desktop.

Create shortcuts

After installing a bunch of apps, I want some of them to be easily accessed. Assigning some keyboard and swipe shortcuts is the way to go. To customize them, download BetterTouchTool. It handles shortcuts for Trackpad, keyboard, Magic Mouse and normal mouse.

Open its Preferences.
Change these settings to move and resize windows easily. These shortcuts don't always work as expected, but they are good enough.


Swipe shortcuts

Adding new shortcuts:
First click Add new gesture, then modify it to your needs. To add app specific shortcuts, find out the application's keyboard shortcut for the action. For example Chrome closes tab with Cmd - W. Then bind a gesture to that keyboard shortcut.


I have the following swipe shortcuts(Finder does not have any):

This way I can close tabs and open links to new tabs in Chrome with three finger tap.


Click->Close tab, Left->Previous tab, Right->Next tab, Up->Open recently closed tab


These commands are to help using Irssi.
Down->Switch to a window which has had activity, Left->Previous window, Right->Next window, Up->Switch to last window. To make the last shortcut work, in Irssi:
/bind meta-l command window last


Exactly the same shortcuts than in Chrome.


Keyboard shortcuts

I have the following keyboard shortcuts:

iTerm new window shortcut

iTerm doesn't open a new terminal window when it is launched. To make it happen, you must create an applescript that does it. I followed these instructions: http://apple.stackexchange.com/questions/46224/how-to-make-clicking-on-icon-in-dock-open-new-instance. After that, move OpenNewiTerm.app to /Applications and bind a keyboard shortcut to launch it.

Other stuff

There have been many annoyments but I can't remember them all.

Disable startup sound

Download StartNinja. It is pretty straightforward to disable the startup sound with it.

SSH reconnect

A simple hack to make SSH reconnect when connection closes. I have set SSH keys to login automatically. Add an alias for loopssh to your ~/.bash_profile:

echo "alias loopssh='/path/to/loopssh.sh'" >> ~/.bash_profile
source ~/.bash_profile

sunnuntai 21. lokakuuta 2012

Why OS X?


This blog was created after asking these questions:
http://apple.stackexchange.com/questions/68848/switching-from-ubuntu-to-os-x-and-im-lost

I have Thinkpad X220 with Xubuntu installed in it. I've been using Ubuntu for about 5 years now. I have tried different desktop environments like Gnome, KDE and Xfce. I tested Debian and Linux Mint in laptop use, but they had their problems.
Ubuntu is great but I've faced countless problems with external monitors etc.
For example, I needed a feature rich window manager so I installed Compiz to Xubuntu. After a few days I found bugs that were distracting my work flow pretty bad (e.g. https://bugs.launchpad.net/ubuntu/+source/compiz/+bug/933776). 
(I wanted to try Xfce and thought that Xfce+Compiz is still lighter than Gnome+Compiz.)
I have encountered these bugs quite frequently. I code a lot and solving bugs in my own programs is enough. I want my environment to just work.
Something new had to be tried and Windows wasn't an option. I just don't like .bat, cmd.exe, C:\, and those windowsy things.
Laptop is the best choice for me because I travel a lot. So I bought 13" Macbook Air with 128GB SSD. It's light, mobile and has a decent resolution. I had also planned to test how to code an app for my iPad, so being in Apple-camp helps.
Now I'm trying to use the Macbook as my main working/coding laptop. Currently I have OS X Lion 10.7.4 installed. I don't know why I even expected anything else, but OS X needs heavy configuring to make it usable.