-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.conf
136 lines (105 loc) · 4.17 KB
/
config.conf
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
# font from nerdfonts.com required
print_info() {
prin " "
prin " "
prin " "
# info " " title
info topbar
info " " distro
info " " kernel #
info " " packages
info " " shell #
info " " de
info " " uptime
info bottombar
}
# custom configs
battery_name="BAT0"
hide_battery=false
# neofetch configs
os_arch="off"
package_managers="tiny"
gap=3
separator="\n"
#uptime_shorthand="tiny"
ascii_bold="off"
# battery bar
bar_char_elapsed=""
bar_char_total=""
bar_border="off"
bar_length=10
# custom battery bar (Linux only)
get_topbar() {
if $hide_battery; then
prin "╭───────────────────────────╮"
return 0
fi
bat="/sys/class/power_supply/${battery_name}"
capacity="$(< "${bat}/capacity")"
status="$(< "${bat}/status")"
if [[ "$capacity" ]]; then
original_elapsed=${bar_color_elapsed}
original_total=${bar_color_total}
case "$status" in
"Charging")
bar_color_total=$(color 3)
bar_color_elapsed=$(color 3)
battery_indicator=""
;;
"Full" | "Not charging")
bar_color_total=$(color 12)
bar_color_elapsed=$(color 12)
battery_indicator=""
;;
"Discharging")
bar_color_total=$(color 7)
battery_indicator="$(color 15)" #
if (( capacity < 10 )); then
bar_color_total=$(color 1)
bar_color_elapsed=$(color 1)
battery_indicator=""
elif (( capacity < 20 )); then
bar_color_elapsed=$(color 1)
elif (( capacity < 30 )); then
bar_color_elapsed=$(color 3)
else
bar_color_elapsed=$(color 2)
fi
;;
esac
# round battery to nearest 10 for printing
capacity=$(( (capacity + 5) / 10 * 10 ))
battery="$(bar "$capacity" 100)"
prin "╭${battery}${battery_indicator}\e[m────────────────╮"
bar_color_elapsed=${original_elapsed}
bar_color_total=${original_total}
else
prin "╭ $(color 1)ʙᴀᴛᴛᴇʀʏ ᴇʀʀᴏʀ\e[m ────────────╮"
fi
}
# custom color bar
get_bottombar() {
prin "╰────────── $(color 3) $(color 8) $(color 2) $(color 1) $(color 4) $(color 5) $(color 6) $(color 7) \e[m╯"
}
# custom ascii
get_distro_ascii() {
set_colors 1 5 4 3 7 0
read -rd '' ascii_data << 'EOF'
${c4}⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠳⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⣀⡴⢧⣀⠀⠀${c5}⣀⣠⠤⠤⠤⠤⣄⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
${c4}⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⠏${c5}⢀⡴⠊⠁⠀⠀⠀⠀⠀⠀⠈⠙⠦⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣰⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⢶⣶⣒⣶⠦⣤⣀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⢀⣰⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⣟⠲⡌⠙⢦⠈⢧⠀
⠀⠀⠀⠀⠀⣠⢴⡾⢟⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣸⡴⢃⡠⠋⣠⠋⠀
⠀⠀⠐⠀⠞⣱⠋⢰⠁⢿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⣠⠤⢖⣋⡥⢖⣫⠔⠋⠀⠀⠀
⠀⠀⠈⠠⡀⠹⢤⣈⣙⠚⠶⠤⠤⠤⠴⠶⣒⣒⣚⣩⠭⢵⣒⣻⠭⢖⠏⠁${c4}⢀⣀⠀⠀⠀⠀
${c5}⠀⠀⠠⠀⠈⠓⠒⠦⠭⠭⠭⣭⠭⠭⠭⠭⠿⠓⠒⠛⠉⠉⠀⠀⣠⠏${c4}⠀⠀⠘⠞⠀⠀⠀⠀
${c5}⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠓⢤⣀⠀⠀⠀⠀⠀⠀⣀⡤⠞⠁⠀${c4}⣰⣆⠀⠀⠀⠀⠀⠀
${c4}⠀⠀⠀⠀⠀⠀⠀⠘⠿⠀⠀⠀⠀⠀${c5}⠈⠉⠙⠒⠒⠛⠉⠁${c4}⠀⠀⠀⠉⢳⡞⠉⠀
⠀
EOF
}
# unused
#bar_char_elapsed=""
#bar_char_total=""