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 00000000..170a5057 Binary files /dev/null and b/i3-current-layout/screenshot-splitv.png differ diff --git a/i3-current-layout/screenshot-stacked.png b/i3-current-layout/screenshot-stacked.png new file mode 100644 index 00000000..6726dc8d Binary files /dev/null and b/i3-current-layout/screenshot-stacked.png differ diff --git a/i3-current-layout/screenshot-tabbed.png b/i3-current-layout/screenshot-tabbed.png new file mode 100644 index 00000000..918f3d5a Binary files /dev/null and b/i3-current-layout/screenshot-tabbed.png differ