File tree 3 files changed +30
-1
lines changed 3 files changed +30
-1
lines changed Original file line number Diff line number Diff line change 1
1
local gdbus = require (' gdbus' )
2
2
local macos = require (' macos' )
3
+ local windows = require (' windows' )
3
4
4
5
local M = {}
5
6
6
7
function M .setup (_ )
7
8
if vim .fn .has (' osx' ) == 1 then
8
9
macos .setup ()
10
+ elseif vim .fn .has (' win32' ) == 1 or vim .fn .has (' win64' ) == 1 then
11
+ windows .setup ()
9
12
elseif vim .fn .executable (' gdbus' ) == 1 then
10
13
gdbus .setup ()
11
14
end
Original file line number Diff line number Diff line change
1
+ local M = {}
2
+
3
+ function M .setup ()
4
+ local reg_cmd = ' reg query'
5
+ .. ' HKCU\\ SOFTWARE\\ Microsoft\\ Windows\\ CurrentVersion\\ Themes\\ Personalize'
6
+ .. ' /v AppsUseLightTheme'
7
+ local reg_stdout = io.popen (reg_cmd )
8
+ if reg_stdout == nil then
9
+ print (' can\' t execute reg' )
10
+ return
11
+ end
12
+ local stdout_str = reg_stdout :read (' *a' )
13
+ local exit_success = reg_stdout :close ()
14
+ if exit_success ~= true then
15
+ print (' reg command failed' )
16
+ return
17
+ end
18
+ local value = stdout_str :match (' AppsUseLightTheme%s+REG_DWORD%s+0x(%d+)' )
19
+ if value == nil then
20
+ print (' unrecognized registry value' )
21
+ return
22
+ end
23
+ vim .opt .background = value == ' 1' and ' light' or ' dark'
24
+ end
25
+
26
+ return M
Original file line number Diff line number Diff line change @@ -17,5 +17,5 @@ Using any other plugin manager add `raindev/daybreak.nvim` and load the plugin w
17
17
- [ ] macOS
18
18
- [ ] windows
19
19
2 . Event based, no polling.
20
- 3 . Support Linux, macOS and Windows (planned) .
20
+ 3 . Support Linux, macOS and Windows.
21
21
4 . Zero configuration.
You can’t perform that action at this time.
0 commit comments