From e18e989e51b6dfc57327dee3bb02c1ee1050be0a Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Thu, 29 Feb 2024 17:33:05 +0100 Subject: [vis] use vis-inotify to reload the theme --- .gitmodules | 3 +++ config/vis/plugins/vis-inotify | 1 + config/vis/visrc.lua | 11 ++++++++--- 3 files changed, 12 insertions(+), 3 deletions(-) create mode 160000 config/vis/plugins/vis-inotify diff --git a/.gitmodules b/.gitmodules index b5fb427..5b179c1 100644 --- a/.gitmodules +++ b/.gitmodules @@ -47,3 +47,6 @@ [submodule "config/vis/plugins/vis-build"] path = config/vis/plugins/vis-build url = git@gitlab.com:muhq/vis-build.git +[submodule "config/vis/plugins/vis-inotify"] + path = config/vis/plugins/vis-inotify + url = git@gitlab.com:muhq/vis-inotify.git diff --git a/config/vis/plugins/vis-inotify b/config/vis/plugins/vis-inotify new file mode 160000 index 0000000..dc13dfb --- /dev/null +++ b/config/vis/plugins/vis-inotify @@ -0,0 +1 @@ +Subproject commit dc13dfb5d77ae6c6a34802b4dbf0cac686480587 diff --git a/config/vis/visrc.lua b/config/vis/visrc.lua index c8ebc11..3a44a6a 100644 --- a/config/vis/visrc.lua +++ b/config/vis/visrc.lua @@ -42,12 +42,17 @@ end) require('plugins/suw') +local theme = "theme" vis.events.subscribe(vis.events.INIT, function() - -- Your global configuration options - local theme = "theme" - vis:command("set theme ".. theme) + -- Your global configuration options + vis:command("set theme " .. theme) end) +local inotify = require('plugins/vis-inotify') +inotify.add_recreate_watch('/home/muhq/.config/vis/themes/theme.lua', function(msg) + vis:command("set theme " .. theme) -- reload vis theme +end, '-P') + -- seperate default settings into per file and per window to not override settings from -- vis-editorconf which are set on FILE_OPEN -- default file settings -- cgit v1.2.3