Procházet zdrojové kódy

Move i3-specific utils to live along i3 config

Alois Mahdal před 5 roky
rodič
revize
830165491e

+ 2
- 2
dotfiles/config/bmo/menu.ini Zobrazit soubor

@@ -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 Zobrazit soubor

@@ -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 Zobrazit soubor

@@ -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