summaryrefslogtreecommitdiff
path: root/portato/plugins/etc_proposals.py
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--portato/plugins/etc_proposals.py31
1 files changed, 29 insertions, 2 deletions
diff --git a/portato/plugins/etc_proposals.py b/portato/plugins/etc_proposals.py
index 6cf53ad..fa54600 100644
--- a/portato/plugins/etc_proposals.py
+++ b/portato/plugins/etc_proposals.py
@@ -16,6 +16,12 @@ from portato.backend import system
from subprocess import Popen
from etcproposals.etcproposals_lib import EtcProposals, __version__
+try:
+ from etcproposals.etcproposals_info import FRONTEND, VERSIONS
+except ImportError:
+ FRONTEND = None
+ VERSIONS = None
+
PROG="/usr/sbin/etc-proposals"
class PortatoEtcProposals(EtcProposals):
@@ -28,6 +34,17 @@ class PortatoEtcProposals(EtcProposals):
self._add_update_proposals(dir)
self.sort()
+def get_frontend ():
+ if FRONTEND is None:
+ return ["--frontend", "gtk"]
+ else:
+ cmds = dict(zip([x.name for x in FRONTEND], [[x.command] for x in FRONTEND]))
+ names = [x.shortname for x in VERSIONS] # need this too, because etcproposals stores frontends in FRONTEND which cannot be launched
+
+ for f in ["gtk2", "qt4"]:
+ if f in names:
+ return cmds[f]
+
def etc_prop (*args, **kwargs):
"""Entry point for this plugin."""
@@ -38,13 +55,23 @@ def etc_prop (*args, **kwargs):
if l > 0:
Popen(PROG)
else:
- Popen([PROG, "--frontend", "gtk", "--fastexit"])
+ f = get_frontend()
+
+ if f:
+ Popen([PROG, "--fastexit"]+f)
+ else:
+ debug("Cannot start etc-proposals. No graphical frontend installed!", error = 1)
def etc_prop_menu (*args, **kwargs):
if am_i_root():
if float(__version__) < 1.1:
Popen(PROG)
else:
- Popen([PROG, "--frontend", "gtk"])
+ f = get_frontend()
+
+ if f:
+ Popen([PROG]+f)
+ else:
+ debug("Cannot start etc-proposals. No graphical frontend installed!", error = 1)
else:
debug("Cannot start etc-proposals. Not root!", error = 1)
tions'>+1 2018-06-25Do not put passwords in herestringsJason A. Donenfeld1-3/+3 2018-06-24Simplify filename matching in redact_pass.vimTom Ryder2-40/+11 2018-06-14version: bump1.7.2Jason A. Donenfeld1-1/+1 2018-06-14show: buffer output before displaying, in case decryption failsJason A. Donenfeld1-2/+4 2018-06-14Close stdout for background task that restores clipboardAllan Odgaard3-3/+3 2018-06-14Don't trap INT or TERM; they are redundant and can break `pass edit`.Nick Kousu1-2/+2 2018-06-14tests: fix compatibility with GnuPG 2.2.5Clément Lassieur1-1/+1 2018-06-14Add tests and documentation of passing options to grep(1)Norbert Buchmueller3-5/+18 2018-06-14Ensure signature regexes are anchoredJason A. Donenfeld1-4/+4 2018-06-10Replace noplaintext.vim as redact_pass.vim pluginTom Ryder3-46/+121 2018-05-24grep: allow grep options and argumentsSitaram Chamarty1-3/+3 2018-02-19fish: reduce completion runtimesMathis Antony1-14/+13 2018-02-08generate: disallow zero length generated passwordsJason A. Donenfeld1-1/+2 2018-02-01generate: in-place should work when file is emptyJason A. Donenfeld1-1/+1 2017-12-18Quote array specifierJason A. Donenfeld1-1/+1 2017-10-13protect dirname calls from pass-names that look like command-line optionsStacey Sheldon1-6/+6 2017-09-15passmenu: Don't eat whitespace at beginning/end of passwordDaniel Lublin1-1/+1 2017-08-29emacs: Release version 1.0.1 of Emacs packageSvend Sorensen2-5/+10 2017-08-29emacs: --run-async: Quote shell argumentsDamien Cassou1-4/+5 2017-08-29emacs: Update author's email addressSvend Sorensen1-2/+2 2017-08-29emacs: Fix package-lint violationsSvend Sorensen1-2/+3 2017-07-26emacs: Release version 1.0.0 of Emacs packageSvend Sorensen2-1/+8 2017-07-26emacs: Use with-editor to wrap "pass edit"Svend Sorensen2-9/+17 2017-04-13Bump version1.7.1Jason A. Donenfeld1-1/+1 2017-04-13init: match only the public keyJason A. Donenfeld1-1/+1 2017-03-28Use $GPG variableJason A. Donenfeld1-3/+3 2017-03-20Fix compatibility with GnuPG 2.2.19Andreas Stieger2-2/+2 2017-03-01tests: fix on OSX by not using the tr hackJason A. Donenfeld3-5/+2 2017-02-26Bump version1.7Jason A. Donenfeld1-1/+1 2017-02-26Modernize makefileJason A. Donenfeld2-31/+36 2017-02-25CopyrightJason A. Donenfeld1-1/+1 2017-02-25StyleJason A. Donenfeld1-2/+2 2017-02-25git: use inner-most directoryJason A. Donenfeld2-27/+48 2017-02-25clip: sleep may require argv[0] to be sleepJason A. Donenfeld1-1/+1 2017-02-25man: document system extensionsJason A. Donenfeld1-2/+3