From f5b7e4142ed4122646501c4d12e18c28fd4878ef Mon Sep 17 00:00:00 2001 From: tigro Date: Mon, 4 Sep 2023 22:50:31 +0300 Subject: [PATCH] Added desktop entry to run hardinfo under superuser --- SOURCES/hardinfo-root.desktop | 19 +++++++++++++++++++ .../org.freedesktop.pkexec.hardinfo.policy | 18 ++++++++++++++++++ SPECS/hardinfo.spec | 16 +++++++++++++++- 3 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 SOURCES/hardinfo-root.desktop create mode 100644 SOURCES/org.freedesktop.pkexec.hardinfo.policy diff --git a/SOURCES/hardinfo-root.desktop b/SOURCES/hardinfo-root.desktop new file mode 100644 index 0000000..8e91960 --- /dev/null +++ b/SOURCES/hardinfo-root.desktop @@ -0,0 +1,19 @@ +[Desktop Entry] +Name=(Superuser) System Profiler and Benchmark +Name[de]=(Superuser) System Profiler und Benchmark +Name[es]=(Superusuario) Informacion y Rendimiento del Sistema +Name[fr]=(Superutilisateur) chmarks du Système +Name[pt_BR]=(Superusuário) Informações e Testes do Sistema +Name[ru]=(Администратор) Информация о системе и тестирование +Name[tr]=(Süper kullanıcı) Sistem Bilgisi ve Karşılaştırma +Comment=(Superuser) Displays system information +Comment[de]=(Superuser) Anzeigen von Systeminformationen +Comment[ru]=(Администратор) Показывает информацию о системе +Exec=pkexec /usr/bin/hardinfo +Icon=hardinfo +Terminal=false +Type=Application +StartupNotify=true +Categories=System; +Keywords=linux;kernel;system;hardware;cpu;processor;capabilities;frequency;memory;ram;board;resources;sensors;devices;usb;pci;display;network;benchmark;test; +X-Desktop-File-Install-Version=0.26 diff --git a/SOURCES/org.freedesktop.pkexec.hardinfo.policy b/SOURCES/org.freedesktop.pkexec.hardinfo.policy new file mode 100644 index 0000000..04884c7 --- /dev/null +++ b/SOURCES/org.freedesktop.pkexec.hardinfo.policy @@ -0,0 +1,18 @@ + + + + + Run Hardinfo program + Authentication is required to run the Hardinfo + accessories-text-editor + + auth_admin + auth_admin + auth_admin + + /usr/bin/hardinfo + true + + diff --git a/SPECS/hardinfo.spec b/SPECS/hardinfo.spec index 3c8e775..9b7c853 100644 --- a/SPECS/hardinfo.spec +++ b/SPECS/hardinfo.spec @@ -3,13 +3,15 @@ Name: hardinfo Version: 0.6 -Release: 1.20230524git%{shorthash}%{?dist}.inferit.1 +Release: 1.20230524git%{shorthash}%{?dist}.inferit.2 Summary: System Profiler and Benchmark License: GPLv2 URL: http://hardinfo.org/ Source0: http://download.berlios.de/hardinfo/%{name}-%{version}-%{fullhash}.tar.xz Source1: ru.po +Source2: hardinfo-root.desktop +Source3: org.freedesktop.pkexec.hardinfo.policy Patch1: 0001-Remove-annoyng-window-about-loading-of-needed-librar.patch BuildRequires: cmake @@ -54,6 +56,13 @@ desktop-file-install --vendor="" --delete-original \ --dir=${RPM_BUILD_ROOT}%{_datadir}/applications \ ${RPM_BUILD_ROOT}%{_datadir}/applications/hardinfo.desktop +install -m644 %{SOURCE2} \ + ${RPM_BUILD_ROOT}%{_datadir}/applications/hardinfo-root.desktop + +install -d -m755 %{buildroot}%{_datadir}/polkit-1/actions +install -m644 %{SOURCE3} \ + %{buildroot}%{_datadir}/polkit-1/actions + %find_lang %{name} %files -f %{name}.lang @@ -64,8 +73,13 @@ desktop-file-install --vendor="" --delete-original \ %{_mandir}/man1/%{name}* %{_datadir}/icons/*/*/*/%{name}* %{_datadir}/applications/%{name}.desktop +%{_datadir}/applications/%{name}-root.desktop +%{_datadir}/polkit-1/actions/org.freedesktop.pkexec.hardinfo.policy %changelog +* Mon Sep 4 2023 Arkady L. Shane - 0.6-1.20230524git45fa969.inferit.2 +- Added desktop entry to run hardinfo under superuser + * Thu Jul 27 2023 Alexey Berezhok - 0.6-1.20230524git45fa969.inferit.1 - Remove annoyng window about loading of needed libraries