[PATCH] gnu: Add userspace desktop services

  • Done
  • quality assurance status badge
Details
2 participants
  • florhizome
  • Tobias Geerinckx-Rice
Owner
unassigned
Submitted by
florhizome
Severity
normal
F
F
florhizome wrote on 13 Oct 2022 17:39
(address . guix-patches@gnu.org)
87bkqflolh.fsf@posteo.net
This patch series adds three packages with service programs that make certain
functionality accessible to userspace. They especially should integrate
with gnome.
Of course, the shepherd services remain to be added (I would like to get
the packages merged first)

* power-profiles-daemon: makes simplified power usage control available -
choosing between two or three profiles depending on cpu support.
* low-memory-monitor: reports memory pressure to userspace. it has an
option to enable oom management through the kernel, that i have not
enabled so far
* iio-sensor-proxy: proxies rotation and ALS information to
userspace. Needed for gnome on mobile/convertible devices. With a
libgudev upgrade more recent versions would be available.

All come with cli-scripts to interact with them manually.
Not sure if its the right module, but they all live in freedesktop.orgs
repos ;>
F
F
florhizome wrote on 14 Oct 2022 14:02
[PATCH 1/3] gnu: freedesktop: Add iio-sensor-proxy
(address . 58501@debbugs.gnu.org)(name . florhizome)(address . florhizome@posteo.net)
fccafcd56377a2bbab7b0562265ba99103f4e9ab.1665748966.git.florhizome@posteo.net
From: florhizome <florhizome@posteo.net>

---
gnu/packages/freedesktop.scm | 51 ++++++++++++++++++++++++++++++++++++
1 file changed, 51 insertions(+)

Toggle diff (69 lines)
diff --git a/gnu/packages/freedesktop.scm b/gnu/packages/freedesktop.scm
index ab37f04bef..d72b18caf5 100644
--- a/gnu/packages/freedesktop.scm
+++ b/gnu/packages/freedesktop.scm
@@ -728,6 +728,57 @@ (define-public elogind
of a the system to know what users are logged in, and where.")
(license license:lgpl2.1+)))
+
+(define-public iio-sensor-proxy
+ (package
+ (name "iio-sensor-proxy")
+ (version "3.1")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://gitlab.freedesktop.org/hadess/iio-sensor-proxy")
+ (commit version)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "1dpcc3i53aw5illfhfkwxy0hsjsnya5iw4iv4al46vgyvcnvjc8z"))))
+ (build-system meson-build-system)
+ (arguments
+ (list
+ #:configure-flags #~(list "-Dsystemdsystemunitdir=false"
+ (string-append "-Dudevrulesdir="
+ #$output
+ "/lib/udev"))
+ #:glib-or-gtk? #t
+ #:tests? #f
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-before 'configure 'fake-pkexec
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out")))
+ (setenv "PKEXEC_UID" "-1"))))
+ (add-before 'configure 'correct-polkit-dir
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out")))
+ (substitute*
+ "meson.build"
+ (("polkit_gobject_dep\\.get_pkgconfig_variable\\('policydir'\\)")
+ (string-append "'" out "/share/polkit-1/actions'")))))))))
+ (native-inputs
+ (list `(,glib "bin") python umockdev python-dbusmock python-psutil dbus
+ gobject-introspection pkg-config))
+ (inputs
+ (list glib polkit libgudev))
+ (synopsis "Proxies sensor devices (accelerometers, light sensors, compass)
+ to applications through D-Bus ")
+ (description "With a GNOME 3.18 (or newer) based system, orientation changes
+ will automatically be applied when rotating the panel, ambient light will be
+ used to change the screen brightness, and GeoClue will be able to read the compass
+data to show the direction in Maps. Can be used by other DEs, too though.")
+ (home-page "https://gitlab.freedesktop.org/hadess/iio-sensor-proxy")
+ (license license:gpl3)))
+
(define-public basu
(package
(name "basu")

base-commit: 86ec52f66735b122b9035eba56516fd16f3be958
prerequisite-patch-id: 253e1cc8278ab9981294f4e483c7b29a466672d9
prerequisite-patch-id: fb797b9fdd73d1c18cba5dbd5804396d333f13df
prerequisite-patch-id: 6f7fd28e90950c738840d3794ce7cd534f0d9180
--
2.38.0
F
F
florhizome wrote on 14 Oct 2022 14:02
[PATCH 2/3] gnu: freedesktop: Add power-profiles-daemon
(address . 58501@debbugs.gnu.org)(name . florhizome)(address . florhizome@posteo.net)
30c42f8604b607345c233c0b60e5330243ecfdbe.1665748966.git.florhizome@posteo.net
From: florhizome <florhizome@posteo.net>

---
gnu/packages/freedesktop.scm | 55 ++++++++++++++++++++++++++++++++++++
1 file changed, 55 insertions(+)

Toggle diff (68 lines)
diff --git a/gnu/packages/freedesktop.scm b/gnu/packages/freedesktop.scm
index d72b18caf5..b6aaf1f1ba 100644
--- a/gnu/packages/freedesktop.scm
+++ b/gnu/packages/freedesktop.scm
@@ -990,6 +990,61 @@ (define-public packagekit
manager for the current system.")
(license license:gpl2+)))
+
+(define-public power-profiles-daemon
+ (package
+ (name "power-profiles-daemon")
+ (version "0.12")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://gitlab.freedesktop.org/hadess/power-profiles-daemon")
+ (commit version)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "1wqcajbj358zpyj6y4h1v34y2yncq76wqxd0jm431habcly0bqyr"))))
+ (build-system meson-build-system)
+ (arguments
+ `(#:configure-flags (list "-Dsystemdsystemunitdir=false")
+ #:glib-or-gtk? #t
+ #:phases
+ (modify-phases %standard-phases
+ (add-before 'install 'fake-pkexec
+ (lambda _ (setenv "PKEXEC_UID" "-1")))
+ (add-before 'configure 'correct-polkit-dir
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out")))
+ (substitute*
+ "meson.build"
+ (("polkit_gobject_dep\\.get_pkgconfig_variable\\('policydir'\\)")
+ (string-append "'" out "/share/polkit-1/actions'"))))))
+ (add-after 'install 'wrap-program
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((out (string-append (assoc-ref outputs "out")))
+ (prog (string-append out "/bin/powerprofilesctl")))
+ (wrap-program prog
+ `("GUIX_PYTHONPATH" = (,(getenv "GUIX_PYTHONPATH")))
+ `("GI_TYPELIB_PATH" = (,(getenv "GI_TYPELIB_PATH"))))))))))
+ (native-inputs
+ (list `(,glib "bin") vala python gobject-introspection pkg-config))
+ (inputs
+ (list upower glib polkit dbus libgudev
+ dbus-glib python python-pygobject))
+ (synopsis "Makes power profiles handling available over D-Bus.")
+ (home-page "https://gitlab.freedesktop.org/hadess/power-profiles-daemon")
+ (description "power-profiles-daemon offers to modify system behaviour based
+ upon user-selected power profiles. There are 3 different power profiles, a
+\"balanced\" default mode, a \"power-saver\" mode, as well as a \"performance\"
+ mode. The first 2 of those are available on every system. The \"performance\"
+ mode is only available on select systems and is implemented by different \"drivers\"
+ based on the system or systems it targets.
+In addition to those 2 or 3 modes (depending on the system), \"actions\" can be hooked
+up to change the behaviour of a particular device. For example, this can be used
+to disable the fast-charging for some USB devices when in power-saver mode.")
+ (license license:gpl3)))
+
(define-public python-libevdev
(package
(name "python-libevdev")
--
2.38.0
F
F
florhizome wrote on 14 Oct 2022 14:02
[PATCH 3/3] gnu: freedesktop: Add low-memory-monitor
(address . 58501@debbugs.gnu.org)(name . florhizome)(address . florhizome@posteo.net)
922dee2e76de618b0bfc406e749bd32e854cc3b3.1665748966.git.florhizome@posteo.net
From: florhizome <florhizome@posteo.net>

---
gnu/packages/freedesktop.scm | 43 ++++++++++++++++++++++++++++++++++++
1 file changed, 43 insertions(+)

Toggle diff (56 lines)
diff --git a/gnu/packages/freedesktop.scm b/gnu/packages/freedesktop.scm
index b6aaf1f1ba..5d496da71e 100644
--- a/gnu/packages/freedesktop.scm
+++ b/gnu/packages/freedesktop.scm
@@ -1733,6 +1733,49 @@ (define-public libqmi
;; The qmicli tool is released under the GPLv2+ license.
(list license:lgpl2.0+ license:gpl2+))))
+(define-public low-memory-monitor
+ (package
+ (name "low-memory-monitor")
+ (version "2.1")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://gitlab.freedesktop.org/hadess/low-memory-monitor")
+ (commit version)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "0431wzn9q2hnx0mwai8w3bcmbln8g76r7wyyhjbkamnl2sccl8jn"))))
+ (build-system meson-build-system)
+ (arguments
+ `(#:configure-flags (list "-Dsystemdsystemunitdir=false")
+ #:tests? #f
+ #:glib-or-gtk? #t))
+ (native-inputs
+ (list `(,glib "bin") gtk-doc libxml2
+ gobject-introspection pkg-config))
+ (inputs
+ (list glib libgudev eudev))
+ (synopsis "Daemon to send information about memory pressure to userspace")
+ (description
+ "The Low Memory Monitor is an early boot daemon that will monitor memory
+pressure information coming from the kernel, and, when memory pressure means
+that memory isn't as readily available and would cause interactivity problems,
+ would:
+
+@itemize
+@item send D-Bus signals to user-space applications when memory is running low,
+
+@item if configured to do so and memory availability worsens, activate the kernel's
+OOM killer.
+@end itemize
+
+It is designed for use on traditional Linux systems, with interactive user interfaces
+and D-Bus communication.")
+ (home-page "https://gitlab.freedesktop.org/hadess/low-memory-monitor")
+ (license license:gpl3)))
+
(define-public modem-manager
(package
(name "modem-manager")
--
2.38.0
F
F
florhizome wrote on 3 Nov 2022 21:59
[PATCH v2 1/3] gnu: Add iio-sensor-proxy
(address . 58501@debbugs.gnu.org)(name . florhizome)(address . florhizome@posteo.net)
8dc869129712737addcc056b47384d3fd66c8977.1667508108.git.florhizome@posteo.net
From: florhizome <florhizome@posteo.net>

Second round, adjust to gexp argument style, enable all tests and minor improvements

* gnu/packages/freedesktop.scm (Add iio-sendor-proxy): New variable.
---
gnu/packages/freedesktop.scm | 51 ++++++++++++++++++++++++++++++++++++
1 file changed, 51 insertions(+)

Toggle diff (77 lines)
diff --git a/gnu/packages/freedesktop.scm b/gnu/packages/freedesktop.scm
index 07ccf9f8f2..8190f59c48 100644
--- a/gnu/packages/freedesktop.scm
+++ b/gnu/packages/freedesktop.scm
@@ -31,6 +31,7 @@
;;; Copyright © 2022 Daniel Meißner <daniel.meissner-i4k@ruhr-uni-bochum.de>
;;; Copyright © 2022 muradm <mail@muradm.net>
;;; Copyright © 2022 Petr Hodina <phodina@protonmail.com>
+;;; Copyright © 2022 florhizome <florhizome@posteo.net>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -728,6 +729,56 @@ (define-public elogind
of a the system to know what users are logged in, and where.")
(license license:lgpl2.1+)))
+(define-public iio-sensor-proxy
+ (package
+ (name "iio-sensor-proxy")
+ (version "3.1")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://gitlab.freedesktop.org/hadess/iio-sensor-proxy")
+ (commit version)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "1dpcc3i53aw5illfhfkwxy0hsjsnya5iw4iv4al46vgyvcnvjc8z"))))
+ (build-system meson-build-system)
+ (arguments
+ (list #:configure-flags
+ #~(list "-Dsystemdsystemunitdir=false"
+ (string-append "-Dudevrulesdir="
+ #$output "/lib/udev"))
+ #:glib-or-gtk? #t
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-before 'configure 'fake-pkexec
+ (lambda _
+ (setenv "PKEXEC_UID" "-1")))
+ (add-before 'configure 'correct-polkit-dir
+ (lambda _
+ (substitute* "meson.build"
+ (("polkit_gobject_dep\\..*")
+ (string-append "'" #$output "/share/polkit-1/actions'"))))))))
+ (native-inputs
+ (list dbus
+ (list glib "bin")
+ gobject-introspection
+ python
+ python-dbusmock
+ python-psutil
+ pkg-config
+ umockdev))
+ (inputs
+ (list glib libgudev polkit))
+ (home-page "https://gitlab.freedesktop.org/hadess/iio-sensor-proxy")
+ (synopsis "Proxies sensor devices to applications through D-Bus")
+ (description "With a GNOME 3.18 (or newer) based system, orientation changes
+ will automatically be applied when rotating the panel, ambient light will be
+ used to change the screen brightness, and GeoClue will be able to read the compass
+data to show the direction in Maps.")
+ (license license:gpl3)))
+
(define-public basu
(package
(name "basu")

base-commit: 754f260753fb6ebe28325616bc08336a184e4621
prerequisite-patch-id: 36ae907c0ae2cbc001f774c0514ab217855270c2
prerequisite-patch-id: 2c99b804c1a929fc9d74b4c3d92263cbd296f785
prerequisite-patch-id: 2525aea715c2eb5be5f61e2e14296a36898413ca
prerequisite-patch-id: f7afbf36e2776eced1e69090ec127a40456efca4
--
2.38.0
F
F
florhizome wrote on 3 Nov 2022 21:59
[PATCH v2 2/3] gnu: Add power-profiles-daemon
(address . 58501@debbugs.gnu.org)(name . florhizome)(address . florhizome@posteo.net)
cb19604073e55323c11807491c4aee8fbce3bf64.1667508108.git.florhizome@posteo.net
From: florhizome <florhizome@posteo.net>

* gnu/packages/freedesktop.scm (Add power-profiles-daemon): New variable.
---
gnu/packages/freedesktop.scm | 57 ++++++++++++++++++++++++++++++++++++
1 file changed, 57 insertions(+)

Toggle diff (70 lines)
diff --git a/gnu/packages/freedesktop.scm b/gnu/packages/freedesktop.scm
index 8190f59c48..5c2cc16345 100644
--- a/gnu/packages/freedesktop.scm
+++ b/gnu/packages/freedesktop.scm
@@ -990,6 +990,63 @@ (define-public packagekit
manager for the current system.")
(license license:gpl2+)))
+(define-public power-profiles-daemon
+ (package
+ (name "power-profiles-daemon")
+ (version "0.12")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://gitlab.freedesktop.org/hadess/power-profiles-daemon")
+ (commit version)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "1wqcajbj358zpyj6y4h1v34y2yncq76wqxd0jm431habcly0bqyr"))))
+ (build-system meson-build-system)
+ (arguments
+ (list #:configure-flags #~(list "-Dsystemdsystemunitdir=false")
+ #:glib-or-gtk? #t
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-before 'install 'fake-pkexec
+ (lambda _ (setenv "PKEXEC_UID" "-1")))
+ (add-before 'configure 'correct-polkit-dir
+ (lambda _
+ (substitute* "meson.build"
+ (("polkit_gobject_dep\\..*")
+ (string-append "'" #$output "/share/polkit-1/actions'")))))
+ (add-after 'install 'wrap-program
+ (lambda _
+ (wrap-program
+ (string-append #$output "/bin/powerprofilesctl")
+ `("GUIX_PYTHONPATH" = (,(getenv "GUIX_PYTHONPATH")))
+ `("GI_TYPELIB_PATH" = (,(getenv "GI_TYPELIB_PATH")))))))))
+ (native-inputs
+ (list `(,glib "bin") gobject-introspection pkg-config python vala))
+ (inputs
+ (list dbus
+ dbus-glib
+ libgudev
+ glib polkit
+ python
+ python-pygobject
+ upower))
+ (home-page "https://gitlab.freedesktop.org/hadess/power-profiles-daemon")
+ (synopsis "Power profile handling over D-Bus")
+ (description "power-profiles-daemon offers to modify system behaviour based
+ upon user-selected power profiles. There are 3 different power profiles, a
+\"balanced\" default mode, a \"power-saver\" mode, as well as a \"performance\"
+ mode. The first 2 of those are available on every system. The \"performance\"
+ mode is only available on select systems and is implemented by different \"drivers\"
+ based on the system or systems it targets.
+In addition to those 2 or 3 modes (depending on the system), \"actions\" can be hooked
+up to change the behaviour of a particular device. For example, this can be used
+to disable the fast-charging for some USB devices when in power-saver mode.")
+ (license license:gpl3)))
+
+
(define-public python-libevdev
(package
(name "python-libevdev")
--
2.38.0
F
F
florhizome wrote on 3 Nov 2022 21:59
[PATCH v2 3/3] gnu: Add low-memory-monitor
(address . 58501@debbugs.gnu.org)(name . florhizome)(address . florhizome@posteo.net)
51a9c9f7e617c42e11eb0b63518456763130fdf6.1667508108.git.florhizome@posteo.net
From: florhizome <florhizome@posteo.net>

* gnu/packages/freedesktop.scm (Add low-memory-monitor): New variable.
---
gnu/packages/freedesktop.scm | 43 ++++++++++++++++++++++++++++++++++++
1 file changed, 43 insertions(+)

Toggle diff (56 lines)
diff --git a/gnu/packages/freedesktop.scm b/gnu/packages/freedesktop.scm
index 5c2cc16345..736c951c68 100644
--- a/gnu/packages/freedesktop.scm
+++ b/gnu/packages/freedesktop.scm
@@ -1735,6 +1735,49 @@ (define-public libqmi
;; The qmicli tool is released under the GPLv2+ license.
(list license:lgpl2.0+ license:gpl2+))))
+(define-public low-memory-monitor
+ (package
+ (name "low-memory-monitor")
+ (version "2.1")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://gitlab.freedesktop.org/hadess/low-memory-monitor")
+ (commit version)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "0431wzn9q2hnx0mwai8w3bcmbln8g76r7wyyhjbkamnl2sccl8jn"))))
+ (build-system meson-build-system)
+ (arguments
+ (list #:configure-flags #~(list "-Dsystemdsystemunitdir=false")
+ #:glib-or-gtk? #t))
+ (native-inputs
+ (list (list glib "bin") gobject-introspection gtk-doc libxml2
+ pkg-config))
+ (inputs
+ (list glib libgudev eudev))
+ (home-page "https://gitlab.freedesktop.org/hadess/low-memory-monitor")
+
+ (synopsis "Daemon to send information about memory pressure to userspace")
+ (description
+ "Low Memory Monitor is an early boot daemon that will monitor memory
+pressure information coming from the kernel, and, when memory pressure means
+that memory isn't as readily available and would cause interactivity problems,
+ would:
+
+@itemize
+@item send D-Bus signals to user-space applications when memory is running low,
+
+@item if configured to do so and memory availability worsens, activate the
+ kernel's OOM killer.
+@end itemize
+
+It is designed for use on traditional Linux systems, with interactive user
+interfaces and D-Bus communication.")
+ (license license:gpl3)))
+
(define-public modem-manager
(package
(name "modem-manager")
--
2.38.0
F
F
florhizome wrote on 14 Mar 2023 16:44
[PATCH] gnu: Add userspace desktop services
(address . 58501@debbugs.gnu.org)
bd61533d5090daf6f8479a5952be0a5e1f44615d.camel@posteo.net
this can be closed, I opened single issues.
T
T
Tobias Geerinckx-Rice wrote on 14 Mar 2023 16:48
2E2239EB-81B2-4E23-B6EB-79FA880BD4A8@tobias.gr
Hi florhizome,

I think you forgot to -close ;-)

Done now.

Kind regards,

T G-R

Sent on the go. Excuse or enjoy my brevity.
?