Add magnify plugin
This commit is contained in:
parent
326c707db0
commit
e00490ee5b
2 changed files with 36 additions and 1 deletions
21
pyprland/plugins/magnify.py
Normal file
21
pyprland/plugins/magnify.py
Normal file
|
@ -0,0 +1,21 @@
|
|||
from .interface import Plugin
|
||||
|
||||
from ..ipc import hyprctlJSON, hyprctl
|
||||
|
||||
|
||||
class Extension(Plugin):
|
||||
async def init(self):
|
||||
self.zoomed = False
|
||||
|
||||
async def run_zoom(self, *args):
|
||||
if args:
|
||||
value = int(args[0])
|
||||
await hyprctl(f"misc:cursor_zoom_factor {value}", "keyword")
|
||||
self.zoomed = value != 1
|
||||
else: # toggle
|
||||
if self.zoomed:
|
||||
await hyprctl("misc:cursor_zoom_factor 1", "keyword")
|
||||
else:
|
||||
fact = int(self.config.get("factor", 2))
|
||||
await hyprctl(f"misc:cursor_zoom_factor {fact}", "keyword")
|
||||
self.zoomed = not self.zoomed
|
Loading…
Add table
Add a link
Reference in a new issue