diff options
-rw-r--r-- | VimperatorrcBuilder.py | 19 | ||||
-rwxr-xr-x | example.py | 1 |
2 files changed, 20 insertions, 0 deletions
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 = { '<C-j>': '<Return>', @@ -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' @@ -59,6 +59,7 @@ def main(): # this is the default behaviour, but it does not hurt to explicit it builder.set_default_search_engine('duckduckgo') + builder.disable_toolbars() # display the generated configuration on the standard output print(builder.get_output()) |