Use "Extension" for the exported object
This commit is contained in:
parent
dc8d78881a
commit
f0f6e0d8e2
5 changed files with 5 additions and 17 deletions
|
@ -33,7 +33,7 @@ class Pyprland:
|
|||
if name not in self.plugins:
|
||||
modname = name if "." in name else f"pyprland.plugins.{name}"
|
||||
try:
|
||||
plug = importlib.import_module(modname).Exported(name)
|
||||
plug = importlib.import_module(modname).Extension(name)
|
||||
await plug.init()
|
||||
self.plugins[name] = plug
|
||||
except Exception as e:
|
||||
|
|
|
@ -1,10 +1,7 @@
|
|||
from .interface import Plugin
|
||||
|
||||
from ..ipc import hyprctlJSON, hyprctl, get_workspaces
|
||||
from ..ipc import hyprctlJSON, hyprctl
|
||||
|
||||
|
||||
class Experimental(Plugin):
|
||||
class Extension(Plugin):
|
||||
pass
|
||||
|
||||
|
||||
Exported = Experimental
|
||||
|
|
|
@ -5,7 +5,7 @@ import subprocess
|
|||
from ..ipc import hyprctlJSON
|
||||
|
||||
|
||||
class MonitorLayout(Plugin):
|
||||
class Extension(Plugin):
|
||||
async def event_monitoradded(self, screenid):
|
||||
screenid = screenid.strip()
|
||||
|
||||
|
@ -43,6 +43,3 @@ class MonitorLayout(Plugin):
|
|||
subprocess.call(
|
||||
["wlr-randr", "--output", screenid, "--pos", f"{x},{y}"]
|
||||
)
|
||||
|
||||
|
||||
Exported = MonitorLayout
|
||||
|
|
|
@ -48,7 +48,7 @@ class Scratch:
|
|||
self.clientInfo.update(clientInfo)
|
||||
|
||||
|
||||
class ScratchpadManager(Plugin):
|
||||
class Extension(Plugin):
|
||||
async def init(self):
|
||||
self.procs: dict[str, subprocess.Popen] = {}
|
||||
self.scratches: dict[str, Scratch] = {}
|
||||
|
@ -288,6 +288,3 @@ class ScratchpadManager(Plugin):
|
|||
await hyprctl(f"focuswindow {pid}")
|
||||
await asyncio.sleep(0.2) # ensure some time for events to propagate
|
||||
self.transitioning_scratches.discard(uid)
|
||||
|
||||
|
||||
Exported = ScratchpadManager
|
||||
|
|
|
@ -54,6 +54,3 @@ class Extension(Plugin):
|
|||
]
|
||||
await hyprctl(f"moveworkspacetomonitor {next_workspace},{monitor['name']}")
|
||||
await hyprctl(f"workspace {next_workspace}")
|
||||
|
||||
|
||||
Exported = Extension
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue