From bafd9e08317457cb60498171ac4e6476efa8e178 Mon Sep 17 00:00:00 2001 From: Toby Vincent Date: Tue, 3 Sep 2024 10:24:41 -0500 Subject: fix(i3blocks): fix title width, again --- i3blocks/.config/i3blocks/config | 1 - i3blocks/.local/lib/i3blocks/i3blocks-title | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'i3blocks') 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" -- cgit v1.2.3-70-g09d2