emilef
6/6/2017 - 6:48 PM

[Mac Additional Configs] #mac #configure #run

[Mac Additional Configs] #mac #configure #run

# additional dev configs to set
defaults write -g ApplePressAndHoldEnabled -bool false
defaults write com.apple.finder ShowPathbar -bool true
defaults write com.apple.finder ShowStatusBar -bool true
defaults write NSGlobalDomain KeyRepeat -int 0.02
defaults write NSGlobalDomain InitialKeyRepeat -int 12
chflags nohidden ~/Library
#Action:{"name":"Open terminal at $HOME","appleScriptHandler":"open_terminal_at_home","requiresDirectory":1}
#Action:{"name":"Open terminal at $CWD","appleScriptHandler":"open_terminal_at_cwd","requiresDirectory":1}

on open_terminal_at_home(dir)
	set p to (dir as text)
	tell application "iterm"
		create window with default profile
		activate
	end tell
end open_terminal_at_home

on open_terminal_at_cwd(dir)
	set dir_path to quoted form of (dir)
	
	tell application "iterm"
		set newWindow to (create window with default profile)
		tell current session of newWindow
			write text "cd " & dir_path
			write text "clear;"
		end tell
		activate
	end tell
end open_terminal_at_cwd
# Scripted mac configs not available throught Preferences

#Enable Press and hold keys  
defaults write -g ApplePressAndHoldEnabled -bool false

#Show Path in the Finder  
defaults write com.apple.finder ShowPathbar -bool true

#Speed Up Key Press Repeat 
defaults write NSGlobalDomain KeyRepeat -int 0.02

#Speed Up Time Taken to Start Key Repeats 
defaults write NSGlobalDomain InitialKeyRepeat -int 12


# disable screenshot shadows
defaults write com.apple.screencapture disable-shadow -bool TRUE
defaults write com.apple.screencapture disable-shadow -bool FALSE

# reset finder
killall Finder
killall SystemUIServer

# Change Screenshot File Format
defaults write com.apple.screencapture type PDF

# Change Screenshot Location
defaults write com.apple.screencapture location /drag/location/here

# show/hide hidden folder
defaults write com.apple.finder AppleShowAllFiles -bool TRUE
      

#Show The Library Folder 
chflags nohidden ~/Library

# Setup Computer, Host and Localhost Name
sudo scutil --set ComputerName "$cpname"
sudo scutil --set HostName "$cpname"
sudo scutil --set LocalHostName "$cpname"
defaults write /Library/Preferences/SystemConfiguration/com.apple.smb.server NetBIOSName -string "$cpname"

# Get Host Computername
scutil --get ComputerName
scutil --get HostName
HostName # has both

#Set a blazingly fast keyboard repeat rate
defaults write NSGlobalDomain KeyRepeat -int 1

#Set a shorter Delay until key repeat
defaults write NSGlobalDomain InitialKeyRepeat -int 10

#Add a context menu item for showing the Web Inspector in web views
defaults write NSGlobalDomain WebKitDeveloperExtras -bool true

#Show the ~/Library folder
chflags nohidden ~/Library

#Store screenshots in subfolder on desktop
mkdir ~/Desktop/Screenshots
defaults write com.apple.screencapture location ~/Desktop/Screenshots

# Make the Icon of Any Hidden App in the Dock Translucent
defaults write com.apple.Dock showhidden -bool TRUE
kilall Dock

# Autocomplete Paths
#What we can do instead is use the Tab key to autocomplete 

# turn off dashboard
defaults write com.apple.dashboard mcx-disabled -boolean TRUE
killall Dock