def activate(self, text=None): if self.use_terminal: try: import subprocess prog = subprocess.Popen(self._name.split(" "), stdout=subprocess.PIPE, stderr=subprocess.STDOUT) matedialog = subprocess.Popen([ "matedialog", "--title=" + self._name, "--window-icon=" + join(deskbar.ART_DATA_DIR, "generic.png"), "--width=700", "--height=500", "--text-info" ], stdin=prog.stdout) # Reap the processes when they have done glib.child_watch_add(matedialog.pid, lambda pid, code: None) glib.child_watch_add(prog.pid, lambda pid, code: None) return except: #No matedialog, get out of the if, and launch without GUI pass spawn_async(self._name.split(" "))
def activate(self, text=None): if self.use_terminal: try: import subprocess prog = subprocess.Popen( self._name.split(" "), stdout=subprocess.PIPE, stderr=subprocess.STDOUT) zenity = subprocess.Popen( ["zenity", "--title="+self._name, "--window-icon="+join(deskbar.ART_DATA_DIR, "generic.png"), "--width=700", "--height=500", "--text-info"], stdin=prog.stdout) # Reap the processes when they have done glib.child_watch_add(zenity.pid, lambda pid, code: None) glib.child_watch_add(prog.pid, lambda pid, code: None) return except: #No zenity, get out of the if, and launch without GUI pass spawn_async(self._name.split(" "))
def activate(self, text=None): exe = GconfStore.get_instance().get_client().get_string("/desktop/gnome/url-handlers/mailto/command") exe = exe.replace(" %s", "") if "thunderbird" in exe: cmd = ["--compose", "attachment=%s" % self._uri] else: # RFC 2368 mailto URI cmd = ["mailto:?attach=%s" % self._file] spawn_async([exe] + cmd)
def activate(self, text=None): exe = GconfStore.get_instance().get_client().get_string("/desktop/mate/url-handlers/mailto/command") exe = exe.replace(" %s", "") if "thunderbird" in exe: cmd = ["--compose", "attachment=%s" % self._uri] else: # RFC 2368 mailto URI cmd = ["mailto:?attach=%s" % self._file] spawn_async([exe] + cmd)
def activate(self, text=None): spawn_async([self._program] + self._arguments)
def activate(self, text=None): if not spawn_async(["beagle-search", self._name]): spawn_async(["best", '--no-tray', '--show-window', self._name])