Skip to content

Commit e300259

Browse files
FineFindusf-person
authored andcommitted
fix: ignore failed D-Bus responses
Fixes an issue, where when the plugin received an error D-Bus response, it would still try to handle it as a successful response, causing unwanted switches of themes. Closes: #55
1 parent 97a86c9 commit e300259

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lua/auto-dark-mode/interval.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ local uv = vim.uv or vim.loop
1616
---@return Appearance?
1717
local function parse_query_response(stdout, stderr)
1818
if M.state.system == "Linux" then
19+
if stderr ~= "" then
20+
return nil;
21+
end
22+
1923
-- https://github.com/flatpak/xdg-desktop-portal/blob/c0f0eb103effdcf3701a1bf53f12fe953fbf0b75/data/org.freedesktop.impl.portal.Settings.xml#L32-L46
2024
-- 0: no preference
2125
-- 1: dark

0 commit comments

Comments
 (0)