-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunction.sh
More file actions
99 lines (83 loc) · 2.28 KB
/
Copy pathfunction.sh
File metadata and controls
99 lines (83 loc) · 2.28 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
if [ -d "$HOME/.local/etc/config/tools" ];then
export PATH="$HOME/.local/etc/config/tools:$PATH"
fi
function log_ok()
{
echo -e "\033[1;5;30;42m$@\033[0m"
}
function log_warn()
{
echo -e "\033[1;5;30;43m$@\033[0m"
}
function log_error()
{
echo -e "\033[1;5;30;41m$@\033[0m"
}
function log_fatal()
{
log_error $@
exit 1
}
# copied from https://github.com/skywind3000/vim/blob/master/etc/function.sh#L393
function q-ansicolors
{
esc="\033["
echo -e "\t 40\t 41\t 42\t 43\t 44 45\t46\t 47"
for fore in 30 31 32 33 34 35 36 37; do
line1="$fore "
line2=" "
for back in 40 41 42 43 44 45 46 47; do
line1="${line1}${esc}${back};${fore}m Normal ${esc}0m"
line2="${line2}${esc}${back};${fore};1m Bold ${esc}0m"
done
echo -e "$line1\n$line2"
done
echo ""
echo "# Example:"
echo "#" echo "# Type a Blinkin TJEENARE in Swedens colours (Yellow on Blue)"
echo "#"
echo "# ESC"
echo "# | CD"
echo "# | | CD2"
echo "# | | | FG"
echo "# | | | | BG + m"
echo "# | | | | | END-CD"
echo "# | | | | | |"
echo "# echo -e '\033[1;5;33;44mTJEENARE\033[0m'"
echo "#"
echo "# Sedika Signing off for now ;->"
}
function tpeek()
{
if [ -z $TMUX ]; then
echo "not in tmux"
return;
fi
tmux split-window -p 33 "$EDITOR" "$@" || return;
}
function weather()
{
local city="${1:-jinan}"
if [ -x "$(which wget)" ]; then
wget -qO- "wttr.in/~${city}?1m"
elif [ -x "$(which curl)" ]; then
curl "wttr.in/~${city}?1m"
fi
}
function my-public-ip()
{
if command -v curl &> /dev/null; then
curl ifconfig.co
elif command -v wget &> /dev/null; then
wget -qO- ifconfig.co
fi
}
function install-kitty()
{
curl -L https://sw.kovidgoyal.net/kitty/installer.sh | sh /dev/stdin \
installer=nightly
}
function alarm_clock()
{
echo "notify-send --icon=gtk-info Info '$1'" | at "$2"
}