You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi everybody!
I'm an everyday jumpapp user but - lately - I have been in need of something that this little app couldn't do: calling for a very specific window, difficult to distinguish from others
I often need to use two different Chromium profiles at the same time: in that case class, process name and such were identical while window title would change according to the website. So I thought a bit about it and came out with this little command that, for now, seems to solve the problem
finds a window with the string "u53r1" in the title (I picked an odd string because "user1" could have been easily found in another window) and grabs an X window identifier, an 8 digit number that - as far as I could try - doesn't change while I switch and close tabs, as long as that Chromium instance stays open. The Chromium profile I launched opens on an homepage where I made sure "U53r1" was in the title.
That identifier gets written in a file and everytime I launch that shortcut xdotool tries to activate a window with that identifier. If it's not valid anymore it means that window has been closed, so it launches a new instance and grabs a new identifier.
I've never tried bash scripting so I made my way through mistakes and it may be a very rough solution: it works for now but do you think it will keep working? Any way I could make it better? Weaknesses? If you find it interesting you could add a similar function in jumpapp and I'll be glad I've been useful. You could of course obtain the same result with
wmctrl -l | grep 'U53r1' | grep -Eo '0x[0-9a-f]+'
and
wmctrl -ia
using an identifier related to PID - given that the PID won't change through the session - but xdotool seemed more readable to me.
Anyway, thanks for your time and for your work!
The text was updated successfully, but these errors were encountered:
Hi everybody!
I'm an everyday jumpapp user but - lately - I have been in need of something that this little app couldn't do: calling for a very specific window, difficult to distinguish from others
I often need to use two different Chromium profiles at the same time: in that case class, process name and such were identical while window title would change according to the website. So I thought a bit about it and came out with this little command that, for now, seems to solve the problem
sh -c "xdotool windowactivate $(cat ~/.cache/identifier) || chromium-browser --profile-directory="U53r1" & xdotool search --sync --name u53r1 > ~/.cache/identifier"
where
xdotool search --all --onlyvisible --sync --name u53r1
finds a window with the string "u53r1" in the title (I picked an odd string because "user1" could have been easily found in another window) and grabs an X window identifier, an 8 digit number that - as far as I could try - doesn't change while I switch and close tabs, as long as that Chromium instance stays open. The Chromium profile I launched opens on an homepage where I made sure "U53r1" was in the title.
That identifier gets written in a file and everytime I launch that shortcut xdotool tries to activate a window with that identifier. If it's not valid anymore it means that window has been closed, so it launches a new instance and grabs a new identifier.
I've never tried bash scripting so I made my way through mistakes and it may be a very rough solution: it works for now but do you think it will keep working? Any way I could make it better? Weaknesses? If you find it interesting you could add a similar function in jumpapp and I'll be glad I've been useful. You could of course obtain the same result with
wmctrl -l | grep 'U53r1' | grep -Eo '0x[0-9a-f]+'
and
wmctrl -ia
using an identifier related to PID - given that the PID won't change through the session - but xdotool seemed more readable to me.
Anyway, thanks for your time and for your work!
The text was updated successfully, but these errors were encountered: