summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorMarcus Fritzsch <marcus_fritzsch@mentor.com>2017-08-17 16:45:56 +0200
committerMarcus Fritzsch <marcus_fritzsch@mentor.com>2017-09-04 16:53:49 +0200
commit6a4504b1fe5e17a09a019edf0377646cc5dd72aa (patch)
treee10f7da1767a327a017028e2d97f3214f68ac88e /scripts
parent0c9c1107ad673bc9a4977d57041c936678429a1e (diff)
Implement surface names
* request_surface(name: string) -> id: int. * activate_surface(name: string). * names will be mapped to their respective layers by use of the layers' surface rola match, a regex. * the generated IDs are global and not reused. * allow wp-request to use -p, disable use of pygments even if found. Things missing: * surface removal does not remove already established mappings/names. * Mostly untested. Signed-off-by: Marcus Fritzsch <marcus_fritzsch@mentor.com>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/wm-request9
1 files changed, 8 insertions, 1 deletions
diff --git a/scripts/wm-request b/scripts/wm-request
index 618da62..c98e748 100755
--- a/scripts/wm-request
+++ b/scripts/wm-request
@@ -1,5 +1,12 @@
#!/bin/sh
+nopygments=0
+if [ "$1" = "-p" ]
+then
+ nopygments=1
+ shift
+fi
+
if ! [ "$1" ]
then
echo "Usage: $0 VERB [ARGS]" >&2
@@ -15,7 +22,7 @@ set -eu
if which python 2>/dev/null 1>&2 && echo '{ "test": "1" }' | python -m json.tool 2>/dev/null 1>&2
then
- if which pygmentize 2>/dev/null 1>&2
+ if [ $nopygments = 0 ] && which pygmentize 2>/dev/null 1>&2
then
json_pretty() {
python -m json.tool | pygmentize -l json