Tag Archives: mac os x

Swap Alt and Windows keys with xmodmap?

The problem: I have a Mac keyboard where the Alt/Win (i.e. Option/Command) keys are inverted compared to a regular PC keyboard, and I'd like to swap them.

The answer:

[codesyntax lang="bash"]

# clear all options
setxkbmap -model "pc105" -layout "us,se" -option ""  

# set the Apple keyboard
setxkbmap -rules "evdev" -model "pc105" -layout "us,se" -option "terminate:ctrl_alt_bksp,lv3:rwin_switch,grp:shifts_toggle,altwin:swap_lalt_lwin"

[/codesyntax]

 

And another one which I call when I'm back on a normal keyboard:

[codesyntax lang="bash"]

# clear settings
setxkbmap -model "pc105" -layout "us,se" -option ""

# pc keyobard
setxkbmap -rules "evdev" -model "pc105" -layout "us,se" -option "terminate:ctrl_alt_bksp,lv3:rwin_switch,grp:shifts_toggle"

[/codesyntax]

Useful shortcuts

Power
[codesyntax lang="bash"]

Lock screen: ctrl + shift + eject
Sleep: command + control + eject

[/codesyntax]

Screen
[codesyntax lang="bash"]

Screen capture (whole screen): command + shift + 3
Screen capture (selection): command +  shift + 4
Screen capture to clipboard (whole screen): command + control + shift + 3
Screen capture to clipboard (selection): command +  control+ shift + 4

[/codesyntax]

Finder
[codesyntax lang="bash"]

 Get info: command + control + i

[/codesyntax]