-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdot_zsh.aliases
42 lines (25 loc) · 1.4 KB
/
dot_zsh.aliases
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
42
#!/bin/bash
alias srcz='source ~/.zshrc'
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Lock screen.
alias afk="/System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -suspend"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Clear DNS cache.
# alias clear-dns-cache="sudo dscacheutil -flushcache; \
# sudo killall -HUP mDNSResponder"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Empty the trash, the main HDD and on all mounted volumes,
# and clear Apple’s system logs to improve shell startup speed.
alias empty-trash="sudo rm -frv /Volumes/*/.Trashes; \
sudo rm -frv ~/.Trash; \
sudo rm -frv /private/var/log/asl/*.asl; \
sqlite3 ~/Library/Preferences/com.apple.LaunchServices.QuarantineEventsV* 'delete from LSQuarantineEvent'"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Hide/Show desktop icons.
alias hide-desktop-icons="defaults write com.apple.finder CreateDesktop -bool false \
&& killall Finder"
alias show-desktop-icons="defaults write com.apple.finder CreateDesktop -bool true \
&& killall Finder"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Get local IP.
# alias local-ip="ipconfig getifaddr en1"