-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathuptime.10s.sh
More file actions
executable file
·36 lines (29 loc) · 1.24 KB
/
uptime.10s.sh
File metadata and controls
executable file
·36 lines (29 loc) · 1.24 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
#!/bin/bash
U=$(uptime | awk '{gsub(",", "")} {print $3, $4, $5}')
date=$(uptime -s)
style="font='Linux Biolinum' size=11" # Use monospace if you don't have/like the font
if [[ ! "$U" =~ "day" ]];then
if [[ ! "$U" =~ ":" ]]; then
up=$(echo "$U" | awk '{ print "0:"$1 }')
else
up=$(echo "$U" | awk '{ print $1 }')
fi
if [ ${up%%:*} -ge 8 ]; then # color to mark "half the ideal" wake time passing assuming 8hrs of sleep
style="font='Linux Biolinum' size=11.5 color=#33BEFF"
fi
if [[ ${up%%:*} -ge 16 ]]; then # color to mark "ideal" wake time passing assuming 8hrs of sleep
style="font='Linux Biolinum' size=11.5 color=#f23400"
fi
else
if [[ ! "$U" =~ ":" ]]; then
up=$(echo $U | awk '{ print $1, $2, "0:"$3 }')
else
up=$(echo "$U" | awk '{print $1, $2, $3}')
fi
fi
echo "<span stretch='condensed' style='oblique' weight='ultrabold' gravity='south' gravity_hint='strong'"\
"variant='smallcaps'>⚡</span><span font_stretch='ultracondensed' style='italic' weight='ultrabold'>$up</span> | $style"
echo "---"
echo "<b>$date</b> | font='monospace' size=10" # "system up since" on drop down
echo "---"
echo "⚡⚡ | bash='gnome-terminal --full-screen -- python3 $DIR/matrix-curses.py' terminal=false" #pseudo screen saver