~kris/dots

srice

ref: e98f3b030dc24445bd55c68d95d2d81933fd68b3 srice/.config/eww/scripts/xwindow-clickable.sh -rw-r--r-- 413 bytes
e98f3b03 — Kris Yotam chore: sync local state after restore (push updates, no pull) a month 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