unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
blob 9c6cca47c6af43c0c399d07e6302663cd35d7238 850 bytes (raw)
name: packages/patches/quickswitch-fix-dmenu-check.patch 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
 
Fix check for dmenu (open file mode, dependency on which).

See <https://github.com/proxypoke/quickswitch-for-i3/pull/24>.

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

debug log:

solving 9c6cca47c6af43c0c399d07e6302663cd35d7238 ...
found 9c6cca47c6af43c0c399d07e6302663cd35d7238 in https://git.savannah.gnu.org/cgit/guix.git

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).