From c165591d471ab92f63d7e3f01ca616dff7624482 Mon Sep 17 00:00:00 2001 From: Ivan Vilata i Balaguer Date: Wed, 21 Sep 2016 11:19:07 +0200 Subject: gnu: Add python-i3-py. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/wm.scm (python-i3-py, python2-i3-py): New variables. Signed-off-by: 宋文武 --- gnu/packages/wm.scm | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) (limited to 'gnu/packages/wm.scm') diff --git a/gnu/packages/wm.scm b/gnu/packages/wm.scm index 710a93397f..3dbd9043da 100644 --- a/gnu/packages/wm.scm +++ b/gnu/packages/wm.scm @@ -35,6 +35,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) @@ -203,6 +204,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") -- cgit 1.4.1 From 37356e0bf8ef930fc0db7167bb2149858f0c754f Mon Sep 17 00:00:00 2001 From: Ivan Vilata i Balaguer Date: Wed, 21 Sep 2016 11:19:20 +0200 Subject: gnu: Add quickswitch-i3. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/wm.scm (quickswitch-i3): New variable. * gnu/packages/patches/quickswitch-fix-dmenu-check.patch: New file. * gnu/local.mk (dist_patch_DATA): Register it. Signed-off-by: 宋文武 --- gnu/local.mk | 1 + .../patches/quickswitch-fix-dmenu-check.patch | 32 +++++++++++++++ gnu/packages/wm.scm | 46 ++++++++++++++++++++++ 3 files changed, 79 insertions(+) create mode 100644 gnu/packages/patches/quickswitch-fix-dmenu-check.patch (limited to 'gnu/packages/wm.scm') diff --git a/gnu/local.mk b/gnu/local.mk index b864ea9020..6e68ad4a6c 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -784,6 +784,7 @@ dist_patch_DATA = \ %D%/packages/patches/python-paste-remove-timing-test.patch \ %D%/packages/patches/python2-pygobject-2-gi-info-type-error-domain.patch \ %D%/packages/patches/qt4-ldflags.patch \ + %D%/packages/patches/quickswitch-fix-dmenu-check.patch \ %D%/packages/patches/rapicorn-isnan.patch \ %D%/packages/patches/ratpoison-shell.patch \ %D%/packages/patches/readline-link-ncurses.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 0000000000..9c6cca47c6 --- /dev/null +++ b/gnu/packages/patches/quickswitch-fix-dmenu-check.patch @@ -0,0 +1,32 @@ +Fix check for dmenu (open file mode, dependency on which). + +See . + +--- quickswitch-i3-2.2/quickswitch.py 2016-09-18 19:59:10.257765542 +0200 ++++ quickswitch-i3-2.2/quickswitch.py 2016-09-21 10:43:01.277577819 +0200 +@@ -24,9 +24,10 @@ + + import argparse + import subprocess +-import os + import re + ++from distutils.spawn import find_executable ++ + try: + import i3 + except ImportError: +@@ -37,11 +38,8 @@ + + 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 ++ executable = find_executable("dmenu") ++ return executable != None + + + def dmenu(options, dmenu): diff --git a/gnu/packages/wm.scm b/gnu/packages/wm.scm index 3dbd9043da..90d1dc1e33 100644 --- a/gnu/packages/wm.scm +++ b/gnu/packages/wm.scm @@ -11,6 +11,7 @@ ;;; Copyright © 2016 Ludovic Courtès ;;; Copyright © 2016 ng0 ;;; Copyright © 2016 doncatnip +;;; Copyright © 2016 Ivan Vilata i Balaguer ;;; ;;; This file is part of GNU Guix. ;;; @@ -60,6 +61,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 +248,50 @@ 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 (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.rst" doc) + ;; Avoid unspecified return value. + #t)))))) + (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.") + (license (license:non-copyleft "http://www.wtfpl.net/txt/copying/"))))) + (define-public xmonad (package (name "xmonad") -- cgit 1.4.1