This commit is contained in:
2024-06-12 13:49:42 +02:00
commit b8e15ff09c
390 changed files with 37206 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
# i3 Focused window
Displays title of focused window in i3Wm
![Demo](i3-focusedwindow.png)
# Requirements
Dependencies: `xprop`, `awk`
# Command line arguments
```bash
i3-focusedwindow [maximum length to display]
```
Blank for unlimited length, i.e. output line can occupy all available space.
# Installation
The recommended i3blocks config is
```INI
[i3-focusedwindow]
label=[]=
command=$SCRIPT_DIR/i3-focusedwindow 20
interval=persist
```

View File

@@ -0,0 +1,15 @@
#!/usr/bin/env bash
# Author: Kn
while :
do
ID=$(xprop -root | awk '/_NET_ACTIVE_WINDOW\(WINDOW\)/{print $NF}')
if [[ $1 ]]
then
TITLE=$(xprop -id $ID -len $1 | awk '/_NET_WM_NAME/{$1=$2="";print}' | cut -d'"' -f2)
echo "$TITLE"
else
TITLE=$(xprop -id $ID | awk '/_NET_WM_NAME/{$1=$2="";print}' | cut -d'"' -f2)
echo "$TITLE"
fi
done

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB