abatt
zeigt den Batteriestand an
#!/usr/bin/bash
charge=$(inxi -B | grep -oP 'charge:.*\(\K[0-9.]+(?=%)')
#toilet -f future -F gay "Batt.: $charge%"
figlet -f future "Batt.: $charge%" | lolcat
atemp
zeigt die CPU-Temperatur an
#!/usr/bin/bash
temp=$(inxi -F | grep -oP 'System Temperatures:.*cpu:\s*\K[0-9.]+(?=\s*C)')
#toilet -f future -F gay "CPU: $temp °C"
figlet -f future "CPU: $temp °C" | lolcat
ahost
zeigt den Hostnamen an
als Alias in ~./config/fish/config.fish
alias ahost="echo $hostname | toilet -f future -F gay"
Als komplexere Funktion
#!/bin/bash
source "/usr/local/lib/acolor.sh"
horst=$(figlet -f future $HOSTNAME)
fghex "c5c9c7" "$horst"
Ja und was sourcen wir?
Das hier:
aclock
zeigt eine Uhr an
#!/usr/bin/env bash
tput civis
trap "tput cnorm; tput sgr0; clear; exit" SIGINT SIGTERM
while true; do
clear
time=$(date +'%R')
# Terminalbreite holen
width=$(tput cols)
# figlet mit manueller Breite, damit -c korrekt funktioniert
ascii=$(figlet -f future -w "$width" -c "$time")
# Terminalhöhe
rows=$(tput lines)
ascii_height=$(printf "%s\n" "$ascii" | wc -l)
# vertikal zentrieren
row=$(((rows - ascii_height) / 2))
tput cup "$row" 0
printf "%s\n" "$ascii"
sleep 10
done