Show All Projects
I use amBX Gaming Lights and while I like them, there are some rough edges.  If my computer would go to sleep, the driver/services wouldn't work correctly unless they were restarted.  And applications like amBX Illuminate would hang as a result, so that needed to be restarted too.

So I wrote a batch script to do this.  Then I used a scheduled task to check the event log for the Power event that meant the system was waking up.  The batch scripts need to run as Administrator, but scheduled tasks have an option for this.  Cool, now the lights work properly after the computer wakes.

But then I decided I wanted shortcut keys to manually stop and start the lights.  So I bound the batch scripts to the extra keys on my Logitech G710+ Mechanical Gaming Keyboard.  But the batch script needs to run as Administrator and there wasn't a built-in way to do that with the keyboard configuration, so I had to find ways to make that happen.  Now the scripts auto elevate which is seemless if UAC is off.  With UAC on this will trigger a prompt, but at least it will work.

Then there was the minor problem that killing Illuminate would leave orphaned icons in the system tray.  This too could be solved with a bit of work.

Included is:

  • A script to (re)start the amBX services and amBX Illuminate

  • A script to kill amBX Illuminate

  • RefreshNotificationArea, which is called from the scripts to clear orphan icons in the system tray after killing processes

  • XML export of a scheduled task to run the restart script when the system wakes from sleep.

  • XML export of a keyboard profile for Logitech's Gaming Software, which binds G1 to (re)start the lights, and G2 to turn them off.


The scheduled task and keyboard profile assume the scripts are in C:\Apps\amBX.  Be sure to update the path if needed.

Though the scripts are stopping and starting amBX Illuminate, the same principle should apply if the scripts are changed to reference an alternative program like Aurora Synesthesia or glOW.


RefreshNotificationArea requires Microsoft Visual C++ 2013 Redistributable

Timeline

Files

  BENCHMARKS  
Loading Time: Base Classes  0.0203
Controller Execution Time ( Project / Id )  0.0520
Total Execution Time  0.0739
  GET DATA  
No GET data exists
  MEMORY USAGE  
1,062,472 bytes
  POST DATA  
No POST data exists
  URI STRING  
project/id/89/amBX_Usability_Enhancements
  CLASS/METHOD  
project/id
  DATABASE:  smkprojects (Project:$db)   QUERIES: 5 (0.0040 seconds)  (Hide)
0.0005   SELECT *
FROM `ProjectResources`
WHERE `ProjectID` = '89' 
0.0005   SELECT *
FROM `Projects`
WHERE `ProjectID` = '89' 
0.0004   SELECT *
FROM `ProjectTags`
WHERE `ProjectID` = '89' 
0.0014   SELECT TagCOUNT(1) AS cnt
FROM 
`ProjectTags`
WHERE `Tag` != 'Private'
GROUP BY `Tag`
HAVING COUNT(1) >
0.0012   SELECT TagCOUNT(1) AS cnt
FROM 
`ProjectTags`
WHERE `Tag` != 'Private'
GROUP BY `Tag`
HAVING COUNT(1) > 
  HTTP HEADERS  (Show)
  CONFIG VARIABLES  (Show)