Skip to content

Commit 4531f8b

Browse files
mariogtf-person
authored andcommitted
custom reg.exe call for WSL
Absolute path for reg.exe when is called from WSL, because if windows interoperation is disabled on etc/file calling reg.exe doesn't work, instead, we have to point to its absolute path.
1 parent d365bec commit 4531f8b

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

lua/auto-dark-mode/init.lua

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,16 @@ local function init()
105105
"string:org.freedesktop.appearance",
106106
"string:color-scheme",
107107
}
108-
elseif system == "Windows_NT" or system == "WSL" then
108+
elseif system == "WSL" then
109+
-- Don't swap the quotes; it breaks the code
110+
query_command = {
111+
"/mnt/c/Windows/system32/reg.exe",
112+
"Query",
113+
"HKCU\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize",
114+
"/v",
115+
"AppsUseLightTheme",
116+
}
117+
elseif system == "Windows_NT" then
109118
-- Don't swap the quotes; it breaks the code
110119
query_command = {
111120
"reg.exe",
@@ -114,6 +123,7 @@ local function init()
114123
"/v",
115124
"AppsUseLightTheme",
116125
}
126+
117127
else
118128
return
119129
end

0 commit comments

Comments
 (0)