diff --git a/pyprland/command.py b/pyprland/command.py index ed66495..5676a90 100755 --- a/pyprland/command.py +++ b/pyprland/command.py @@ -137,7 +137,7 @@ async def run_daemon(): async def run_client(): - if sys.argv[1] == "--help": + if sys.argv[1] in ("--help", "-h"): manager = Pyprland() await manager.load_config(init=False) print( @@ -147,12 +147,16 @@ If command is ommited, runs the daemon which will start every configured command Commands: - reload""" + reload Reloads the config file (only supports adding or updating plugins)""" ) for plug in manager.plugins.values(): for name in dir(plug): - if name.startswith("run_") and callable(getattr(plug, name)): - print(f" {name[4:]:20} (from {plug.name})") + if name.startswith("run_"): + fn = getattr(plug, name) + if callable(fn): + print( + f" {name[4:]:20} {fn.__doc__.strip() if fn.__doc__ else 'N/A'} (from {plug.name})" + ) return diff --git a/pyprland/plugins/lost_windows.py b/pyprland/plugins/lost_windows.py index 6f9b559..3f115f3 100644 --- a/pyprland/plugins/lost_windows.py +++ b/pyprland/plugins/lost_windows.py @@ -19,6 +19,7 @@ def contains(monitor, window): class Extension(Plugin): async def run_attract_lost(self, *args): + """Brings lost floating windows to the current workspace""" monitors = await hyprctlJSON("monitors") windows = await hyprctlJSON("clients") lost = [ diff --git a/pyprland/plugins/magnify.py b/pyprland/plugins/magnify.py index 6508fba..f8052aa 100644 --- a/pyprland/plugins/magnify.py +++ b/pyprland/plugins/magnify.py @@ -8,6 +8,7 @@ class Extension(Plugin): self.zoomed = False async def run_zoom(self, *args): + """[factor] zooms to "factor" or toggles zoom level ommited""" if args: value = int(args[0]) await hyprctl(f"misc:cursor_zoom_factor {value}", "keyword") diff --git a/pyprland/plugins/scratchpads.py b/pyprland/plugins/scratchpads.py index e203cee..0930d4d 100644 --- a/pyprland/plugins/scratchpads.py +++ b/pyprland/plugins/scratchpads.py @@ -196,6 +196,7 @@ class Extension(Plugin): item.just_created = False async def run_toggle(self, uid: str) -> None: + """ toggles visibility of scratchpad "name" """ uid = uid.strip() item = self.scratches.get(uid) if not item: @@ -227,6 +228,7 @@ class Extension(Plugin): self.scratches_by_address[scratch.clientInfo["address"][2:]] = scratch async def run_hide(self, uid: str, force=False) -> None: + """ hides scratchpad "name" """ uid = uid.strip() item = self.scratches.get(uid) if not item: @@ -262,6 +264,7 @@ class Extension(Plugin): await hyprctl(f"movetoworkspacesilent special:scratch,{pid}") async def run_show(self, uid, force=False) -> None: + """ shows scratchpad "name" """ uid = uid.strip() item = self.scratches.get(uid) diff --git a/pyprland/plugins/toggle_dpms.py b/pyprland/plugins/toggle_dpms.py index c774f96..ece811b 100644 --- a/pyprland/plugins/toggle_dpms.py +++ b/pyprland/plugins/toggle_dpms.py @@ -5,6 +5,7 @@ from ..ipc import hyprctlJSON, hyprctl class Extension(Plugin): async def run_toggle_dpms(self): + """toggles dpms on/off for every monitor""" monitors = await hyprctlJSON("monitors") poweredOff = any(m["dpmsStatus"] for m in monitors) if not poweredOff: diff --git a/pyprland/plugins/workspaces_follow_focus.py b/pyprland/plugins/workspaces_follow_focus.py index 7022195..41fa834 100644 --- a/pyprland/plugins/workspaces_follow_focus.py +++ b/pyprland/plugins/workspaces_follow_focus.py @@ -28,6 +28,7 @@ class Extension(Plugin): await hyprctl(batch) async def run_change_workspace(self, direction: str): + """<+1/-1> Switch workspaces of current monitor, avoiding displayed workspaces""" increment = int(direction) # get focused screen info monitors = await hyprctlJSON("monitors")