Launches the application.
Select whether Finder shows hidden files and directories.
Select whether Safari detects encoding automatically.
Clear Kotoeri learnings.
| #!/bin/bash | |
| function app { | |
| open "/Applications/${1}.app" | |
| } | |
| function clear_kotoeri_dict { | |
| read -p "Do you want to clear Kotoeri learnings? [Y/N]:" answer | |
| case $answer in | |
| [Yy] ) | |
| local dict="${HOME}/Library/Preferences/com.apple.JapaneseAnalysis/LearningDictionary.dict" | |
| if [ ! -e $dict ]; then | |
| echo "No learning data." | |
| return 0 | |
| fi | |
| read -p "Backup? [Y/N]:" answer2 | |
| case $answer2 in | |
| [Yy] ) | |
| local backup="${dict}.$(date +%Y-%m-%d)" | |
| if [ -e $backup ]; then | |
| rm -f $backup | |
| fi | |
| mv $dict $backup | |
| echo "Backed up and Cleared.";; | |
| * ) | |
| rm $dict | |
| echo "Cleared.";; | |
| esac | |
| ;; | |
| * ) echo "Aborted.";; | |
| esac | |
| } | |
| function finder_shows_all { | |
| read -p "Do you want Finder to show all files? [Y/N]:" answer | |
| case $answer in | |
| [Yy] ) defaults write com.apple.finder AppleShowAllFiles YES; killall Finder /System/Library/CoreServices/Finder.app;; | |
| [Nn] ) defaults write com.apple.finder AppleShowAllFiles NO; killall Finder /System/Library/CoreServices/Finder.app;; | |
| * ) echo "Aborted.";; | |
| esac | |
| } | |
| function safari_detects_enc { | |
| read -p "Do you want Safari to detect encoding? [Y/N/D]:" answer | |
| case $answer in | |
| [Yy] ) defaults write com.apple.Safari WebKitUsesEncodingDetector -bool yes;; | |
| [Nn] ) defaults write com.apple.Safari WebKitUsesEncodingDetector -bool no;; | |
| [Dd] ) defaults delete com.apple.Safari WebKitUsesEncodingDetector;; | |
| * ) echo "Aborted.";; | |
| esac | |
| } |