-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsillyutils.sh
executable file
·91 lines (81 loc) · 1.97 KB
/
sillyutils.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
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
#!/bin/bash -e
emu() {
case `id -u` in 0) ;; *)
if which doas &> /dev/null; then P="doas"; else P="sudo"; fi ;;
esac
"${P}" su -c "emaint sync -a && emerge -uDN @world --keep-going && emerge -c"
}
corntab() {
sp="/-\|"
case $1 in -e) xdg-open https://www.youtube.com/watch?v=X0YLt4dcx8w; exit 0 ;; esac
clear; cat << EOF
=================
corntab
by draumaz
=================
EOF
read; clear
}
hdd_backup() {
DATE="$(date -I)"
case ${1} in
dots|"")
case $1 in --include-repos) XTRA="remote-repos" ;; *) ;; esac
FILE="$HOME/dots-${DATE}-${HOSTNAME}.tar"
cd ${HOME}
tar -cvf ${FILE} \
.git* \
.hidden* \
.ssh* \
${XTRA}
;;
storage)
FILE="/mnt/storage/storage-${DATE}-${HOSTNAME}.tar"
cd /mnt/storage
tar -cvf ${FILE} \
misc \
music \
photos \
unix \
videos \
vpn
;;
esac
du -sh "${FILE}"
}
fastpush() {
case "${1}" in '') exit 1 ;; *) cd "${1}" ;; esac
git add *; git commit -m "${2}"; git push
}
tbc() {
case ${URL} in "") URL="${1}" ;; esac
curl -sL ${URL} | grep 'watch?v' | \
tr '"' '\n' | grep 'youtube.com/watch?v' | tee -a ./videos.txt
}
glog() {
case "${1}" in "")
CURRENT="`ls --color=no /var/log/portage -tr | tail -1`" ;;
*) CURRENT="*${1}*" ;;
esac
tail -f /var/log/portage/${CURRENT} || sudo tail -f /var/log/portage/${CURRENT}
}
loop_despook() {
while ps aux | grep -i "[M]icrosoftEdgeUpdate" > /dev/null 2>&1; do
kill `ps aux | grep -i "[M]icrosoftEdgeUpdate" | awk '{print $2}'`
echo "found and killed."
done
}
dbus_plasma_wayland_session() { exec dbus-run-session startplasma-wayland; }
rain_noise() { mpv https://www.youtube.com/watch?v=b8w6ma9gfys --no-video --really-quiet; }
LAUNCHER="$(echo ${0} | tr '/' '\n' | tail -1)"
case "${LAUNCHER}" in
*sillyutils*)
if test -e ./sillyutils.1; then
man ./sillyutils.1
else
man sillyutils
fi
exit 0
;;
*) "${LAUNCHER}" "${@}" ;;
esac