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
|
||||||
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'
|
local ripgrep = 'rg --column --line-number --color=always --smart-case'
|
||||||
|
|
||||||
vis.events.subscribe(vis.events.INIT, function()
|
vis.events.subscribe(vis.events.INIT, function()
|
||||||
@@ -301,8 +314,11 @@ vis.events.subscribe(vis.events.INIT, function()
|
|||||||
vis:map(vis.modes.NORMAL, ' tl', function()
|
vis:map(vis.modes.NORMAL, ' tl', function()
|
||||||
vis:command('set theme lupan-light')
|
vis:command('set theme lupan-light')
|
||||||
end, 'change to light theme')
|
end, 'change to light theme')
|
||||||
|
vis:map(vis.modes.NORMAL, ' tt', set_current_theme)
|
||||||
|
|
||||||
|
set_current_theme()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
vis.events.subscribe(vis.events.WIN_OPEN, function(win)
|
vis.events.subscribe(vis.events.WIN_OPEN, function(win)
|
||||||
vis:command('set relativenumber')
|
vis:command('set relativenumber')
|
||||||
end)
|
end)
|
||||||
Reference in New Issue
Block a user