PowerToys icon indicating copy to clipboard operation
PowerToys copied to clipboard

Add setting to show/hide Awake icon in system tray

Open Copilot opened this issue 4 months ago • 0 comments

Summary

Adds a new setting to the Awake module that allows users to show or hide the system tray icon. This addresses the user request to keep Awake running while maintaining a clean system tray. The default value is set to show the icon to maintain backward compatibility.

Changes

Settings UI

  • Added ShowTrayIcon boolean property to AwakeProperties with default value true
  • Added property binding in AwakeViewModel with change notifications
  • Added new SettingsCard with ToggleSwitch control in AwakePage.xaml, positioned at the top of the Behavior settings group
  • Added localized string resource "Show tray icon" in Resources.resw
  • Updated AwakeSettings.Clone() method to include the new property

Awake Module

  • Added ShowTrayIcon static property to Manager class
  • Added SetShowTrayIcon() method to update the setting and refresh the tray icon state
  • Added UpdateTrayIconText() helper method to check ShowTrayIcon before updating the icon
  • Updated SetModeShellIcon() to delete the tray icon when ShowTrayIcon is false
  • Updated timed keep-awake countdown timer to respect the ShowTrayIcon setting
  • Modified ProcessSettings() in Program.cs to apply the setting when configuration changes

Behavior

When enabled (default):

  • Awake icon appears in the system tray with appropriate mode indicator (passive/indefinite/timed/expirable)
  • Timed mode displays countdown timer in the tooltip
  • Right-click context menu remains available

When disabled:

  • Icon is removed from the system tray using TrayIconAction.Delete
  • Awake continues to function normally in the background
  • All keep-awake functionality remains active according to the selected mode
  • Icon remains hidden even after taskbar recreation events (e.g., Windows Explorer restart)

Implementation Notes

This implementation follows the existing pattern used by the ZoomIt module's ShowTrayIcon feature for consistency across PowerToys. The setting is persisted in the JSON configuration file and takes effect immediately when changed in the Settings UI.

Fixes #35661

[!WARNING]

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • i1qvsblobprodcus353.vsblob.vsassets.io
    • Triggering command: dotnet build -c Release (dns block)
    • Triggering command: dotnet restore /home/REDACTED/work/PowerToys/PowerToys/src/settings-ui/Settings.UI.Library/Settings.UI.Library.csproj (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Add a setting to show/hide the Awake icon in system tray</issue_title> <issue_description>### Description of the new feature / enhancement

Ask from DevBlogs comment: add a setting on the Awake settingspage that allows you to show or hide the Awake system tray icon. The default should be set to Show.

Scenario when this would be used?

When using Awake, but I do want my system tray to be clean.

Supporting information

No response</issue_description>

Comments on the Issue (you are @copilot in this section)

Fixes microsoft/PowerToys#42403


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copilot avatar Oct 16 '25 11:10 Copilot