aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorToby Vincent <tobyv@tobyvin.dev>2024-09-03 10:24:41 -0500
committerToby Vincent <tobyv@tobyvin.dev>2024-09-03 10:24:41 -0500
commitbafd9e08317457cb60498171ac4e6476efa8e178 (patch)
tree6aaddf06444b77ffe73672c1bfe50a71a09d76d9
parent26bf1702e8617d90878e706ffacba902ad686b7f (diff)
fix(i3blocks): fix title width, again
-rw-r--r--i3blocks/.config/i3blocks/config1
-rwxr-xr-xi3blocks/.local/lib/i3blocks/i3blocks-title6
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"