Automatically switches your VS Code theme between specified day and night themes. There is a lighter version without geolocation.
Size warning: this extension will take up about 86 MB because of the geolocation feature. If you don't want that just install NightSwitch-Lite (you can still manually set your location).
If you want the geolocation feature, install the extension and go to your preferences. Add the settings
"nightswitch.dayTheme": "[YourDayTheme]"
"nightswitch.nightTheme": "[YourNightTheme]"
"nightswitch.geolocation": true
Allows for automatic geolocation based on IP and manual GPS coordinate location.
Geolocation is not turned on out of the box to protect privacy, however if you want to turn it on just invoke the setting
"nightswitch.geolocation": true
Note for GitHub: This extension requires the node modules suncalc
, geoip-lite
, and public-ip
. Install those with
npm install suncalc
npm install geoip-lite
npm install public-ip
in this folder. You'll also need the .vscode folder, which you can create using Yeoman or something.
None. Probably safer to set your main theme to either the day or night theme from the outset though.
"nightswitch.dayTheme"
- sets the theme to be shown during the day (eg.
"Solarized Light"
)
- sets the theme to be shown during the day (eg.
"nightswitch.nightTheme"
- sets the theme to be shown at night (eg.
"Default Dark+"
)
- sets the theme to be shown at night (eg.
"nightswitch.location"
- specifies a user defined GPS location in decimal degrees (eg.
"(49.89,-97.14)"
)
- specifies a user defined GPS location in decimal degrees (eg.
"nightswitch.geolocation"
- specifies whether to infer user location based on IP address (default
false
)
- specifies whether to infer user location based on IP address (default
"nightswitch.sunrise"
- manually sets the time to switch theme to day, with priority over location (24hr time, eg.
"6:00"
)
- manually sets the time to switch theme to day, with priority over location (24hr time, eg.
"nightswitch.sunset"
- manually sets the time to switch theme to night, with priority over location (24hr time, eg.
"18:00"
)
- manually sets the time to switch theme to night, with priority over location (24hr time, eg.
"nightswitch.forceSwitch"
- forces the theme to switch to currently canonical theme, ie. if it is day and you have your theme set to something other than
nightswitch.dayTheme
, resets the theme tonightswitch.dayTheme
(defaulttrue
).
- forces the theme to switch to currently canonical theme, ie. if it is day and you have your theme set to something other than
Toggle Day/Night
- toggles the theme between day and night
Switch to Day Theme
- switches the theme to
nightswitch.dayTheme
- switches the theme to
Switch to Night Theme
- switches the theme to
nightswitch.nightTheme
- switches the theme to
Removes some transitory code used to update to new setting names and updates dependencies.
Fixes issue where the theme wouldn't update after coming out of restore on Linux.
Should fix the issue where we were using local ip addresses rather than public.
Fixes issue where manually setting the time didn't do anything.
Fixes bug where nightswitch.geolocation
did not have the same name in the code.
Updates readme
Removes useless line updating the location setting from geolocation.
Corrects version number
Gives priority to location. If using geolocation updates location to decrease workload.
Creates changelog and updates docs.
Changes to documentation, fixes a couple of bugs with commands.
Initial release. Still probably pretty buggy (I wrote this pretty hastily).