Run script when X window title changes
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
This script changes Firefox window titles from this pattern [PageName] - Mozilla Firefox
to just [pageName]
:
pids=$(xdotool search --class "Firefox")
for pid in $pids; do
name=$(xdotool getwindowname $pid)
new_title=$(echo $name | sed "s/- Mozilla Firefox//")
if [[ $name == "$name" ]] && [[ $name != "" ]]; then
xdotool search --name "$name" set_window --name "$new_title"
fi
done
Does anyone know if there is something like an OnWindowChange hook or another solution, that allows to run the script automatically, whenever a window title changes or a new window is created?
I'm using i3 window manager. Maybe there is a way to hook this up there?
x11 i3 window-title
add a comment |Â
up vote
1
down vote
favorite
This script changes Firefox window titles from this pattern [PageName] - Mozilla Firefox
to just [pageName]
:
pids=$(xdotool search --class "Firefox")
for pid in $pids; do
name=$(xdotool getwindowname $pid)
new_title=$(echo $name | sed "s/- Mozilla Firefox//")
if [[ $name == "$name" ]] && [[ $name != "" ]]; then
xdotool search --name "$name" set_window --name "$new_title"
fi
done
Does anyone know if there is something like an OnWindowChange hook or another solution, that allows to run the script automatically, whenever a window title changes or a new window is created?
I'm using i3 window manager. Maybe there is a way to hook this up there?
x11 i3 window-title
1
try ` xprop -spy -root _NET_ACTIVE_WINDOW`
â Ipor Sircer
Dec 15 '17 at 14:44
In the X11 protocol, it's called a PropertyNotify event. I don't think i3 can react to that but Devilspie probably can.
â Gilles
Dec 15 '17 at 21:12
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
This script changes Firefox window titles from this pattern [PageName] - Mozilla Firefox
to just [pageName]
:
pids=$(xdotool search --class "Firefox")
for pid in $pids; do
name=$(xdotool getwindowname $pid)
new_title=$(echo $name | sed "s/- Mozilla Firefox//")
if [[ $name == "$name" ]] && [[ $name != "" ]]; then
xdotool search --name "$name" set_window --name "$new_title"
fi
done
Does anyone know if there is something like an OnWindowChange hook or another solution, that allows to run the script automatically, whenever a window title changes or a new window is created?
I'm using i3 window manager. Maybe there is a way to hook this up there?
x11 i3 window-title
This script changes Firefox window titles from this pattern [PageName] - Mozilla Firefox
to just [pageName]
:
pids=$(xdotool search --class "Firefox")
for pid in $pids; do
name=$(xdotool getwindowname $pid)
new_title=$(echo $name | sed "s/- Mozilla Firefox//")
if [[ $name == "$name" ]] && [[ $name != "" ]]; then
xdotool search --name "$name" set_window --name "$new_title"
fi
done
Does anyone know if there is something like an OnWindowChange hook or another solution, that allows to run the script automatically, whenever a window title changes or a new window is created?
I'm using i3 window manager. Maybe there is a way to hook this up there?
x11 i3 window-title
edited Dec 15 '17 at 21:08
Gilles
507k12010031530
507k12010031530
asked Dec 15 '17 at 14:37
Rotareti
2731313
2731313
1
try ` xprop -spy -root _NET_ACTIVE_WINDOW`
â Ipor Sircer
Dec 15 '17 at 14:44
In the X11 protocol, it's called a PropertyNotify event. I don't think i3 can react to that but Devilspie probably can.
â Gilles
Dec 15 '17 at 21:12
add a comment |Â
1
try ` xprop -spy -root _NET_ACTIVE_WINDOW`
â Ipor Sircer
Dec 15 '17 at 14:44
In the X11 protocol, it's called a PropertyNotify event. I don't think i3 can react to that but Devilspie probably can.
â Gilles
Dec 15 '17 at 21:12
1
1
try ` xprop -spy -root _NET_ACTIVE_WINDOW`
â Ipor Sircer
Dec 15 '17 at 14:44
try ` xprop -spy -root _NET_ACTIVE_WINDOW`
â Ipor Sircer
Dec 15 '17 at 14:44
In the X11 protocol, it's called a PropertyNotify event. I don't think i3 can react to that but Devilspie probably can.
â Gilles
Dec 15 '17 at 21:12
In the X11 protocol, it's called a PropertyNotify event. I don't think i3 can react to that but Devilspie probably can.
â Gilles
Dec 15 '17 at 21:12
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f411069%2frun-script-when-x-window-title-changes%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
1
try ` xprop -spy -root _NET_ACTIVE_WINDOW`
â Ipor Sircer
Dec 15 '17 at 14:44
In the X11 protocol, it's called a PropertyNotify event. I don't think i3 can react to that but Devilspie probably can.
â Gilles
Dec 15 '17 at 21:12