#!/bin/bash trunc=16 sample=$(hyprctl activewindow | grep title: | awk -F: '{print $2}') #echo ${sample} if [ ${#sample} -gt $trunc ]; then echo $sample | head -c $trunc | sed 's/$/.../' else if [ ${#sample} -ne 0 ]; then echo $sample else echo None fi fi #hyprctl activewindow | grep title: | awk -F: '{print $2}' | head -c $trunc | sed 's/$/.../'