add a toggle_dpms plugin
This commit is contained in:
parent
8179aff7b2
commit
6d0e86a886
2 changed files with 21 additions and 0 deletions
13
pyprland/plugins/toggle_dpms.py
Normal file
13
pyprland/plugins/toggle_dpms.py
Normal file
|
@ -0,0 +1,13 @@
|
|||
from .interface import Plugin
|
||||
|
||||
from ..ipc import hyprctlJSON, hyprctl
|
||||
|
||||
|
||||
class Extension(Plugin):
|
||||
async def run_toggle_dpms(self):
|
||||
monitors = await hyprctlJSON("monitors")
|
||||
poweredOff = any(m["dpmsStatus"] for m in monitors)
|
||||
if not poweredOff:
|
||||
await hyprctl("dpms on")
|
||||
else:
|
||||
await hyprctl("dpms off")
|
Loading…
Add table
Add a link
Reference in a new issue