DPMSForceLevel(3)

πŸ’– DPMSForceLevel β€” the "go to sleep bestie" button for your monitor πŸ’–

okay so real talk, this one lives in the X FUNCTIONS part of the X world, and it's like... the most direct way to tell a screen "hey. power level. now." No negotiating, no waiting, just vibes deployed immediately. ✨


🌸 NAME 🌸

DPMSForceLevel β€” forces a DPMS capable display into the specified power level

like literally forces it. not a suggestion. a demand. πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

cc [ flag ... ] file ... -lXext [ library ... ]
#include <X11/extensions/dpms.h>

Status DPMSForceLevel ( Display *display, CARD16 level );

yes bestie you gotta link -lXext and yes you gotta pull in <X11/extensions/dpms.h> or it's giving nothing. 🫢


✨ ARGUMENTS ✨

  • display β€” the connection to the X server, aka your little hotline to the display situation. πŸ“ž
  • level β€” the power level you wanna force it to. pick wisely, queen. πŸ‘‘

πŸ’« DESCRIPTION πŸ’«

so the DPMSForceLevel function forces a DPMS capable display into the specified power level. That's the whole assignment. πŸ’–

the level you pass has to be one of these four states, no substitutes:

  • DPMSModeOn
  • DPMSModeStandby
  • DPMSModeSuspend
  • DPMSModeOff

anything other than those four? that's a BadValue error, bestie. the server said no. πŸ’€

and one more thing β€” if DPMS is disabled on the display, trying to set the power level on the display will result in a BadMatch protocol error. so like, if DPMS isn't even turned on, don't come for it. it's not gonna work. 😭


πŸ”₯ RETURN VALUES πŸ”₯

  • TRUE β€” the DPMSForceLevel function always returns TRUE.

ngl that's it. that's the whole return value list. it's an overachiever with exactly one answer and honestly? iconic. πŸ‘‘


πŸ’… ERRORS πŸ’…

  • BadValue β€” a level other than DPMSModeOn, DPMSModeStandby, DPMSModeSuspend, or DPMSModeOff was specified. you colored outside the lines. πŸ™ˆ
  • BadMatch β€” DPMS is disabled on the specified display. the door was locked the whole time fr fr. πŸšͺ

🌈 SEE ALSO 🌈

the rest of the DPMS friend group, go say hi:


that's the page bestie, go forth and dim responsibly ✨

this whole thing comes to you from X Version 11, libXext 1.3.6 β€” mwah, thanks for reading, ily, bye πŸŽ€πŸ¦‹πŸ’œ

πŸ“¦ where this page comes from