vis: theme switching based on existance of ~/.lightmode
This commit is contained in:
@@ -158,25 +158,15 @@ local function add_global_mark()
|
||||
end
|
||||
end
|
||||
|
||||
local last_theme = 'default'
|
||||
|
||||
local function set_current_theme()
|
||||
local path = os.getenv('HOME') .. '/.config/xsettingsd/xsettingsd.conf'
|
||||
local path = os.getenv('HOME') .. '/.lightmode'
|
||||
local theme = 'lupan-dark'
|
||||
local f = io.open(path)
|
||||
if f then
|
||||
local s = f:read('*all')
|
||||
f:close()
|
||||
local theme = s:match('light') and 'light' or 'dark'
|
||||
if theme == last_theme then
|
||||
return
|
||||
end
|
||||
last_theme = theme
|
||||
if theme == 'light' then
|
||||
vis:command('set theme lupan-light')
|
||||
else
|
||||
vis:command('set theme lupan-dark')
|
||||
end
|
||||
theme = 'lupan-light'
|
||||
end
|
||||
vis:command('set theme ' .. theme)
|
||||
end
|
||||
|
||||
local ripgrep = 'rg --column --line-number --color=always --smart-case'
|
||||
|
||||
Reference in New Issue
Block a user