all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [PATCH 1/2] gnu: wm: Add python-i3-py.
       [not found] <cover.1474288491.git.ivan@selidor.net>
@ 2016-09-19 12:44 ` Ivan Vilata i Balaguer
  2016-09-20 14:44   ` Alex Kost
  2016-09-19 12:45 ` [PATCH 2/2] gnu: wm: Add quickswitch-i3 Ivan Vilata i Balaguer
  1 sibling, 1 reply; 4+ messages in thread
From: Ivan Vilata i Balaguer @ 2016-09-19 12:44 UTC (permalink / raw)
  To: guix-devel

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

Thanks to Brendan Tildesley, Leo Famulari and Hartmut Goebel for testing and
advice.

* gnu/packages/wm.scm (python-i3-py, python2-i3-py): New variables.
---
 gnu/packages/wm.scm | 44 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 44 insertions(+)

diff --git a/gnu/packages/wm.scm b/gnu/packages/wm.scm
index 6275e6f..39ecb20 100644
--- a/gnu/packages/wm.scm
+++ b/gnu/packages/wm.scm
@@ -34,6 +34,7 @@
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system haskell)
+  #:use-module (guix build-system python)
   #:use-module (gnu packages haskell)
   #:use-module (gnu packages base)
   #:use-module (gnu packages pkg-config)
@@ -202,6 +203,49 @@ from scratch.  i3 is primarily targeted at advanced users and
 developers.")
     (license license:bsd-3)))
 
+(define-public python-i3-py
+  (package
+    (name "python-i3-py")
+    (version "0.6.5")
+    (source
+     (origin
+       ;; The latest release is not tagged in Git nor has an entry in PyPi,
+       ;; but there is still a clear commit for it, and it's been the last one
+       ;; for years.
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/ziberna/i3-py.git")
+             (commit "27f88a616e9ecc340e7d041d3d00782f8a1964c1")))
+       (sha256
+        (base32
+         "1nm719dc2xqlll7vj4c4m7mpjb27lpn3bg3c66gajvnrz2x1nmxs"))
+       (file-name (string-append name "-" version "-checkout"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:tests? #f ; no tests yet
+       #:phases
+       (alist-cons-after
+        'install 'install-doc
+        ;; Copy readme file to documentation directory.
+        (lambda* (#:key outputs #:allow-other-keys)
+          (let ((doc (string-append (assoc-ref outputs "out")
+                                    "/share/doc/" ,name "-" ,version)))
+            (mkdir-p doc)
+            (copy-file "README.md" (string-append doc "/README.md"))))
+        %standard-phases)))
+    (propagated-inputs
+     `(("i3-wm" ,i3-wm)))
+    (home-page "https://github.com/ziberna/i3-py")
+    (synopsis "Python interface to the i3 window manager")
+    (description "This package allows you to interact from a Python program
+with the i3 window manager via its IPC socket.  It can send commands and other
+kinds of messages to i3, select the affected containers, filter results and
+subscribe to events.")
+    (license license:gpl3+)))
+
+(define-public python2-i3-py
+  (package-with-python2 python-i3-py))
+
 (define-public xmonad
   (package
     (name "xmonad")
-- 
2.10.0


-- 
Ivan Vilata i Balaguer -- https://elvil.net/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] gnu: wm: Add quickswitch-i3.
       [not found] <cover.1474288491.git.ivan@selidor.net>
  2016-09-19 12:44 ` [PATCH 1/2] gnu: wm: Add python-i3-py Ivan Vilata i Balaguer
@ 2016-09-19 12:45 ` Ivan Vilata i Balaguer
  1 sibling, 0 replies; 4+ messages in thread
From: Ivan Vilata i Balaguer @ 2016-09-19 12:45 UTC (permalink / raw)
  To: guix-devel

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

Thanks to Brendan Tildesley, Leo Famulari and Hartmut Goebel for testing and
advice.

* gnu/packages/wm.scm (quickswitch-i3): New variable.
---
 .../patches/quickswitch-fix-dmenu-check.patch      | 26 ++++++++++++
 gnu/packages/wm.scm                                | 46 ++++++++++++++++++++++
 2 files changed, 72 insertions(+)
 create mode 100644 gnu/packages/patches/quickswitch-fix-dmenu-check.patch

diff --git a/gnu/packages/patches/quickswitch-fix-dmenu-check.patch b/gnu/packages/patches/quickswitch-fix-dmenu-check.patch
new file mode 100644
index 0000000..3328af3
--- /dev/null
+++ b/gnu/packages/patches/quickswitch-fix-dmenu-check.patch
@@ -0,0 +1,26 @@
+Fix Debian-specific check for dmenu.
+
+See <https://github.com/proxypoke/quickswitch-for-i3/pull/28>.
+
+--- quickswitch-for-i3-2.2/quickswitch.py	2016-09-18 19:59:10.257765542 +0200
++++ quickswitch-for-i3-2.2/quickswitch.py	2016-09-19 11:00:51.147101323 +0200
+@@ -37,11 +37,14 @@
+ 
+ def check_dmenu():
+     '''Check if dmenu is available.'''
+-    devnull = open(os.devnull)
+-    retcode = subprocess.call(["which", "dmenu"],
+-                              stdout=devnull,
+-                              stderr=devnull)
+-    return True if retcode == 0 else False
++    with open(os.devnull, 'w') as devnull:
++        try:
++            retcode = subprocess.call(["dmenu", "-v"],
++                                      stdout=devnull,
++                                      stderr=devnull)
++            return retcode == 0
++        except OSError:
++            return False
+ 
+ 
+ def dmenu(options, dmenu):
diff --git a/gnu/packages/wm.scm b/gnu/packages/wm.scm
index 39ecb20..a8db05f 100644
--- a/gnu/packages/wm.scm
+++ b/gnu/packages/wm.scm
@@ -59,6 +59,7 @@
   #:use-module (gnu packages gperf)
   #:use-module (gnu packages imagemagick)
   #:use-module (gnu packages lua)
+  #:use-module (gnu packages suckless)
   #:use-module (guix download)
   #:use-module (guix git-download))
 
@@ -246,6 +247,51 @@ subscribe to events.")
 (define-public python2-i3-py
   (package-with-python2 python-i3-py))
 
+(define-public quickswitch-i3
+  (let ((commit "ed692b1e8f43b95bd907ced26238ce8ccb2ed28f")
+        (revision "1")) ; Guix package revision
+      (package
+        (name "quickswitch-i3")
+        (version (string-append "2.2-" revision "."
+                                (string-take commit 7)))
+        (source
+         (origin
+           ;; The latest commit is a few years old and just a couple commits
+           ;; after the last tagged release, so we use that latest commit
+           ;; instead of the release.
+           (method git-fetch)
+           (uri (git-reference
+                 (url "https://github.com/proxypoke/quickswitch-for-i3.git")
+                 (commit commit)))
+           (sha256
+            (base32
+             "0447077sama80jcdg5p64zjsvafmz5rbdrirhm1adcdjhkh6iqc5"))
+           (patches (search-patches "quickswitch-fix-dmenu-check.patch"))
+           (file-name (string-append name "-" version "-checkout"))))
+        (build-system python-build-system)
+        (arguments
+         `(#:tests? #f ; no tests yet
+           #:phases
+           (alist-cons-after
+            'install 'install-doc
+            ;; Copy readme file to documentation directory.
+            (lambda* (#:key outputs #:allow-other-keys)
+              (let ((doc (string-append (assoc-ref outputs "out")
+                                        "/share/doc/" ,name "-" ,version)))
+                (mkdir-p doc)
+                (copy-file "README.rst" (string-append doc "/README.rst"))))
+            %standard-phases)))
+        (propagated-inputs
+         `(("python-i3-py" ,python-i3-py)
+           ("dmenu" ,dmenu)))
+        (home-page "https://github.com/proxypoke/quickswitch-for-i3")
+        (synopsis "Quickly change to and locate windows in the i3 window manager")
+        (description "This utility for the i3 window manager allows you to quickly
+switch to and locate windows on all your workspaces, using an interactive
+dmenu prompt.  It has since gained a lot of other functionality to make
+working with i3 even more efficient.")
+        (license (license:non-copyleft "http://www.wtfpl.net/txt/copying/")))))
+
 (define-public xmonad
   (package
     (name "xmonad")
-- 
2.10.0


-- 
Ivan Vilata i Balaguer -- https://elvil.net/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] gnu: wm: Add python-i3-py.
  2016-09-19 12:44 ` [PATCH 1/2] gnu: wm: Add python-i3-py Ivan Vilata i Balaguer
@ 2016-09-20 14:44   ` Alex Kost
  0 siblings, 0 replies; 4+ messages in thread
From: Alex Kost @ 2016-09-20 14:44 UTC (permalink / raw)
  To: Ivan Vilata i Balaguer; +Cc: guix-devel

Ivan Vilata i Balaguer (2016-09-19 14:44 +0200) wrote:

> Thanks to Brendan Tildesley, Leo Famulari and Hartmut Goebel for testing and
> advice.
>
> * gnu/packages/wm.scm (python-i3-py, python2-i3-py): New variables.
> ---
>  gnu/packages/wm.scm | 44 ++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 44 insertions(+)
>
> diff --git a/gnu/packages/wm.scm b/gnu/packages/wm.scm
> index 6275e6f..39ecb20 100644
> --- a/gnu/packages/wm.scm
> +++ b/gnu/packages/wm.scm
> @@ -34,6 +34,7 @@
>    #:use-module (guix build-system cmake)
>    #:use-module (guix build-system gnu)
>    #:use-module (guix build-system haskell)
> +  #:use-module (guix build-system python)
>    #:use-module (gnu packages haskell)
>    #:use-module (gnu packages base)
>    #:use-module (gnu packages pkg-config)
> @@ -202,6 +203,49 @@ from scratch.  i3 is primarily targeted at advanced users and
>  developers.")
>      (license license:bsd-3)))
>  
> +(define-public python-i3-py
> +  (package
> +    (name "python-i3-py")
> +    (version "0.6.5")
> +    (source
> +     (origin
> +       ;; The latest release is not tagged in Git nor has an entry in PyPi,
> +       ;; but there is still a clear commit for it, and it's been the last one
> +       ;; for years.
> +       (method git-fetch)
> +       (uri (git-reference
> +             (url "https://github.com/ziberna/i3-py.git")
> +             (commit "27f88a616e9ecc340e7d041d3d00782f8a1964c1")))
> +       (sha256
> +        (base32
> +         "1nm719dc2xqlll7vj4c4m7mpjb27lpn3bg3c66gajvnrz2x1nmxs"))
> +       (file-name (string-append name "-" version "-checkout"))))
> +    (build-system python-build-system)
> +    (arguments
> +     `(#:tests? #f ; no tests yet
> +       #:phases
> +       (alist-cons-after
> +        'install 'install-doc

Nowadays we use 'modify-syntax' instead of calling 'alist-...'
procedures directly:

  (modify-phases %standard-phases
    (add-after 'install 'install-doc
      (lambda ...)))

> +        ;; Copy readme file to documentation directory.
> +        (lambda* (#:key outputs #:allow-other-keys)
> +          (let ((doc (string-append (assoc-ref outputs "out")
> +                                    "/share/doc/" ,name "-" ,version)))

I think it is uncommon to put doc files in a versioned directory, I
would just use "share/doc/<name>"

> +            (mkdir-p doc)
> +            (copy-file "README.md" (string-append doc "/README.md"))))

I think 'instal-file' is more suitable here:

  (install-file "README.md" doc)

Also, please add #t in the end of the phase: if a phase succeeds it
should return non-false value, and the value of 'copy-file' (and
'install-file') is not specified.

> +        %standard-phases)))
> +    (propagated-inputs
> +     `(("i3-wm" ,i3-wm)))
> +    (home-page "https://github.com/ziberna/i3-py")
> +    (synopsis "Python interface to the i3 window manager")
> +    (description "This package allows you to interact from a Python program
> +with the i3 window manager via its IPC socket.  It can send commands and other
> +kinds of messages to i3, select the affected containers, filter results and
> +subscribe to events.")
> +    (license license:gpl3+)))
> +
> +(define-public python2-i3-py
> +  (package-with-python2 python-i3-py))
> +
>  (define-public xmonad
>    (package
>      (name "xmonad")
> -- 
>
> 2.10.0

-- 
Alex

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/2] gnu: wm: Add python-i3-py.
       [not found] <cover.1474449049.git.ivan@selidor.net>
@ 2016-09-21  9:19 ` Ivan Vilata i Balaguer
  0 siblings, 0 replies; 4+ messages in thread
From: Ivan Vilata i Balaguer @ 2016-09-21  9:19 UTC (permalink / raw)
  To: guix-devel

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

Thanks to Brendan Tildesley, Leo Famulari, Hartmut Goebel and Alex Kost for
testing and advice.

* gnu/packages/wm.scm (python-i3-py, python2-i3-py): New variables.
---
 gnu/packages/wm.scm | 43 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)

diff --git a/gnu/packages/wm.scm b/gnu/packages/wm.scm
index 6275e6f..ea73d26 100644
--- a/gnu/packages/wm.scm
+++ b/gnu/packages/wm.scm
@@ -34,6 +34,7 @@
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system haskell)
+  #:use-module (guix build-system python)
   #:use-module (gnu packages haskell)
   #:use-module (gnu packages base)
   #:use-module (gnu packages pkg-config)
@@ -202,6 +203,48 @@ from scratch.  i3 is primarily targeted at advanced users and
 developers.")
     (license license:bsd-3)))
 
+(define-public python-i3-py
+  (package
+    (name "python-i3-py")
+    (version "0.6.5")
+    (source
+     (origin
+       ;; The latest release is not tagged in Git nor has an entry in PyPi,
+       ;; but there is still a clear commit for it, and it's been the last one
+       ;; for years.
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/ziberna/i3-py.git")
+             (commit "27f88a616e9ecc340e7d041d3d00782f8a1964c1")))
+       (sha256
+        (base32
+         "1nm719dc2xqlll7vj4c4m7mpjb27lpn3bg3c66gajvnrz2x1nmxs"))
+       (file-name (string-append name "-" version "-checkout"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:tests? #f ; no tests yet
+       #:phases (modify-phases %standard-phases
+                  (add-after 'install 'install-doc
+                    ;; Copy readme file to documentation directory.
+                    (lambda* (#:key outputs #:allow-other-keys)
+                      (let ((doc (string-append (assoc-ref outputs "out")
+                                                "/share/doc/" ,name)))
+                        (install-file "README.md" doc)
+                        ;; Avoid unspecified return value.
+                        #t))))))
+    (propagated-inputs
+     `(("i3-wm" ,i3-wm)))
+    (home-page "https://github.com/ziberna/i3-py")
+    (synopsis "Python interface to the i3 window manager")
+    (description "This package allows you to interact from a Python program
+with the i3 window manager via its IPC socket.  It can send commands and other
+kinds of messages to i3, select the affected containers, filter results and
+subscribe to events.")
+    (license license:gpl3+)))
+
+(define-public python2-i3-py
+  (package-with-python2 python-i3-py))
+
 (define-public xmonad
   (package
     (name "xmonad")
-- 
2.10.0


-- 
Ivan Vilata i Balaguer -- https://elvil.net/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-09-21  9:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <cover.1474288491.git.ivan@selidor.net>
2016-09-19 12:44 ` [PATCH 1/2] gnu: wm: Add python-i3-py Ivan Vilata i Balaguer
2016-09-20 14:44   ` Alex Kost
2016-09-19 12:45 ` [PATCH 2/2] gnu: wm: Add quickswitch-i3 Ivan Vilata i Balaguer
     [not found] <cover.1474449049.git.ivan@selidor.net>
2016-09-21  9:19 ` [PATCH 1/2] gnu: wm: Add python-i3-py Ivan Vilata i Balaguer

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.