-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.aliases
More file actions
162 lines (143 loc) · 3.74 KB
/
Copy path.aliases
File metadata and controls
162 lines (143 loc) · 3.74 KB
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
# -*- mode: sh; sh-shell: bash; -*-
# =====
# Linux
# =====
if [[ "$OSTYPE" = linux* ]]; then
alias edit="sensible-editor"
# alias e="sensible-editor" # using package e-wrapper instead
# GNU utils
alias ls="ls --almost-all --classify --color=auto --group-directories-first --literal --sort=extension"
alias l="ls --almost-all --classify --color=auto --group-directories-first --human-readable -l --literal --sort=extension"
alias cp="cp --interactive --verbose"
alias mv="mv --interactive --verbose"
alias rm="rm --interactive=once --verbose"
alias fstabshow="column -t /etc/fstab"
alias img="swayimg"
fi
# =====
# macOS
# =====
if [[ "$OSTYPE" = darwin* ]]; then
alias e='$EDITOR'
alias edit='$EDITOR'
# BSD utils
alias ls="ls -AFG"
alias l="ls -AFGlhS"
alias cp="cp -iv"
alias mv="mv -iv"
alias rm="rm -Rv"
fi
# =======
# Commons
# =======
# utils (blank space so its not in history)
alias clear=" clear"
alias claer=" clear"
alias cl=" clear"
alias exit=" exit"
alias root="sudo -i"
alias se="sudoedit"
alias sv="sudo visudo"
alias hist="history | sed -E 's/^ *[0-9]+ *//' | grep "
alias screenoff="setterm -blank 1"
alias curldl="curl --location --progress-bar --remote-name"
alias youtube2mp3="youtube-dl --audio-format mp3 --audio-quality 0 --extract-audio"
alias chatty="nohup java -jar /opt/Chatty/Chatty.jar </dev/null &>/dev/null & disown;"
alias cdtbb="cd ~/.local/share/torbrowser/tbb/x86_64/tor-browser_en-US/Browser/Downloads/"
alias wgetws="wget -mpEk" # add "--wait=seconds" if ban occurs
alias logo="swaymsg exit"
alias ipcheck="curl http://ip-api.com"
# security/privacy
alias chckvir="sudo freshclam && clamscan --recursive=yes --infected /"
alias metaimgremove="exiftool -overwrite_original -all="
# zsh specific
if [[ "${ZSH_NAME}" ]]; then
alias history="history 1"
fi
# =========
# Functions
# =========
metavideoremove() {
ffmpeg -i "${1}" \
-vcodec copy \
-acodec copy \
-map 0 \
-map_metadata -1 \
cleaned-"${1}"
}
hex10() {
hexdump -v -n 5 \
-e '4/4 "%x" 1 "\n"' \
/dev/urandom
}
ffind() {
find . \
-type d -name ".git" -prune -o \
-iname "*${1}*" \
| grep --color=auto \
--ignore-case \
--regexp="${1}"
}
ffd() {
local fdcommand
fdcommand=$(command -v fd || command -v fdfind)
"$fdcommand" --hidden \
--exclude=".git" "${1}" \
| grep --color=auto \
--ignore-case \
--regexp="${1}"
}
lgrep() {
find . \
-maxdepth 1 \
-type f \
-exec grep \
--binary-files=without-match \
--color=auto \
--ignore-case \
--line-number \
--with-filename \
--null \
--regexp="${1}" {} +
}
rgrep() {
find . \
-type d -name ".git" -prune -o \
-type f \
-exec grep \
--binary-files=without-match \
--color=auto \
--ignore-case \
--line-number \
--with-filename \
--null \
--regexp="${1}" {} +
}
lrg() {
rg --max-depth 1 \
--no-heading \
--smart-case \
--hidden \
--search-zip \
--null \
--regexp="${1}"
}
rrg() {
rg --glob='!.git/' \
--no-heading \
--smart-case \
--hidden \
--search-zip \
--null \
--regexp="${1}"
}
sway() {
if [[ -z "${WAYLAND_DISPLAY}" ]] && (( XDG_VTNR == 1 )); then
export XDG_CURRENT_DESKTOP=sway
export XDG_SESSION_DESKTOP=sway
if [[ -S "${XDG_RUNTIME_DIR}/gcr/ssh" ]]; then
export SSH_AUTH_SOCK="${XDG_RUNTIME_DIR}/gcr/ssh"
fi
exec /usr/bin/sway
fi
}