i3blocks: move win title to separate script

This commit is contained in:
Daniel Lundin 2020-03-08 19:51:45 +01:00
parent 75c5b20eb7
commit 7e2f254204
No known key found for this signature in database
GPG key ID: 6AB527C9196ACDCC
2 changed files with 9 additions and 1 deletions

View file

@ -3,7 +3,7 @@ separator_block_width=40
[window]
align=left
command=swaymsg -t subscribe -m '["window"]' | stdbuf -oL jq --unbuffered -M -r '.container.name // empty' | stdbuf -oL cut -c -80 | stdbuf -oL sed -e 's/ *$//'
command=~/.config/i3blocks/win-title
interval=persist
background=#000000cc

8
.config/i3blocks/win-title Executable file
View file

@ -0,0 +1,8 @@
#!/bin/sh
set -o pipefail
while true; do
swaymsg -t subscribe -m '["window"]' \
| stdbuf -oL jq --unbuffered -M -r '.container.name // empty' \
| stdbuf -oL cut -c -80 \
| stdbuf -oL sed -e 's/ *$//'
done