Last active
August 26, 2024 10:53
-
-
Save floffy-f/62d08d2a32194d39e02bed815ffa00fe to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Put thins in your i3 block: | |
| # workspace_command /usr/local/bin/custom_zellij_bar.sh | |
| # Output readale by i3-bar | |
| RESULT="[{ | |
| \"id\": 1, | |
| \"num\": 1, | |
| \"name\": \"<flag>\", | |
| \"focused\": true, | |
| \"output\": \"eDP-1\", | |
| \"urgent\": false | |
| }]" | |
| PATTERN=#Fill the pattern your i3 displays after the Zellij session name. For me something like <myusername@machine-somedigits>:cdir | |
| i3-msg -t subscribe -m '["window"]' | { | |
| while read p; do | |
| NAME=$(echo $p | jq -r .container.name | sed -n /Zellij/p | sed 's/Zellij (\(.\+\)) - $PATTERN:\(.\+\)/\1 - (\2)/g' | sed 's/\//\\\//g') | |
| echo $RESULT | sed "s/<flag>/$NAME/g" | |
| done | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment