Created
July 29, 2022 16:18
-
-
Save aparatext/a623573ab4f72c0816a7aced6a777a41 to your computer and use it in GitHub Desktop.
A tiny Fish script to fetch some basic info on Ubuntu Touch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env fish | |
| set TIME (date +%H:%M) | |
| set DATE (set LANG en_us_88591; date +"%b %d, %a") | |
| set MEM_USE (free -t | awk 'FNR == 2 {printf("%.1f"), $3/$2*100}') | |
| set CPU_USE (cat /proc/loadavg | awk '{ printf("%.2f"), $0;}') | |
| set BATT (cat /sys/class/power_supply/battery/capacity) | |
| set MISSED_CALLS (sqlite3 ~/.local/share/history-service/history.sqlite "SELECT COUNT(*) FROM 'voice_events' WHERE timestamp >= datetime('now','-1 hour') AND missed=1;") | |
| set_color green; echo "[TIME] $TIME" | |
| set_color blue; echo "[DATE] $DATE" | |
| set_color yellow; echo "[MEM_USE] $MEM_USE%" | |
| set_color purple; echo "[CPU_USE] $CPU_USE%" | |
| set_color green; echo "[BATT] $BATT%" | |
| if test $MISSED_CALLS != 0; set_color red; echo "You have $MISSED_CALLS missed calls!"; end; | |
| set_color normal |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment