Makefile: Added option for app installation
This commit is contained in:
parent
495045ef2a
commit
600680d3ec
27
README.md
27
README.md
|
@ -5,14 +5,14 @@ It can monitor these values:
|
|||
- CPU Temperature
|
||||
- CPU Core (SVI2) Voltage, Current and Power
|
||||
- SOC (SVI2) Voltage, Current and Power
|
||||
- Package and Core Power
|
||||
- Package and Core Power (RAPL)
|
||||
- Core Frequency (from OS)
|
||||
|
||||
![screenshot](screenshot.png)
|
||||
|
||||
## Dependencies
|
||||
- [zenpower driver](https://github.com/ocerman/zenpower/) - For monitoring CPU temperature and SVI2 sensors
|
||||
- MSR driver - For monitoring Package/Core Power
|
||||
- MSR driver - For monitoring Package/Core Power (RAPL)
|
||||
|
||||
Follow [zenpower README.md](https://github.com/ocerman/zenpower/blob/master/README.md) to install and activate zenpower module.
|
||||
Enter `sudo modprobe msr` to enable MSR driver.
|
||||
|
@ -23,9 +23,25 @@ Make sure that GTK3 dev package and common build tools are installed.
|
|||
make
|
||||
```
|
||||
|
||||
## Running
|
||||
## Launching
|
||||
You can launch app by `sudo ./zenmonitor`, or you can install it to your system and then launch it from your OS menu.
|
||||
|
||||
Note: Because superuser privileges are usually needed to access data from MSR driver, you need to launch zenmonitor as root for monitoring CPU power usage (RAPL).
|
||||
|
||||
## Installing
|
||||
By default, Zenmonitor will be installed to /usr/local.
|
||||
```
|
||||
sudo ./zenpower
|
||||
sudo make install
|
||||
```
|
||||
|
||||
To add menu item for launching zenpower as root (Polkit is required):
|
||||
```
|
||||
sudo make install-polkit
|
||||
```
|
||||
|
||||
## Uninstalling
|
||||
```
|
||||
sudo make uninstall
|
||||
```
|
||||
|
||||
## Setup on ubuntu
|
||||
|
@ -39,5 +55,6 @@ cd ~
|
|||
git clone https://github.com/ocerman/zenmonitor
|
||||
cd zenmonitor
|
||||
make
|
||||
sudo ./zenmonitor
|
||||
sudo make install
|
||||
sudo make install-polkit
|
||||
```
|
||||
|
|
18
data/org.pkexec.zenmonitor.policy.in
Normal file
18
data/org.pkexec.zenmonitor.policy.in
Normal file
|
@ -0,0 +1,18 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE policyconfig PUBLIC "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
|
||||
"http://www.freedesktop.org/standards/PolicyKit/1/policyconfig.dtd">
|
||||
<policyconfig>
|
||||
|
||||
<action id="org.pkexec.zenmonitor">
|
||||
<description>Run Zenmonitor as root</description>
|
||||
<message>Authentication is required to run Zenmonitor as root.</message>
|
||||
<defaults>
|
||||
<allow_any>auth_admin</allow_any>
|
||||
<allow_inactive>auth_admin</allow_inactive>
|
||||
<allow_active>auth_admin</allow_active>
|
||||
</defaults>
|
||||
<annotate key="org.freedesktop.policykit.exec.path">@APP_EXEC@</annotate>
|
||||
<annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
|
||||
</action>
|
||||
|
||||
</policyconfig>
|
8
data/zenmonitor-root.desktop.in
Normal file
8
data/zenmonitor-root.desktop.in
Normal file
|
@ -0,0 +1,8 @@
|
|||
[Desktop Entry]
|
||||
Name=Zenmonitor (root)
|
||||
Comment=Monitoring software for AMD Zen-based CPUs
|
||||
Exec=pkexec @APP_EXEC@
|
||||
Type=Application
|
||||
Categories=GTK;System;
|
||||
Terminal=false
|
||||
Keywords=CPU;AMD;zen;system;core;speed;clock;temperature;voltage;
|
8
data/zenmonitor.desktop.in
Normal file
8
data/zenmonitor.desktop.in
Normal file
|
@ -0,0 +1,8 @@
|
|||
[Desktop Entry]
|
||||
Name=Zenmonitor
|
||||
Comment=Monitoring software for AMD Zen-based CPUs
|
||||
Exec=@APP_EXEC@
|
||||
Type=Application
|
||||
Categories=GTK;System;
|
||||
Terminal=false
|
||||
Keywords=CPU;AMD;zen;system;core;speed;clock;temperature;voltage;
|
28
makefile
28
makefile
|
@ -1,5 +1,33 @@
|
|||
ifeq ($(PREFIX),)
|
||||
PREFIX := /usr/local
|
||||
endif
|
||||
|
||||
build:
|
||||
cc -Isrc/include `pkg-config --cflags gtk+-3.0` src/*.c src/ss/*.c -o zenmonitor `pkg-config --libs gtk+-3.0` -lm -no-pie -Wall
|
||||
|
||||
install:
|
||||
mkdir -p $(DESTDIR)$(PREFIX)/bin
|
||||
install -m 755 zenmonitor $(DESTDIR)$(PREFIX)/bin
|
||||
|
||||
mkdir -p $(DESTDIR)$(PREFIX)/share/applications
|
||||
sed -e "s|@APP_EXEC@|${DESTDIR}${PREFIX}/bin/zenmonitor|" \
|
||||
data/zenmonitor.desktop.in > \
|
||||
$(DESTDIR)$(PREFIX)/share/applications/zenmonitor.desktop
|
||||
|
||||
install-polkit:
|
||||
sed -e "s|@APP_EXEC@|${DESTDIR}${PREFIX}/bin/zenmonitor|" \
|
||||
data/zenmonitor-root.desktop.in > \
|
||||
$(DESTDIR)$(PREFIX)/share/applications/zenmonitor-root.desktop
|
||||
|
||||
sed -e "s|@APP_EXEC@|${DESTDIR}${PREFIX}/bin/zenmonitor|" \
|
||||
data/org.pkexec.zenmonitor.policy.in > \
|
||||
$(DESTDIR)/usr/share/polkit-1/actions/org.pkexec.zenmonitor.policy
|
||||
|
||||
uninstall:
|
||||
rm -f $(DESTDIR)$(PREFIX)/bin/zenmonitor
|
||||
rm -f $(DESTDIR)$(PREFIX)/share/applications/zenmonitor.desktop
|
||||
rm -f $(DESTDIR)$(PREFIX)/share/applications/zenmonitor-root.desktop
|
||||
rm -f $(DESTDIR)/usr/share/polkit-1/actions/org.pkexec.zenmonitor.policy
|
||||
|
||||
clean:
|
||||
rm -f zenmonitor
|
||||
|
|
Loading…
Reference in a new issue