Browse Source

Move i3-specific utils to live along i3 config

Alois Mahdal 5 years ago
parent
commit
830165491e
3 changed files with 18 additions and 2 deletions
  1. 2
    2
      dotfiles/config/bmo/menu.ini
  2. 4
    0
      dotfiles/i3/bin/i3-focuswin
  3. 12
    0
      dotfiles/i3/bin/i3-lswin

+ 2
- 2
dotfiles/config/bmo/menu.ini View File

@@ -54,5 +54,5 @@
54 54
     consumer = pwatcher -
55 55
 
56 56
 [menu.def.windows]
57
-    generator = i3-lswin
58
-    consumer = i3-focuswin
57
+    generator = ~/.i3/bin/i3-lswin
58
+    consumer = ~/.i3/bin/i3-focuswin

+ 4
- 0
dotfiles/i3/bin/i3-focuswin View File

@@ -0,0 +1,4 @@
1
+#!/bin/sh
2
+
3
+sed -ne 's/.* \([0-9]*\)/[id=\1] focus/p' \
4
+  | (read -r cmd; i3-msg "$cmd")

+ 12
- 0
dotfiles/i3/bin/i3-lswin View File

@@ -0,0 +1,12 @@
1
+#!/bin/bash
2
+
3
+lswindows() {
4
+    echo -ne "i3-ipc\x0\x0\x0\x0\x4\x0\x0\x0" \
5
+      | socat STDIO "UNIX-CLIENT:$(i3 --get-socketpath)" \
6
+      | tail -c +15 \
7
+      | sed -e 's/"id":/\n"id":/g' \
8
+      | sed -ne 's/.*"name":"\([^"]\+\)".*"window":\([0-9]\+\).*/\1 \2/p' \
9
+      | grep .
10
+}
11
+
12
+lswindows