Skip to content

Commit 2a471cb

Browse files
author
Yoshiki Sato
committed
init
1 parent 4e003a6 commit 2a471cb

File tree

5 files changed

+71
-0
lines changed

5 files changed

+71
-0
lines changed

finder_dup_merge.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
# Mac OS X Finderの「このアプリケーションで開く」の重複削除
3+
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain system -domain local -domain user
4+
killall Finder

open_finder.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/sh
2+
3+
usage_exit() {
4+
echo "usage: open_finder.sh [-h] [DIR]" 1>&2
5+
exit 1
6+
}
7+
8+
while getopts h OPT
9+
do
10+
case $OPT in
11+
h) usage_exit
12+
;;
13+
esac
14+
done
15+
16+
if [ $# -eq 0 ]; then
17+
DIR=`pwd`
18+
else
19+
DIR=$1
20+
fi
21+
22+
FINDER=/System/Library/CoreServices/Finder.app
23+
echo "open $DIR"
24+
open $FINDER $DIR

restart_network.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/sh
2+
3+
if [ $# -ne 1 ]; then
4+
echo "usage: restart_network.sh [interface]" 1>&2
5+
exit 1
6+
else
7+
ifconfig $1 down
8+
echo $1 down
9+
ifconfig $1 up
10+
echo $1 up
11+
fi

save_new_documents_to.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/sh
2+
3+
if [ $# -ne 1 ]; then
4+
echo "usage: ./save_new_documents_to.sh [local|cloud]" 1>&2
5+
exit 1
6+
fi
7+
8+
if [ $1 = "local" ]; then
9+
defaults write NSGlobalDomain NSDocumentSaveNewDocumentsToCloud -bool false
10+
killall Dock
11+
echo "Save new documents to Local"
12+
elif [ $1 = "cloud" ]; then
13+
defaults write NSGlobalDomain NSDocumentSaveNewDocumentsToCloud -bool true
14+
killall Dock
15+
echo "Save new documents to iCloud"
16+
fi

show_dotfile.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/sh
2+
3+
if [ $# -ne 1 ]; then
4+
echo "usage: ./show_dotfile.sh [show|hide]" 1>&2
5+
exit 1
6+
fi
7+
8+
if [ $1 = "show" ]; then
9+
defaults write com.apple.finder AppleShowAllFiles -boolean true
10+
killall Finder
11+
echo "show dotfiles"
12+
elif [ $1 = "hide" ]; then
13+
defaults write com.apple.finder AppleShowAllFiles -boolean false
14+
killall Finder
15+
echo "hide dotfiles"
16+
fi

0 commit comments

Comments
 (0)