From 95fdacdd312b8168f54998b8341a829846914495 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Pankowski?= Date: Wed, 8 Oct 2025 22:39:36 +0200 Subject: [PATCH] vis: theme switching based on existance of ~/.lightmode --- vis/.config/vis/visrc.lua | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/vis/.config/vis/visrc.lua b/vis/.config/vis/visrc.lua index 5d34e25..8fa515d 100644 --- a/vis/.config/vis/visrc.lua +++ b/vis/.config/vis/visrc.lua @@ -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'