Published: 18. 5. 2016 Category: GNU/Linux
First time MacOSX user guide for longterm Linux user
In work, I've got a macbook instead of normal notebook (with Fedora
Desktop). I was NOT HAPPY with this, because I'm Linux user for almost
18 years now. But on the other hand, I was quite curious about this
unix-like operating system.
MacOSX ElCapitan most WTF moments
- Second screen on LCD via VGA port has really bad font rendering.
It is look like subpixel font rendering is not possible to enable
here. Later, I have changed cable to DVI and font display started to
be okay on the same monitor.
- It is not possible to customize everything. For example LShift+LAlt
for keyboard layout change is not possible anymore.
- There is no Insert key! And it is not simple to make the Insert
work as you were used to (at least at ViM and Midnight Commander is).
[Solution]
- When you have two screens working separately, switching to full
screen on one will blank the second. When you move then between
virtual desktops the full screen window is lost and it is difficult to
bring him back (it is available in Mission Control in list of desktops).
- MacOSX use keys Ctrl, Alt and Command. The Command is used a lot and if you
use a PC keyboard, it is mapped to "Windows" key. Some keyboards have "Windows"
key just on right side, they have "Fn" key between L_Ctrl and L_Alt, so pay
attention when choosing PC keyboard for Mac, because it is not possible to remap
it!. A lot of shortcuts burned into your muscle memory will not work for you
anymore and try to remap them on the different keys will make it even more
confusing. Some multiplatform software changes shortcut from Ctrl+Key to
Command+Key, but some not (mainly X11 application running under XQuartz).
- Default bash version in ElCapitan is: 3.2.57(1)-release
(x86_64-apple-darwin15). Probably because new version is released
under GPLv3. A lot of cool stuff is missing in version 3.x, for
example hash maps.
- Application settings are not binded with its window, but in the
main menu on the top of screen. It is still very confusing to me.
- Drivers for RAT7 mouse has issues. Mouse-hover feedback sometimes does not
work, hot corners sometimes does not work. With this mouse the Mission Control
behaves weirdly or does not work at all. The cursor moves just to the right when
in login screen. When I put back a generic USB mouse the problem disappeared.
Later, I have realized, that you need a shareware program USB Overdrive,
because the producer Madcatz claims that this mouse is "driver less" and allows
download only Windows drivers. If you have money to buy mouse for $70, you
should have also $28 for working third-party shareware driver, of course.
However, later observation has showed that this driver does not work good, needs
to be reinstalled quite often and each reinstall requires computer restart :(
- When user invokes "Lock screen" the network connections are
disabled. [Solution]
- I'm really missing the system wide X11 copy-paste style, i.e. when text is
selected it is immediately copied into clipboard and mouse middle-click is
paste. However, just inside terminal iTerm it works, but only between terminal
windows.
- Weird inconsistencies. Drag and drop from download list and drag and drop
from Finder is completely different operation (for example TunnelBlick will
accept configuration file provided by the second way).
- Microphone does not work in Chrome, it is quite common problem. If you open
System Preferences you will see that there is a signal coming to the input, so
everything looks okay, but you cannot do any conferences... Solution: Restart
coreaudiod: change to you admin account with su - admin, then
find its process ID: ps xau | grep coreaudiod, there will be something
like:
admin 51893 0.0 0.0 2434840 668 s002 S+ 3:16PM 0:00.00
grep coreaudiod
_coreaudiod 51877 0.0 0.0 2497036 2588 ?? Ss 3:08PM 0:00.05
/System/Library/Frameworks/CoreAudio.framework/Versions/A/XPCServices/com.apple.audio.DriverHelper.xpc/Contents/MacOS/com.apple.audio.DriverHelper
_coreaudiod 51876 0.0 0.1 2499904 8840 ?? Ss 3:08PM 0:10.22
/usr/sbin/coreaudiod
Kill that process: sudo kill -s QUIT 51876. You can test your
microphone online: www.onlinemictest.com.
Customization
Install package manager brew and important CLI utilities
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" < /dev/null 2> /dev/null
brew install elinks
brew install mc
brew install openvpn
brew install htop
brew install nmap
brew install bash bash-completion
brew install wget
Brew install pstree
Bash and terminal behaviour
- brew install bash
- Login as root: sudo - admin, then sudo - su
- Rename default bash: mv /bin/bash /bin/bash3
- Create symlink: ln -s /usr/local/bin/bash /bin/bash
Brew
creates link /usr/local/bin/bash to actual bash version in
/usr/local/Cellar/bash and you want also call your script with hashbang
#!/bin/bash and use latest version by default.
- Instead of .bashrc the .bash_profile is used, to make it work same put into
~/.bash_profile:
[[ -s ~/.bashrc ]] && source ~/.bashrc
- End / Home press skip to beggining or end of the line in shell:
- Terminal Preferences → Profile → Keyboard
- Add Home, Modifier None, Send text: \001 (Ctrl+a)
- Add End, Modifier None, Send text: \005 (Ctrl+e)
- Exit window when logout: Terminal Preferences → Profile → Shell → When the
shell exits: Close the Window
- X11 copy&paste style with select/middle click works only in terminal window.
- System wide copy&paste is done with Command+c/Command+v shortcut.
Remap keyboard (missing Insert key)
- Install Karabinier: https://pqrs.org/osx/karabiner/
- Karabinier: Ctrl+t used when pressed "Insert" (fn).
- Insert/Ctrl+t will work as file selection in Midnight Commander.
- Change terminal identification to 'rxvt' (it will help you detect special
options even when logged over SSH).
Insert mapped to Ctrl+t enabled in .vimrc
" Initial state
let MODE="Command"
function InsertState()
" prefix g: to acces global variable
if g:MODE == "Insert"
let g:MODE = "Replace"
startreplace
elseif g:MODE == "Replace"
let g:MODE = "Insert"
startinsert
endif
endfunction
" Entering Insert mode from Command
map <c-t> :let MODE="Insert" \| :startinsert<CR>
" Pressing Insert in insert-mode swithes between Insert/Replace
" <C-o> + :command does not move cursor left, like pressing <Esc>.
imap <c-t> <C-O>:call InsertState()<CR>
Note: Ctrl+t is still remapped when you SSH somewhere, so you need to
also enable it in your remote ~/.vimrc. If you also SSH there from Linux box
with a normal Insert key, the macro will change the behaviour, you can change
iTerm2 identification to different terminal and call this macro, i.e. when term
is rxvt:
if &term=="rxvt" || &term=="screen.rxvt"
...
endif
Use Command+L to lock screen with password protected screen-saver
Install Inkscape