mirror of
https://github.com/bvanroll/_dotfiles.git
synced 2025-08-30 04:22:47 +00:00
init
This commit is contained in:
28
.config/i3blocks/i3-focusedwindow/README.md
Normal file
28
.config/i3blocks/i3-focusedwindow/README.md
Normal file
@@ -0,0 +1,28 @@
|
||||
# i3 Focused window
|
||||
|
||||
Displays title of focused window in i3Wm
|
||||
|
||||

|
||||
|
||||
# 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
|
||||
```
|
15
.config/i3blocks/i3-focusedwindow/i3-focusedwindow
Executable file
15
.config/i3blocks/i3-focusedwindow/i3-focusedwindow
Executable 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
|
BIN
.config/i3blocks/i3-focusedwindow/i3-focusedwindow.png
Normal file
BIN
.config/i3blocks/i3-focusedwindow/i3-focusedwindow.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.5 KiB |
Reference in New Issue
Block a user