-
Notifications
You must be signed in to change notification settings - Fork 0
/
general-aliases.zsh
72 lines (60 loc) · 1.56 KB
/
general-aliases.zsh
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
### 🐚 ZSH
alias zshconfig="code ~/.zshrc"
alias zshsource="source ~/.zshrc"
alias p10source="source ~/.p10k.zsh"
alias reload="echo -e 'Running: source ~/.zshrc\n...'; zshsource"
# Oh my...
alias ohmyzsh="cd ~/.oh-my-zsh"
alias ohmyzshconfig="code ~/.oh-my-zsh"
### 🌡️ Check the CPU temperature
alias temp="sudo powermetrics --samplers smc |grep -i 'CPU die temperature'"
### 📆 Date stuff
alias week='date +%V'
alias isodate='date +'\''%Y-%m-%dT%H:%M:%SZ'\'
### 🍱 Misc
alias sshconfig="code ~/.ssh/config"
alias vsc="code ."
# To avoid using any system wide Gradle distribution
alias gradle=gw
# unalias gw
### 🛰️ IP address
alias ip="echo -e 'WiFi IP address:'; ipconfig getifaddr en0"
alias ipc="echo -n $(ipconfig getifaddr en0) | pbcopy; echo -e 'WiFi IP address copied to clipboard!'"
## 🐘 Gradle
alias gwDeps='gw dependencies $(gw -q projects \
| grep -Fe ---\ Project \
| sed -Ee "s/^.+--- Project '"'([^']+)'/\1:dependencies/"'")'
## Colima start
alias cols="colima start --cpu 4 --memory 16 --disk 100 --vm-type=vz --vz-rosetta"
### 🎨 Set the tab color
tabColor () {
case $1 in
red)
tabColorRBG 204 89 89
;;
orange)
tabColorRBG 216 125 75
;;
yellow)
tabColorRBG 224 219 74
;;
green)
tabColorRBG 98 196 143
;;
blue)
tabColorRBG 70 190 206
;;
purple)
tabColorRBG 151 92 214
;;
pink)
tabColorRBG 198 71 188
;;
esac
}
# Set tab color by RBG value
tabColorRBG () {
echo -e "\033]6;1;bg;red;brightness;$1\a"
echo -e "\033]6;1;bg;green;brightness;$2\a"
echo -e "\033]6;1;bg;blue;brightness;$3\a"
}