Few years ago I moved from Linux desktop to MacOS for my business, day to day work. There were 2 main reasons for that:
- Corporations don’t like Linux - they can’t manage it, they can’t support it, so they blocked it with “Security policy”, ISO20001, or other nonsense.
- Actually they’re partially right but in different place - many business collaboration applications don’t work well on LInux (or they don’t work at all)
- Skype for Business - there’s open source alternative but to get full support you have to pay for additional codecs (as far as I remember) - it’s not working stable even in paid version
- Outlook and calendar support - I love Thunderbird and I use it for years, but calendar invitations didn’t work nice (honestly, they didn’t work nice even between different Outlook versions…)
- Corporate VPN apps - Christ, I always was able to get it working eventually, but… why bother
I’m older, maybe lazier, maybe smarter - I don’t like to spend my time resolving problems that don’t give me any value. That’s how I switched to MacOS - for business purposes only. Privately I still prefer Linux.
After the switch I’ve found some differences. Annoying stuff like different behavior of home/end buttons, etc. So right now, on every Mac that I’m working with, I’m making it to work more like Linux desktop. I’ve found those information useful to few my friends too. I decided to publish this because I received too many questions about what to do, how to start?
If you think I’m missing something important or I did something really bad way - please comment, I will updated it.
How to make screnshots (full screen/partial/desktop recording)?
How to change screenshot save localisation?
By default screenshots are saved on desktop which will turn into mess quickly. It’s possible to change default save localization for created screenshots: https://discussions.apple.com/docs/DOC-9081
Keyboard and keyboard shortcuts…
Polish keyboard layout is terrific, location of tilde and backslash buttons cause both Left Shift and Enter to be really far from normal hands position - in my case it’s causing pain in hands after few hours of use Another problem is location of Right Alt, it’s hidden deeply under hand during writing so it’s not convenient to write polish letters like ąśłóćź, etc. Maybe it will be possible to remap few keys to make this layout more usable but right now experience is terrific.
This is really big issue. Because on Mac Win/CMD key is used a lot switch to normal keyboard doesn’t help. Use of most common shortcuts really overload my thumbs.
Best solutions I’ve found is Karabiner-Elements. It allow to remap keys (ex. switch right alt/cmd) and you can define different options per device (internal/external keyboard). It’s also very useful to make standard PC keyboards to be mapped like Apple keyboard.
Special function keys do not work from external keyboard (it’s not Mac compatible )
I don’t know if it’s possible to configure them. With Karabiner-Elements it’s possible to add support for some of them.
Keyboard shortcuts are totally different than on Windows or Linux
Here you could find introduction to most typical shortcuts: https://www.apple.com/support/pages/shortcuts/body.html No other way - you have to learn them.
Few of my favorites, I use everyday:
- Cmd + Space - Spotlight search - think about it like ‘Win’ key in Gnome 3, you can start writing app or file name to start/open it
- Ctrl + Left/Right - switch Desktop on specific screen (full screen apps use “whole desktop” so it’s easy way to see what you have there or start new empty desktop)
- Ctrl + Up - shows all active windows, desktops, etc. Useful if you’re searching specific window
Problem with bash completion on linux boxes
-bash: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8)
-bash: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8)
I solved it by marking option in iTerm2 to always set language system variables.
Bash completion do not work well on Mac, there are no completions for hosts configured in ssh_config or /etc/hosts
I initially tried this one: http://davidalger.com/development/bash-completion-on-os-x-with-brew/ - it generally works but only for some common tools, ex, svn requires manual download of:
curl -L http://svn.apache.org/repos/asf/subversion/trunk/tools/client-side/bash_completion -o /usr/local/etc/bash_completion.d/svn
Right now I thing that Brew makes this even easier, because it’s installing a lot of bash_completion configs.
How to add bash completion for docker?
Those two commands will solve problem:
curl -L https://raw.githubusercontent.com/docker/compose/master/contrib/completion/bash/docker-compose -o /usr/local/etc/bash_completion.d/docker-compose
curl -L https://raw.githubusercontent.com/docker/docker-ce/blob/master/components/cli/contrib/completion/bash/docker -o /usr/local/etc/bash_completion.d/docker
SSH agent for key management does not work by default
There is a Keychain application installed on MacOS by default, it’s responsible for storing keys and managing access to them. To add ssh key to Keychain you have to run:
and provide password to unlock key.
Sadly this works only one time, I have to manually add key to keychain every time I login by:
How to automatically unlock private SSH keys on login (how to keep SSH private key password in OS X Keychain)?
It’s all nice described here: https://apple.stackexchange.com/a/250572
How to write to multiple terminal panes in iTerm2?
use cmd + shift + i to write to all panes on all tabs, or cmd + alt + i to write to all panes on current tab only
Blurry fonts on external monitors
Fonts on external monitors are really blurry - they’re badly anti-aliased or hinting is bad. I’ve found, that MacOS disable hinting on external monitors. It’s possible to enable it back. Check below and play with it to get what would work for you.
Jump word left/right (Ctrl+left/right) shortcut don’t work on console (iTerm2)
You have to configure special escape sequences for Alt+left/right, described here: http://apple.stackexchange.com/a/136931
Packages on MacOS are outdated and updates arrive later than on Linux
Yes, that’s sad true. When I have Ansible 2.3 on Jenkins server for MacOS only version 2.2 was available. Version 2.3 will arrive but some time later. This is causing problems in compatibility of code (newer features/options on Jenkins cause problems during deployment and I’m not able to test this all on my workstation before real release). Another problem connected to that is that some command line tool on Mac have different switches than on Linux, ex. date -rfc-3339=s is not available, causing scripts to broke on Mac when working on Linux, this also makes testing harder.
MacOS also use quite old version of bash. As a result .bashrc won’t be parsed, you have to put everything to .bash_profile which will slow down starting of each new terminal session (ex. python virtual envs can add significant delay).
End/Home keys behave differently on MacOS
Generally you won’t find Home/End keys on typical MacBook keyboad - by default on Mac you have Command + Right keyboard shortcut to mimic End, and Command + Left to mimic Home.
But… by default Home/End will move you to the end of page, not line. If you want this behavior back in most of your apps you could try to change keybinding:
One option is to create
~/Library/KeyBindings/ and save a property list like this as
"\UF729" = moveToBeginningOfLine:;
"\UF72B" = moveToEndOfLine:;
"$\UF729" = moveToBeginningOfLineAndModifySelection:;
"$\UF72B" = moveToEndOfLineAndModifySelection:;
Quit and reopen applications to apply the changes. Note that
DefaultKeyBinding.dict is not supported by some applications like Xcode or Firefox.
I can’t use X forwarding with MacOS ssh client and Linux on second end
There’s additional X11 server app that you can install on MacOS (it’s called XQuartz. I tried it for short time but I don’t need it anymore.
I have problems working with terminator on Mac
- it’s running as python process but it’s not available in Lunchpad (not easy to switch with Cmd + Tab
- keyboard shortcuts are different than on Linux, so this is not making switch easier
I’ve found iTerm2, which is “state of the art” terminal for MacOS. It’s popular, well supported and feature complete.
Useful key shortcuts:
- Cmd + T - new tab
- Cmd + D - spit vertically
- Cmd + Shift + D - split horizontally
- Cmd + Opt + Left/Right/Up/Down - move between shell windows (after split)
- Cmd + Left/Right - prev/next tab
- Ctrl + Cmd + Left/Right/Up/Down - change size of windows after split
How to access /opt folder and make it visible in Finder
I use Homebrew as a package manager on MacOS. It installs packages in
/opt/homebrew and if I want to configure for example my code editor to use
java or some
ansible-lint from this location it’s not trivial. MacOS hides “such system paths” in file selector window. There are two approaches we can do:
To force Finder to show us such directories, we can run:
defaults write com.apple.Finder AppleShowAllFiles YES
Now we have to reinitialize the Finder, either by rebooting or right-clicking the Finder on Dock, holding Option key, then selecting Relaunch.
If we want to turn it off again, we use:
defaults write com.apple.Finder AppleShowAllFiles NO
And as above, reluch Finder.
There’s also another way, that works nicely with file selection windows. Just press Command + Shift + G, which will open a dialog box in which you can input path, like: