Issue
What is the most simple way to check if the executing platform is laptop or desktop? If i need to check the files in /sys/class/power_supply/ which file should i go for? Thanks
Solution
You only think you care about distinguishing laptops from desktops. What you really care about is simply whether /sys/class/power_supply/
exists.
if [ -d "/sys/class/power_supply" ]; then
# Work with the files in /sys/class/power_supply
fi
Answered By - chepner