diff options
| author | Daniel Jankowski <daniel.jankowski@rub.de> | 2023-09-03 08:26:27 +0200 |
|---|---|---|
| committer | Daniel Jankowski <daniel.jankowski@rub.de> | 2023-09-03 08:26:27 +0200 |
| commit | 34c90ccea120f20386f1ef4ba30198df16fb7bbd (patch) | |
| tree | b2e34b530ee8bdeeda3762ee0e1211cc6194960d | |
| parent | chore: fix clippy issue (diff) | |
| download | sl0pstatus-34c90ccea120f20386f1ef4ba30198df16fb7bbd.tar.gz sl0pstatus-34c90ccea120f20386f1ef4ba30198df16fb7bbd.tar.xz sl0pstatus-34c90ccea120f20386f1ef4ba30198df16fb7bbd.zip | |
fix: make non-selectable on permissionresult
| -rw-r--r-- | README.md | 7 | ||||
| -rw-r--r-- | plugin-dev-workspace.kdl | 1 | ||||
| -rw-r--r-- | src/main.rs | 13 |
3 files changed, 4 insertions, 17 deletions
@@ -20,12 +20,6 @@ plugin can be included by referencing it in a layout file, e.g. in the default l You could also refer to the plugin guide from zellij, after downloading the binary: [https://zellij.dev/documentation/plugin-loading](https://zellij.dev/documentation/plugin-loading) -On the first run or updates, you need to grant permissions to zjstatus in order to allow access to certain information -and to send commands (like enabling or disabling the pane border). Since zjstatus is not designed to be a selectable -window, zellij won't let you grant the permissions. For this purpose zjstatus offers the configuration `first_start "true"`. -When this configuration is set, you are able to select the pane for the plugin and grant permissions. Then simply -disable or delete the config flag again to make it work just as a statusbar. - Please ensure, that the configuration is correct. ## ⚙️ Configuration @@ -45,7 +39,6 @@ layout { format_right "{datetime}" format_space "" - first_start "false" hide_frame_for_single_pane "true" mode_normal "#[bg=#89B4FA] " diff --git a/plugin-dev-workspace.kdl b/plugin-dev-workspace.kdl index d3ac362..b21dc5f 100644 --- a/plugin-dev-workspace.kdl +++ b/plugin-dev-workspace.kdl @@ -9,7 +9,6 @@ layout { format_right "{datetime}" format_space "#[bg=#181825]" - first_start "false" hide_frame_for_single_pane "true" mode_normal "#[bg=#89B4FA] " diff --git a/src/main.rs b/src/main.rs index 0614a06..41ffb09 100644 --- a/src/main.rs +++ b/src/main.rs @@ -43,19 +43,11 @@ impl ZellijPlugin for State { subscribe(&[ EventType::ModeUpdate, EventType::PaneUpdate, + EventType::PermissionRequestResult, EventType::TabUpdate, EventType::SessionUpdate, ]); - let mut selectable = false; - if let Some(first_start) = configuration.get("first_start") { - if first_start.eq("true") { - selectable = true; - } - } - - set_selectable(selectable); - self.userspace_configuration = configuration.clone(); self.module_config = ModuleConfig::new(configuration.clone()); self.widget_map = register_widgets(configuration); @@ -85,6 +77,9 @@ impl ZellijPlugin for State { should_render = true; } } + Event::PermissionRequestResult(_result) => { + set_selectable(false); + } Event::SessionUpdate(session_info) => { if self.module_config.hide_frame_for_single_pane { let current_session = session_info.iter().find(|s| s.is_current_session); |
