all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: John Kehayias via Guix-patches via <guix-patches@gnu.org>
To: 53222@debbugs.gnu.org
Cc: "~whereiseveryone/guixrus@lists.sr.ht"
	<~whereiseveryone/guixrus@lists.sr.ht>
Subject: [bug#53222] [PATCH] gnu: Add autokey.
Date: Wed, 12 Jan 2022 21:03:00 +0000	[thread overview]
Message-ID: <Kubuvj_ZYaawCDW6qu7U-Z-q_Sj1s_8I8hNmJo1u-hkGHByPRsJ_y6joxVtJiJnezoX01VMS1538BIBPlkhDKYxnu0uwEA3nZzb_YRDbszE=@protonmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 645 bytes --]

Hello,

Here is a patch for autokey, a python based program for things like keyboard shortcuts and text expansion. I find it invaluable for having emacs-like keys everywhere.

It includes both a gtk and qt frontend; after discussion on IRC I decided against trying to split them. Since it is one package and it is built together, it is a bit tricky I think to disentangle the code and paths needed for each. In my first attempts it didn't reduce the closure and needed a lot of manual work. Possibly it could work with more effort, but since this is used as a GUI tool primarily, the GTK/QT packages shouldn't be adding anything new.

John

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-Add-autokey.patch --]
[-- Type: text/x-patch; name=0001-gnu-Add-autokey.patch, Size: 3466 bytes --]

From 419a8587d6101b8ac48922ff06d75ecd405e16e9 Mon Sep 17 00:00:00 2001
From: John Kehayias <john.kehayias@protonmail.com>
Date: Wed, 12 Jan 2022 15:51:17 -0500
Subject: [PATCH] gnu: Add autokey.

* gnu/packages/python-xyz.scm (autokey): New variable.
---
 gnu/packages/python-xyz.scm | 62 +++++++++++++++++++++++++++++++++++++
 1 file changed, 62 insertions(+)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 4df794eb60..b85232f2b7 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -114,6 +114,7 @@
 ;;; Copyright © 2021 ZmnSCPxj <ZmnSCPxj@protonmail.com>
 ;;; Copyright © 2021 Filip Lajszczak <filip@lajszczak.dev>
 ;;; Copyright © 2021 Greg Hogan <code@greghogan.com>
+;;; Copyright © 2022 John Kehayias <john.kehayias@protonmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -4180,6 +4181,67 @@ (define-public python-anytree
 structure for Python.")
     (license license:asl2.0)))
 
+(define-public autokey
+  (package
+    (name "autokey")
+    (version "0.95.10")
+    (source (origin
+             (method git-fetch)
+             (uri (git-reference
+                   (url "https://github.com/autokey/autokey")
+                   (commit (string-append "v" version))))
+             (file-name (git-file-name name version))
+             (sha256
+              (base32
+               "0f0cqfnb49wwdy7zl2f2ypcnd5pc8r8n7z7ssxkq20d4xfxlgamr"))))
+    (build-system python-build-system)
+    (arguments
+     (list
+      #:tests? #f ; Tests are deprecated/broken until next version.
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'unpack 'fix-paths
+            (lambda* (#:key inputs #:allow-other-keys)
+              (substitute* "lib/autokey/scripting.py"
+                (("\"wmctrl\"")
+                 (string-append "\"" (search-input-file inputs "bin/wmctrl") "\""))
+                (("\"zenity\"")
+                 (string-append "\"" (search-input-file inputs "bin/zenity") "\"")))))
+          (add-after 'install 'wrap-autokey
+            (lambda _
+              (let ((gi-typelib-path (getenv "GI_TYPELIB_PATH")))
+                (for-each
+                 (lambda (program)
+                   (wrap-program program
+                     `("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path))))
+                 (map (lambda (name)
+                        (string-append #$output "/bin/" name))
+                      '("autokey-gtk"
+                        "autokey-shell")))))))))
+    (inputs
+     (list bash-minimal ; for wrap-program
+           gtksourceview-3
+           libappindicator
+           libnotify
+           wmctrl
+           zenity))
+    (propagated-inputs
+     (list python-dbus
+           python-pygobject
+           python-pyinotify
+           python-pyqt+qscintilla
+           python-xlib))
+    (home-page "https://github.com/autokey/autokey")
+    (synopsis
+      "Keyboard and GUI automation utility")
+    (description
+      "AutoKey is a desktop automation utility for X11.  It allows the automation of
+virtually any task by responding to typed abbreviations and hotkeys.  It
+offers a full-featured GUI (GTK and QT versions) that makes it highly
+accessible for novices, as well as a scripting interface offering the full
+flexibility and power of the Python language.")
+    (license license:gpl3+)))
+
 (define-public python-docutils
   (package
     (name "python-docutils")
-- 
2.34.0


             reply	other threads:[~2022-01-12 21:07 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-12 21:03 John Kehayias via Guix-patches via [this message]
2022-01-12 21:22 ` [bug#53222] [PATCH] gnu: Add autokey Nicolas Goaziou
2022-01-12 21:26 ` Maxime Devos
2022-01-12 21:55   ` John Kehayias via Guix-patches via
2022-01-13  7:34     ` Maxime Devos
2022-01-14 20:40 ` [bug#53222] [PATCH] gnu: autokey fix paths John Kehayias via Guix-patches via
2022-01-14 22:35   ` Maxime Devos
2022-01-14 22:48     ` John Kehayias via Guix-patches via
2022-01-15 11:17       ` Maxime Devos
2022-01-15 20:03         ` John Kehayias via Guix-patches via
2022-01-15 20:32           ` bug#53222: " Nicolas Goaziou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='Kubuvj_ZYaawCDW6qu7U-Z-q_Sj1s_8I8hNmJo1u-hkGHByPRsJ_y6joxVtJiJnezoX01VMS1538BIBPlkhDKYxnu0uwEA3nZzb_YRDbszE=@protonmail.com' \
    --to=guix-patches@gnu.org \
    --cc=53222@debbugs.gnu.org \
    --cc=john.kehayias@protonmail.com \
    --cc=~whereiseveryone/guixrus@lists.sr.ht \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.