diff options
| author | JSON Derulo <136133082+xXJSONDeruloXx@users.noreply.github.com> | 2025-04-02 15:36:02 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-04-02 15:36:02 -0400 |
| commit | c226e87f77375ec5682834aaf9049a0076f3e9c2 (patch) | |
| tree | 78110de676f1b6ae601ac6aaeab0e8d55ee82704 /main.py | |
| parent | fc242fa45d24477c028032dc2f0777da07a44153 (diff) | |
| parent | 0e8fa29ac63933d3c4b5f9071c174cc2f26d99db (diff) | |
| download | decky-bazzite-buddy-c226e87f77375ec5682834aaf9049a0076f3e9c2.tar.gz decky-bazzite-buddy-c226e87f77375ec5682834aaf9049a0076f3e9c2.zip | |
Merge pull request #2 from victor-borges/main
Add Steam release notes support
Diffstat (limited to 'main.py')
| -rw-r--r-- | main.py | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/main.py b/main.py deleted file mode 100644 index 65a10da..0000000 --- a/main.py +++ /dev/null @@ -1,57 +0,0 @@ -import os - -# The decky plugin module is located at decky-loader/plugin -# For easy intellisense checkout the decky-loader code repo -# and add the `decky-loader/plugin/imports` path to `python.analysis.extraPaths` in `.vscode/settings.json` -import decky -import asyncio - -class Plugin: - # A normal method. It can be called from the TypeScript side using @decky/api. - async def add(self, left: int, right: int) -> int: - return left + right - - async def long_running(self): - await asyncio.sleep(15) - # Passing through a bunch of random data, just as an example - await decky.emit("timer_event", "Hello from the backend!", True, 2) - - # Asyncio-compatible long-running code, executed in a task when the plugin is loaded - async def _main(self): - self.loop = asyncio.get_event_loop() - decky.logger.info("Hello World!") - - # Function called first during the unload process, utilize this to handle your plugin being stopped, but not - # completely removed - async def _unload(self): - decky.logger.info("Goodnight World!") - pass - - # Function called after `_unload` during uninstall, utilize this to clean up processes and other remnants of your - # plugin that may remain on the system - async def _uninstall(self): - decky.logger.info("Goodbye World!") - pass - - async def start_timer(self): - self.loop.create_task(self.long_running()) - - # Migrations that should be performed before entering `_main()`. - async def _migration(self): - decky.logger.info("Migrating") - # Here's a migration example for logs: - # - `~/.config/decky-template/template.log` will be migrated to `decky.decky_LOG_DIR/template.log` - decky.migrate_logs(os.path.join(decky.DECKY_USER_HOME, - ".config", "decky-template", "template.log")) - # Here's a migration example for settings: - # - `~/homebrew/settings/template.json` is migrated to `decky.decky_SETTINGS_DIR/template.json` - # - `~/.config/decky-template/` all files and directories under this root are migrated to `decky.decky_SETTINGS_DIR/` - decky.migrate_settings( - os.path.join(decky.DECKY_HOME, "settings", "template.json"), - os.path.join(decky.DECKY_USER_HOME, ".config", "decky-template")) - # Here's a migration example for runtime data: - # - `~/homebrew/template/` all files and directories under this root are migrated to `decky.decky_RUNTIME_DIR/` - # - `~/.local/share/decky-template/` all files and directories under this root are migrated to `decky.decky_RUNTIME_DIR/` - decky.migrate_runtime( - os.path.join(decky.DECKY_HOME, "template"), - os.path.join(decky.DECKY_USER_HOME, ".local", "share", "decky-template")) |
