From anonymous, 9 Months ago, written in Diff-output.
This paste will buy the farm in 1 Month.
Embed
  1. +++ b/qutebrowser/browser/commands.py
  2. @@ -32,10 +32,10 @@ from PyQt5.QtPrintSupport import QPrintDialog, QPrintPreviewDialog
  3.  from qutebrowser.commands import userscripts, cmdexc, cmdutils, runners
  4.  from qutebrowser.config import config, configdata
  5.  from qutebrowser.browser import (urlmarks, browsertab, inspector, navigate,
  6. -                                 webelem, downloads)
  7. +                                 webelem, downloads, shared)
  8.  from qutebrowser.keyinput import modeman, keyutils
  9.  from qutebrowser.utils import (message, usertypes, log, qtutils, urlutils,
  10. -                               objreg, utils, standarddir)
  11. +                               objreg, utils, standarddir, javascript)
  12.  from qutebrowser.utils.usertypes import KeyMode
  13.  from qutebrowser.misc import editor, guiprocess
  14.  from qutebrowser.completion.models import urlmodel, miscmodels
  15. @@ -2166,6 +2166,25 @@ class CommandDispatcher:
  16.  
  17.          ed.edit(url or old_url)
  18.  
  19. +
  20. +    def apply_css(self, css):
  21. +        widget = self._current_widget()
  22. +        widget.run_js_async(javascript.assemble('stylesheet', 'set_css', css));
  23. +
  24. +
  25. +    @cmdutils.register(instance='command-dispatcher', scope='window')
  26. +    def edit_css(self):
  27. +        """Create new user stylesheet or edit existing one.
  28. +
  29. +        The editor which should be launched can be configured via the
  30. +        `editor.command` config option. Changes to edited file will be applied
  31. +        immediately on save.
  32. +        """
  33. +        ed = editor.ExternalEditor(self._tabbed_browser, watch=True)
  34. +        ed.file_updated.connect(self.apply_css)
  35. +        ed.edit(shared.get_user_stylesheet())
  36. +
  37. +
  38.      @cmdutils.register(instance='command-dispatcher', scope='window')
  39.      def set_mark(self, key):
  40.          """Set a mark at the current scroll position in the current tab.
  41.  

Replies to qutebrowser-edit-css.patch rss

Title Name Language When
Re: qutebrowser-edit-css.patch Kenton Callister diff 7 Months ago.
Re: qutebrowser-edit-css.patch Mattie Seifert diff 8 Months ago.