Difference between revisions of "OS X for Linux people"
m (→...from the Internet) |
(→Starting apps form the command line) |
||
Line 132: | Line 132: | ||
Here is [http://osxdaily.com/2007/02/01/how-to-launch-gui-applications-from-the-terminal/ more info] |
Here is [http://osxdaily.com/2007/02/01/how-to-launch-gui-applications-from-the-terminal/ more info] |
||
==Add recent servers, documents,... to the Dock== |
|||
I have a linksys e4200 wireless router with a USB drive attached to it. Unfortunately, my Mac forgets about the shared drive. I wanted to add a shortcut to it somewhere, and finally found a way: Add a stack with "Recent Items" to the dock. This is the magic: |
|||
* Start the Terminal, and enter the following: |
|||
defaults write com.apple.dock persistent-others -array-add '{ "tile-data" = { "list-type" = 1; }; "tile-type" = "recents-tile"; }' |
|||
* The Dock will disappear and appear again after this: |
|||
killall Dock |
|||
* Close the terminal. You should have a "Recent (something)" icon on the right of your Dock. You can change the properties with two-click (right-click) on it to show the recent Servers or what fits you. |
|||
More info here: [http://macs.about.com/od/usingyourmac/qt/dockrecentitem.htm here]. |
|||
=Useful applications= |
=Useful applications= |
Revision as of 18:35, 9 March 2012
Contents
|
So you just run into OS X Lion or some other animal. I just did, too. If feels like roaming through jungle while looking for gems. And finding them.
Some might call this
"10 or so things to do with MAC OS X/Macbook Air/Pro/Mini after you got it".
Let me share some simple things that took time. This is mostly about OS X 10.7+ Lion, which is the current version at the time.
Impressions and differences
...the good
- Safe-mag power connector is the best. just sticks to the place, from front and behind, shows the status with a LED, and pulls off without effort.
- I like how the keyboard responds. Soft and quiet.
- The backlight under the keys is nice, and should probably be used in most such input devices.
- Multi-touch is nice and easy to get used to. Especially the scrolling, and moving windows (enable the 3-finger move in system prefs)
- Most installations for new software is easy. Download and click on *.dmg file. Maybe drag the new software icon to Applications. Enjoy (or hate) the new spoils.
...the bad, and sometimes ugly
- Now, the backspace key is called delete and does backspace (like in the old days). But where is the delete key...? Oh, well, it turns out you can press Fn+delete for the delete functionality.
- I am too used to linux/win control and alt key functionality. This throws me off. For example, I just accidentally switched panes again when wanted to jump a word back (pressed Ctrl+Left instead of Option/alt+Left).
- Integrated AppStore is ok, but rather limited, understandably so, to approved software. Oh, well, one can find many alternative software choices on the Internet, as already precompiled .dmg files.
Simple things
Right click?
Easy. Click two fingers.
Tired of pressing that click on the Macbook?
Switch to "tap to click". System Preferences -> Trackpad -> Point & Click -> check Tap with one finger. It is quieter, too.
Keyboard shortcuts
Delete key confusion
The usual backspace key is named delete on Macbook, but it does backspace, which is fine. But where is the Delete key that does forward-delete? No such key.
But you can use Fn+delete to do forward delete. I guess the old typewriter keys dod not have a notion of deleting what has not been typed yet, and therefore did not include such key on the keyboard. Sometimes Apple is conservative...
A few other useful shortcuts
- Fn+up/down is page up/down
- Fn+left/right is home/end
- Alt+delete will delete a whole word. Command+delete will delete the whole line to the left
- Fn+alt+delete will delete the next word forward.
Keyboard remapping
Control+arrow switches desktop panes. But I want it to jump words. This is where a keyboard remapping software, such as KeyRemap4MacBook comes in. Download and install it, then choose what keys or combinations change to what. My favorite remappings, coming from the PC world:
- Control+Arrow to Option_L+Arrow, to get the control to skip words, not desks.
- Command_R to Option_R, or else I keep pressing command+a to get 'ā' for my Latvian text, but it selects everything instead, and kills the text with the next stroke.
- Option_R to Forward-Delete, to get my Del key back.
Terminal
Where to find
You could search most things by clicking on the search icon at top right corner. Then type "Terminal" and see the options below.
Or you can go and explore the Launcher. Slide two fingers right to get the left pane, and you see the system (preinstalled) apps. The right pane show the downloaded or purchased apps that are installed. Go to the left pane Utilities -> Terminal to get the terminal.
I still want to create a systemwide shortcut for new terminal... TODO
Terminal auto-close on shell exit
OK, I press Ctrl+D to exit the terminal and it nicely tells me:
...$ logout [Process Completed]
Thats not enough. I want the window to close when I am done. And this is what we need to do:
- Start the terminal
- Go menu -> Terminal -> Preferences -> Settings -> Shell -> "When the shell exits:" set to "Close if the shell exited cleanly"
- Close the Settings window
Now the Terminal window will close on Ctrl+D. It will also close when other programs invoke the shell and exit with no errors. If they have errors, the terminal will stay open so you can read about what went wrong.
There is no place like home
Well, there is. It (the directory) is called Users, not home. For example, JOHN will have his home at /Users/JOHN, instead of /home/JOHN. Be prepared to love $HOME in your shell scripts instead of the explicit pathnames with "home" in them.
Where's my apt-get install?
Not there. But there is MacPorts, that you may want to install to ease the path to other open source software. Goto http://macports.org and install their package by following their instructions.
Where is my .bashrc ?
You want it - create it. You might also want to create and add the following in your .bash_profile
if [ -f ~/.bashrc ]; then . ~/.bashrc fi
Wine, please
for my windows stuff, such as old Visual Basic programs. This will be easier with MacPorts.
Here is one how-to: http://www.davidbaumgold.com/tutorials/wine-mac/
What this tells you to do is:
- Set up Xcode from apple (free from AppStore)
- Install "Command line tools" from Xcode - registration required as an apple developer
- Download and set up MacPorts, so you could run "port install wine".
- Install wine using MacPorts from the terminal. Then have a rather long coffee or tee or just nap while everything downloads and compiles.
sudo port install wine
- I'd add that you will probably need and like to add winetricks. This will ease the installation of various dlls and components needed for your windows programs, such as mfc42.dll.
sudo port install winetricks
Starting apps form the command line
OK, I got the terminal. I even got nano. But I want, say, TextWrangler to edit my text file. How?
Use "open". For example, if you want to edit your .bashrc then do this:
open -a TextWrangler .bashrc
Haha! Now I can create alias(es) for my favorite apps to be invoked from CLI. You could, too. Here is more info
Add recent servers, documents,... to the Dock
I have a linksys e4200 wireless router with a USB drive attached to it. Unfortunately, my Mac forgets about the shared drive. I wanted to add a shortcut to it somewhere, and finally found a way: Add a stack with "Recent Items" to the dock. This is the magic:
- Start the Terminal, and enter the following:
defaults write com.apple.dock persistent-others -array-add '{ "tile-data" = { "list-type" = 1; }; "tile-type" = "recents-tile"; }'
- The Dock will disappear and appear again after this:
killall Dock
- Close the terminal. You should have a "Recent (something)" icon on the right of your Dock. You can change the properties with two-click (right-click) on it to show the recent Servers or what fits you.
More info here: here.
Useful applications
There is a list of some applications or packages that I set up on my Mac.
...from the AppStore
- Keynote - for presentations. Beats Powerpoint at $20.
- Xcode - useful and free from apple for development or installing some other packages.
- The Unarchiver - to get them archives unfold
...from the Internet
System and tools
- MacPorts - enables other good open source software
- Ukelele - a keyboard layout editor. But it cannot change the modifier keys, such as control, option, command.
- KeyRemap4MacBook - Keyboard remapper, for the modifier keys and arrows.