Kaydet (Commit) 8d12af1d authored tarafından Hakan Dündar's avatar Hakan Dündar

Several improvements (RPM packaging, dependencies, etc.

üst 96f53ab7
......@@ -18,7 +18,6 @@ Depends: ${misc:Depends},
systemd,
bash (>=5.0),
pci.ids,
x11-xserver-utils,
dmidecode
Description: Provides information about system performance and usage.
Provides information about CPU/RAM/Disk/Network/GPU performance, sensors, processes, users, storage, startup programs, services, environment variables and system.
......@@ -21,11 +21,19 @@ def files_in_folder(folder):
file_paths.append(folder + file)
return file_paths
PREFIX = "/usr"
if "--flatpak" in sys.argv:
PREFIX = "/app"
sys.argv.remove("--flatpak")
if "--rpm" in sys.argv:
PREFIX = "RPM"
sys.argv.remove("--rpm")
build_root = sys.argv[-1].strip("--")
del sys.argv[-1]
if PREFIX == "/app":
os.rename("integration/tr.org.pardus.system-monitoring-center.desktop", "integration/tr.org.pardus.pkexec.system-monitoring-center.desktop")
os.rename("icons/apps/system-monitoring-center.svg", "icons/apps/tr.org.pardus.pkexec.system-monitoring-center.svg")
......@@ -50,7 +58,30 @@ if PREFIX == "/app":
("/app/bin/", ["integration/system-monitoring-center"])
]
if PREFIX != "/app":
if PREFIX == "RPM":
os.chmod("integration/tr.org.pardus.system-monitoring-center.desktop", 0o644)
os.chmod("translations/tr/system-monitoring-center.mo", 0o644)
for file in files_in_folder("src/"):
os.chmod(file, 0o644)
for file in files_in_folder("ui/"):
os.chmod(file, 0o644)
for file in files_in_folder("icons/actions/"):
os.chmod(file, 0o644)
os.chmod("icons/apps/system-monitoring-center.svg", 0o644)
os.chmod("integration/tr.org.pardus.pkexec.system-monitoring-center.policy", 0o644)
os.chmod("integration/system-monitoring-center", 0o644)
data_files = [
(build_root + "/usr/share/applications/", ["integration/tr.org.pardus.system-monitoring-center.desktop"]),
(build_root + "/usr/share/locale/tr/LC_MESSAGES/", ["translations/tr/system-monitoring-center.mo"]),
(build_root + "/usr/share/system-monitoring-center/src/", files_in_folder("src/")),
(build_root + "/usr/share/system-monitoring-center/ui/", files_in_folder("ui/")),
(build_root + "/usr/share/icons/hicolor/scalable/actions/", files_in_folder("icons/actions/")),
(build_root + "/usr/share/icons/hicolor/scalable/apps/", ["icons/apps/system-monitoring-center.svg"]),
(build_root + "/usr/share/polkit-1/actions/", ["integration/tr.org.pardus.pkexec.system-monitoring-center.policy"]),
(build_root + "/usr/bin/", ["integration/system-monitoring-center"])
]
if PREFIX != "/app" and PREFIX != "RPM":
data_files = [
("/usr/share/applications/", ["integration/tr.org.pardus.system-monitoring-center.desktop"]),
("/usr/share/locale/tr/LC_MESSAGES/", ["translations/tr/system-monitoring-center.mo"]),
......
......@@ -3,11 +3,11 @@
# ----------------------------------- GPU - GPU Tab Import Function (contains import code of this module in order to avoid running them during module import) -----------------------------------
def gpu_import_func():
global Gtk, GLib, Thread, os, subprocess
global Gtk, GLib, Gdk, Thread, os, subprocess
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk, GLib
from gi.repository import Gtk, GLib, Gdk
from threading import Thread
import os
import subprocess
......@@ -253,18 +253,21 @@ def gpu_loop_func():
drawingarea1501.queue_draw()
# Get current resolution and current refresh rate
xrandr_lines = (subprocess.check_output(["xrandr"], shell=False)).decode().strip().split("\n")
for line in xrandr_lines:
if "*" in line:
current_resolution = line.split()[0]
current_refresh_rate = line.split()[1].split("*")[0]
break
current_screen = Gdk.Screen.get_default()
current_resolution = str(current_screen.get_width()) + "x" + str(current_screen.get_height())
try:
current_monitor_number = current_screen.get_monitor_at_window(current_screen.get_active_window())
current_display = Gdk.Display.get_default()
current_refresh_rate = f'{(current_display.get_monitor(current_monitor_number).get_refresh_rate() / 1000):.2f} Hz'
except:
current_refresh_rate = "[" + "Unknown" + "]"
# Set and update GPU tab label texts by using information get
label1503.set_text(f'{fps_count[-1]:.0f}')
label1504.set_text(f'{frame_latency:.1f} ms')
label1505.set_text(f'{current_refresh_rate} Hz')
label1505.set_text(current_refresh_rate)
label1506.set_text(f'{current_resolution}')
......
app-id: tr.org.pardus.pkexec.system-monitoring-center
runtime: org.freedesktop.Platform
runtime-version: '21.08'
sdk: org.freedesktop.Sdk
runtime: org.gnome.Platform
runtime-version: '3.38'
sdk: org.gnome.Sdk
command: system-monitoring-center
finish-args:
- --share=ipc
- --socket=x11
- --device=dri
- --socket=wayland
- --filesystem=home
- --filesystem=host-os:ro
- --filesystem=host:ro
- --filesystem=/run/systemd/units/:ro
- --device=all
modules:
- name: cpython
......@@ -57,4 +68,4 @@ modules:
- python3 setup.py install --flatpak
sources:
- type: dir
path: /home/asush/Masaüstü/files/python/system-monitoring-center/project/
path: [path to project]
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-11-07 12:38+0300\n"
"POT-Creation-Date: 2021-11-12 09:50+0300\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
......@@ -892,7 +892,7 @@ msgstr ""
msgid "Network"
msgstr ""
#: src/SettingsGUI.py:333 ui/GpuTab.ui:358 ui/MainWindow.ui:221
#: src/SettingsGUI.py:333 ui/GpuTab.ui:360 ui/MainWindow.ui:221
msgid "GPU"
msgstr ""
......@@ -1450,8 +1450,8 @@ msgstr ""
#: ui/FloatingSummaryWindow.ui:67 ui/FloatingSummaryWindow.ui:79
#: ui/FloatingSummaryWindow.ui:91 ui/FloatingSummaryWindow.ui:103
#: ui/GpuTab.ui:86 ui/GpuTab.ui:103 ui/GpuTab.ui:120 ui/GpuTab.ui:165
#: ui/GpuTab.ui:182 ui/GpuTab.ui:215 ui/GpuTab.ui:247 ui/GpuTab.ui:264
#: ui/GpuTab.ui:311 ui/GpuTab.ui:328 ui/GpuTab.ui:402 ui/GpuTab.ui:417
#: ui/GpuTab.ui:182 ui/GpuTab.ui:217 ui/GpuTab.ui:249 ui/GpuTab.ui:266
#: ui/GpuTab.ui:313 ui/GpuTab.ui:330 ui/GpuTab.ui:404 ui/GpuTab.ui:419
#: ui/NetworkTab.ui:139 ui/NetworkTab.ui:156 ui/NetworkTab.ui:173
#: ui/NetworkTab.ui:190 ui/NetworkTab.ui:207 ui/NetworkTab.ui:224
#: ui/NetworkTab.ui:241 ui/NetworkTab.ui:258 ui/NetworkTab.ui:289
......@@ -1811,7 +1811,7 @@ msgstr ""
msgid "Disk Read (-) & Write (--) Speed:"
msgstr ""
#: ui/DiskTab.ui:508 ui/GpuTab.ui:465 ui/NetworkTab.ui:390
#: ui/DiskTab.ui:508 ui/GpuTab.ui:467 ui/NetworkTab.ui:390
msgid "0"
msgstr ""
......@@ -2069,72 +2069,74 @@ msgstr ""
msgid ""
"Current refresh rate\n"
"\n"
"May be different than maximum refresh rate of the monitor."
"May be different than maximum refresh rate of the monitor.\n"
"\n"
"This information is available only on systems with X11 windowing system."
msgstr ""
#: ui/GpuTab.ui:202
#: ui/GpuTab.ui:204
msgid "Refresh Rate:"
msgstr ""
#: ui/GpuTab.ui:231
#: ui/GpuTab.ui:233
msgid ""
"Current driver name and version of the selected GPU\n"
"(May be proprietary or open sourced driver name)"
msgstr ""
#: ui/GpuTab.ui:234
#: ui/GpuTab.ui:236
msgid "Driver:"
msgstr ""
#: ui/GpuTab.ui:280
#: ui/GpuTab.ui:282
msgid ""
"If selected GPU is default on system boot and/or used for graphics "
"processing by default"
msgstr ""
#: ui/GpuTab.ui:282
#: ui/GpuTab.ui:284
msgid "Default GPU:"
msgstr ""
#: ui/GpuTab.ui:294
#: ui/GpuTab.ui:296
msgid ""
"Current resolution\n"
"\n"
"May be different than maximum resolution of the monitor."
msgstr ""
#: ui/GpuTab.ui:298
#: ui/GpuTab.ui:300
msgid "Resolution:"
msgstr ""
#: ui/GpuTab.ui:356
#: ui/GpuTab.ui:358
msgid "GPU (Graphics Processing Unit) / Graphics Card"
msgstr ""
#: ui/GpuTab.ui:374
#: ui/GpuTab.ui:376
msgid "GPU Tab Customizations"
msgstr ""
#: ui/GpuTab.ui:400
#: ui/GpuTab.ui:402
msgid "GPU/Graphics Card Device Name Given By OS (And In Driver)"
msgstr ""
#: ui/GpuTab.ui:415
#: ui/GpuTab.ui:417
msgid "GPU/Graphics Card Device Model Name"
msgstr ""
#: ui/GpuTab.ui:453
#: ui/GpuTab.ui:455
msgid "FPS"
msgstr ""
#: ui/GpuTab.ui:482
#: ui/GpuTab.ui:484
msgid ""
"FPS (Frames Per Second)\n"
"(Maximum value could be limited with current monitor refresh rate or GPU "
"performance)"
msgstr ""
#: ui/GpuTab.ui:485
#: ui/GpuTab.ui:487
msgid "FPS Count:"
msgstr ""
......
......@@ -7,8 +7,8 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-11-07 12:38+0300\n"
"PO-Revision-Date: 2021-11-07 12:39+0300\n"
"POT-Creation-Date: 2021-11-12 09:50+0300\n"
"PO-Revision-Date: 2021-11-12 09:51+0300\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: tr_TR\n"
......@@ -924,7 +924,7 @@ msgstr "Disk"
msgid "Network"
msgstr "Ağ"
#: src/SettingsGUI.py:333 ui/GpuTab.ui:358 ui/MainWindow.ui:221
#: src/SettingsGUI.py:333 ui/GpuTab.ui:360 ui/MainWindow.ui:221
msgid "GPU"
msgstr "GPU"
......@@ -1502,8 +1502,8 @@ msgstr "%0"
#: ui/FloatingSummaryWindow.ui:67 ui/FloatingSummaryWindow.ui:79
#: ui/FloatingSummaryWindow.ui:91 ui/FloatingSummaryWindow.ui:103
#: ui/GpuTab.ui:86 ui/GpuTab.ui:103 ui/GpuTab.ui:120 ui/GpuTab.ui:165
#: ui/GpuTab.ui:182 ui/GpuTab.ui:215 ui/GpuTab.ui:247 ui/GpuTab.ui:264
#: ui/GpuTab.ui:311 ui/GpuTab.ui:328 ui/GpuTab.ui:402 ui/GpuTab.ui:417
#: ui/GpuTab.ui:182 ui/GpuTab.ui:217 ui/GpuTab.ui:249 ui/GpuTab.ui:266
#: ui/GpuTab.ui:313 ui/GpuTab.ui:330 ui/GpuTab.ui:404 ui/GpuTab.ui:419
#: ui/NetworkTab.ui:139 ui/NetworkTab.ui:156 ui/NetworkTab.ui:173
#: ui/NetworkTab.ui:190 ui/NetworkTab.ui:207 ui/NetworkTab.ui:224
#: ui/NetworkTab.ui:241 ui/NetworkTab.ui:258 ui/NetworkTab.ui:289
......@@ -1908,7 +1908,7 @@ msgstr ""
msgid "Disk Read (-) & Write (--) Speed:"
msgstr "Disk Okuma (-) & Yazma (--) Hızı:"
#: ui/DiskTab.ui:508 ui/GpuTab.ui:465 ui/NetworkTab.ui:390
#: ui/DiskTab.ui:508 ui/GpuTab.ui:467 ui/NetworkTab.ui:390
msgid "0"
msgstr ""
......@@ -2205,17 +2205,21 @@ msgstr "Birleşik Bellek:"
msgid ""
"Current refresh rate\n"
"\n"
"May be different than maximum refresh rate of the monitor."
"May be different than maximum refresh rate of the monitor.\n"
"\n"
"This information is available only on systems with X11 windowing system."
msgstr ""
"Şimdiki yenileme oranı\n"
"\n"
"Monitörün en yüksek yenileme oranından farklı olabilir."
"Ekranın maksimum yenileme oranından farklı olabilir.\n"
"\n"
"Bu bilgi sadece X11 pencere sisteminin kullanıldığı sistemlerde sağlanabilir."
#: ui/GpuTab.ui:202
#: ui/GpuTab.ui:204
msgid "Refresh Rate:"
msgstr "Yenileme Oranı:"
#: ui/GpuTab.ui:231
#: ui/GpuTab.ui:233
msgid ""
"Current driver name and version of the selected GPU\n"
"(May be proprietary or open sourced driver name)"
......@@ -2223,11 +2227,11 @@ msgstr ""
"Seçilen GPU'nun şimdiki sürücü adı ve sürümü\n"
"(Kapalı veya açık kaynak kodlu sürücünün adı olabilir)"
#: ui/GpuTab.ui:234
#: ui/GpuTab.ui:236
msgid "Driver:"
msgstr "Sürücü:"
#: ui/GpuTab.ui:280
#: ui/GpuTab.ui:282
msgid ""
"If selected GPU is default on system boot and/or used for graphics "
"processing by default"
......@@ -2235,11 +2239,11 @@ msgstr ""
"Seçili GPU'nun sistem açılışında varsayılan olup olmaması ve/veya grafik "
"işleme için varsayılan olup olmaması"
#: ui/GpuTab.ui:282
#: ui/GpuTab.ui:284
msgid "Default GPU:"
msgstr "Varsayılan GPU:"
#: ui/GpuTab.ui:294
#: ui/GpuTab.ui:296
msgid ""
"Current resolution\n"
"\n"
......@@ -2249,31 +2253,31 @@ msgstr ""
"\n"
"Monitörün en yüksek çözünürlüğünden farklı olabilir."
#: ui/GpuTab.ui:298
#: ui/GpuTab.ui:300
msgid "Resolution:"
msgstr "Çözünürlük:"
#: ui/GpuTab.ui:356
#: ui/GpuTab.ui:358
msgid "GPU (Graphics Processing Unit) / Graphics Card"
msgstr "GPU (Grafik İşleme Ünitesi = Graphics Processing Unit) / Grafik Kartı"
#: ui/GpuTab.ui:374
#: ui/GpuTab.ui:376
msgid "GPU Tab Customizations"
msgstr "GPU Sekmesi Özelleştirmeleri"
#: ui/GpuTab.ui:400
#: ui/GpuTab.ui:402
msgid "GPU/Graphics Card Device Name Given By OS (And In Driver)"
msgstr "İ.S. Tarafından Verilen (Ve Sürücüdeki) GPU/Grafik Kartı Adı"
#: ui/GpuTab.ui:415
#: ui/GpuTab.ui:417
msgid "GPU/Graphics Card Device Model Name"
msgstr "GPU/Grafik Kartı Cihaz Modeli Adı"
#: ui/GpuTab.ui:453
#: ui/GpuTab.ui:455
msgid "FPS"
msgstr "FPS"
#: ui/GpuTab.ui:482
#: ui/GpuTab.ui:484
msgid ""
"FPS (Frames Per Second)\n"
"(Maximum value could be limited with current monitor refresh rate or GPU "
......@@ -2283,7 +2287,7 @@ msgstr ""
"(En yüksek değer monitörün şimdiki yenileme oranı veya GPU performansı ile "
"limitli olabilir)"
#: ui/GpuTab.ui:485
#: ui/GpuTab.ui:487
msgid "FPS Count:"
msgstr "FPS Sayısı:"
......@@ -3897,6 +3901,15 @@ msgstr "Sadece giriş yapmış kullanıcıları göster"
msgid "Show only users logged out"
msgstr "Sadece çıkış yapmış kullanıcıları göster"
#~ msgid ""
#~ "Current refresh rate\n"
#~ "\n"
#~ "May be different than maximum refresh rate of the monitor."
#~ msgstr ""
#~ "Şimdiki yenileme oranı\n"
#~ "\n"
#~ "Monitörün en yüksek yenileme oranından farklı olabilir."
#~ msgid "CPU %"
#~ msgstr "% MİB"
......
......@@ -197,7 +197,9 @@ FPS counting does not continue when window is minimized.</property>
<property name="can-focus">False</property>
<property name="tooltip-text" translatable="yes">Current refresh rate
May be different than maximum refresh rate of the monitor.</property>
May be different than maximum refresh rate of the monitor.
This information is available only on systems with X11 windowing system.</property>
<property name="halign">start</property>
<property name="label" translatable="yes">Refresh Rate:</property>
<property name="ellipsize">end</property>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment