summary refs log tree commit diff
path: root/browset.py
diff options
context:
space:
mode:
authorZach DeCook <zachdecook@librem.one>2023-01-28 10:04:34 -0500
committerZach DeCook <zachdecook@librem.one>2023-01-28 10:04:34 -0500
commit88eac6043213185757075b6d182d5398ac412031 (patch)
tree266a9ee495a6c80c6bb60c92803bd9a1e638240a /browset.py
parent92875ee6e1a9faa00f9f1e9c6c689a193179635e (diff)
downloadbrowset-88eac6043213185757075b6d182d5398ac412031.tar.gz
Commands: Add external open
Diffstat (limited to 'browset.py')
-rwxr-xr-xbrowset.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/browset.py b/browset.py
index bf76aa3..3c01c29 100755
--- a/browset.py
+++ b/browset.py
@@ -11,6 +11,7 @@ from protocol.gemini import GeminiProtocol
 from protocol.data import DataProtocol
 from protocol.http import HttpProtocol
 from protocol.about import AboutProtocol
+from subprocess import Popen, DEVNULL
 
 protocols = {
     "gemini": GeminiProtocol,
@@ -27,6 +28,7 @@ class Browset(App):
         Binding("ctrl+q,ctrl+c", "app.quit", "Quit", show=True),
         Binding("ctrl+left", "back()", "Back", show=False),
         Binding("ctrl+right", "soon()", "Soon", show=False),
+        Binding("ctrl+o", "external_open()", "Open Externally"),
     ]
     history = []
     fistory = [] # forward history
@@ -69,6 +71,10 @@ class Browset(App):
       else:
         toolbar.remove_class('mobile')
 
+    def action_external_open(self):
+      # Run this command in the background
+      Popen(["xdg-open", self.url], stdout=DEVNULL, stderr=DEVNULL)
+
     def action_back(self):
       if len(self.history):
         self.fistory.append(self.url)