Compare commits

...

11 commits

Author SHA1 Message Date
Erkin Alp Güney
a09f0b25d3
Zenmonitor3 about dialog patch for forgejo 2023-05-21 12:44:12 -04:00
2e68a31b02
Merge pull request #12 from h3o66/fedora-copr
Add Fedora copr repo
2022-02-26 17:01:47 -06:00
Christian
37b7ee09eb
Add Fedora copr repo 2022-02-26 23:24:47 +01:00
f4bcdf7d76
Merge pull request #11 from h3o66/rpmbuild-path-fix
Remove DESTDIR in makefile from sed
2022-02-26 15:48:37 -06:00
Christian
24a265cb8e
Remove DESTDIR in makefile from sed
Fix to only add the realpath in the build, to be able to use the makefile in a rpmbuild.
2022-02-26 21:17:15 +01:00
e810cd0e20
Add an icon to the .desktop files 2022-02-09 16:53:38 -06:00
946f5edaa3
Bump version to 2.0.0 2022-02-09 11:50:13 -06:00
8ebd28113c
Merge pull request #8 from tahsinkose/conky-support
Provide two new modalities for CLI
2021-11-30 18:55:07 +00:00
Tahsincan Köse
ef2c1793d9
Refresh in place capability. 2021-11-30 20:48:39 +03:00
Tahsincan Köse
48bf54c46c
Separate CLI uninstall rule. 2021-11-30 20:48:34 +03:00
Tahsincan Köse
b847e69abb
Provide stimuli output capability. 2021-11-30 20:48:27 +03:00
7 changed files with 48 additions and 13 deletions

View file

@ -55,7 +55,7 @@ Then:
```sh
sudo modprobe msr
sudo bash -c 'echo "msr" > /etc/modules-load.d/msr.conf'
sudo apt install build-essential libgtk-3-dev git
sudo apt install build-essential libgtk-3-dev libncurses5-dev git
cd ~
git clone https://github.com/Ta180m/zenmonitor3
cd zenmonitor3
@ -66,3 +66,6 @@ sudo make install-polkit
## Setup on Arch
You may use the AUR package [zenmonitor3-git](https://aur.archlinux.org/packages/zenmonitor3-git/) to install via [traditional method](https://wiki.archlinux.org/index.php/Arch_User_Repository) or using an AUR helper.
## Installation for Fedora 35+
You can install it from the [copr package repo](https://copr.fedorainfracloud.org/coprs/birkch/zenpower3/)

View file

@ -2,6 +2,7 @@
Name=Zenmonitor (root)
Comment=Monitoring software for AMD Zen-based CPUs
Exec=pkexec @APP_EXEC@
Icon=utilities-system-monitor
Type=Application
Categories=GTK;System;
Terminal=false

View file

@ -2,6 +2,7 @@
Name=Zenmonitor
Comment=Monitoring software for AMD Zen-based CPUs
Exec=@APP_EXEC@
Icon=utilities-system-monitor
Type=Application
Categories=GTK;System;
Terminal=false

View file

@ -22,14 +22,14 @@ build:
$(CC) -Isrc/include `pkg-config --cflags gtk+-3.0` $(BUILD_FILES_GUI) -o zenmonitor `pkg-config --libs gtk+-3.0` -lm -no-pie -Wall $(CFLAGS)
build-cli:
$(CC) -Isrc/include `pkg-config --cflags glib-2.0` $(BUILD_FILES_CLI) -o zenmonitor-cli `pkg-config --libs glib-2.0` -lm -no-pie -Wall $(CFLAGS)
$(CC) -Isrc/include `pkg-config --cflags glib-2.0` $(BUILD_FILES_CLI) -o zenmonitor-cli `pkg-config --libs glib-2.0` -lm -lncurses -no-pie -Wall $(CFLAGS)
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|" \
sed -e "s|@APP_EXEC@|${PREFIX}/bin/zenmonitor|" \
data/zenmonitor.desktop.in > \
$(DESTDIR)$(PREFIX)/share/applications/zenmonitor.desktop
@ -38,11 +38,11 @@ install-cli:
install -m 755 zenmonitor-cli $(DESTDIR)$(PREFIX)/bin
install-polkit:
sed -e "s|@APP_EXEC@|${DESTDIR}${PREFIX}/bin/zenmonitor|" \
sed -e "s|@APP_EXEC@|${PREFIX}/bin/zenmonitor|" \
data/zenmonitor-root.desktop.in > \
$(DESTDIR)$(PREFIX)/share/applications/zenmonitor-root.desktop
sed -e "s|@APP_EXEC@|${DESTDIR}${PREFIX}/bin/zenmonitor|" \
sed -e "s|@APP_EXEC@|${PREFIX}/bin/zenmonitor|" \
data/org.pkexec.zenmonitor.policy.in > \
$(DESTDIR)/usr/share/polkit-1/actions/org.pkexec.zenmonitor.policy
@ -52,6 +52,9 @@ uninstall:
rm -f $(DESTDIR)$(PREFIX)/share/applications/zenmonitor-root.desktop
rm -f $(DESTDIR)/usr/share/polkit-1/actions/org.pkexec.zenmonitor.policy
uninstall-cli:
rm -f $(DESTDIR)$(PREFIX)/bin/zenmonitor-cli
all: build build-cli
clean:

View file

@ -144,7 +144,7 @@ static void add_columns (GtkTreeView *treeview) {
static void about_btn_clicked(GtkButton *button, gpointer user_data) {
GtkWidget *dialog;
const gchar *website = "https://github.com/Ta180m/zenmonitor3";
const gchar *website = "https://git.exozy.me/a/zenmonitor3";
const gchar *msg = "<b>Zenmonitor3</b> %s\n"
"Zenmonitor3 is monitoring software for AMD Zen-based CPUs, now with Zen 3 support!\n"
"<a href=\"%s\">%s</a>\n\n"

View file

@ -5,7 +5,7 @@
#include <glib.h>
#define ERROR_VALUE -999.0
#define VERSION "1.4.2"
#define VERSION "2.0.0"
typedef struct
{

View file

@ -4,6 +4,7 @@
#include <time.h>
#include <unistd.h>
#include <signal.h>
#include <ncurses.h>
#include "msr.h"
#include "os.h"
#include "zenpower.h"
@ -14,6 +15,8 @@ gdouble delay = 0.5;
gchar *file = "";
SensorDataStore *store;
int quit = 0;
int refresh_in_place = 0;
int output_once = 0;
static GOptionEntry options[] = {
{"file", 'f', G_OPTION_FLAG_NONE, G_OPTION_ARG_STRING, &file,
@ -22,6 +25,10 @@ static GOptionEntry options[] = {
"Interval of refreshing informations", "SECONDS"},
{"coreid", 'c', 0, G_OPTION_ARG_NONE, &display_coreid,
"Display core_id instead of core index", NULL},
{"refresh-in-place", 'r', 0, G_OPTION_ARG_NONE, &refresh_in_place,
"Whether to flush stdout block in-place.", NULL},
{"output-once", 'o', 0, G_OPTION_ARG_NONE, &output_once,
"Output CPU information once and quit", NULL},
{NULL}};
static SensorSource sensor_sources[] = {
@ -138,7 +145,7 @@ void update_data()
const SensorInit *sensorData;
sensor_data_store_keep_time(store);
int i = 1; //ncurses uses 1-based indexing.
for(source = sensor_sources; source->drv; source++)
{
if(source->enabled)
@ -148,11 +155,19 @@ void update_data()
{
node = source->sensors;
while(node)
while (node)
{
sensorData = (SensorInit*)node->data;
sensorData = (SensorInit *)node->data;
sensor_data_store_add_data(store, sensorData->label, *sensorData->value);
printf("%s\t%f\n", sensorData->label, *sensorData->value);
if (refresh_in_place)
{
mvprintw(i++, 0, "%s\t%f", sensorData->label, *sensorData->value);
refresh();
}
else
{
printf("%s\t%f\n", sensorData->label, *sensorData->value);
}
node = node->next;
}
}
@ -164,8 +179,12 @@ void update_data()
void start_watching()
{
while(!quit)
{
{
update_data();
if (output_once)
{
break;
}
usleep(delay * 1000 * 1000);
}
}
@ -189,8 +208,16 @@ int main(int argc, char *argv[])
store = sensor_data_store_new();
init_sensors();
if (refresh_in_place)
{
initscr();
curs_set(0);
}
start_watching();
if (refresh_in_place)
{
endwin();
}
sensor_data_store_free(store);
return EXIT_SUCCESS;