vis: set dark or light theme and start and also add key for this action
This commit is contained in:
@@ -146,6 +146,19 @@ local function add_global_mark()
|
||||
end
|
||||
end
|
||||
|
||||
function set_current_theme()
|
||||
local f = io.open(os.getenv('HOME') .. '/.config/xsettingsd/xsettingsd.conf')
|
||||
if f then
|
||||
local s = f:read('*all')
|
||||
f:close()
|
||||
if s:match('light') then
|
||||
vis:command('set theme lupan-light')
|
||||
else
|
||||
vis:command('set theme lupan-dark')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local ripgrep = 'rg --column --line-number --color=always --smart-case'
|
||||
|
||||
vis.events.subscribe(vis.events.INIT, function()
|
||||
@@ -301,6 +314,9 @@ vis.events.subscribe(vis.events.INIT, function()
|
||||
vis:map(vis.modes.NORMAL, ' tl', function()
|
||||
vis:command('set theme lupan-light')
|
||||
end, 'change to light theme')
|
||||
vis:map(vis.modes.NORMAL, ' tt', set_current_theme)
|
||||
|
||||
set_current_theme()
|
||||
end)
|
||||
|
||||
vis.events.subscribe(vis.events.WIN_OPEN, function(win)
|
||||
|
||||
Reference in New Issue
Block a user