-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathShowAllFiles.sh
executable file
·43 lines (35 loc) · 1.15 KB
/
ShowAllFiles.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/env bash
# Hidden File Toggle
#
#
# <bitbar.title>Hidden File Toggle</bitbar.title>
# <bitbar.version>v0.1</bitbar.version>
# <bitbar.author>mkennedy</bitbar.author>
# <bitbar.author.github>cnfn</bitbar.author.github>
# <bitbar.desc>Show All Hidden Files Toggle</bitbar.desc>
# <bitbar.dependencies>bash</bitbar.dependencies>
#
export PATH=$PATH:/usr/local/bin
# Hack for language not being set properly and unicode support
export LANG="${LANG:-en_US.UTF-8}"
showFileState=$(defaults read com.apple.finder AppleShowAllFiles 2> /dev/null)
if [ "$1" == "hideFiles" ]; then
/usr/bin/defaults write com.apple.finder AppleShowAllFiles -boolean false
/usr/bin/killall Finder
elif [ "$1" == "showFiles" ]; then
/usr/bin/defaults write com.apple.finder AppleShowAllFiles -boolean true
/usr/bin/killall Finder
fi
echo "Hidden Files"
echo "---"
if [ "$showFileState" == "1" ]; then
echo "Showing hidden files"
else
echo "Not showing hidden files"
fi
echo "---"
if [ "$showFileState" == "1" ]; then
echo "Hide all files | bash='$0' param1=hideFiles terminal=false refresh=true"
else
echo "Show all files | bash='$0' param1=showFiles terminal=false refresh=true"
fi