A custom fastfetch module that displays when the last Arch Linux system update was run.
This module checks the pacman log (/var/log/pacman.log) to find the last time a full system upgrade was performed (typically via yay -Syu or sudo pacman -Syu). It then displays how long ago the update occurred with color-coded output to indicate freshness.
The output color changes based on how recently the system was updated:
- Green: Updated today or yesterday (fresh!)
- Yellow: Updated 2-3 days ago (getting old)
- Orange: Updated 4-7 days ago (should update soon)
- Red: Updated more than 7 days ago (needs update!)
Run the script directly:
bash ~/.config/fastfetch/archfetch/main.shAdd to your config.jsonc modules array:
Or use command-raw for more control:
{
"type": "command-raw",
"key": " Last Update",
"text": "/home/jake/.config/fastfetch/archfetch/main.sh"
}- Arch Linux or Arch-based distribution
- Access to
/var/log/pacman.log - Standard Unix utilities:
grep,date,tail
- Reads the pacman log file
- Searches for log entries indicating a full system upgrade
- Extracts the timestamp of the most recent upgrade
- Calculates how many days have passed since then
- Outputs a color-coded message based on the age of the update
Last Update: Today
Last Update: Yesterday
Last Update: 5 days ago
Last Update: 14 days ago
Each with appropriate coloring (green, yellow, orange, or red).
{ "type": "command", "key": "", "keyIcon": "", "text": "/home/jake/.config/fastfetch/archfetch/main.sh" }