Jan Lunge

Rofi bring window

2021/02/05 - Jan Lunge

i had the issue that i didn’t only need a window switcher but also a tool that would grab a window from a hidden workspace and bring it to the current one.

Links

Rofi bring window

i had the issue that i didn’t only need a window switcher but also a tool that would grab a window from a hidden workspace and bring it to the current one.

the rofi window switcher only switched my current workspace to be the one with the window I’m looking for but that’s just not enough.

but rofi is customizable so i added something with wmctrl

#!/bin/zsh
if [ $1 ]
then
echo $1 | cut -d' ' -f1 | read h; herbstclient bring ${h:0:10}
else
# just removing the hostname from the output as i dont need it in rofi
wmctrl -l | sed 's/wDeskArch //g'
fi

this lists all open windows and i can fuzzy search with rofi in it and the herbstclient bring command brings the window to my current workspace.

then this is just added to my herbstluftwm autostart

hc keybind $Mod-t spawn rofi -modi grab:~/dotfiles/grabwindow.zsh -show grab