everforest and titlebar fix

This commit is contained in:
atagen 2023-05-21 21:07:49 +10:00
parent 707157c0fe
commit d20d3d8310
5 changed files with 78 additions and 29 deletions

View file

@ -1,10 +1,18 @@
#!/usr/bin/env bash
limit=128
socat -u UNIX-CLIENT:/tmp/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock STDOUT |
while read line; do
if [[ "$line" == activewindow\>\>* ]]; then
windowtitle="$(echo $line | cut -d',' -f 2)"
echo '{"title": "'$windowtitle'"}'
windowtitle="$(printf $line | cut -d',' -f 2)"
apptitle="$(printf $line | cut -d',' -f 1 | cut -d'>' -f 3)"
combined="$windowtitle - $apptitle"
if [[ "${#combined}" -lt $limit ]]; then
printf '{"title": "'$combined'"}'
else
clipto=$((limit-${#apptitle}))
printf '{"title": "'"${windowtitle:0:$clipto} - $apptitle"'"}'
fi
fi
done