Protoco...xt::DPMS(3)

🌸 NAME 🌸

X11::Protocol::Ext::DPMS β€” a Perl module for the X11 Protocol DPMS Extension πŸ’–

okay so real talk, this little icon lives in the User Contributed Perl Documentation section of the manual, and honestly? she's giving "small but powerful." periodt ✨


πŸŽ€ SYNOPSIS πŸŽ€

bestie, here's the whole vibe in three lines:

use X11::Protocol;
$x = X11::Protocol->new();
$x->init_extension('DPMS');

that's it. that's the ritual. load it up, make your X11::Protocol object, then init_extension('DPMS') and you're in. no cap πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

so this module is literally here to control the DPMS features of compliant monitors ✨ like, the power-saving sleepy-time stuff your screen does. your monitor has to be "compliant" for this to work, which is the polite way of saying "it has to actually support DPMS, iykyk."


🫢 SYMBOLIC CONSTANTS 🫢

this extension adds the constant type DPMSPowerLevels, with values as defined in the standard. that's the whole tea β€” the actual values come straight from the standard, not from this module πŸ™ˆ


πŸ”₯ REQUESTS πŸ”₯

this extension adds several requests, and you call them exactly like this:

$x->DPMSGetVersion => ($major, $minor)

$x->DPMSCapable => ($capable)

$x->DPMSGetTimeouts => ($standby_timeout, $suspend_timeout, $off_timeout)

$x->DPMSSetTimeouts($standby_timeout, $suspend_timeout, $off_timeout) => ()

$x->DPMSEnable => ()

$x->DPMSDisable => ()

$x->DPMSForceLevel($power_level) => ()

$x->DPMSInfo => ($power_level,$state)

okay let's break the group chat down because these are all iconic in their own way:

  • $x->DPMSGetVersion => ($major, $minor) β€” grabs the version, hands you $major and $minor. she's the intro slide πŸ’œ
  • $x->DPMSCapable => ($capable) β€” asks the question we're all wondering: is this monitor actually DPMS-capable? you get $capable back. the vibe check of the whole extension, fr fr 🌈
  • $x->DPMSGetTimeouts => ($standby_timeout, $suspend_timeout, $off_timeout) β€” three timeouts, one call. $standby_timeout, $suspend_timeout, $off_timeout. the holy trinity of nap time 😭
  • $x->DPMSSetTimeouts($standby_timeout, $suspend_timeout, $off_timeout) => () β€” same three, but now you're the one setting them. note the => () β€” she returns nothing, she simply acts πŸ‘‘
  • $x->DPMSEnable => () β€” turns the whole thing on. returns () because she doesn't owe you an explanation πŸ’…
  • $x->DPMSDisable => () β€” turns it off. also returns (). main character energy either way ⭐
  • $x->DPMSForceLevel($power_level) => () β€” forces a specific $power_level. no negotiating, no asking nicely. returns () πŸ”₯
  • $x->DPMSInfo => ($power_level,$state) β€” tells you the current $power_level and $state. the receipts request, honestly πŸ“

πŸ’€ AUTHOR πŸ’€

Jay Kominek <jay.kominek@colorado.edu> β€” we stan a legend 🫢


🌟 SEE ALSO 🌟

  • perl(1)
  • X11::Protocol
  • X Display Power Management Signaling (DPMS) Extension (X Consortium Standard)

ngl if you got this far you're basically a DPMS expert now. go put your monitor to sleep responsibly πŸ’–

perl v5.42.0 πŸ¦‹ dated 2024-03-04 πŸ¦‹ and that's the whole page, bestie β€” mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from