From ec4513474275a545c6996bf6ca199a06eca5b35a Mon Sep 17 00:00:00 2001 From: WerWolv Date: Wed, 13 Apr 2022 22:07:15 +0200 Subject: [PATCH] Updated plugin to support latest loader changes --- index.html | 36 ------------------------ main.py | 20 ++++---------- main_view.html | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++ plugin.json | 11 ++++++++ 4 files changed, 91 insertions(+), 51 deletions(-) delete mode 100644 index.html create mode 100644 main_view.html create mode 100644 plugin.json diff --git a/index.html b/index.html deleted file mode 100644 index 74f355e..0000000 --- a/index.html +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - -
-
-
-
-
-
-
- - - - - -
- SSH Server -
-
-
-
-
-
-
-
-
-
-
- - \ No newline at end of file diff --git a/main.py b/main.py index 5c45999..1be1152 100644 --- a/main.py +++ b/main.py @@ -1,23 +1,13 @@ import subprocess class Plugin: - name = "Extra Settings" - - author = "WerWolv" - - main_view_html = "index.html" - - tile_view_html = "" - async def get_ssh_state(self): return subprocess.Popen("systemctl is-active sshd", stdout=subprocess.PIPE, shell=True).communicate()[0] == b'active\n' - async def set_ssh_state(self, **kwargs): - print(kwargs["state"]) - - if kwargs["state"]: - print(subprocess.Popen("systemctl start sshd", stdout=subprocess.PIPE, shell=True).communicate()) + async def set_ssh_state(self, state): + if state: + subprocess.Popen("systemctl enable --now sshd", stdout=subprocess.PIPE, shell=True).wait() else: - print(subprocess.Popen("systemctl stop sshd", stdout=subprocess.PIPE, shell=True).communicate()) + subprocess.Popen("systemctl disable --now sshd", stdout=subprocess.PIPE, shell=True).wait() - return await self.get_ssh_state(self) + return await self.get_ssh_state(self) \ No newline at end of file diff --git a/main_view.html b/main_view.html new file mode 100644 index 0000000..4fa1aed --- /dev/null +++ b/main_view.html @@ -0,0 +1,75 @@ + + + + + + + + + +
+
+
+
+
+
+
+ + + + + +
+ SSH Server +
+
+
+
+
+
+
+
+
+
+
+ + \ No newline at end of file diff --git a/plugin.json b/plugin.json new file mode 100644 index 0000000..8447ad7 --- /dev/null +++ b/plugin.json @@ -0,0 +1,11 @@ +{ + "name": "Extra Settings", + "author": "WerWolv", + "main_view_html": "main_view.html", + "flags": [ "hot_reload", "root" ], + "publish": { + "discord_id": "181738643008782346", + "description": "Advanced settings to control the Steam Deck's system features", + "tags": [ "utility", "settings" ] + } +} \ No newline at end of file