Tuesday, July 2, 2013

OSX Key: Keyboard Shortcut To Sleep, Log Out, & Shut Down

You might need to press and hold some shortcuts slightly longer than others. This helps you to avoid using them unintentionally.


Press to turn on your Mac or wake it from sleep. Press and hold for 1.5 seconds to put your Mac to sleep.* Continue holding to force your Mac to turn off.

power

Put your Mac to sleep.

optioncommandpower* or 
optioncommandeject 

Put your displays to sleep.

controlshiftpower* or 
controlshifteject 

Display a dialog asking whether you want to restart, sleep, or shut down.

controlpower* or 
controleject 

Force your Mac to restart, without prompting to save any open and unsaved documents.

controlcommandpower

Quit all apps, then restart your Mac. If any open documents have unsaved changes, you will be asked whether you want to save them.

controlcommandeject 

Quit all apps, then shut down your Mac. If any open documents have unsaved changes, you will be asked whether you want to save them.

controloptioncommandpower* or 
controloptioncommandeject 

Immediately lock your screen.

control-command-q

Log out of your macOS user account. You will be asked to confirm. To log out immediately without confirming, press Option-Shift-Command-Q.

shift-command-q
optionshift-command-q



* Does not apply to the Touch ID sensor.


OSX Cmd: Reschedule Time Machine Backups


If you want to change the interval of Time Machine backups simply enter the following command into your Terminal:

sudo defaults write/System/Library/LaunchDaemons/com.apple.backupd-auto StartInterval -int 1800

900  = 15 minutes
1800 = 30 minutes
3600 = 1 hour

Tuesday, April 9, 2013

OSX Cmd: Getting Rid of "Open With" duplicates


You right-click icon in the Finder, choose "Open With", and a submenu pops up with an absurd number of duplicate entries.

The duplicate entries in the "Open With" submenu are caused by some corruption of the Launch Services database. The lsregister command, which is buried many layers under the /System/Library folder, will rebuild the database if you invoke it with the right options.

Here’s a on how to fix it (and you can add to your .bashrc):

# Quick way to rebuild the Launch Services database and get rid
# of duplicates in the Open With submenu.
alias fixopenwith='/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user'

Now you can get rid of the duplicates from the Terminal by running:

fixopenwith

You may need to follow that up with a:

killall Finder



OSX Cmd: Customize Mission Control To Show Only Windows From Current Desktop Space

To get Mission Control to only show you open windows from the current Desktop Space, type or paste the following into your Terminal:

defaults write com.apple.dock wvous-show-windows-in-other-spaces -bool FALSE

Then, restart the Dock process, which also controls the Mission Control process:

killall Dock

Now you’ll only see windows from the currently active Desktop Space when you activate Mission Control.



NOTE: Return it back:

defaults write com.apple.dock wvous-show-windows-in-other-spaces -bool TRUE

killall Dock