-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.aliasrc.darwin
37 lines (30 loc) · 1.5 KB
/
.aliasrc.darwin
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
#!/bin/sh
export EDITOR_PATH
export EDITOR_ARGS
for i in code subl3 subl "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl"; do
if EDITOR_PATH=$(command -v "$i"); then
# EDITOR_PATH=$(realpath "$EDITOR_PATH")
EDITOR_ARGS="-w"
break
fi
done
# Empty the Trash on all mounted volumes and the main HDD.
# Also, clear Apple’s System Logs to improve shell startup speed.
# Finally, clear download history from quarantine. https://mths.be/bum
emptytrash() {
sudo rm -rfv /Volumes/*/.Trashes;
sudo rm -rfv ~/.Trash;
sudo rm -rfv /private/var/log/asl/*.asl;
sqlite3 ~/Library/Preferences/com.apple.LaunchServices.QuarantineEventsV* 'delete from LSQuarantineEvent'
}
# Stuff I never really use but cannot delete either because of http://xkcd.com/530/
alias volume-mute="osascript -e 'set volume output muted true'"
alias volume-up="osascript -e 'set volume output volume 100'"
# Lock the screen (when going AFK)
alias afk="/System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -suspend"
# Show/hide hidden files in Finder
alias show="defaults write com.apple.finder AppleShowAllFiles -bool true && killall Finder"
alias hide="defaults write com.apple.finder AppleShowAllFiles -bool false && killall Finder"
# Hide/show all desktop icons (useful when presenting)
alias hidedesktop="defaults write com.apple.finder CreateDesktop -bool false && killall Finder"
alias showdesktop="defaults write com.apple.finder CreateDesktop -bool true && killall Finder"