Skip to content

Instantly share code, notes, and snippets.

@cristiklein
Last active August 19, 2022 08:48
Show Gist options
  • Save cristiklein/0d0462a59418425882abe4ede986c44c to your computer and use it in GitHub Desktop.
Save cristiklein/0d0462a59418425882abe4ede986c44c to your computer and use it in GitHub Desktop.
Get laptop and screen info, i.e., make, model and serial number
#!/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