]> git.armaanb.net Git - bin.git/blob - ufetch-arch
pubup: add variable expansion
[bin.git] / ufetch-arch
1 #!/usr/bin/env sh
2 # ufetch-armaan. My customized version of ufetch that doesn't print the ascii
3 # art, and focuses on information that changes often. Ufetch was written
4 # by jschx (Joe Schillinger), and is ISC licensed.
5 # https://gitlab.com/jschx/ufetch
6
7 ## INFO
8 host="$(cat /etc/hostname)"
9 os="Arch Linux"
10 kernel="$(uname -sr)"
11 uptime="$(uptime -p | sed \
12   -e 's/up //' \
13   -e 's/hour./hr/' \
14   -e 's/minute./min/')"
15 date="$(date +%Y-%m-%0e)"
16 time="$(date +%r)"
17 tasks="$(task list due.before:week | tail -n 1 | head -c -7)"
18
19 ## DEFINE COLORS
20 bold='\033[1m'
21 white='\033[0;37m'
22 reset='\033[0m'
23
24 lc="${reset}${bold}${white}"         # labels
25 nc="${reset}${bold}${white}"         # user and hostname
26 ic="${reset}"                        # info
27
28 ## OUTPUT
29 printf "${nc}${USER}${ic}@${nc}${host}${reset}
30 ${lc}OS        ${ic}${os}${reset}
31 ${lc}KERNEL    ${ic}${kernel}${reset}
32 ${lc}UPTIME    ${ic}${uptime}${reset}
33 ${lc}DATE      ${ic}${date}${reset}
34 ${lc}TIME      ${ic}${time}${reset}
35 ${lc}TASKS     ${ic}${tasks}${reset}
36 "