Note: This script is NOT compatible with systems running Wayland. We use Xubuntu Linux at our project.
The idea for this BASH shell script was born out of the need to process a lot of monitors in one sitting at The Working Centre’s Computer Recycling Project. The findmonitor.sh shell script collects EDID and DDC information from monitors. The script then produces a single letter-size page PDF with a box around the following monitor information:
- Manufacturer
- Model
- Serial Number
- Resolution
- Date of Manufacture
If the monitor also supports DDC, and the DDC information is correctly filled out by the manufacturer in the monitor’s firmware, it will show the inputs on the back: VGA/DVI/HDMI, DisplayPort.
The script also takes information from the monitor’s Serial Number and produces a barcode, making it easy to input into a Point-Of-Sale system.
As of this post, the script now also produces a price in the top right corner, based on the size of the monitor. In the script I’ve set prices as:
- 24″ – $30
- 22″ – 23″ – $20
- 20″ – 21″ – $10
- 17″ – 19″ – $5
- Anything unrecognized gets a SEE STAFF price
All these are easily changeable in the script. The feature image at the top of this post shows changes between the old version (left) and the new version (right).
Installing the script
The script is available on github: https://github.com/chaslinux/findmonitor. On the site you can right click on the findmonitor.sh script and Save Link As (Xubuntu) or you can simply use git (if you’ve installed it) to clone the repository:
git clone https://github.com/chaslinux/findmonitor
Running the script is as simple as changing into the directory and running: ./findmonitor.sh
cd findmonitor
./findmonitor.sh
The script will generate several files as it attempts to detect different parts of the monitor. This script uses LaTeX as an intermediary before producing a PDF file. If the script runs into an error, you’ll see a number of files, a LaTeX file, a file storing a serial number, and maybe more. This script has been widely tested, but there are a few off-brand manufacturers, or models that may have issues.
If the script doesn’t run when you use ./findmonitor.sh make sure it has execute permission:
chmod ugo+x findmonitor.sh
Or right click on the script and look for the check box that lets you “Execute/Run” the script.
Before Running the script
Before you run findmonitor.sh, for best results run on monitors with a digital connection. This means DVI, DisplayPort, or HDMI. If you run on a system with DSUB/VGA be prepared to log-out or reboot each time, or the script will produce information for the last monitor.
Be aware: Not all manufacturers add all EDID or DDC information, but this script tries to make a best guess. Some manufacturers do no fill out the main serial number field, but use another serial number field. Or the serial number field is only partially filled compared to what you might find on the back of the monitor.
Notes about the PDF
The PDF produced is a full page PDF for a single monitor. This is wasteful. What we do at our project is turn the page and cut the long strips of paper away from the rectangle. These long strips are then stapled together and used as scratch pads by our phone. The other small pieces are recycled in our paper recycling, or used as a quick price tag for something else.
How Price is determined
We’ve based price on monitor size. As mentioned earlier, we charge $30 for a 24″ monitor, $20 for a 22″ monitor, and so on. Sadly there is no EDID information that indicates monitor size. We use the monitor model as a best guess for the size of the monitor. For example: the Dell U221H monitor in the image is parsed as a 22″ monitor and gets a price of $20. The script trims the letters out of the model, then cuts the model to the first couple of characters. On some models this doesn’t work. For example: The BenQ FP951 is detected, but when the script parses this it ends up being read as 95, not a 19″ monitor, so a price of Price: $SEE STAFF is produced.
It’s not a perfect script, but it works for a lot of monitors.
Please let me know if you find this script helpful. I’m available on most social media platforms as @chaslinux, but most often on Mastodon lately.