about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2025-06-11 18:20:18 +0200
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2025-06-11 18:20:18 +0200
commit75953a5910bcae2649128b3ae4b53092957f686e (patch)
tree550f1fabad13b76ce58d3b4ce01efad1ddc156c1
parentpkgs/tskm/open: Allow opening multiple URLs at a time (diff)
downloadnixos-config-75953a5910bcae2649128b3ae4b53092957f686e.zip
pkgs/tskm/open: Define the default tab as an empty tab
Otherwise, one could not save a session at all, as qutebrowser will
always open at least the default tab.
-rw-r--r--pkgs/by-name/ts/tskm/src/interface/open/handle.rs10
1 files changed, 9 insertions, 1 deletions
diff --git a/pkgs/by-name/ts/tskm/src/interface/open/handle.rs b/pkgs/by-name/ts/tskm/src/interface/open/handle.rs
index 6243fd32..0cf60b41 100644
--- a/pkgs/by-name/ts/tskm/src/interface/open/handle.rs
+++ b/pkgs/by-name/ts/tskm/src/interface/open/handle.rs
@@ -19,7 +19,15 @@ use crate::{browser::open_in_browser, cli::OpenCommand, rofi, state::State, task
 fn is_empty(project: &task::Project) -> Result<bool> {
     let tabs = get_tabs(project)?;
 
-    Ok(tabs.is_empty())
+    if tabs.is_empty() {
+        Ok(true)
+    } else if tabs.len() > 1 {
+        Ok(false)
+    } else {
+        let url = &tabs[0].1;
+
+        Ok(url == &Url::from_str("qute://start/").expect("Hardcoded"))
+    }
 }
 
 #[allow(clippy::too_many_lines)]