[SOLVED] Control Center Malfunction

I was reading on the forums that Mabox Control Center displays the date of original installation so I decided to check my daily driver. Keep in mind that I have gone out of my way to break this system to no avail. However I do find the occasional ‘glitch.’

To further verify, I booted into a fairly fresh installation on USB to look and sure enough…

I copied the mcc script from the USB installation into /bin and ran it again, thinking I had somehow altered the one on my main computer installation. Again same Result.

In the immortal words of Rick Flair, 'What’s causing all this?"

I suppose it’s not really a big deal as I have the information available via Fastfetch which automatically executes on launch of my terminal.

It just bugs me.

Install date in mcc is based on /var/log/pacman.log.
Here is how the calculation goes:

if [[ -e /var/log/pacman.log ]]; then
        INST="$(sed 1q /var/log/pacman.log)"
        INST="${INST/ */}"
        INST="${INST/T*/}" # newer pacman adds a different timestamp (TXX:XX:XX+0000), we just want the date
        INST="${INST/\[/}"
        #INST="${INST//\-/ }"
fi
# Days ago
TODAY=$(date +%F)
let DIFF=($(date +%s -d ${TODAY})-$(date +%s -d ${INST}))/86400
if [[ "$DIFF" > "1" ]];then
DAGO="(${DIFF} ${DAYS_AGO})"
else
DAGO=""
fi

I use this in my Fastfetch config to arrive at the age of the OS install.

{
            "type": "command",
            "key": "  OS Age ",
            "keyColor": "magenta",
            "text": "birth_install=$(stat -c %W /); current=$(date +%s); time_progression=$((current - birth_install)); days_difference=$((time_progression / 86400)); echo $days_difference days"
        },

My point being. The mcc script is unaltered yet when I launch the Mabox Control center…

Just did a quick test. Perhaps using pacman.log is not the best way to determine the date of installation?

Doing some further testing, I copied the mcc script into my work folder, commented out the block of text that is used to determine the install date of Mabox and inserted 1 line. It works, I guess, I have yet to fully test if I broke anything else. Will let you know.

Yes, use of root file system birthdate will be better. I will change the method with the next update.

1 Like