~kris/dots

srice

ref: 0e7f2c2785a36c2c4d5f7214411d3746a1667303 srice/.config/eww/scripts/xwindow-clickable.sh -rwxr-xr-x 413 bytes
0e7f2c27 — Kris Yotam xprofile: bump laptop HiDPI to 180 and scale cursor for M1 Pro retina 3 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/bash
# ~/.config/polybar/scripts/xwindow-clickable.sh

# Get active window title
window_title=$(xdotool getactivewindow getwindowname 2>/dev/null)

# Truncate to max 50 characters
if [ -z "$window_title" ]; then
    echo "Desktop"
else
    # Truncate and add ellipsis if needed
    if [ ${#window_title} -gt 50 ]; then
        echo "${window_title:0:50}..."
    else
        echo "$window_title"
    fi
fi