aboutsummaryrefslogtreecommitdiffhomepage
path: root/examples/data/scripts/uzbl-tabbed
diff options
context:
space:
mode:
Diffstat (limited to 'examples/data/scripts/uzbl-tabbed')
-rwxr-xr-xexamples/data/scripts/uzbl-tabbed25
1 files changed, 10 insertions, 15 deletions
diff --git a/examples/data/scripts/uzbl-tabbed b/examples/data/scripts/uzbl-tabbed
index 5bf802a..9e5d715 100755
--- a/examples/data/scripts/uzbl-tabbed
+++ b/examples/data/scripts/uzbl-tabbed
@@ -158,7 +158,7 @@ import atexit
import types
from gobject import io_add_watch, source_remove, timeout_add, IO_IN, IO_HUP
-from signal import signal, SIGTERM, SIGINT, SIGCHLD
+from signal import signal, SIGTERM, SIGINT
from optparse import OptionParser, OptionGroup
from traceback import print_exc
@@ -536,7 +536,6 @@ class UzblTabbed:
self._timers = {}
self._buffer = ""
self._killed = False
- self._processes = []
# A list of the recently closed tabs
self._closed = []
@@ -656,9 +655,6 @@ class UzblTabbed:
# Catch keyboard interrupts
signal(SIGINT, lambda signum, stack_frame: self.terminate(SIGINT))
- # Catch SIGCHLD
- signal(SIGCHLD, lambda signum, stack_frame: self.join_children())
-
try:
gtk.main()
@@ -678,15 +674,6 @@ class UzblTabbed:
raise
-
- def join_children(self):
- '''Find and remove zombie children processes.'''
-
- for p in self._processes:
- if p.poll() is not None:
- self._processes.remove(p)
-
-
def terminate(self, termsig=None):
'''Handle termination signals and exit safely and cleanly.'''
@@ -847,6 +834,8 @@ class UzblTabbed:
# Commands ( [] = optional, {} = required )
# new [uri]
# open new tab and head to optional uri.
+ # newbg [uri]
+ # open a new tab in the background
# close [tab-num]
# close current tab or close via tab id.
# next [n-tabs]
@@ -875,6 +864,12 @@ class UzblTabbed:
else:
self.new_tab()
+ elif cmd[0] == "newbg":
+ if len(cmd) == 2:
+ self.new_tab(cmd[1], switch=False)
+ else:
+ self.new_tab(switch=False)
+
elif cmd[0] == "newfromclip":
uri = subprocess.Popen(['xclip','-selection','clipboard','-o'],\
stdout=subprocess.PIPE).communicate()[0]
@@ -1009,7 +1004,7 @@ class UzblTabbed:
cmd = ['uzbl-browser', '-n', name, '-s', str(sid),
'--connect-socket', self.socket_path, '--uri', uri]
- self._processes += [subprocess.Popen(cmd)] # TODO: do i need close_fds=True ?
+ gobject.spawn_async(cmd, flags=gobject.SPAWN_SEARCH_PATH)
uzbl = UzblInstance(self, tab, name, uri, title, switch)
SocketClient.instances_queue[name] = uzbl