diff --git a/docs/Configuration.md b/docs/Configuration.md index 42ec7149..4dc608db 100644 --- a/docs/Configuration.md +++ b/docs/Configuration.md @@ -44,6 +44,9 @@ The options listed here are not editable from within the user interface. # Auto-lock the screen after a period of inactivity (in seconds) # 0 means disabled # autolock_timeout: 0 + +# Start KlipperScreen with the screen locked +# start_locked: False ``` !!! tip diff --git a/ks_includes/config.py b/ks_includes/config.py index 5456e9c7..f08c9da9 100644 --- a/ks_includes/config.py +++ b/ks_includes/config.py @@ -162,7 +162,7 @@ class KlipperScreenConfig: bools = ( 'invert_x', 'invert_y', 'invert_z', '24htime', 'only_heaters', 'show_cursor', 'confirm_estop', 'autoclose_popups', 'use_dpms', 'use_default_menu', 'side_macro_shortcut', 'use-matchbox-keyboard', - 'show_heater_power', "show_scroll_steppers", "auto_open_extrude" + 'show_heater_power', "show_scroll_steppers", "auto_open_extrude", "start_locked" ) strs = ( 'default_printer', 'language', 'print_sort_dir', 'theme', 'screen_blanking_printing', 'font_size', diff --git a/screen.py b/screen.py index 1d661c30..29879e61 100755 --- a/screen.py +++ b/screen.py @@ -183,6 +183,8 @@ class KlipperScreen(Gtk.Window): self.lock_screen.set_autolock_timeout(autolock) self.log_notification("KlipperScreen Started", 1) self.initial_connection() + if self._config.get_main_config().getboolean('start_locked', False): + self.lock_screen.lock(None) def update_cursor(self, show: bool): self.show_cursor = show