dotfiles/i3/scripts/uptime

14 lines
288 B
Bash
Executable File

#!/bin/bash
#
# Author: Raphael P. Ribeiro <raphaelpr01@gmail.com>
uptime=$(</proc/uptime)
uptime=${uptime%%.*}
s=$(( uptime%60 ))
m=$(( uptime/60%60 ))
h=$(( uptime/60/60%24 ))
d=$(( uptime/60/60/24 ))
echo '<span background="#8A458A" foreground="black">  '$d'd'$h'h'$m'm </span>'