Core index is now displayed by default, added command line argument "--core_id" to display core_id instead

Fixed dates in LICENSE file
Version 1.3
This commit is contained in:
Ondrej Čerman 2020-01-23 22:47:52 +01:00
parent f04d8e4dc6
commit a82a28c135
6 changed files with 24 additions and 5 deletions

View file

@ -1,6 +1,6 @@
MIT License
Copyright (c) 2019 Ondrej Čerman
Copyright (c) 2018-2020 Ondrej Čerman
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View file

@ -141,7 +141,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/ocerman/zenmonitor";
const gchar *msg = "<b>Zen Monitor</b> 1.2\n"
const gchar *msg = "<b>Zen Monitor</b> 1.3\n"
"Monitoring software for AMD Zen-based CPUs\n"
"<a href=\"%s\">%s</a>\n\n"
"Created by: Ondrej Čerman";

View file

@ -25,3 +25,4 @@ void sensor_init_free(SensorInit *s);
gboolean check_zen();
gchar *cpu_model();
guint get_core_count();
gboolean display_coreid;

View file

@ -166,7 +166,7 @@ GSList* msr_get_sensors() {
for (i = 0; i < cores; i++) {
data = sensor_init_new();
data->label = g_strdup_printf("Core %d Power", cpu_dev_ids[i].coreid);
data->label = g_strdup_printf("Core %d Power", display_coreid ? cpu_dev_ids[i].coreid: i);
data->value = &(core_power[i]);
data->min = &(core_power_min[i]);
data->max = &(core_power_max[i]);

View file

@ -80,7 +80,7 @@ GSList* os_get_sensors(void) {
for (i = 0; i < cores; i++) {
data = sensor_init_new();
data->label = g_strdup_printf("Core %d Frequency", cpu_dev_ids[i].coreid);
data->label = g_strdup_printf("Core %d Frequency", display_coreid ? cpu_dev_ids[i].coreid: i);
data->value = &(core_freq[i]);
data->min = &(core_freq_min[i]);
data->max = &(core_freq_max[i]);

View file

@ -114,8 +114,26 @@ void sensor_init_free(SensorInit *s) {
}
}
gboolean display_coreid = 0;
static GOptionEntry options[] =
{
{ "coreid", 'c', 0, G_OPTION_ARG_NONE, &display_coreid, "Display core_id instead of core index", NULL },
{ NULL }
};
int main (int argc, char *argv[])
{
gtk_init(&argc, &argv);
GError *error = NULL;
GOptionContext *context;
context = g_option_context_new ("- Zenmonitor display options");
g_option_context_add_main_entries(context, options, NULL);
g_option_context_add_group(context, gtk_get_option_group (TRUE));
if (!g_option_context_parse(context, &argc, &argv, &error)) {
g_print ("option parsing failed: %s\n", error->message);
exit (1);
}
start_gui(sensor_sources);
}