LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

laptop-detect

attempts to determine whether the system is a laptop or desktop computer

TLDR

Detect if running on a laptop (exit code 0) or desktop (exit code 1)
$ laptop-detect
copy
Print detected device type
$ laptop-detect --verbose
copy
Display version
$ laptop-detect --version
copy

SYNOPSIS

laptop-detect [options]

DESCRIPTION

laptop-detect attempts to determine whether the system is a laptop or desktop computer. It examines system characteristics like battery presence, chassis type, and hardware identifiers.The command returns exit code 0 if the system is detected as a laptop, or 1 if it appears to be a desktop or the detection fails. This is useful in scripts that need to behave differently based on system type.

PARAMETERS

--verbose

Print the detected device type
--version
Display version information
-h, --help
Display help message

INSTALL

sudo pacman -S laptop-detect
copy

CAVEATS

Detection is heuristic and may not be accurate for all systems. Some virtual machines or unusual hardware configurations may be misdetected.

HISTORY

laptop-detect was developed for Debian-based systems to allow software configuration to adapt automatically based on whether the system is mobile or stationary.

SEE ALSO

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid