hardwaremon 2.0.0__tar.gz → 2.0.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. hardwaremon-2.0.3/.github/workflows/publish.yml +115 -0
  2. hardwaremon-2.0.3/.github/workflows/python-app.yml +40 -0
  3. hardwaremon-2.0.3/.gitignore +20 -0
  4. hardwaremon-2.0.3/HardwareMon.sh +231 -0
  5. hardwaremon-2.0.3/PKG-INFO +176 -0
  6. hardwaremon-2.0.3/README.md +160 -0
  7. hardwaremon-2.0.3/Windows/HardwareMon.exe +0 -0
  8. hardwaremon-2.0.3/Windows/hardwaremon_win.py +803 -0
  9. hardwaremon-2.0.3/assets/demo.gif +0 -0
  10. hardwaremon-2.0.3/hardwaremon/__init__.py +1 -0
  11. hardwaremon-2.0.0/hardwaremonLINUX/HardwareMon.py → hardwaremon-2.0.3/hardwaremon/hardwaremon.py +140 -239
  12. hardwaremon-2.0.3/hardwaremon/hardwaremon_gui.py +328 -0
  13. hardwaremon-2.0.3/hardwaremon/icons/board.png +0 -0
  14. hardwaremon-2.0.3/hardwaremon/icons/cpu.png +0 -0
  15. hardwaremon-2.0.3/hardwaremon/icons/disk.png +0 -0
  16. hardwaremon-2.0.3/hardwaremon/icons/gpu.png +0 -0
  17. hardwaremon-2.0.3/hardwaremon/icons/os.png +0 -0
  18. hardwaremon-2.0.3/hardwaremon/icons/ram.png +0 -0
  19. hardwaremon-2.0.3/hardwaremon.egg-info/PKG-INFO +176 -0
  20. hardwaremon-2.0.3/hardwaremon.egg-info/SOURCES.txt +28 -0
  21. hardwaremon-2.0.3/hardwaremon.egg-info/entry_points.txt +3 -0
  22. hardwaremon-2.0.3/hardwaremon.egg-info/requires.txt +6 -0
  23. hardwaremon-2.0.3/hardwaremon.egg-info/top_level.txt +1 -0
  24. hardwaremon-2.0.3/nfpm.yaml +27 -0
  25. hardwaremon-2.0.3/pyproject.toml +37 -0
  26. hardwaremon-2.0.3/requirements.txt +5 -0
  27. hardwaremon-2.0.3/test_hardwaremon.py +5 -0
  28. hardwaremon-2.0.0/PKG-INFO +0 -84
  29. hardwaremon-2.0.0/README.md +0 -50
  30. hardwaremon-2.0.0/hardwaremon.egg-info/PKG-INFO +0 -84
  31. hardwaremon-2.0.0/hardwaremon.egg-info/SOURCES.txt +0 -12
  32. hardwaremon-2.0.0/hardwaremon.egg-info/entry_points.txt +0 -2
  33. hardwaremon-2.0.0/hardwaremon.egg-info/requires.txt +0 -2
  34. hardwaremon-2.0.0/hardwaremon.egg-info/top_level.txt +0 -1
  35. hardwaremon-2.0.0/hardwaremonLINUX/__init__.py +0 -0
  36. hardwaremon-2.0.0/pyproject.toml +0 -19
  37. hardwaremon-2.0.0/setup.py +0 -17
  38. {hardwaremon-2.0.0 → hardwaremon-2.0.3}/LICENSE +0 -0
  39. {hardwaremon-2.0.0 → hardwaremon-2.0.3}/hardwaremon.egg-info/dependency_links.txt +0 -0
  40. {hardwaremon-2.0.0 → hardwaremon-2.0.3}/setup.cfg +0 -0
@@ -0,0 +1,115 @@
1
+ name: Build & Publish HardwareMon
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - 'v*.*.*'
7
+
8
+ jobs:
9
+ build-and-publish:
10
+ runs-on: ubuntu-latest
11
+ permissions:
12
+ contents: write
13
+
14
+ steps:
15
+ - name: Checkout code
16
+ uses: actions/checkout@v4
17
+ with:
18
+ fetch-depth: 0
19
+
20
+ - name: Setup Python
21
+ uses: actions/setup-python@v5
22
+ with:
23
+ python-version: "3.11"
24
+
25
+ - name: Install Python tools
26
+ run: |
27
+ python -m pip install --upgrade pip
28
+ pip install build twine setuptools_scm
29
+
30
+ - name: Clean previous builds
31
+ run: |
32
+ rm -rf dist build *.egg-info
33
+
34
+ - name: Build Python package
35
+ run: python -m build
36
+
37
+ - name: Upload to PyPI
38
+ run: python -m twine upload dist/*
39
+ env:
40
+ TWINE_USERNAME: __token__
41
+ TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
42
+
43
+ - name: Set version
44
+ run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
45
+
46
+ - name: Install package into staging
47
+ run: |
48
+ mkdir -p pkg/hardwaremon
49
+ pip install dist/*.whl --target pkg/hardwaremon --no-deps
50
+ rm -rf pkg/hardwaremon/*.dist-info pkg/hardwaremon/*.data
51
+
52
+ # =========================
53
+ # CLI WRAPPERS (NO HEREDOC VERSION)
54
+ # =========================
55
+ - name: Create CLI wrapper
56
+ run: |
57
+ mkdir -p pkg/bin
58
+
59
+ echo '#!/usr/bin/env python3' > pkg/bin/hardwaremon
60
+ echo 'import sys' >> pkg/bin/hardwaremon
61
+ echo "sys.path.insert(0, '/opt/')" >> pkg/bin/hardwaremon
62
+ echo 'from hardwaremon.hardwaremon import main' >> pkg/bin/hardwaremon
63
+ echo 'main()' >> pkg/bin/hardwaremon
64
+
65
+ chmod +x pkg/bin/hardwaremon
66
+
67
+ echo '#!/usr/bin/env python3' > pkg/bin/hardwaremon-gui
68
+ echo 'import sys' >> pkg/bin/hardwaremon-gui
69
+ echo "sys.path.insert(0, '/opt/')" >> pkg/bin/hardwaremon-gui
70
+ echo 'from hardwaremon.hardwaremon_gui import gui' >> pkg/bin/hardwaremon-gui
71
+ echo 'gui()' >> pkg/bin/hardwaremon-gui
72
+
73
+ chmod +x pkg/bin/hardwaremon-gui
74
+
75
+ - name: Install nfpm
76
+ run: |
77
+ echo 'deb [trusted=yes] https://repo.goreleaser.com/apt/ /' | sudo tee /etc/apt/sources.list.d/goreleaser.list
78
+ sudo apt-get update -q
79
+ sudo apt-get install -y nfpm
80
+
81
+ - name: Build Linux packages
82
+ run: |
83
+ nfpm pkg --config nfpm.yaml --target ./hardwaremon.deb
84
+ nfpm pkg --config nfpm.yaml --target ./hardwaremon.rpm
85
+
86
+ echo "📦 Built files:"
87
+ ls -lah *.deb *.rpm
88
+
89
+ - name: Verify artifacts exist
90
+ run: ls -lah
91
+
92
+ # =========================
93
+ # NEXUS UPLOAD (APT)
94
+ # =========================
95
+ - name: Upload DEB to Nexus
96
+ run: |
97
+ curl -v --fail-with-body -u ${{ secrets.NEXUS_USER }}:${{ secrets.NEXUS_PASS }} \
98
+ --upload-file ./hardwaremon.deb \
99
+ ${{ secrets.NEXUS_URL }}/repository/hardwaremon-apt/
100
+
101
+ # =========================
102
+ # NEXUS UPLOAD (YUM)
103
+ # =========================
104
+ - name: Upload RPM to Nexus
105
+ run: |
106
+ curl -v --fail-with-body -u ${{ secrets.NEXUS_USER }}:${{ secrets.NEXUS_PASS }} \
107
+ --upload-file ./hardwaremon.rpm \
108
+ ${{ secrets.NEXUS_URL }}/repository/hardwaremon-yum/
109
+
110
+ - name: Create GitHub Release
111
+ uses: softprops/action-gh-release@v2
112
+ with:
113
+ files: |
114
+ *.deb
115
+ *.rpm
@@ -0,0 +1,40 @@
1
+ name: Lint
2
+
3
+ on:
4
+ push:
5
+ branches: ["**"]
6
+ pull_request:
7
+ branches: ["**"]
8
+
9
+ jobs:
10
+ lint:
11
+ runs-on: ubuntu-latest
12
+
13
+ steps:
14
+ - name: Checkout code
15
+ uses: actions/checkout@v4
16
+
17
+ - name: Set up Python
18
+ uses: actions/setup-python@v5
19
+ with:
20
+ python-version: "3.11"
21
+
22
+ - name: Install dependencies
23
+ run: |
24
+ pip install flake8 pylint
25
+
26
+ - name: Run flake8
27
+ run: |
28
+ flake8 hardwaremon/hardwaremon.py hardwaremon/hardwaremon_gui.py \
29
+ --max-line-length=120 \
30
+ --extend-ignore=E501,W503,F401,F841,F811,E302,E303,E305,E266,W291,W292,W293,E402,E741,E701,E722,E131,E228,E231 \
31
+ --count \
32
+ --statistics
33
+
34
+ - name: Run pylint
35
+ run: |
36
+ pylint hardwaremon/hardwaremon_gui.py hardwaremon/hardwaremon.py \
37
+ --disable=C0114,C0115,C0116 \
38
+ --max-line-length=120 \
39
+ --fail-under=6.0
40
+ continue-on-error: true
@@ -0,0 +1,20 @@
1
+ venv/
2
+ pycache/
3
+ *.pyc
4
+ .env
5
+ .vscode/
6
+ .DS_Store
7
+ Thumbs.db
8
+ build/
9
+ dist/
10
+ *.egg-info/
11
+ *.egg
12
+ __pycache__/
13
+ *.py[cod]
14
+ *$py.class
15
+ Windows/build/
16
+ Windows/dist/
17
+ Windows/*.spec
18
+ Windows/build.bat
19
+ Windows/*.svg
20
+ Windows/*make_icon.py
@@ -0,0 +1,231 @@
1
+ #!/bin/bash
2
+
3
+ VERSION="2.0.0"
4
+
5
+ MODE="summary"
6
+
7
+ # Colors
8
+ RED="\e[31m"
9
+ GREEN="\e[32m"
10
+ CYAN="\e[36m"
11
+ YELLOW="\e[33m"
12
+ RESET="\e[0m"
13
+
14
+ MAX_POINTS=50
15
+
16
+ cpu_history=()
17
+ mem_history=()
18
+ disk_history=()
19
+
20
+ clear_screen() {
21
+ clear
22
+ }
23
+
24
+ cpu_percent() {
25
+
26
+ awk -v RS="" '
27
+ {usage=($2+$4)*100/($2+$4+$5)}
28
+ END {printf "%d", usage}
29
+ ' /proc/stat
30
+
31
+ }
32
+
33
+ mem_percent() {
34
+ free | awk '/Mem:/ {printf "%d", $3/$2 *100}'
35
+ }
36
+
37
+
38
+ disk_percent() {
39
+ df / | awk 'NR==2 {print $5}' | tr -d %
40
+ }
41
+
42
+ bar() {
43
+
44
+ value=$1
45
+ width=50
46
+
47
+ filled=$((value*width/100))
48
+
49
+ printf "["
50
+
51
+ for ((i=0;i<filled;i++))
52
+ do
53
+ printf "#"
54
+ done
55
+
56
+ for ((i=filled;i<width;i++))
57
+ do
58
+ printf " "
59
+ done
60
+
61
+ printf "] %s%%" "$value"
62
+
63
+ }
64
+
65
+ graph() {
66
+
67
+ arr=("$@")
68
+
69
+ for v in "${arr[@]}"
70
+ do
71
+
72
+ height=$((v/5))
73
+
74
+ printf "%2s|" "$v"
75
+
76
+ for ((i=0;i<height;i++))
77
+ do
78
+ printf "#"
79
+ done
80
+
81
+ echo
82
+
83
+ done
84
+
85
+ }
86
+
87
+ add_history() {
88
+
89
+ cpu_history+=($(cpu_percent))
90
+ mem_history+=($(mem_percent))
91
+ disk_history+=($(disk_percent))
92
+
93
+ if [ ${#cpu_history[@]} -gt $MAX_POINTS ]
94
+ then
95
+
96
+ cpu_history=("${cpu_history[@]:1}")
97
+ mem_history=("${mem_history[@]:1}")
98
+ disk_history=("${disk_history[@]:1}")
99
+
100
+ fi
101
+
102
+ }
103
+
104
+ alerts() {
105
+
106
+ cpu=$(cpu_percent)
107
+ mem=$(mem_percent)
108
+
109
+ if ((cpu>90))
110
+ then
111
+ echo -e "${RED}CPU HIGH${RESET}"
112
+ fi
113
+
114
+ if ((mem>90))
115
+ then
116
+ echo -e "${RED}MEMORY HIGH${RESET}"
117
+ fi
118
+
119
+ }
120
+
121
+ summary() {
122
+
123
+ cpu=$(cpu_percent)
124
+ mem=$(mem_percent)
125
+ disk=$(disk_percent)
126
+
127
+ echo -e "${CYAN}=== SYSTEM SUMMARY ===${RESET}"
128
+
129
+ printf "CPU "
130
+ bar $cpu
131
+ echo
132
+
133
+ printf "MEM "
134
+ bar $mem
135
+ echo
136
+
137
+ printf "DISK "
138
+ bar $disk
139
+ echo
140
+
141
+ echo
142
+
143
+ alerts
144
+
145
+ }
146
+
147
+ full() {
148
+
149
+ summary
150
+
151
+ echo
152
+
153
+ echo -e "${CYAN}=== CPU GRAPH ===${RESET}"
154
+
155
+ graph "${cpu_history[@]}"
156
+
157
+ echo
158
+
159
+ echo -e "${CYAN}=== MEMORY GRAPH ===${RESET}"
160
+
161
+ graph "${mem_history[@]}"
162
+
163
+ echo
164
+
165
+ echo -e "${CYAN}=== DISK GRAPH ===${RESET}"
166
+
167
+ graph "${disk_history[@]}"
168
+
169
+ echo
170
+
171
+ echo -e "${CYELLOW}Top Processes${RESET}"
172
+
173
+ ps -eo comm,%cpu,%mem \
174
+ --sort=-%cpu | head -6
175
+
176
+ echo
177
+
178
+ echo -e "${CYAN}Temperatures${RESET}"
179
+
180
+ sensors 2>/dev/null | grep Core
181
+
182
+ echo
183
+
184
+ echo -e "${CYAN}GPU${RESET}"
185
+
186
+ lspci | grep -Ei "VGA|3D"
187
+
188
+ }
189
+
190
+ while true
191
+ do
192
+
193
+ clear_screen
194
+
195
+ add_history
196
+
197
+ if [ "$MODE" = "summary" ]
198
+ then
199
+ summary
200
+ else
201
+ full
202
+ fi
203
+
204
+ echo
205
+
206
+ echo "HardwareMon Lite v$VERSION"
207
+
208
+ echo "Press:"
209
+ echo "s = summary"
210
+ echo "f = full"
211
+ echo "q = quit"
212
+
213
+ read -t 1 -n 1 key
214
+
215
+ case "$key" in
216
+
217
+ s)
218
+ MODE="summary"
219
+ ;;
220
+
221
+ f)
222
+ MODE="full"
223
+ ;;
224
+
225
+ q)
226
+ exit
227
+ ;;
228
+
229
+ esac
230
+
231
+ done
@@ -0,0 +1,176 @@
1
+ Metadata-Version: 2.4
2
+ Name: hardwaremon
3
+ Version: 2.0.3
4
+ Summary: Hardware monitoring tool for Linux
5
+ Author: Louis
6
+ Requires-Python: >=3.8
7
+ Description-Content-Type: text/markdown
8
+ License-File: LICENSE
9
+ Requires-Dist: psutil
10
+ Requires-Dist: requests
11
+ Requires-Dist: Pillow
12
+ Requires-Dist: gputil
13
+ Requires-Dist: pyinstaller
14
+ Requires-Dist: customtkinter
15
+ Dynamic: license-file
16
+
17
+ # HardwareMon #
18
+ ![HardwareMon Demo](assets/demo.gif)
19
+ (Windows GUI)
20
+
21
+
22
+ HardwareMon is a lightweight system monitoring tool designed to provide a detailed overview of your computer's hardware and performance metrics. It can display CPU, memory, disk, GPU, battery, network, and peripheral information in real time. The project includes a Python GUI version for Linux and a modern Windows GUI application.
23
+
24
+ ## Features
25
+
26
+ HardwareMon gathers and presents information such as CPU usage, memory usage, disk activity, top running processes, GPU specifications and temperatures, battery status, and peripheral details. On Linux, the Python version uses the psutil library and native system commands to extract detailed system information. On Windows, both the new Python GUI and the PowerShell version leverage CIM/WMI queries to report similar statistics.
27
+
28
+ The Linux version includes a GUI mode built with Tkinter, offering a modern and configurable interface with light, dark, and hacker-style themes. To cycle themes, press F2. Graphs for CPU, memory, and disk usage are updated in real time, providing a quick visual snapshot of system performance.
29
+
30
+ The Windows GUI version is built with CustomTkinter and features a Windows 11 Fluent Design-inspired interface with animated arc gauges, live sparkline graphs, per-core CPU bars, a real-time process table, and a full system information page.
31
+
32
+ ---
33
+
34
+ ## Windows (Python GUI — Recommended)
35
+
36
+ The new Windows GUI is a modern, standalone application built with Python and CustomTkinter. It includes six pages which may change: Overview, CPU, Memory, Disk, Network, and System.
37
+
38
+ Just download the .exe from this repo.
39
+
40
+ That's literally it.
41
+
42
+
43
+ ### Notes
44
+
45
+ - Run as Administrator for complete process visibility.
46
+ - The `.exe` is fully self-contained — no Python required on the target machine.
47
+ - Tested on Windows 10 and Windows 11.
48
+
49
+ ---
50
+
51
+ ## Installation (Linux version)
52
+
53
+ ### Using Git
54
+
55
+ Ensure Python 3 and the psutil library are installed, then clone the repository and run:
56
+
57
+ ```
58
+ python3 hardware_mon.py
59
+ ```
60
+
61
+ ### Using Pip (Easier, Quicker)
62
+
63
+ Ubuntu/Debian:
64
+
65
+ ```
66
+ sudo apt update
67
+ sudo apt install python3-pip python3-tk pipx
68
+ pip3 --version
69
+ ```
70
+
71
+ RHEL/Fedora:
72
+
73
+ ```
74
+ sudo dnf install python3-pip pipx python3-tk
75
+ pip3 --version
76
+ ```
77
+
78
+ Arch Linux:
79
+
80
+ ```
81
+ sudo pacman -S python-pip pipx python3-tk
82
+ pip --version
83
+ ```
84
+
85
+ Then install HardwareMon:
86
+
87
+ ```
88
+ pip install hardwaremon
89
+ ```
90
+
91
+ ### Fixing the "Externally Managed Environment" Error
92
+
93
+ On Ubuntu and Debian-based systems you may see `error: externally-managed-environment`. The recommended fix is pipx:
94
+
95
+ ```
96
+ sudo apt install pipx
97
+ pipx ensurepath
98
+ source ~/.bashrc
99
+ pipx install hardwaremon
100
+ ```
101
+
102
+ Run with either:
103
+
104
+ ```
105
+ hardwaremon
106
+ hardwaremon_cli
107
+ ```
108
+
109
+ **Option 2 — Virtual environment:**
110
+
111
+ ```
112
+ python3 -m venv hardwaremon-env
113
+ source hardwaremon-env/bin/activate
114
+ pip install hardwaremon
115
+ ```
116
+
117
+ **Option 3 — Force install (not recommended):**
118
+
119
+ ```
120
+ pip install hardwaremon --break-system-packages
121
+ ```
122
+
123
+ ## Updating
124
+
125
+ To update hardwaremon on Linux, just use this command:
126
+
127
+ ```
128
+ pipx upgrade hardwaremon
129
+ ```
130
+
131
+ ---
132
+
133
+ ## GUI vs CLI Versions (Linux)
134
+
135
+ HardwareMon on Linux comes in two flavours. The GUI version separates hardware data into separate pages with clickable icons, while the CLI version displays everything in the terminal.
136
+
137
+ ```
138
+ hardwaremon # GUI version
139
+ hardwaremon_cli # CLI version
140
+ ```
141
+
142
+ The GUI version receives the majority of active development, hoping to enhance its functionality.
143
+
144
+ ---
145
+
146
+ ## Q&A
147
+
148
+ **What platforms is HardwareMon available for?**
149
+ Windows and Linux. Linux versions receive more frequent updates. Windows now has a fully featured Python GUI.
150
+
151
+ **What is the difference between hardwaremon and hardwaremon_cli on Linux?**
152
+ `hardwaremon` is the GUI version for Linux with separate pages and clickable icons. `hardwaremon_cli` is the original terminal-based version, with much deeper insight into hardware compared to the GUI version. (this will change, it's quite bare-bones at the moment.)
153
+
154
+ **Which version should I use?**
155
+ On Linux, use `hardwaremon_cli` for the best experience and advanced performance metrics. If you want a "cleaner" version for Linux that receives more development than the GUI version of HardwareMon Linux, use `hardwaremon`. On Windows, use the GUI `.exe` for a modern, feature-rich interface.
156
+
157
+ **What do the YAML workflows do?**
158
+ One workflow lints the scripts for errors, and the other packages the GUI and CLI versions into a pip package for Linux. Both workflows only operate on the Linux versions.
159
+
160
+ **Can I contribute?**
161
+ Absolutely! Feel free to fork the repo and submit pull requests or report issues on the issue tracker.
162
+
163
+ ---
164
+
165
+ ## Notes
166
+
167
+
168
+ The `.sh` script is more basic than the `.py` script on Linux, as it cannot use Tkinter for graph drawing.
169
+
170
+ The GitHub Actions workflows only run on the Linux versions.
171
+
172
+ I have packaged each version into their own folder, so you don't get confused and run the wrong script for your OS.
173
+
174
+ ---
175
+
176
+ Made with ❤️ by Louis