Last active
August 19, 2022 08:48
-
-
Save cristiklein/0d0462a59418425882abe4ede986c44c to your computer and use it in GitHub Desktop.
Get laptop and screen info, i.e., make, model and serial number
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
#!/bin/bash | |
sudo echo "Sudo successful" | |
echo "== START user info ==" | |
echo "Username: $USER" | |
echo "Fullname: $(getent passwd $USER | cut -d: -f5 | cut -d, -f1)" | |
echo "== END user info ==" | |
echo "== START laptop info ==" | |
sudo dmidecode -t system | grep 'Manufacturer:' | |
sudo dmidecode -t system | grep 'Product Name:' | |
sudo dmidecode -t system | grep 'Serial Number:' | |
echo "== END laptop info ==" | |
for EDID_FILE in /sys/class/drm/*/edid; do | |
echo "== START screen info ===" | |
strings ${EDID_FILE} | grep -P "^[a-zA-Z0-9\s]+$" | |
echo "== END screen info ===" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment