Skip to content

TNTaddicted/hwmonitorserver

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenHardwareMonitorJsonServer (AppTracker Backend)

A Windows tray application for tracking time spent in user-selected applications, with global hotkey support, notifications, a settings GUI, and JSON server for hardware stats.

Features

  • Tray icon with right-click menu
  • Register a global hotkey (default: Win+Shift+L) to add the current app to the tracked list
  • Prompt for a custom name when adding an app
  • Tracks time spent in each app (even if not focused)
  • Notifications when apps are added
  • Settings window to view/remove tracked apps and edit the hotkey
  • Data is saved in trackedapps.json
  • Serves hardware stats and tracked app info via JSON (for frontend dashboard)

Requirements

Dependencies

Install these via NuGet Package Manager or with the CLI:

dotnet add package NHotkey.WindowsForms
dotnet add package System.Text.Json
dotnet add package Microsoft.VisualBasic

Build Instructions

Using Visual Studio

  1. Open OpenHardwareMonitorJsonServer.sln in Visual Studio.
  2. Restore NuGet packages (right-click solution > Restore NuGet Packages).
  3. Build the solution (Ctrl+Shift+B).
  4. Run the project (F5 or Ctrl+F5).

Using .NET CLI

  1. Open a terminal in the openhardwaremonitor-json-server/OpenHardwareMonitorJsonServer/ directory.
  2. Run:
    dotnet restore
    dotnet build
    dotnet run
    

Usage

  • The tray icon will appear in the system tray.
  • Press Win+Shift+L to add the currently active app to the tracked list. You will be prompted for a name (leave blank to use the window title).
  • Right-click the tray icon and select Settings to view or remove tracked apps.
  • Tracked time is saved automatically in trackedapps.json in the app's working directory.

Changing the PC IP for the Frontend

  • The frontend dashboard (hwmonitor/index.html) uses an IP address to connect to the backend for hardware stats and app info.
  • To change the PC IP:
    1. Open hwmonitor/index.html in a text editor.
    2. Find the line with the iframe or JavaScript URL, e.g.:
      <iframe id="pc-stats-iframe" src="http://YOUR_PC_IP:8885/dashboard.html"></iframe>
    3. Replace YOUR_PC_IP with the local IP address of the PC running this backend.
    4. Save the file and reload it in your browser.

Customization

  • Change the default hotkey: Edit the registration in TrayApp.cs.
  • Add more tracked app features: Extend TrackedAppsManager.cs and TrackedApp.cs.
  • Change notification behavior: Edit TrayApp.cs notification logic.
  • Change JSON server port or endpoints: Update the backend code to serve on a different port or with different data.

Troubleshooting

  • If you get errors about duplicate class or namespace definitions, make sure you have deleted any old versions of the files from your project.
  • If the hotkey does not work, ensure no other app is using the same hotkey combination.
  • If you see errors about missing dependencies, double-check that all NuGet packages are installed.
  • If the frontend dashboard does not update, make sure the backend is running and the IP/port are correct in the HTML.

License

MIT

About

OpenHardwareMonitor standalone JSON server

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%