Merge pull request #777 from JaroslawSlabik/main

Adding the ability to change the editor to module todo
This commit is contained in:
tobi-wan-kenobi 2021-03-20 11:38:01 +01:00 committed by GitHub
commit 3d809eb590
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -21,9 +21,10 @@ class Module(core.module.Module):
super().__init__(config, theme, core.widget.Widget(self.output)) super().__init__(config, theme, core.widget.Widget(self.output))
self.__doc = os.path.expanduser(self.parameter("file", "~/Documents/todo.txt")) self.__doc = os.path.expanduser(self.parameter("file", "~/Documents/todo.txt"))
self.__editor = self.parameter("editor", "xdg-open")
self.__todos = self.count_items() self.__todos = self.count_items()
core.input.register( core.input.register(
self, button=core.input.LEFT_MOUSE, cmd="xdg-open {}".format(self.__doc) self, button=core.input.LEFT_MOUSE, cmd="{} {}".format(self.__editor, self.__doc)
) )
def output(self, widget): def output(self, widget):