From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ivan Vilata i Balaguer Subject: [PATCH 2/2] gnu: wm: Add quickswitch-i3. Date: Mon, 19 Sep 2016 14:45:00 +0200 Message-ID: <20160919124500.GA19342@sax.terramar.selidor.net> References: Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="XsQoSWH+UP9D9v3l" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:60810) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1blxwa-0005Wd-1J for guix-devel@gnu.org; Mon, 19 Sep 2016 08:45:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1blxwT-0006l1-Uj for guix-devel@gnu.org; Mon, 19 Sep 2016 08:45:06 -0400 Received: from lev.selidor.net ([2600:3c03:e001:1100::1]:42908) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1blxwT-0006km-Rh for guix-devel@gnu.org; Mon, 19 Sep 2016 08:45:01 -0400 Content-Disposition: inline In-Reply-To: List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: guix-devel@gnu.org --XsQoSWH+UP9D9v3l Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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/p= ackages/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 . + +--- quickswitch-for-i3-2.2/quickswitch.py 2016-09-18 19:59:10.257765542 +0= 200 ++++ quickswitch-for-i3-2.2/quickswitch.py 2016-09-19 11:00:51.147101323 +0= 200 +@@ -37,11 +37,14 @@ +=20 + def check_dmenu(): + '''Check if dmenu is available.''' +- devnull =3D open(os.devnull) +- retcode =3D subprocess.call(["which", "dmenu"], +- stdout=3Ddevnull, +- stderr=3Ddevnull) +- return True if retcode =3D=3D 0 else False ++ with open(os.devnull, 'w') as devnull: ++ try: ++ retcode =3D subprocess.call(["dmenu", "-v"], ++ stdout=3Ddevnull, ++ stderr=3Ddevnull) ++ return retcode =3D=3D 0 ++ except OSError: ++ return False +=20 +=20 + 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)) =20 @@ -246,6 +247,51 @@ subscribe to events.") (define-public python2-i3-py (package-with-python2 python-i3-py)) =20 +(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 commi= ts + ;; 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 m= anager") + (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") --=20 2.10.0 --=20 Ivan Vilata i Balaguer -- https://elvil.net/ --XsQoSWH+UP9D9v3l Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJX393MAAoJED3swQX13SOC4LEP/RGa4v0NRlxrkvIUpdi+eues fWidd8OSYWLYL1tKNI9zgzHjpG7S3k6bo14UEpVM5YSLO+OOtWbl1fv19utpYyRp 4GgDmYbcEXrZx/OUWKD5X8OXVrtmuekNrzyFOpqf1nyixihjuequB1R4Ctv+2CV4 sxBRBLYK83X7AhN9wBaBcNmbg/nKL0k1qlRQ+xXp65RrdwyYz8Ce2mBK3cxd0c+T fSmLSG7qX+RbznJAyxffsaiKGuQ/YU4RR5cG7pQuncHCEYhFkaa8fqlTPBzC8QA1 APZtcAVO4noLeUo2A6WFGIwoxJVE6rEkRA25y556s1hABaELta/17ZIck5GmdVi2 6Zj5LqMSJobS+0hn1MV5xUAszqG9ez0prn/IYAYtb0sWD/r/t9cssFNQybiBQniG nlSaMCyY/Klxal6hOnb4OE5DuYbAv3K2dEUlRN7boCbwUJoTZF1dFF2Aa7ju+PLb K9QVQ8XQrQ/dz7b/UibANSPDLTY9MVMeNjPwSRCfZVbsjsMFdC4PY27I7OB/cY6i 9yvk1JFMP+VlZVjqGuEyLqqIlVrpobMXivHlTVce9Fm+J7n4govT1vAVB5t4WhV9 bev1L67W3HoFiJQ2Abu2Y/ORbMwT3+426Ybma7/MaHM7Kn/vMgKQR84olkMIe+pA fva821TOlM0nrkT4GDMB =LAL2 -----END PGP SIGNATURE----- --XsQoSWH+UP9D9v3l--