~abcdw/rde-devel

contrib: Move feature ydotool to contrib. v1 REJECTED

Nicolas Graves: 1
 contrib: Move feature ydotool to contrib.

 2 files changed, 66 insertions(+), 53 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~abcdw/rde-devel/patches/40149/mbox | git am -3
Learn more about email & git

[PATCH] contrib: Move feature ydotool to contrib. Export this patch

---
 src/contrib/features/xdisorg.scm | 65 ++++++++++++++++++++++++++++++++
 src/rde/features/xdisorg.scm     | 54 +-------------------------
 2 files changed, 66 insertions(+), 53 deletions(-)
 create mode 100644 src/contrib/features/xdisorg.scm

diff --git a/src/contrib/features/xdisorg.scm b/src/contrib/features/xdisorg.scm
new file mode 100644
index 00000000..1b421591
--- /dev/null
+++ b/src/contrib/features/xdisorg.scm
@@ -0,0 +1,65 @@
(define-module (contrib features xdisorg)
  #:use-module (rde features)
  #:use-module (rde features predicates)
  #:use-module (rde packages)
  #:use-module (gnu packages xdisorg)
  #:use-module (gnu services)
  #:use-module (gnu services base)
  #:use-module (gnu home services)
  #:use-module (gnu home services shepherd)
  #:use-module (rde system services accounts)
  #:use-module (guix gexp)
  #:export (feature-ydotool))



;;;
;;; ydotool.
;;;

(define* (feature-ydotool
          #:key
          (ydotool ydotool))
  "Configure Ydotool, a generic command-line automation tool. This package is
in contrib, because the feature it provides are now better handled with the
wtype package."
  (ensure-pred file-like? ydotool)

  (define (get-home-services config)
    (list
     (simple-service
      'ydotool-add-ydotool-package
      home-profile-service-type
      (list ydotool))
     (simple-service
      'start-ydotoold-at-startup
      home-shepherd-service-type
      (list (shepherd-service
             (documentation "Run the ydotool daemon (ydotoold).")
             (provision '(ydotool))
             (requirement '())
             (start #~(make-forkexec-constructor
                       (list (string-append
                              #$ydotool "/bin/ydotoold"))))
             (one-shot? #f)
             (stop #~(make-kill-destructor)))))))

  (define (get-system-services _)
    (list
     (simple-service
      'ydotool-add-input-group-to-user
      rde-account-service-type
      (list "input"))
     (udev-rules-service
      'ydotool
      (udev-rule
       "80-uinput.rules"
       ;; TODO: Take it from ydotool package
       (string-append
        "KERNEL==\"uinput\", MODE==\"0660\", "
        "GROUP=\"input\", OPTIONS+=\"static_node=uinput\"")))))

  (feature
   (name 'ydotool)
   (values `((ydotool . ,ydotool)))
   (home-services-getter get-home-services)
   (system-services-getter get-system-services)))
diff --git a/src/rde/features/xdisorg.scm b/src/rde/features/xdisorg.scm
index cd6fecb6..c59c49c9 100644
--- a/src/rde/features/xdisorg.scm
+++ b/src/rde/features/xdisorg.scm
@@ -11,8 +11,7 @@
  #:use-module (rde home services xdisorg)
  #:use-module (rde system services accounts)
  #:use-module (guix gexp)
  #:export (feature-rofi
            feature-ydotool))
  #:export (feature-rofi))



;;;
@@ -64,54 +63,3 @@
                       ,(file-append rofi "/bin/rofi -show drun")))
                   '())))
   (home-services-getter get-home-services)))



;;;
;;; ydotool.
;;;

(define* (feature-ydotool
          #:key
          (ydotool ydotool))
  "Configure Ydotool."
  (ensure-pred file-like? ydotool)

  (define (get-home-services config)
    (list
     (simple-service
      'ydotool-add-ydotool-package
      home-profile-service-type
      (list ydotool))
     (simple-service
      'start-ydotoold-at-startup
      home-shepherd-service-type
      (list (shepherd-service
             (documentation "Run the ydotool daemon (ydotoold).")
             (provision '(ydotool))
             (requirement '())
             (start #~(make-forkexec-constructor
                       (list (string-append
                              #$ydotool "/bin/ydotoold"))))
             (one-shot? #f)
             (stop #~(make-kill-destructor)))))))

  (define (get-system-services _)
    (list
     (simple-service
      'ydotool-add-input-group-to-user
      rde-account-service-type
      (list "input"))
     (udev-rules-service
      'ydotool
      (udev-rule
       "80-uinput.rules"
       ;; TODO: Take it from ydotool package
       (string-append
        "KERNEL==\"uinput\", MODE==\"0660\", "
        "GROUP=\"input\", OPTIONS+=\"static_node=uinput\"")))))

  (feature
   (name 'ydotool)
   (values `((ydotool . ,ydotool)))
   (home-services-getter get-home-services)
   (system-services-getter get-system-services)))
-- 
2.39.2
Hi Andrew!

Just a quick reminder on this one. Since I've found wtype, I don't see a
reason to recommend ydotool anymore, even if it works fine ;)