From 274934c110632ab4f7574965d7d610f728727372 Mon Sep 17 00:00:00 2001 From: Sebastian Plaza Date: Mon, 18 Dec 2023 09:41:13 +0100 Subject: [PATCH] i3-current-layout: add i3-current-layout, shows current window layout mode --- i3-current-layout/README.md | 26 +++++++++++++++++++++++ i3-current-layout/i3-current-layout | 18 ++++++++++++++++ i3-current-layout/screenshot-splitv.png | Bin 0 -> 895 bytes i3-current-layout/screenshot-stacked.png | Bin 0 -> 1184 bytes i3-current-layout/screenshot-tabbed.png | Bin 0 -> 899 bytes 5 files changed, 44 insertions(+) create mode 100644 i3-current-layout/README.md create mode 100755 i3-current-layout/i3-current-layout create mode 100644 i3-current-layout/screenshot-splitv.png create mode 100644 i3-current-layout/screenshot-stacked.png create mode 100644 i3-current-layout/screenshot-tabbed.png diff --git a/i3-current-layout/README.md b/i3-current-layout/README.md new file mode 100644 index 00000000..42bdd04a --- /dev/null +++ b/i3-current-layout/README.md @@ -0,0 +1,26 @@ +# i3 Current layout + +Displays i3 layout mode of the current window + +Example: + +![splitv](./screenshot-splitv.png) + +![stacked](./screenshot-stacked.png) + +![tabbed](./screenshot-tabbed.png) + +## Requirements + +Dependencies: `jq` + +## Installation + +The recommended i3blocks config is + +```INI +[i3-current-layout] +command=$SCRIPT_DIR/i3-current-layout +color=#DCD427 +interval=1 +``` diff --git a/i3-current-layout/i3-current-layout b/i3-current-layout/i3-current-layout new file mode 100755 index 00000000..32a0b433 --- /dev/null +++ b/i3-current-layout/i3-current-layout @@ -0,0 +1,18 @@ +#!/usr/bin/env bash + +# Copyright 2023 Sebastian Plaza +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +i3-msg -t get_tree | jq -r 'recurse(.nodes[];.nodes!=null)|select(.nodes[].focused).layout' diff --git a/i3-current-layout/screenshot-splitv.png b/i3-current-layout/screenshot-splitv.png new file mode 100644 index 0000000000000000000000000000000000000000..170a50576eb5c499ac1924f5a0e5727c91c06682 GIT binary patch literal 895 zcmV-_1AzRAP)q%;XTSMER2{6n3xz=ERriL5*=ul z;sp_*0=PWD$jFeHD(vabiz(GuE52~HEF&Xf^DzMn-Te0dKg0CdZ>er96IM}6bFOtO z2i*DF907;+L~ zWMr5>Q|8VU_2_T`YfG-%m(}lFQJ*(MhLMqhiHTwPLb--&akyeBN!H6}RBbG|344Hx zi>bd$^5UiMu0HpJA|9^U@R140k*utY8fxsG{`c+O@A2_7wKYmGVGjfZ`1|+2ci;mx zy_;vweMgIv#PlaBIyaZD{BZR6H&xx6DmpilGM@bZ&+zXb!j7OlGEB3=9m+OblKgygPS){`KoWVGq21^JnLt&)sbjbEe4@e!A?(Lbels#K$jP$N!UM10{5g60o0mH;0|SG+9Gj*F$JQO6F_mHQz`uVCMdi=K zV;>zl`c+q(W91^*Ab)-oJ+KtT%)~%m(LoIO|DR#=w$G0CJlxz&p6@OL{ptzM~fpbTlnzNuPTKKz=b%7Jfd$1r!84eDqsgm0eARot>Q# zxeodC`QO1KUvo2s73A5r?fgunX$(Sw%+n@HAKj;XFP~AJ(kCS(h~i2{Mux;V!PAFTZeLc1*G-{;{E#vfj&58~gBQ&V3=Dj{Oj9RF zT|TXP`!ci`g#&wA?pv4CS1ghvSk@5*oE>?toK@rEqKaYE0fWdXBh&+)8MR002ovPDHLkV1oAiwORlG literal 0 HcmV?d00001 diff --git a/i3-current-layout/screenshot-stacked.png b/i3-current-layout/screenshot-stacked.png new file mode 100644 index 0000000000000000000000000000000000000000..6726dc8db89db0186bead22583315c0a53c52c85 GIT binary patch literal 1184 zcmV;R1Yi4!P)^_vF+K|#>S6r{E!SLsDxeDdFOSd$%)=k zXm(LuXkl;=B1vdMKj^5;q94>@sOu<547l<*0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