Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change Awake icon in the tray depending on the current state #11996

Closed
fmiqbal opened this issue Jun 30, 2021 · 49 comments
Closed

Change Awake icon in the tray depending on the current state #11996

fmiqbal opened this issue Jun 30, 2021 · 49 comments
Assignees
Labels
Idea-Enhancement New feature or request on an existing product Product-Awake Issues regarding the PowerToys Awake utility Resolution-Fix Committed Fix is checked in, but it might be 3-4 weeks until a release.

Comments

@fmiqbal
Copy link

fmiqbal commented Jun 30, 2021

Description of the new feature / enhancement

  • The icon should be distinguishable when its keeping awake, or not,
  • The tooltip can be changed also, or if its using timer, show the remaining time ?
  • Ability to toggle using double click
  • The icon seems a bit off with the rest of the theme, simpler icon without much detail would be appreciated
  • on the general side, I think the term "Prevent sleep" is preferable rather than "Keep awake"

Scenario when this would be used?

I need a quick glance whether Awake is active or not

Supporting information

No response

@fmiqbal fmiqbal added the Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams label Jun 30, 2021
@apsolut
Copy link

apsolut commented Jun 30, 2021

Before anything it should be clear its from PowerToys (info, about... anything) 💥

#11962
#11964

@tomcollis
Copy link

I agree, some way to determine what Awake is currently doing, would be great. Maybe 3 icons:

  • Keep Awake Indefinitely (or Prevent Sleep) - Add Steam to Cup?
  • Keep Awake Temporarily - Add Clock to Cup (not moving, just a static round clock icon)
  • Disabled - Remove All Colour from Cup and Just have the outline to identify the shape.

@jankolkmeier
Copy link

On a side note, I would appreciate if it this feature was opt-in.

I noticed this new icon in my tray today and had no idea where it came from. I only found out through the "select which icons appear on the taskbar" system dialogue that it was related to Power Toys (which I had updated earlier today).

If it is meant to stay opt-out, at the very least add a title item to the right-click-dialogue that identifies it as a PowerToys feature, so users know where to disable it (and dont have get paranoid about an unknown new tray icon process ;) ).

@dedavis6797 dedavis6797 added Idea-Enhancement New feature or request on an existing product Product-Awake Issues regarding the PowerToys Awake utility and removed Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams labels Jun 30, 2021
@dedavis6797 dedavis6797 added this to the Post stabilization milestone Jun 30, 2021
@dedavis6797
Copy link
Contributor

Thank you for the feedback! We have a hot fix coming to add a "PowerToys Awake" label to the taskbar sys-tray icon.

For the visual indicators of Awake's mode, I think it's a great idea but will likely have to wait until after our general stability push for us to begin prioritizing investigations/development for it.

@r2evans
Copy link

r2evans commented Jul 1, 2021

I agree, some way to determine what Awake is currently doing, would be great. Maybe 3 icons:

* Keep Awake Indefinitely (or Prevent Sleep) - Add Steam to Cup?

* Keep Awake Temporarily - Add Clock to Cup (not moving, just a static round clock icon)

* Disabled - Remove All Colour from Cup and Just have the outline to identify the shape.

I suggest also considering an indicator for "Keep screen on", not just awake or not.

My recommendations (I'm showing on a dark background, colors might need adjusting for broader use):

image

From left to right:

  • normal
  • "Keep screen on", these steam lines are added to any of the other symbols
  • On (no sub-icon, in case you prefer the cup by itself for one of the default modes)
  • On (indefinitely), that is meant to be an infinity symbol
  • On (temporarily)

I give full artistic license to the PowerToys developers for these designs.

@LRitzdorf
Copy link

LRitzdorf commented Jul 1, 2021

Personally, I like the idea of a grayscale icon for "passive mode" (turned off), and the blue color, plus sub-icons, when it's active in either indefinite or timed mode. Great work with the steam and sub-icons, by the way!

@dend dend self-assigned this Jul 6, 2021
@dend
Copy link
Collaborator

dend commented Jul 6, 2021

Love the idea - thank you for the detailed input. Will put this on the backlog to implement - will also need @niels9001's help with the icons. Next step here will be creating a concrete specification. I will work on that and make sure that it's covered within this work item.

@technobulb
Copy link

How about not having it appear as an extra icon at all, unless it is active? It can be activated from the powertoys main menu or notification context menu..

@as-it
Copy link

as-it commented Sep 3, 2021

I would like to have the option to define "quick actions" for different mouse/key interactions on try icon:

In Awake settings would be new pane with list of predefined Quick Actions and Add button (to be able to Add more).

Example of Predefined Quick Actions list:

  • Action: [fixed] PopupMenu | Activation/Deactivation: [combobox] Right mouse button click
  • Action: [combobox] KeepScreenOn | Activation/Deactivation: [combobox] Left mouse button click | Remove
  • Action: [combobox] KeepAwakeIndefinitely | Activation/Deactivation: [combobox] Shift + Left mouse button click | Remove
  • Action: [combobox] KeepScreenOn+KeepAwakeIndefinitely | Activation/Deactivation: [combobox] Left mouse button double-click | Remove

Action: [combobox] :

  • filled with all possibilities of:
    Left/Right/Middle mouse button + Click/DoubleClick + ShiftKeyPressed + CtrlKeyPressed + AltKeyPressed

Activation/Deactivation [combobox] :

  • filled with all possible modes available
    (like: KeepScreenOn, KeepAwakeIndefinitely, KeepAwake30min, ...)
    (even combined, like: KeepScreenOn + KeepAwakeIndefinitely, KeepScreenOn + KeepAwake30min, ...)

When any defined Activation if made on try icon:

  • if current state is different from Action of this Activation it will set new state
  • if current state is same as Action of this Activation it will set Deactivate (set to Passive)

@htcfreek
Copy link
Collaborator

htcfreek commented Sep 5, 2021

@dend

  • When Awake is running in temporary (timer) mode we should show how much time is left in settings window and tray icon tool tip.
  • For setting we could add a state group directly und the enable switch.

@mchowdhury
Copy link

I created a tool similar to awake a while back. For the tray UI I used a button that toggles different time intervals and shows the time remaining all at once. The UI was inspired by the Caffeine quick tile in LineageOS Android ROM.

The UI looks like this:

caffeinetray2

This type of design would solve this issue along with:

And could be integrated into: #6751

@ddimick
Copy link

ddimick commented Nov 4, 2021

Currently, Caffeine delivers the functionality I need better than Awake (visual icon status and double-click to activate/deactivate). Would love to see Awake incorporate these features.

Alternatively, I'm wondering if it's possible to script Awake with AutoHotKey. Has anyone tried that?

@r2evans
Copy link

r2evans commented Nov 5, 2021

(This is a little off-topic here, but I'll answer it. If the mods what to remove it, my apologies for the noise :-)

I do have an AHK script for what I want ... it may be more than is necessary, and outside the scope of Awake (since I also want to force stronger power modes at times), but it does what I want, which is: set the "Active" power configuration and disable the screensaver; or set the other (non-Active) power configuration and enable the screensaver. This works for me in Win10Pro, I have not tested on any other computer (yet).

The TrayTips are a little verbose, that's mostly because I'm not a guru at AHK, and I found many times what I thought was being set was not. I'll likely trim down the verbosity a little at some point.

  • Alt-Win-\ status of my power-config/ssaver,

    image

  • ShiftCtrl-Win-\ go to a "balanced" mode (power-config "Balanced", ssaver on/enabled)

  • Ctrl-Win-\ go to an "active" mode (power-config "Active", ssaver on/disabled)

  • Win-\ toggle the mode between the "active" and "balanced"

    image

The "change" traytip is rather verbose, mostly because I'm not a guru at AHK and I needed it during dev/debugging:

Power: (Active) -> (Balanced)
        ^^^^^^      ^^^^^^^^
           \            `--- 2. the new power-configuration state
            `--- 1. the previous power-configuration state
SSaver: disabled -> enable/enabled
        ^^^^^^^^    ^^^^^^ ^^^^^^^
            \           \      `--- 3. ssaver after I think I changed it
             \           `--- 2. what we will be commanding it to
              `--- 1. what it was before we tried to set it
AHK script for power-configuration and screensaver toggling
DllCall("AllocConsole")
WinHide % "ahk_id " DllCall("GetConsoleWindow", "ptr")

StayAwake(ByRef Action := "status") {
  ; http://www.jasinskionline.com/windowsapi/ref/s/systemparametersinfo.html
  sh := ComObjCreate("WScript.shell")
  out := sh.Exec("powercfg /list").StdOut.ReadAll()
  actGUID := "unkg"
  actPLAN := "unkp"
  othGUID := "unkg"
  othPLAN := "unkp"
  isACTIVE := 0
  for each, line in StrSplit(out, "`n", "`r") {
    if (!InStr(line, "GUID")) {
      continue
    }
    if (InStr(line, "active")) {
      isActive := (RegexMatch(line, "\* *$") <> 0) ; 1 means we are in "(Active)"
      actGUID := RegExReplace(line, "i).*GUID:\s*([^ ]+)\s+.*", "$1")
      actPLAN := RegexReplace(line, "i).*GUID:\s*[^ ]+\s+([^\s].*?)[\s*]*$", "$1")
    } else {
      othGUID := RegExReplace(line, "i).*GUID:\s*([^ ]+)\s+.*", "$1")
      othPLAN := RegexReplace(line, "i).*GUID:\s*[^ ]+\s+([^\s].*?)[\s*]*$", "$1")
    }
  }
  if (actPLAN = "unkp" or othPLAN = "unkp") {
    TrayTip Power Plan Error, Unable to find both 'Active' and at least one other power plan, , 0x3
  }
  if (Action = "toggle") {
    Action := isActive = 0 ? "active" : "balance"
  }
  curPLAN := isActive ? actPLAN : othPLAN
  if (Action = "active") {
    newGUID := actGUID
    newPLAN := actPLAN
  } else {
    newGUID := othGUID
    newPLAN := othPLAN
  }
  ;; what WAS the state before we do anything
  DllCall("SystemParametersInfo", Int,16,  UInt,NULL, "UInt *",SS_oldstate,   Int,0)
  SS_oldstate := SS_oldstate = 0 ? "disabled" : "enabled"
  ;; what we INTEND to set it to (if not "status")
  SS_newstate := Action = "active" ? 0 : 1
  if (Action = "status") {
    TrayTip Current State, Power: %curPLAN%`nSSaver: %SS_oldstate%, , 0x10
  } else {
    DllCall("SystemParametersInfo", Int,17 , Int,SS_newstate , UInt,NULL , Int,2)
    DllCall("SystemParametersInfo", Int,16,  UInt,NULL, "UInt *",SS_curstate,   Int,0)
    SS_newstate := SS_newstate = 0 ? "disable" : "enable"
    SS_curstate := SS_curstate = 0 ? "disabled" : "enabled"
    S = powercfg /setactive %newGUID%
    ign := sh.Exec(S).StdErr.ReadAll()
    TrayTip Change State, Power: %curPLAN% -> %newPLAN%`nSSaver: %SS_oldstate% -> %SS_newstate%/%SS_curstate%, , 0x10
  }
}

#\:: StayAwake("toggle")
#!\:: StayAwake("status")
#^\:: StayAwake("active")
#^+\:: StayAwake("balance")

@jasontenpenny
Copy link

differing icons would be awesome. This is common in these types of apps. I use both Mac and Windows, and have been using Amphetamine on the Mac side for a long time. The ability to see at a glance if it's on or not is helpful. It also has the ability to send periodic reminder notifications that it's still on. That would be useful as well, at least when you have it on the indefinite setting.

@Jeffrey04
Copy link

* Ability to toggle using double click

personally prefer a single tap as double tapping through the tablet interface is not a pleasant experience

@dend
Copy link
Collaborator

dend commented Jan 13, 2022

@niels9001 I'd love your professional help with the icons for this request. Could you please help create the SVG, PNG, and ICO files for each of the states?

  • Disabled but running
  • Timed keep awake with screen on
  • Timed keep awake without keeping the screen on
  • Indefinite keep awake with screen on
  • Indefinite keep awake without keeping the screen on

@lalomartins
Copy link

* Ability to toggle using double click

personally prefer a single tap as double tapping through the tablet interface is not a pleasant experience

I also think single click/tap makes more sense, there's no obvious other function for single click in this icon.

@TheJoeFin
Copy link
Collaborator

@niels9001 is this on your to-do list? Any ETA?

@niels9001
Copy link
Contributor

niels9001 commented Dec 21, 2023

@dend @TheJoeFin @crutkas

Long, long, loooong overdue! This is what I have so far:

image

in situ (100%):

image

  • I have made a slight update to the Awake icon so it no longer has the saucer which helps when the icon is tiny.

  • For the different states: is the "keep screen on" something that is crucial for the icon to display? It feels a bit like secondary information that we could show in the tooltip (but maybe I'm wrong)? Was thinking of replacing the circle with a rectangle to indicate the screen is on, but it's hard to distinguish really.. only so much information we can display in a 16x16px icon :)

@technobulb
Copy link

Nice work. I propose changing the arrow in the "indefinite" mode to an Infiniti loop ♾️. I feel like it gets the point across clearer than the circular arrow, which may indicate restart....

@TheJoeFin
Copy link
Collaborator

@niels9001 any update on this?

@niels9001
Copy link
Contributor

@niels9001 any update on this?

not from my side.. I can deliver the correct icons if someone is implementing this feature!

@TheJoeFin
Copy link
Collaborator

@niels9001 I believe @dend is doing the implementation

@CennoxX
Copy link

CennoxX commented Apr 10, 2024

@niels9001 It might be better if the sub-icons were to the left of the cup icon, as the current version makes it difficult to identify that the main icon is a cup:
grafik

@dend
Copy link
Collaborator

dend commented Apr 10, 2024

@niels9001 can you please add the icons somewhere? 😊 I am working on implementing this feature (will be tracked in #32378)

We also need one more icon for the expirable state (might be a small calendar overlay?)

@niels9001
Copy link
Contributor

@niels9001 can you please add the icons somewhere? 😊 I am working on implementing this feature (will be tracked in #32378)

We also need one more icon for the expirable state (might be a small calendar overlay?)

What format do you need? .ico?

@dend
Copy link
Collaborator

dend commented Apr 10, 2024

@niels9001 can you please add the icons somewhere? 😊 I am working on implementing this feature (will be tracked in #32378)
We also need one more icon for the expirable state (might be a small calendar overlay?)

What format do you need? .ico?

You can send PNGs and I can produce ICOs.

@dend
Copy link
Collaborator

dend commented Jul 16, 2024

@niels9001 nudge on this little item 😀

@dend
Copy link
Collaborator

dend commented Jul 17, 2024

We probably need two more icons for:

  • Expirable keep-awake (that is - with a target date/time). Maybe a calendar overlay?
  • Scheduled keep-awake (coming in future version). Potentially something like a "refresh" like icon, that shows recurrence? That would mean that the Indefinite keep-awake would have a different kind of overlay (maybe the infinity symbol).

cc: @niels9001

@niels9001
Copy link
Contributor

@dend Here you go:

AwakeIcons.zip

@technobulb
Copy link

@dend Here you go:

AwakeIcons.zip

Nice. maybe you can take into account what was mentioned by @CennoxX

@niels9001 It might be better if the sub-icons were to the left of the cup icon, as the current version makes it difficult to identify that the main icon is a cup: !

@niels9001
Copy link
Contributor

@dend Here you go:
AwakeIcons.zip

Nice. maybe you can take into account what was mentioned by @CennoxX

@niels9001 It might be better if the sub-icons were to the left of the cup icon, as the current version makes it difficult to identify that the main icon is a cup: !

Yeah, we've looked at that. Two issues though:

  • All indicators for most apps are on the right, and it helps with the visual balance of the icon.
  • Putting it on the left shows the cup handle, but that acts additional visual complexity on a very small icon.

@dend
Copy link
Collaborator

dend commented Jul 23, 2024

Thank you @niels9001 for the icons! I am working on including them in the application.

@technobulb - confirming that we've decided that right-side state is better and consistent with the rest of the Windows tray icons.

@mchowdhury
Copy link

mchowdhury commented Jul 23, 2024

@dend Here you go:
AwakeIcons.zip

Nice. maybe you can take into account what was mentioned by @CennoxX

@niels9001 It might be better if the sub-icons were to the left of the cup icon, as the current version makes it difficult to identify that the main icon is a cup: !

Yeah, we've looked at that. Two issues though:

  • All indicators for most apps are on the right, and it helps with the visual balance of the icon.
  • Putting it on the left shows the cup handle, but that acts additional visual complexity on a very small icon.

Nice work! @niels9001
Maybe the cup be flipped so that the handle is on the left side and icons are on the right? This might fix the issue.

jaimecbernardo added a commit that referenced this issue Jul 25, 2024
Improves the following:

- Consolidates different code paths for easier maintenance.
- Removes the dependency on Windows Forms and creates the system tray
icon and handling through native Win32 APIs (massive thank you to
@BrianPeek for helping write the window creation logic and diagnosing
threading issues).
- Changing modes in Awake now triggers icon changes in the tray
(#11996). Massive thank you to @niels9001 for creating the icons.

Fixes the following:

- When in the UI and you select `0` as hours and `0` as minutes in
`TIMED` awake mode, the UI becomes non-responsive whenever you try to
get back to timed after it rolls back to `PASSIVE`. (#33630)
- Adds the option to keep track of Awake state through tray tooltip.
(#12714)

---------

Co-authored-by: Clint Rutkas <[email protected]>
Co-authored-by: Jaime Bernardo <[email protected]>
@jaimecbernardo jaimecbernardo added Resolution-Fix Committed Fix is checked in, but it might be 3-4 weeks until a release. and removed Status-In progress This issue or work-item is under development labels Jul 25, 2024
@dend dend closed this as completed Jul 30, 2024
@technobulb
Copy link

Thanks for this @dend! This fix is really a game-changer for me. It makes the whole awake utility feel so much more polished! (Not to mention the usability aspect)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Idea-Enhancement New feature or request on an existing product Product-Awake Issues regarding the PowerToys Awake utility Resolution-Fix Committed Fix is checked in, but it might be 3-4 weeks until a release.
Projects
None yet
Development

No branches or pull requests