From 9ecd7ede0f3b1043aa8a6b1e1558176c09814a5f Mon Sep 17 00:00:00 2001 From: Olivier Gayot Date: Tue, 25 Aug 2015 04:25:40 +0100 Subject: added a way to disable the toolbars in the browser Signed-off-by: Olivier Gayot --- VimperatorrcBuilder.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'VimperatorrcBuilder.py') diff --git a/VimperatorrcBuilder.py b/VimperatorrcBuilder.py index 5313b15..f21ffef 100644 --- a/VimperatorrcBuilder.py +++ b/VimperatorrcBuilder.py @@ -22,6 +22,13 @@ class VimperatorrcBuilder(): bang_shortcuts_pfx = 's', 'S' bang_shortcuts = {} default_engine = 'duckduckgo' + toolbars = { + 'bookmarks': False, + 'addons': False, + 'menu': False, + 'navigation': True, + 'tabs': True, + } cli_bindings = { '': '', @@ -48,6 +55,15 @@ class VimperatorrcBuilder(): self.bang_shortcuts[seq] = bang_shortcut + def disable_toolbars(self): + """ Disable the toolbars in the gui of the browser """ + + self.toolbars['addons'] = False + self.toolbars['bookmarks'] = False + self.toolbars['menu'] = False + self.toolbars['navigation'] = False + self.toolbars['tabs'] = False + def set_default_search_engine(self, engine): """ Set the default search engine (i.e. when you type 'open foo') """ @@ -75,6 +91,9 @@ class VimperatorrcBuilder(): output += '\n" default search engine\n' output += 'set defsearch=' + self.default_engine + '\n' + output += '\n" toolbars displayed in the browser\n' + output += 'set toolbars=' + ','.join(('no' if not value else '') + key for key,value in self.toolbars.items()) + '\n' + output += '\n" bang shortcuts\n' for key in self.bang_shortcuts: output += "noremap '" + self.bang_shortcuts_pfx[0] + key + "' o!" + self.bang_shortcuts[key] + ' \n' -- cgit v1.2.3