Menu
Chaslinux.com
  • About
  • Blog
  • Contact
  • My Tech
Chaslinux.com
Improved hardware.sh script

(barcode) Improvements to hardware.sh script

January 19, 2022

Last week I mentioned the hardware detection BASH script I wrote for refurbishers installing Ubuntu-based distributions on desktops and laptops. I’ve made several changes to the script, including:

  • fixing a bug where the script broke on a laptop if a battery wasn’t present
  • changing the margins so more information could be included in the future
  • the addition of a graphical barcode based on the system’s serial number

It’s worth mentioning that these changes (unfortunately) add quite a few packages to the system. While I’ve only added a few additional programs, one of those programs texlive-extra-utils installs approximately 70 libraries. The texlive-extra-utils is needed for a single tool that isn’t available in other packages, so for now texlive-extra-utils is being included.

Much of the work done is around the inclusion of a graphical barcode based on the system’s serial number. The barcode is created using the following steps:

  • dmidecode is used to output the serial number to a text file
  • barcode is used to generate a visual EPS file based on the text file contents
  • eps2pdf converts the EPS file to a PDF (because there aren’t great tools to crop EPS files)
  • pdfcrop then crops the PDF to something that fits nicely in a LaTeX document

During the process several files are created and deleted. I’ve also deleted the specs.log and specs.aux files at the end of the script as they’re really not helpful after the script is done.

If you’ve already followed the instructions in my previous post about hardware.sh to install it, you can update to the newest version by changing to the hardware.sh directory and running git pull:

cd ~/Code/hardware.sh
git pull

See my previous post about installing the script: https://www.chaslinux.com/?p=127

Leave a Reply Cancel reply

You must be logged in to post a comment.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Recent Posts

  • Learning Gamedev on a Xubuntu Laptop (workspaces)
  • Eliminating Xubuntu’s Alt key behaviour for gamedev
  • What can you do with a Thinkpad T430s running Xubuntu in 2022
  • Syncthing – Synchronizing my Android cell phone with Xubuntu
  • Install Google Chrome in Xubuntu Linux 20.04

Recent Comments

No comments to show.
©2022 Chaslinux.com | Powered by WordPress and Superb Themes!