~abcdw/rde-devel

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
2 2

[PATCH] contrib: Move feature ydotool to contrib.

Details
Message ID
<20230403180331.7281-1-ngraves@ngraves.fr>
DKIM signature
missing
Download raw message
Patch: +66 -53
---
 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
Details
Message ID
<87wmznisyg.fsf@ngraves.fr>
In-Reply-To
<20230403180331.7281-1-ngraves@ngraves.fr> (view parent)
DKIM signature
missing
Download raw message
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 ;)

-- 
Best regards,
Nicolas Graves
Details
Message ID
<87352a7mjn.fsf@trop.in>
In-Reply-To
<87wmznisyg.fsf@ngraves.fr> (view parent)
DKIM signature
missing
Download raw message
On 2023-06-28 16:04, Nicolas Graves wrote:

> 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 ;)

I don't have too much use cases for neither ydotool nor wtype ATM, but I
think ydotool does quite a good job and can't be completely substituted
by wtype, so I don't mind keeping it in rde features xdisorg (I don't
insist either).

Miguel, WDYT?

-- 
Best regards,
Andrew Tropin
Reply to thread Export thread (mbox)