DEVICETYPE-DETECT(1)

πŸ“¦ version 0.03build2, in ubuntu jammy, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– DEVICETYPE-DETECT πŸ’–

okay bestie so this is devicetype-detect, a page from the General Commands Manual (section 1, the classics ✨), and it's literally just a little guy that looks at your machine and goes "hmm. what ARE you."


🌸 NAME 🌸

devicetype-detect β€” attempt to detect the type of the current device


πŸŽ€ SYNOPSIS πŸŽ€

devicetype-detect [-h|--help|-v|--verbose|-V| --version|--compat]

✨ DESCRIPTION ✨

so here's the vibe: devicetype-detect is trying to figure out the device class of the system it's running on, and it does that by peeking at three things:

  • the display size
  • the display resolution
  • whether there's a battery or not

and then, depending on what it decides you are, it prints one of these to STDOUT:

  • "phone"
  • "desktop"
  • "netbook"
  • "laptop"

that's it. that's the whole job. πŸ’…


πŸ¦‹ OPTIONS πŸ¦‹

  • -h, --help β€” shows you a usage message and then dips. so polite 🫢
  • -v, --verbose β€” spills extra info to STDERR while it's doing the detection. nosy behavior, love that for us πŸ‘‘
  • -V, --version β€” prints version info and exits. short and sweet.
  • --compat β€” tries to mimic the return codes of laptop-detect(1). it's giving throwback, it's giving legacy support 😭

πŸ’€ EXIT STATUS πŸ’€

  • 0 β€” detection was successfully attempted βœ…
  • 1 β€” detection was successfully attempted, and the device is a desktop (aka: it has no battery). only happens in --compat mode, bestie, don't come for me
  • 2 β€” invalid options πŸ™ˆ you did something weird
  • Others β€” errors in the detection process. if you hit one of these, please report a bug πŸ’–

🌈 NOTES 🌈

ngl, the device type detection here is necessarily crude, and it would benefit hugely from clearer product differentiation. like. let's look at the chaos:

  • "phones" with resolutions of 1280x720 or greater 🧚
  • "laptops" available down to 3.7" diagonal
  • "desktops" with internal batteries for "power conditioning"
  • and an increasing presence of modems, both AT and 3G, in devices of all classes

so yeah, device class is often determined by the usage model of specific individuals rather than objective measurements of the device. it's not science, it's vibes. it's always been vibes. ⭐


πŸ“ BUGS πŸ“

it would be a great boon to be able to detect tablets by determining if there's a physical keyboard available. someone please do this, i'm begging 😭


πŸ’œ SEE ALSO πŸ’œ


πŸ‘‘ AUTHOR πŸ‘‘

Written by Emmet Hikory


lowkey this whole page lives in the General Commands Manual (section 1) and the title stays DEVICETYPE-DETECT(1) forever and ever, periodt. take care of her, she's iconic πŸ’–βœ¨πŸŽ€
πŸ“¦ where this page comes from