Kaydet (Commit) 06f7360d authored tarafından Hakan Dündar's avatar Hakan Dündar

New: Support for Flatpak packaging

üst dad1d2f6
.flatpak-builder/
build-dir/
dist/
*.egg-info/
.git/
#PyCharm
*.idea
......
include LICENSE
include README.md
include integration/com.github.hakand34.system-monitoring-center.desktop
include integration/io.github.hakandundar34coding.system-monitoring-center.desktop
include database/*
include src/*.py
include src/__version__
......
# Maintainer: Hakan Dündar <hakandundar34coding@gmail.com>
pkgname=system-monitoring-center
_pkgver=1.28.0
pkgver=${_pkgver//-/.}
pkgrel=1
pkgdesc="Multi-featured system monitor."
arch=('any')
url="https://github.com/hakandundar34coding/system-monitoring-center"
license=('GPL3')
depends=('bash' 'dmidecode' 'gtk3' 'iproute2' 'polkit'
'python-cairo' 'python-gobject' 'systemd' 'util-linux')
makedepends=('python-setuptools')
source=("$pkgname-$pkgver.tar.gz::$url/archive/refs/tags/v$_pkgver.tar.gz")
sha256sums=('7470b4f1c00f64b967cdec05877d06559c32a7c95157e846d7f60d4011f0bcbb')
build() {
cd "$pkgname-$_pkgver"
python setup.py build
}
package() {
cd "$pkgname-$_pkgver"
python setup.py install --root="$pkgdir" --optimize=1 --skip-build
}
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
This diff is collapsed.
10
\ No newline at end of file
Source: system-monitoring-center
Section: utils
Priority: optional
Maintainer: Hakan Dündar <hakandundar34coding@gmail.com>
Build-Depends: debhelper (>= 10), dh-python, python3-all, python3-setuptools
Standards-Version: 4.3.0
Homepage: https://github.com/hakandundar34coding/system-monitoring-center
Package: system-monitoring-center
Architecture: all
Depends: ${misc:Depends},
${python3:Depends},
bash (>=4.4),
dmidecode,
iproute2,
python3 (>=3.6),
python3-cairo,
python3-gi,
python3-gi-cairo,
util-linux (>=2.31)
Description: Multi-featured system monitor.
Provides information about CPU/RAM/Disk/Network/GPU performance, sensors,
processes, users, services and system.
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: system-monitoring-center
Source: https://github.com/hakandundar34coding/system-monitoring-center
Files: *
Copyright: 2021 Hakan Dündar <hakandundar34coding@gmail.com>
License: GPL-3.0+
License: GPL-3.0+
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
.
This package is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
.
On Debian systems, the complete text of the GNU General
Public License version 3 can be found in "/usr/share/common-licenses/GPL-3".
#!/usr/bin/make -f
%:
dh $@ --with python3 --buildsystem=pybuild
3.0 (native)
\ No newline at end of file
......@@ -8,7 +8,7 @@
<vendor>System Monitoring Center</vendor>
<vendor_url>https://github.com/hakandundar34coding/system-monitoring-center</vendor_url>
<action id="com.github.hakand34.system-monitoring-center">
<action id="io.github.hakandundar34coding.system-monitoring-center">
<description>System Monitoring Center Authentication</description>
<message>Authentication is required to run System Monitoring Center</message>
<message xml:lang="tr">Sistem Gözlem Merkezi için yetkilendirme gerekiyor</message>
......@@ -21,4 +21,4 @@
<annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
</action>
</policyconfig>
\ No newline at end of file
</policyconfig>
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 2022 Hakan Dündar -->
<component>
<id type="desktop">io.github.hakandundar34coding.system-monitoring-center.desktop</id>
<launchable type="desktop-id">io.github.hakandundar34coding.system-monitoring-center.desktop</launchable>
<metadata_license>CC0-1.0</metadata_license>
<name>System Monitoring Center</name>
<developer_name>Hakan Dündar</developer_name>
<project_license>GPL-3.0</project_license>
<summary>Multi-featured system monitor.</summary>
<url type="homepage">https://github.com/hakandundar34coding/system-monitoring-center</url>
<description>
<p>Multi-featured system monitor.</p>
<p>Features:</p>
<ul>
<li>Detailed system performance and usage usage monitoring/managing features</li>
<li>Monitoring CPU, RAM, Disk, Network, GPU hardware/usage information</li>
<li>Monitoring and managing processes and services (systemd)</li>
<li>Monitoring users, sensors and general system information</li>
<li>Supports PolicyKit. No need to run the application with "sudo"</li>
<li>Hardware selection options (selecting CPU cores, disks, network cards, GPUs)</li>
<li>Plotting performance data of multiple devices at the same time</li>
<li>Interactive charts for querying performance data on any point</li>
<li>Option for showing processes as tree or list</li>
<li>Optimized for low CPU usage and fast start</li>
<li>Shows notification if update is available on PyPI (disabled by default)</li>
<li>Supports ARM architecture</li>
<li>Adapts to system theme</li>
<li>Free and open source</li>
<li>Free and open source</li>
</ul>
<p>Notes:</p>
<ul>
<li>GPU usage information availability depends on vendor/driver.</li>
<li>GPU load is not tracked if GPU tab is switched off (for lower CPU usage).</li>
<li>Virtual machines may not provide CPU min-max frequencies, sensors and RAM hardware information.</li>
</ul>
<p>Notes for Flatpak Support:</p>
<ul>
<li>Other packages of the application are suggested instead of FLatpak package due to security reasons.</li>
<li>FLatpak version of the application uses some permisions to access information of the host OS. THis may cause security problems.</li>
<li>Flatpak package of the application may be installed for system-wide instead of user-specific for avoiding source code modifications.</li>
<li>Currently, Flatpak package of the application has some limitations such as Processes tab and others. Work in progress for this packaging type.</li>
</ul>
</description>
<screenshots>
<screenshot type="default">
<image>https://github.com/hakandundar34coding/system-monitoring-center/blob/master/screenshots/summary_tab_dark_system_theme.png</image>
</screenshot>
<screenshot>
<image>https://github.com/hakandundar34coding/system-monitoring-center/blob/master/screenshots/cpu_tab_dark_system_theme.png</image>
</screenshot>
<screenshot>
<image>https://github.com/hakandundar34coding/system-monitoring-center/blob/master/screenshots/cpu_tab_white_system_theme.png</image>
</screenshot>
<screenshot>
<image>https://github.com/hakandundar34coding/system-monitoring-center/blob/master/screenshots/cpu_tab_per_core_dark_system_theme.png</image>
</screenshot>
<screenshot>
<image>https://github.com/hakandundar34coding/system-monitoring-center/blob/master/screenshots/network_tab_dark_system_theme.png</image>
</screenshot>
<screenshot>
<image>https://github.com/hakandundar34coding/system-monitoring-center/blob/master/screenshots/gpu_tab_dark_system_theme.png</image>
</screenshot>
<screenshot>
<image>https://github.com/hakandundar34coding/system-monitoring-center/blob/master/screenshots/sensors_tab_dark_system_theme.png</image>
</screenshot>
<screenshot>
<image>https://github.com/hakandundar34coding/system-monitoring-center/blob/master/screenshots/processes_list_view_dark_system_theme.png</image>
</screenshot>
<screenshot>
<image>https://github.com/hakandundar34coding/system-monitoring-center/blob/master/screenshots/services_tab_dark_system_theme.png</image>
</screenshot>
<screenshot>
<image>https://github.com/hakandundar34coding/system-monitoring-center/blob/master/screenshots/system_tab_dark_system_theme.png</image>
</screenshot>
</screenshots>
<releases>
<release version="1.29.0" date="2022-10-20">
<description>
<p>
New: Flatpak packaging
</p>
</description>
</release>
<release version="1.28.0" date="2022-10-11">
<description>
<p>
New: Option for language selection
New: Chinese (Simplified) translations
Minor improvements (GUI, translations, etc.)
</p>
</description>
</release>
</releases>
<content_rating type="oars-1.1"/>
</component>
app-id: io.github.hakandundar34coding.system-monitoring-center
runtime: org.gnome.Platform
runtime-version: '43'
sdk: org.gnome.Sdk
command: system-monitoring-center
finish-args:
# For X11 shared memory access (higher performance for X11).
- --share=ipc
# For X11 access.
- --socket=x11
# For Wayland access.
- --socket=wayland
# For X11 fallback.
- --socket=fallback-x11
# For host OS commands access. Otherwise it gives this error: Failed to register: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: org.freedesktop.DBus.Error.ServiceUnknown
- --socket=session-bus
# For monitoring data download/upload speed on network cards.
- --device=all
# For OpenGL access (hardware acceleration).
- --device=dri
# For monitoring data download/upload speed on network cards.
- --share=network
# For host OS commands access (such as 'systemctl' for service details, 'ls /proc' for process list, 'ps' for process information, etc.).
- --talk-name=org.freedesktop.Flatpak
# For reading several files (systemd service files, process information in '/proc' folder, etc.) of host OS.
- --filesystem=host:ro
cleanup:
- /include
- /lib/pkgconfig
- /share/man
modules:
# For using hardware database of "udev".
- name: eudev
cleanup:
- /bin
- /sbin
- /include
- /lib*/udev
- /lib/pkgconfig
buildsystem: autotools
post-install:
- udevadm hwdb --update
sources:
- type: archive
url: https://github.com/eudev-project/eudev/releases/download/v3.2.11/eudev-3.2.11.tar.gz
sha256: 19847cafec67897da855fde56f9dc7d92e21c50e450aa79068a7e704ed44558b
x-checker-data:
type: anitya
project-id: 13466
stable-only: true
url-template: https://github.com/eudev-project/eudev/releases/download/v$version/eudev-$version.tar.gz
# For getting IPv4 and IPv6 addresses by using 'ip a show [network_card]' command.
- name: iproute2
buildsystem: simple
sources:
- type: archive
url: https://github.com/shemminger/iproute2/archive/refs/tags/v5.11.0.tar.gz
sha256: 16b79e6ce65d4d5fd425cef2fd92a58c403a93faeeed0e0a3202b36a8e857d1f
build-commands:
- ./configure --prefix=/
- make -j $FLATPAK_BUILDER_N_JOBS
- find . -type f | perl -lne 'print if -B and -x' | xargs strip
- install -D ./ip/ip $FLATPAK_DEST/bin/ip
# For drawing Cairo graphics.
- name: pycairo
buildsystem: simple
build-commands:
- pip3 install --verbose --exists-action=i --no-index --find-links="file://${PWD}"
--prefix=${FLATPAK_DEST} "pycairo>=1.20.1" --no-build-isolation
sources:
- type: file
url: https://files.pythonhosted.org/packages/bc/3f/64e6e066d163fbcf13213f9eeda0fc83376243335ea46a66cefd70d62e8f/pycairo-1.20.1.tar.gz
sha256: 1ee72b035b21a475e1ed648e26541b04e5d7e753d75ca79de8c583b25785531b
# For System Monitoring Center.
- name: system-monitoring-center
buildsystem: simple
build-commands:
- python3 setup.py install --flatpak_package --prefix=${FLATPAK_DEST}
sources:
- type: git
url: https://github.com/hakandundar34coding/system-monitoring-center.git
commit: dad1d2f63310dbfd9f3b0521f6e3b7c66905377e
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
Run the required packaging script file in this directory without moving it.
#!/bin/sh
cd ..
dpkg-buildpackage -us -uc
#!/bin/sh
cd ..
flatpak-builder --force-clean build-dir io.github.hakandundar34coding.system-monitoring-center.yml
flatpak-builder --user --install --force-clean build-dir io.github.hakandundar34coding.system-monitoring-center.yml
flatpak run io.github.hakandundar34coding.system-monitoring-center
#!/bin/sh
cd ..
rpmdev-setuptree
cp -a ./. ~/rpmbuild/BUILD
rpmbuild -ba system-monitoring-center.spec
This diff is collapsed.
......@@ -10,9 +10,10 @@ class Config:
# ----------------------- Always called when object is generated -----------------------
def __init__(self):
# Define configration file and directory
self.current_user_homedir = os.environ.get('HOME')
self.config_folder_path = self.current_user_homedir + "/.config/system-monitoring-center/"
# Define configration file and directory.
# "XDG_CONFIG_HOME" may not be defined on several distributions.
user_config_folder = config_dir = os.environ.get("XDG_CONFIG_HOME", os.environ.get("HOME") + "/.config")
self.config_folder_path = user_config_folder + "/system-monitoring-center/"
self.config_file_path = self.config_folder_path + "config.txt"
# Define read-only values
......
......@@ -376,20 +376,30 @@ class Cpu:
def cpu_total_processes_threads_func(self):
thread_count_list = []
pid_list = [filename for filename in os.listdir("/proc/") if filename.isdigit()]
for pid in pid_list:
try:
with open("/proc/" + pid + "/status") as reader:
proc_status_output = reader.read()
# try-except is used in order to skip to the next loop without application error if a "FileNotFoundError" error is encountered when process is ended after process list is get.
except (FileNotFoundError, ProcessLookupError) as me:
continue
# Append number of threads of the process
thread_count_list.append(int(proc_status_output.split("\nThreads:", 1)[1].split("\n", 1)[0].strip()))
number_of_total_processes = len(thread_count_list)
number_of_total_threads = sum(thread_count_list)
if Config.environment_type == "flatpak":
import subprocess
ps_output_lines = (subprocess.check_output(["flatpak-spawn", "--host", "ps", "--no-headers", "-eo", "thcount"], shell=False)).decode().strip().split("\n")
number_of_total_processes = len(ps_output_lines)
number_of_total_threads = 0
for line in ps_output_lines:
number_of_total_threads = number_of_total_threads + int(line.strip())
else:
pid_list = [filename for filename in os.listdir("/proc/") if filename.isdigit()]
for pid in pid_list:
try:
with open("/proc/" + pid + "/status") as reader:
proc_status_output = reader.read()
# try-except is used in order to skip to the next loop without application error if a "FileNotFoundError" error is encountered when process is ended after process list is get.
except (FileNotFoundError, ProcessLookupError) as me:
continue
# Append number of threads of the process
thread_count_list.append(int(proc_status_output.split("\nThreads:", 1)[1].split("\n", 1)[0].strip()))
number_of_total_processes = len(thread_count_list)
number_of_total_threads = sum(thread_count_list)
return number_of_total_processes, number_of_total_threads
......
File mode changed from 100755 to 100644
......@@ -415,7 +415,11 @@ class Disk:
if disk_file_system == "fuseblk":
try:
disk_for_file_system = "/dev/" + selected_disk
disk_file_system = (subprocess.check_output(["lsblk", "-no", "FSTYPE", disk_for_file_system], shell=False)).decode().strip()
if Config.environment_type == "flatpak":
import subprocess
disk_file_system = (subprocess.check_output(["flatpak-spawn", "--host", "lsblk", "-no", "FSTYPE", disk_for_file_system], shell=False)).decode().strip()
else:
disk_file_system = (subprocess.check_output(["lsblk", "-no", "FSTYPE", disk_for_file_system], shell=False)).decode().strip()
except Exception:
pass
......
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
......@@ -466,13 +466,19 @@ class Gpu:
# Get GPU memory capacity. This information is get by using "vcgencmd" tool and it is not installed on the systems by default.
try:
gpu_memory_capacity = (subprocess.check_output(["vcgencmd", "get_mem", "gpu"], shell=False)).decode().strip().split("=")[1]
if Config.environment_type == "flatpak":
gpu_memory_capacity = (subprocess.check_output(["flatpak-spawn", "--host", "vcgencmd", "get_mem", "gpu"], shell=False)).decode().strip().split("=")[1]
else:
gpu_memory_capacity = (subprocess.check_output(["vcgencmd", "get_mem", "gpu"], shell=False)).decode().strip().split("=")[1]
except Exception:
gpu_memory_capacity = "-"
# Get GPU current frequency. This information is get by using "vcgencmd" tool and it is not installed on the systems by default.
try:
gpu_current_frequency = (subprocess.check_output(["vcgencmd", "measure_clock", "core"], shell=False)).decode().strip().split("=")[1]
if Config.environment_type == "flatpak":
gpu_current_frequency = (subprocess.check_output(["flatpak-spawn", "--host", "vcgencmd", "measure_clock", "core"], shell=False)).decode().strip().split("=")[1]
else:
gpu_current_frequency = (subprocess.check_output(["vcgencmd", "measure_clock", "core"], shell=False)).decode().strip().split("=")[1]
gpu_current_frequency = f'{float(gpu_current_frequency)/1000000:.0f} MHz'
except Exception:
gpu_current_frequency = "-"
......@@ -594,7 +600,10 @@ class Gpu:
def gpu_load_nvidia_func(self):
# Define command for getting GPU usage information.
gpu_tool_command = ["nvidia-smi", "--query-gpu=gpu_name,gpu_bus_id,driver_version,utilization.gpu,utilization.memory,memory.total,memory.free,memory.used,temperature.gpu,clocks.current.graphics,clocks.max.graphics,power.draw", "--format=csv"]
if Config.environment_type == "flatpak":
gpu_tool_command = ["flatpak-spawn", "--host", "nvidia-smi", "--query-gpu=gpu_name,gpu_bus_id,driver_version,utilization.gpu,utilization.memory,memory.total,memory.free,memory.used,temperature.gpu,clocks.current.graphics,clocks.max.graphics,power.draw", "--format=csv"]
else:
gpu_tool_command = ["nvidia-smi", "--query-gpu=gpu_name,gpu_bus_id,driver_version,utilization.gpu,utilization.memory,memory.total,memory.free,memory.used,temperature.gpu,clocks.current.graphics,clocks.max.graphics,power.draw", "--format=csv"]
# Try to get GPU usage information.
try:
......
File mode changed from 100755 to 100644
......@@ -8,7 +8,7 @@ from gi.repository import Gtk
class Application(Gtk.Application):
def __init__(self, *args, **kwargs):
super().__init__(*args, application_id="com.github.hakand34.system-monitoring-center", **kwargs)
super().__init__(*args, application_id="io.github.hakandundar34coding.system-monitoring-center", **kwargs)
self.window = None
def do_activate(self):
......
......@@ -33,6 +33,9 @@ class MainGUI:
except Exception:
pass
# Detect environment type (Flatpak or native). This information will be used for accessing host OS commands if the application is run in Flatpak environment.
self.main_gui_environment_type_detection_func()
# Generate symbolic links for GUI icons and application shortcut (.desktop file) in user folders if they are not generated.
self.main_gui_application_system_integration_func()
......@@ -134,8 +137,13 @@ class MainGUI:
# Hide Services tab if systemd is not used on the system.
try:
with open("/proc/1/comm") as reader:
process_name = reader.read().strip()
# Access host OS commands if the application is run in Flatpak environment.
if Config.environment_type == "flatpak":
import subprocess
process_name = (subprocess.check_output(["flatpak-spawn", "--host", "cat", "/proc/1/comm"], shell=False)).decode().strip()
else:
with open("/proc/1/comm") as reader:
process_name = reader.read().strip()
if process_name != "systemd":
self.radiobutton6.set_visible(False)
except Exception:
......@@ -752,9 +760,33 @@ class MainGUI:
self.main_glib_source.attach(GLib.MainContext.default())
# ----------------------- Called for detecting environment type (Flatpak or native). This information will be used for accessing host OS commands if the application is run in Flatpak environment. -----------------------
def main_gui_environment_type_detection_func(self):
# Get OS version information.
os_version = "-"
with open("/etc/os-release") as reader:
os_release_output_lines = reader.read().strip().split("\n")
for line in os_release_output_lines:
if line.startswith("VERSION="):
os_version = line.split("VERSION=")[1].strip(' "')
break
if "flatpak runtime" in os_version.lower():
environment_type = "flatpak"
else:
environment_type = "native"
Config.environment_type = environment_type
# ----------------------- Called for copying files for GUI icons and application shortcut (.desktop file) in user folders if they are not copied before. -----------------------
def main_gui_application_system_integration_func(self):
if Config.environment_type == "flatpak":
return
# Called for removing files.
def remove_file(file):
try:
......
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
......@@ -9,6 +9,8 @@ import subprocess
from locale import gettext as _tr
from Config import Config
# Define class
class MemoryRamHardware:
......@@ -58,7 +60,10 @@ class MemoryRamHardware:
# "sudo" has to be used for using "pkexec" to run "dmidecode" with root privileges.
try:
dmidecode_output = (subprocess.check_output(["pkexec", "sudo", "dmidecode", "-t", "16,17"], stderr=subprocess.STDOUT, shell=False)).decode().strip()
if Config.environment_type == "flatpak":
dmidecode_output = (subprocess.check_output(["flatpak-spawn", "--host", "pkexec", "sudo", "dmidecode", "-t", "16,17"], stderr=subprocess.STDOUT, shell=False)).decode().strip()
else:
dmidecode_output = (subprocess.check_output(["pkexec", "sudo", "dmidecode", "-t", "16,17"], stderr=subprocess.STDOUT, shell=False)).decode().strip()
except Exception:
self.window1201w.hide()
return
......
File mode changed from 100755 to 100644
......@@ -279,8 +279,11 @@ class Network:
try:
nmcli_output_lines = (subprocess.check_output(["nmcli", "-get-values", "DEVICE,CONNECTION", "device", "status"], shell=False)).decode().strip().split("\n")
# Avoid errors because Network Manager (which is required for running "nmcli" command) may not be installed on all systems (very rare).
except FileNotFoundError:
network_ssid = f'[{_tr("Unknown")}]'
except (FileNotFoundError, subprocess.CalledProcessError) as me:
if Config.environment_type == "flatpak":
network_ssid = "[" + "!Flatpak" + "]"
else:
network_ssid = f'[{_tr("Unknown")}]'
# Check if "nmcli_output_lines" value is get.
if "nmcli_output_lines" in locals():
......
File mode changed from 100755 to 100644
......@@ -319,6 +319,10 @@ class Performance:
# Some older Linux distributions use "/lib/" instead of "/usr/lib/" but they are merged under "/usr/lib/" in newer versions.
if os.path.isdir(udev_hardware_database_dir) == False:
udev_hardware_database_dir = "/lib/udev/hwdb.d/"
if Config.environment_type == "flatpak":
udev_hardware_database_dir = "/etc/udev/hwdb.d/"
if Config.environment_type == "flatpak":
udev_hardware_database_dir = os.path.dirname(os.path.realpath(__file__)) + "/../../../etc/udev/hwdb.d/"
# Example modalias file contents for testing.
# modalias_output = "usb:v0B95p1790d0100dcFFdscFFdp00icFFiscFFip00in00"
......@@ -512,7 +516,12 @@ class Performance:
cpu_usage_text = f'{self.cpu_usage_percent_ave[-1]:.{performance_cpu_usage_percent_precision}f}'
performance_memory_data_precision = 0
ram_usage_text = f'{self.ram_usage_percent[-1]:.{performance_memory_data_precision}f}'
processes_number_text = f'{len([filename for filename in os.listdir("/proc/") if filename.isdigit()])}'
if Config.environment_type == "flatpak":
import subprocess
ls_proc_list = (subprocess.check_output(["flatpak-spawn", "--host", "ls", "/proc/"], shell=False)).decode().strip().split()
processes_number_text = f'{len([filename for filename in ls_proc_list if filename.isdigit()])}'
else:
processes_number_text = f'{len([filename for filename in os.listdir("/proc/") if filename.isdigit()])}'
swap_usage_text = f'{self.swap_usage_percent[-1]:.0f}%'
selected_disk_number = self.selected_disk_number
performance_disk_data_precision = 1
......
File mode changed from 100755 to 100644
......@@ -182,6 +182,25 @@ def on_button2101_clicked(widget):
# ----------------------------------- Processes - Initial Function (contains initial code which defines some variables and gets data which is not wanted to be run in every loop) -----------------------------------
def processes_initial_func():
if Config.environment_type == "flatpak":
try:
global label_flatpak_information_shown
if label_flatpak_information_shown == 1:
return
except Exception:
pass
label_flatpak_information_shown = 1
label_flatpak_information = Gtk.Label(label=_tr("!Flatpak. Currently this tab is not supported for Flatpak."))
css = b"label {background: rgba(50%,50%,50%,1.0);}"
style_provider = Gtk.CssProvider()
style_provider.load_from_data(css)
label_flatpak_information.get_style_context().add_provider(style_provider, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION)
grid2101.insert_row(0)
# Attach the label to the grid at (0, 0) position.
grid2101.attach(label_flatpak_information, 0, 0, 1, 1)
label_flatpak_information.set_visible(True)
return
# data list explanation:
# processes_data_list = [
# [treeview column number, treeview column title, internal column count, cell renderer count, treeview column sort column id, [data type 1, data type 2, ...], [cell renderer type 1, cell renderer type 2, ...], [cell attribute 1, cell attribute 2, ...], [cell renderer data 1, cell renderer data 2, ...], [cell left/right alignment 1, cell left/right alignment 2, ...], [set expand 1 {if cell will allocate unused space} cell expand 2, ...], [cell function 1, cell function 2, ...]]
......@@ -264,6 +283,9 @@ def processes_initial_func():
# ----------------------------------- Processes - Get Process Data Function (gets processes data, adds into treeview and updates it) -----------------------------------
def processes_loop_func():
if Config.environment_type == "flatpak":