The i3 FAQ has migrated to https://github.com/i3/i3/discussions. All content here is read-only.
Ask Your Question
0

How to detect when a container is set to float

asked 2015-05-26 15:11:11 +0000

msx gravatar image

updated 2015-05-28 08:18:46 +0000

Adaephon gravatar image

Hi all,

I would like to act upon any window that is set as floating so I can be able to set border as normal when in floating mode and 1pixel when in tabbed mode.

As for now I am able to do this but only for selected applications via for_window [...], however I would like to extend this behaviour for any and all applications.

Regards.

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
1

answered 2015-05-26 19:36:08 +0000

gurkensalat gravatar image

As Airblader mentioned already, you can do this as following using i3subscribe:

#!/bin/bash
i=0
i3subscribe window dump | grep --line-buffered -e "^window:floating" -e "floating' => 'user_" | sed -u 's/^\s*//' | \
while read -r line; do
    [ "$line" == "window:floating" ] && i=1 && continue
    [ "$i" == 1 -a "$line" == "'floating' => 'user_on'," ] && i3-msg border normal
    [ "$i" == 1 -a "$line" == "'floating' => 'user_off'," ] && i3-msg border 1pixel
    i=0
done
edit flag offensive delete link more
0

answered 2015-05-26 15:55:10 +0000

Airblader gravatar image

updated 2015-05-26 15:55:40 +0000

Subscribe to the IPC window event: i3 IPC #window

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2015-05-26 15:11:11 +0000

Seen: 96 times

Last updated: May 28