diff options
author | Toby Vincent <tobyv@tobyvin.dev> | 2024-09-03 10:24:41 -0500 |
---|---|---|
committer | Toby Vincent <tobyv@tobyvin.dev> | 2024-09-03 10:24:41 -0500 |
commit | bafd9e08317457cb60498171ac4e6476efa8e178 (patch) | |
tree | 6aaddf06444b77ffe73672c1bfe50a71a09d76d9 /i3blocks | |
parent | 26bf1702e8617d90878e706ffacba902ad686b7f (diff) |
fix(i3blocks): fix title width, again
Diffstat (limited to 'i3blocks')
-rw-r--r-- | i3blocks/.config/i3blocks/config | 1 | ||||
-rwxr-xr-x | i3blocks/.local/lib/i3blocks/i3blocks-title | 6 |
2 files changed, 3 insertions, 4 deletions
diff --git a/i3blocks/.config/i3blocks/config b/i3blocks/.config/i3blocks/config index 6dc4da3..6afdd1a 100644 --- a/i3blocks/.config/i3blocks/config +++ b/i3blocks/.config/i3blocks/config @@ -1,6 +1,5 @@ [i3blocks] command=$SCRIPT_DIR/i3blocks-title -max_width=30 interval=persist format=json diff --git a/i3blocks/.local/lib/i3blocks/i3blocks-title b/i3blocks/.local/lib/i3blocks/i3blocks-title index 716f56f..c014adc 100755 --- a/i3blocks/.local/lib/i3blocks/i3blocks-title +++ b/i3blocks/.local/lib/i3blocks/i3blocks-title @@ -1,9 +1,9 @@ #!/bin/sh into_block='{ - "full_text": (.name // ""), - "short_text": ([.app_id, .window_title, .name] | map(select(. != null and . != "")) | (first // "")), -} | .short_text |= .[0:(env.max_width // (. | length) | tonumber)]' + "full_text": (.name[0:50] // ""), + "short_text": ([.app_id, .window_title, .name] | map(select(. != null and . != "")) | (first // "") | .[0:25]), +}' swaymsg -t get_tree | jq -c '.. | select(.focused? == true and .type == "con") | '"$into_block" |