Skip to content
This repository has been archived by the owner on Nov 5, 2023. It is now read-only.

Commit

Permalink
Minor improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
hakandundar34coding committed Apr 10, 2022
1 parent a730ac3 commit 93669fa
Show file tree
Hide file tree
Showing 119 changed files with 181 additions and 120 deletions.
Empty file modified .gitignore
100644 → 100755
Empty file.
1 change: 1 addition & 0 deletions Changes.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# System Monitoring Center

### v1.10.2
* v1.10.0, v1.10.1 are not published (fixes for packaging, etc.)
* Improved: Getting ARM CPU model names
* Improved: Device vendor-model detection
* Fix: Detect window manager of GNOME DE
Expand Down
Empty file modified MANIFEST.in
100644 → 100755
Empty file.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ GTK3 and Python 3 based, system performance and usage monitoring tool.
<p align="center">
<a href="https://github.com/hakandundar34coding/system-monitoring-center/tags"><img alt="Platform (GNU/Linux)" src="https://img.shields.io/badge/platform-GNU/Linux-blue.svg"/></a>
<a href="https://github.com/hakandundar34coding/system-monitoring-center/tags"><img alt="GitHub tag (latest by date)" src="https://img.shields.io/github/v/tag/hakandundar34coding/system-monitoring-center"></a>
<a href="https://github.com/hakandundar34coding/system-monitoring-center/tags"><img alt="PyPI - Downloads" src="https://img.shields.io/pypi/dm/system-monitoring-center"></a>
<a href="https://github.com/hakandundar34coding/system-monitoring-center/tags"><img alt="Download System Monitoring Center" src="https://img.shields.io/sourceforge/dt/system-monitoring-center.svg" ></a>
<a href="https://github.com/hakandundar34coding/system-monitoring-center/tags"><img alt="GitHub all releases" src="https://img.shields.io/github/downloads/hakandundar34coding/system-monitoring-center/total"></a>
<a href="https://pypi.org/project/system-monitoring-center/"><img src="https://img.shields.io/badge/Visit-PyPI%20Page-b37840"/></a>
Expand Down
Empty file modified database/arm.ids
100644 → 100755
Empty file.
Empty file modified database/database_license.txt
100644 → 100755
Empty file.
Empty file modified database/sdcard.ids
100644 → 100755
Empty file.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified icons/hicolor/scalable/apps/system-monitoring-center.svg
100644 → 100755
Empty file modified locale/cs/system-monitoring-center.mo
100644 → 100755
Empty file.
Empty file modified locale/cs/system-monitoring-center.po
100644 → 100755
Empty file.
Empty file modified locale/pl/system-monitoring-center.mo
100644 → 100755
Empty file.
Empty file modified locale/pl/system-monitoring-center.po
100644 → 100755
Empty file.
Empty file modified locale/pt_BR/system-monitoring-center.mo
100644 → 100755
Empty file.
Empty file modified locale/pt_BR/system-monitoring-center.po
100644 → 100755
Empty file.
Empty file modified locale/tr/system-monitoring-center.mo
100644 → 100755
Empty file.
Empty file modified locale/tr/system-monitoring-center.po
100644 → 100755
Empty file.
Empty file modified pyproject.toml
100644 → 100755
Empty file.
Empty file modified screenshots/cpu_tab_dark_system_theme.png
100644 → 100755
Empty file modified screenshots/cpu_tab_per_core_dark_system_theme.png
100644 → 100755
Empty file modified screenshots/cpu_tab_white_system_theme.png
100644 → 100755
Empty file modified screenshots/gpu_tab_dark_system_theme.png
100644 → 100755
Empty file modified screenshots/network_tab_dark_system_theme.png
100644 → 100755
Empty file modified screenshots/processes_list_view_dark_system_theme.png
100644 → 100755
Empty file modified screenshots/sensors_tab_dark_system_theme.png
100644 → 100755
Empty file modified screenshots/services_tab_dark_system_theme.png
100644 → 100755
Empty file modified screenshots/startup_tab_dark_system_theme.png
100644 → 100755
Empty file modified screenshots/system_tab_dark_system_theme.png
100644 → 100755
95 changes: 60 additions & 35 deletions src/Disk.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from gi.repository import Gtk
import os
import subprocess
import cairo

from locale import gettext as _tr

Expand Down Expand Up @@ -69,43 +70,46 @@ def on_eventbox1301_button_click_event(self, widget, event):
# ----------------------- Called for drawing Disk read/write speed as line chart -----------------------
def on_drawingarea1301_draw(self, widget, ctx):

# Get chart data history.
chart_data_history = Config.chart_data_history
chart_x_axis = list(range(0, chart_data_history))

# Get performance data to be drawn.
disk_read_speed = Performance.disk_read_speed[Performance.selected_disk_number]
disk_write_speed = Performance.disk_write_speed[Performance.selected_disk_number]

# Get chart colors.
chart_line_color = Config.chart_line_color_disk_speed_usage
chart_background_color = Config.chart_background_color_all_charts

chart1301_width = Gtk.Widget.get_allocated_width(widget)
chart1301_height = Gtk.Widget.get_allocated_height(widget)
# Get drawingarea size. Therefore chart width and height is updated dynamically by using these values when window size is changed by user.
chart_width = Gtk.Widget.get_allocated_width(widget)
chart_height = Gtk.Widget.get_allocated_height(widget)

# Draw and fill chart background.
ctx.set_source_rgba(chart_background_color[0], chart_background_color[1], chart_background_color[2], chart_background_color[3])
ctx.rectangle(0, 0, chart1301_width, chart1301_height)
ctx.rectangle(0, 0, chart_width, chart_height)
ctx.fill()

# Draw horizontal and vertical gridlines.
ctx.set_line_width(1)
ctx.set_source_rgba(chart_line_color[0], chart_line_color[1], chart_line_color[2], 0.25 * chart_line_color[3])
for i in range(3):
ctx.move_to(0, chart1301_height/4*(i+1))
ctx.line_to(chart1301_width, chart1301_height/4*(i+1))
ctx.move_to(0, chart_height/4*(i+1))
ctx.rel_line_to(chart_width, 0)
for i in range(4):
ctx.move_to(chart1301_width/5*(i+1), 0)
ctx.line_to(chart1301_width/5*(i+1), chart1301_height)
ctx.move_to(chart_width/5*(i+1), 0)
ctx.rel_line_to(0, chart_height)
ctx.stroke()

# Maximum performance data value is multiplied by 1.1 in order to scale chart when performance data is increased or decreased for preventing the line being out of the chart border.
chart1301_y_limit = 1.1 * ((max(max(disk_read_speed), max(disk_write_speed))) + 0.0000001)
if Config.plot_disk_read_speed == 1 and Config.plot_disk_write_speed == 0:
chart1301_y_limit = 1.1 * (max(disk_read_speed) + 0.0000001)
if Config.plot_disk_read_speed == 0 and Config.plot_disk_write_speed == 1:
chart1301_y_limit = 1.1 * (max(disk_write_speed) + 0.0000001)

# ---------- Start - This block of code is used in order to show maximum value of the chart as multiples of 1, 10, 100. ----------
# Chart maximum value is shown as multiples of 1, 10, 100 (For example, 1, 2, 3, ..., 10, 20, 30, ..., 100, 200, 300, ...) in order to simplify the value and avoid misunderstandings of performance data and chart maximum values.
# Chart maximum value is get as calculated value (instead of Bytes) and number of digits is calculated by using integer part of this value.
# Next multiple value is calculated, data unit is appended as string and value is shown on a label.
# "chart1301_y_limit" value is updated by using new (multiple) value.
data_unit_for_chart_y_limit = 0
if Config.performance_disk_speed_data_unit >= 8:
data_unit_for_chart_y_limit = 8
Expand All @@ -126,38 +130,59 @@ def on_drawingarea1301_draw(self, widget, ctx):
chart1301_y_limit = (chart1301_y_limit * next_multiple / (chart1301_y_limit_float + 0.0000001) + 0.0000001)
# ---------- End - This block of code is used in order to show maximum value of the chart as multiples of 1, 10, 100. ----------

# Draw outer border of the chart.
ctx.set_source_rgba(chart_line_color[0], chart_line_color[1], chart_line_color[2], chart_line_color[3])
ctx.rectangle(0, 0, chart1301_width, chart1301_height)
ctx.rectangle(0, 0, chart_width, chart_height)
ctx.stroke()

if Config.plot_disk_read_speed == 1:
ctx.move_to(chart1301_width*chart_x_axis[0]/(chart_data_history-1), chart1301_height - chart1301_height*disk_read_speed[0]/chart1301_y_limit)
for i in range(len(chart_x_axis) - 1):
delta_x_chart1301a = (chart1301_width * chart_x_axis[i+1]/(chart_data_history-1)) - (chart1301_width * chart_x_axis[i]/(chart_data_history-1))
delta_y_chart1301a = (chart1301_height*disk_read_speed[i+1]/chart1301_y_limit) - (chart1301_height*disk_read_speed[i]/chart1301_y_limit)
ctx.rel_line_to(delta_x_chart1301a, -delta_y_chart1301a)

ctx.rel_line_to(10, 0)
ctx.rel_line_to(0, chart1301_height+10)
ctx.rel_line_to(-(chart1301_width+20), 0)
ctx.rel_line_to(0, -(chart1301_height+10))

# Draw performance data.
ctx.move_to(0, chart_height)
ctx.rel_move_to(0, -chart_height*disk_read_speed[0]/chart1301_y_limit)
for i in range(chart_data_history - 1):
delta_x = (chart_width * chart_x_axis[i+1]/(chart_data_history-1)) - (chart_width * chart_x_axis[i]/(chart_data_history-1))
delta_y = (chart_height*disk_read_speed[i+1]/chart1301_y_limit) - (chart_height*disk_read_speed[i]/chart1301_y_limit)
ctx.rel_line_to(delta_x, -delta_y)

# Change line color before drawing lines for closing the drawn line in order to revent drawing bolder lines due to overlapping.
ctx.stroke_preserve()
ctx.set_source_rgba(0, 0, 0, 0)

# Close the drawn line to fill inside area of it.
ctx.rel_line_to(0, chart_height*disk_read_speed[-1]/chart1301_y_limit)
ctx.rel_line_to(-(chart_width), 0)
ctx.close_path()
ctx.stroke()

# Fill the closed area.
ctx.stroke_preserve()
gradient_pattern = cairo.LinearGradient(0, 0, 0, chart_height)
gradient_pattern.add_color_stop_rgba(0, chart_line_color[0], chart_line_color[1], chart_line_color[2], 0.55 * chart_line_color[3])
gradient_pattern.add_color_stop_rgba(1, chart_line_color[0], chart_line_color[1], chart_line_color[2], 0.10 * chart_line_color[3])
ctx.set_source(gradient_pattern)
ctx.fill()

if Config.plot_disk_write_speed == 1:
ctx.set_dash([3, 3])
ctx.move_to(chart1301_width*chart_x_axis[0]/(chart_data_history-1), chart1301_height - chart1301_height*disk_write_speed[0]/chart1301_y_limit)
for i in range(len(chart_x_axis) - 1):
delta_x_chart1301b = (chart1301_width * chart_x_axis[i+1]/(chart_data_history-1)) - (chart1301_width * chart_x_axis[i]/(chart_data_history-1))
delta_y_chart1301b = (chart1301_height*disk_write_speed[i+1]/chart1301_y_limit) - (chart1301_height*disk_write_speed[i]/chart1301_y_limit)
ctx.rel_line_to(delta_x_chart1301b, -delta_y_chart1301b)

ctx.rel_line_to(10, 0)
ctx.rel_line_to(0, chart1301_height+10)
ctx.rel_line_to(-(chart1301_width+20), 0)
ctx.rel_line_to(0, -(chart1301_height+10))

ctx.set_source_rgba(chart_line_color[0], chart_line_color[1], chart_line_color[2], chart_line_color[3])
ctx.set_dash([5, 3])

# Draw performance data.
ctx.move_to(0, chart_height)
ctx.rel_move_to(0, -chart_height*disk_write_speed[0]/chart1301_y_limit)
for i in range(chart_data_history - 1):
delta_x = (chart_width * chart_x_axis[i+1]/(chart_data_history-1)) - (chart_width * chart_x_axis[i]/(chart_data_history-1))
delta_y = (chart_height*disk_write_speed[i+1]/chart1301_y_limit) - (chart_height*disk_write_speed[i]/chart1301_y_limit)
ctx.rel_line_to(delta_x, -delta_y)

# Change line color before drawing lines for closing the drawn line in order to revent drawing bolder lines due to overlapping.
ctx.stroke_preserve()
ctx.set_source_rgba(0, 0, 0, 0)

# Close the drawn line to fill inside area of it.
ctx.rel_line_to(0, chart_height*disk_write_speed[-1]/chart1301_y_limit)
ctx.rel_line_to(-(chart_width), 0)
ctx.close_path()
ctx.stroke()


# ----------------------- Called for drawing Disk usage as bar chart -----------------------
Expand Down
43 changes: 29 additions & 14 deletions src/Gpu.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -67,37 +67,43 @@ def on_button1501_clicked(self, widget):
# ----------------------- Called for drawing FPS as line chart -----------------------
def on_drawingarea1501_draw(self, widget, ctx):

# Get chart data history.
chart_data_history = Config.chart_data_history
chart_x_axis = list(range(0, chart_data_history))

# Get performance data to be drawn.
try:
fps_count_check = self.fps_count
fps_count = self.fps_count
# Handle errors because chart signals are connected before running relevant performance thread (in the GPU module) to be able to use GUI labels in this thread. Chart could not get any performance data before running of the relevant performance thread.
except AttributeError:
return

# Get chart colors.
chart_line_color = Config.chart_line_color_fps
chart_background_color = Config.chart_background_color_all_charts

# Get drawingarea size. Therefore chart width and height is updated dynamically by using these values when window size is changed by user.
chart_width = Gtk.Widget.get_allocated_width(widget)
chart_height = Gtk.Widget.get_allocated_height(widget)

# Draw and fill chart background.
ctx.set_source_rgba(chart_background_color[0], chart_background_color[1], chart_background_color[2], chart_background_color[3])
ctx.rectangle(0, 0, chart_width, chart_height)
ctx.fill()

# Draw horizontal and vertical gridlines.
ctx.set_line_width(1)
ctx.set_source_rgba(chart_line_color[0], chart_line_color[1], chart_line_color[2], 0.25 * chart_line_color[3])
for i in range(3):
ctx.move_to(0, chart_height/4*(i+1))
ctx.line_to(chart_width, chart_height/4*(i+1))
ctx.rel_line_to(chart_width, 0)
for i in range(4):
ctx.move_to(chart_width/5*(i+1), 0)
ctx.line_to(chart_width/5*(i+1), chart_height)
ctx.rel_line_to(0, chart_height)
ctx.stroke()

# Maximum FPS value is multiplied by 1.1 in order to scale chart when FPS is increased or decreased for preventing the line being out of the chart border.
chart1501_y_limit = 1.1 * (max(self.fps_count) + 0.0000001)
# Maximum performance data value is multiplied by 1.1 in order to scale chart when performance data is increased or decreased for preventing the line being out of the chart border.
chart1501_y_limit = 1.1 * (max(fps_count) + 0.0000001)

# ---------- Start - This block of code is used in order to show maximum value of the chart as multiples of 1, 10, 100. ----------
chart1501_y_limit_float = chart1501_y_limit
Expand All @@ -109,21 +115,30 @@ def on_drawingarea1501_draw(self, widget, ctx):
chart1501_y_limit = (chart1501_y_limit * next_multiple / (chart1501_y_limit_float + 0.0000001) + 0.0000001)
# ---------- End - This block of code is used in order to show maximum value of the chart as multiples of 1, 10, 100. ----------


# Draw outer border of the chart.
ctx.set_source_rgba(chart_line_color[0], chart_line_color[1], chart_line_color[2], chart_line_color[3])
ctx.rectangle(0, 0, chart_width, chart_height)
ctx.stroke()

ctx.move_to(chart_width*chart_x_axis[0]/(chart_data_history-1), chart_height - chart_height*self.fps_count[0]/chart1501_y_limit)
for i in range(len(chart_x_axis) - 1):
delta_x_chart1501 = (chart_width * chart_x_axis[i+1]/(chart_data_history-1)) - (chart_width * chart_x_axis[i]/(chart_data_history-1))
delta_y_chart1501 = (chart_height*self.fps_count[i+1]/chart1501_y_limit) - (chart_height*self.fps_count[i]/chart1501_y_limit)
ctx.rel_line_to(delta_x_chart1501, -delta_y_chart1501)
# Draw performance data.
ctx.move_to(0, chart_height)
ctx.rel_move_to(0, -chart_height*fps_count[0]/chart1501_y_limit)
for i in range(chart_data_history - 1):
delta_x = (chart_width * chart_x_axis[i+1]/(chart_data_history-1)) - (chart_width * chart_x_axis[i]/(chart_data_history-1))
delta_y = (chart_height*fps_count[i+1]/chart1501_y_limit) - (chart_height*fps_count[i]/chart1501_y_limit)
ctx.rel_line_to(delta_x, -delta_y)

# Change line color before drawing lines for closing the drawn line in order to revent drawing bolder lines due to overlapping.
ctx.stroke_preserve()
ctx.set_source_rgba(0, 0, 0, 0)

ctx.rel_line_to(10, 0)
ctx.rel_line_to(0, chart_height+10)
ctx.rel_line_to(-(chart_width+20), 0)
ctx.rel_line_to(0, -(chart_height+10))
# Close the drawn line to fill inside area of it.
ctx.rel_line_to(0, chart_height*fps_count[-1]/chart1501_y_limit)
ctx.rel_line_to(-(chart_width), 0)
ctx.close_path()

# Fill the closed area.
ctx.stroke_preserve()
gradient_pattern = cairo.LinearGradient(0, 0, 0, chart_height)
gradient_pattern.add_color_stop_rgba(0, chart_line_color[0], chart_line_color[1], chart_line_color[2], 0.55 * chart_line_color[3])
Expand Down
Loading

0 comments on commit 93669fa

Please sign in to comment.