You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MAJOR UPDATE:
- Added parameters to control script functions
- Added the ability to move the slideshow to the next wallpaper
- Added a native OFFLINE sunrise/sunset calculation system
- Added a Desktop CONTEXT MENU to control the slideshow or theme
- Fixed a problem where wallpapers would not change if a task was created without the need to change theme
- Fixed geolocation (again)
- Added verification of the config file to the setup script
- Improved the Rainmeter sample skin
- Many minor fixes
Copy file name to clipboardExpand all lines: README.md
+84-16Lines changed: 84 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
1
+
2
2
# AUTO THEME
3
3
Powershell script which changes the active Windows theme and Desktop background based on daylight or a predefined schedule. Works in Windows 10/11. Not tested in Windows 7.
4
4
@@ -13,11 +13,15 @@ If using `.theme` files and the standard Windows slideshow, displaying wallpaper
13
13
14
14
**Auto Theme** is designed to run in the background as a scheduled task, ensuring that the system theme is updated without user intervention.
15
15
16
-
It only connects to the internet to verify Location and retrieve Sunrise and Sunset times, via free api services such as sunrisesunset.io and ip-api.com.
16
+
This script operates <ins>almost entirely offline</ins>. It only connects to the internet to verify Location, in the case this is not retrivable from the system or is not provided by the user in the config file.
17
+
18
+
Sunrise and sunset calculations are done locally (optionally the user can request this via free api services such as sunrisesunset.io, but it is mostly unnecessary.)
17
19
18
-
It can also stay completely offline by operating on fixed hours provided by the user.
20
+
Alternatively, the script can operate on fixed hours provided by the user.
19
21
20
-
When run from terminal, using the `.\at.ps1`[^2] command, the script will 'toggle' the theme mode and then exit, ignoring any scheduled event.
22
+
**Auto Theme** includes a Desktop context menu to control the slideshow, toggle the theme or refresh the sunrise/sunset schedule. This is first created via the setup script, but can be disabled in the configuration file, and/or removed using the included `.reg` file in the repository.
23
+
24
+
When run from terminal, using the `./at.ps1 --Toggle`[^2] command (or just `./at.ps1` with no parameters), the script will 'toggle' the theme mode and then exit, <ins>ignoring any scheduled event</ins>.
21
25
22
26

23
27
<br /><sup>The command `.\at.ps1` can be run in terminal in verbose mode.</sup>
@@ -37,20 +41,20 @@ When run from terminal, using the `.\at.ps1`[^2] command, the script will 'toggl
37
41
<br /><sup>In the Personalize>Themes windows, right click on a theme and select 'Save for sharing'.</sup>
38
42
- Indicate the paths to the `.theme files` in the config file
39
43
40
-
4)(optional) Run the script `.\at-setup.ps1`[^2] to create the main scheduled task. The script will ask for system privileges if not run as admin, and then proceed to create the "Auto Theme" task.
44
+
4) Run the script `./at-setup.ps1`[^2] to create the main scheduled task and the desktop context menu. The script will ask for system privileges if not run as admin, and then proceed to create and launch the "Auto Theme" task.
41
45
42
46
6) (alternative) You can of course create the task yourself using Task Scheduler, setting the triggers to anything you prefer. In this case, make sure that the Action is set up as follows:
<b>It is advisable to always add the "On Workstation Unlock" trigger to the task. When the workstation is locked, the task may be unable to apply the theme fully, leaving out slideshow customizations and resulting in a hybrid "Custom" theme.</b>
47
51
48
52
7) When triggered, the task will then run the script `at.ps1`. The script itself will schedule the next temporary task ("Sunrise Theme" or "Sunset theme") to run at the next required theme change time, whether set by the user or identified through user location. These task will be overwritten as a matter of course, to avoid clutter.
49
53
50
54
## Usage
51
55
This script is designed to run from Task Scheduler, and after the initial setup doesn't need interaction from the user.
52
56
53
-
The Scheduled tasks can run the script in a completely hidden manner, or in a visible way, per user choice.
57
+
The Scheduled tasks can run the script in a completely hidden manner, or visibly, per user choice.
54
58
55
59
For convenience, a shortcut to the script can be created and placed on the desktop or taskbar for quick access. In this case, the shortcut should be to `powershell.exe` followed by the path to the script `"C:\path\to\at.ps1"`, indicating the same path in the `Start in` field:
56
60
<p><imgwidth="532"height="540"alt="A Windows shortcut can be created to directly toggle the theme."src="https://github.com/user-attachments/assets/b85cb2d7-91b1-44ef-90d4-b504b74c40df" />
@@ -59,11 +63,75 @@ For convenience, a shortcut to the script can be created and placed on the deskt
59
63
## Extra apps
60
64
Workarounds have been added for a number of apps which do not toggle theme gracefully when the system theme changes. More details in the Config file.
61
65
62
-
63
-
64
-
<palign=center>Why, thank you for asking!<br />👉 You can donate to all my projects <ahref="https://www.buymeacoffee.com/unalignedcoder"target="_blank"title="buymeacoffee.com">here</a>👈</p>
65
-
66
-
67
-
68
-
[^1]: `.theme` files are simple configuration instructions for the Windows pesonalization engine. You can find two examples included in this repository, with helpful comments.
66
+
<p> </p>
67
+
68
+
<divalign="center"><tableborder="1"cellspacing="0"cellpadding="20"><tr><td><palign="center"> <br>Why, thank you for asking!</p><hrwidth="60%"><palign="center">👉 You can donate to all my projects <ahref="https://www.buymeacoffee.com/unalignedcoder"target="_blank">here</a> 👈<br> </p></td></tr></table></div>
69
+
70
+
<p> </p>
71
+
72
+
73
+
74
+
### v1.0.45 (2026-01-13)
75
+
MAJOR UPDATE:
76
+
- Added parameters to control script functions
77
+
- Added the ability to move the slideshow to the next wallpaper
78
+
- Added a native OFFLINE sunrise/sunset calculation system
79
+
- Added a Desktop CONTEXT MENU to control the slideshow or theme
80
+
- Fixed a problem where wallpapers would not change if a task was created without the need to change theme
81
+
- Fixed geolocation (again)
82
+
- Added verification of the config file to the setup script
83
+
- Improved the Rainmeter sample skin
84
+
- Many minor fixes
85
+
### v1.0.43
86
+
- Fixed a problem that caused the wallpaper not to change if the PC was off a long time
87
+
- Improved the at-setup.ps1 script for the creation of the main scheduled task
88
+
- Many minor fixes
89
+
90
+
### v1.0.42
91
+
- Fixed loading/unloading of Rainmeter skins
92
+
- Added description to the Scheduled Tasks
93
+
- Attempt to correct suspect interference with Power settings
94
+
- Several minor fixes
95
+
96
+
### v1.0.40
97
+
MAJOR UPDATE:
98
+
- Added a native system to load Dark or Light modes and randomize wallpapers.
99
+
- Renamed the script `at.ps1` for consistency with my other "short-named" projects.
100
+
- Changed the names of the generated tasks, make sure you delete the old ones in Task Scheduler.
101
+
- Added a "wrapper" script (`AutoTheme.ps1`) for compatibility with older tasks and existing shortcuts.
102
+
- Added a worker script (`at-wallpaper.ps1`) to handle the wallpaper slideshow natively via Task Scheduler.
103
+
- Fixed a problem with the script not recognizing it was running from Task Scheduler
104
+
- Improved geolocation
105
+
- Removed the MusicBee restart option, as not really helpful
106
+
- Many minor fixes
107
+
108
+
### v1.0.37
109
+
- Added logic to completely hide the console window when ran from Scheduler, or use Windows Terminal
110
+
- Fixed an issue with possible user identity spoofing when creating Scheduled Tasks, in main and setup scripts
111
+
- Scheduked Tasks are now created with battery settings to avoid the script being blocked on laptops
112
+
- Added logic to control elevation privileges of restarted apps.
113
+
114
+
### v1.0.33
115
+
- Corrected a problem with Taskbar colorization
116
+
- Improved variables in config file
117
+
118
+
### v1.0.32
119
+
- Added T-Clock to extra apps and Fixed theme switching issues with it.
120
+
- Changed function names to appease PS standards. Sigh.
121
+
- Several minor improvements and fixes.
122
+
123
+
### v1.0.27
124
+
- Improved the renaming of random wallpapers.
125
+
- Simplified/optimized several functions.
126
+
- Optionally show the wallpaper filename in notifications, when the theme changes.
127
+
- Added MusicBee to the apps that can be optionally restarted upon theme change.
128
+
- Minor fixes.
129
+
130
+
### v1.0.19
131
+
- Improved the release-creation system
132
+
- Minor fixes
133
+
134
+
## Footnotes
135
+
[^1]: `.theme` files are simple configuration instructions for the Windows pesonalization engine. You can find two examples included in this repository, with helpful comments.
69
136
[^2]: To run a PowerShell script on Windows, you need to set `Execution Policy` in PowerShell, using this command: `Set-ExecutionPolicy RemoteSigned` as Administrator.
Copy file name to clipboardExpand all lines: at-config.ps1
+10-1Lines changed: 10 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -96,6 +96,15 @@
96
96
$sunriseOffset=0
97
97
$sunsetOffset=0
98
98
99
+
# ============= Context menu =============
100
+
101
+
<# If `$true`, adds an 'Auto Theme' context menu on desktop.
102
+
This allows you to show the next wallpaper in the slideshow,
103
+
quickly switch between Light and Dark modes on demand,
104
+
or refresh the Scheduled Tasks.
105
+
It may requires a restart of Explorer to take effect. #>
106
+
$addContextMenu=$true
107
+
99
108
# ============= Extra apps variables =============
100
109
101
110
<# Sysinternals Process Explorer doesn't automatically change theme when the system theme is changed. Use this variable if you want it to be restarted.
@@ -149,7 +158,7 @@
149
158
# Write Wallpaper name in Registry for other apps or scripts to read
150
159
$writeRegistry=$false
151
160
152
-
# ============= Shared Win32 API & Power Management ==============
161
+
# ============= Shared Win32 API & Power Management, for wallpaper changing ==============
0 commit comments