lemmyvore,

I think it was done on purpose.

Anyway… I figured out a workaround in my script. By focusing one of the windows on the current workspace before I open a new tab it seems to make it the preferred window. It’s not foolproof, sometimes it still selects one of the other windows, but it’s close enough.

Here’s the script in case anybody needs it, should work with any editor that has some sort of -tab and -window options if you grep for the correct window name:


<span style="color:#323232;">#!/bin/bash
</span><span style="color:#323232;">WORKSPACE=$(
</span><span style="color:#323232;">	wmctrl -d |
</span><span style="color:#323232;">	grep '*' |
</span><span style="color:#323232;">	awk '{print $1}'
</span><span style="color:#323232;">)
</span><span style="color:#323232;">
</span><span style="color:#323232;">WINID=$(
</span><span style="color:#323232;">	wmctrl -l |
</span><span style="color:#323232;">	grep ' - Mousepad' |
</span><span style="color:#323232;">	grep -E "s${WORKSPACE}s"|
</span><span style="color:#323232;">	tail -1|
</span><span style="color:#323232;">	awk '{print $1}'
</span><span style="color:#323232;">)
</span><span style="color:#323232;">
</span><span style="color:#323232;">if [ -z "$WINID" ]; then
</span><span style="color:#323232;">	exec /usr/bin/mousepad -o window "$@"
</span><span style="color:#323232;">else
</span><span style="color:#323232;">	wmctrl -i -a "$WINID" &amp;&amp; 
</span><span style="color:#323232;">	sleep 0.5 &amp;&amp; 
</span><span style="color:#323232;">	exec /usr/bin/mousepad -o tab "$@"
</span><span style="color:#323232;">fi
</span>
  • All
  • Subscribed
  • Moderated
  • Favorites
  • linux@lemmy.ml
  • localhost
  • All magazines
  • Loading…
    Loading the web debug toolbar…
    Attempt #