Add Ability to Use Custom Service (#418)

* Custom Servive

* Custom Service

* Update system.py

* Update Configuration.md
This commit is contained in:
Devil-of-Chaos 2022-01-13 17:17:45 +01:00 committed by GitHub
parent 8c489bc465
commit f796a72057
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 2 deletions

View File

@ -33,6 +33,9 @@ language: en
# Allows the cursor to be displayed on the screen
show_cursor: False
# Allows to define custom systemctl command for restart like xrdp
service: KlipperScreen
```
## Printer Options

View File

@ -1,6 +1,7 @@
[main]
moonraker_host: 127.0.0.1
moonraker_port: 7125
service: KlipperScreen
[preheat PLA]
bed = 40

View File

@ -399,4 +399,4 @@ class SystemPanel(ScreenPanel):
self._screen._ws.klippy.restart()
def restart_ks(self, widget):
os.system("sudo systemctl restart KlipperScreen")
os.system("sudo systemctl restart %s" % self._config.get_main_config_option('service'))

View File

@ -435,7 +435,7 @@ class KlipperScreen(Gtk.Window):
def restart_ks(self, widget, response_id):
if response_id == Gtk.ResponseType.OK:
logging.debug("Restarting")
os.system("sudo systemctl restart KlipperScreen")
os.system("sudo systemctl restart %s" % self._config.get_main_config_option('service'))
widget.destroy()
def init_style(self):