Geany: Open a new instance per workspace when opening a file in that workspace

Use this batch to open Geany. This will open a separate socket specific to each workspace.

For example, in Thunar, use 'open with other application' and point to this batch file.

#!/bin/sh

socket=`xprop -root _NET_CURRENT_DESKTOP`
socket=${socket##* }

if [ "$socket" ]
then
    if [ "$DISPLAY" ]
    then
        socket="${DISPLAY%.*}-$socket"
        socket=${socket#*:}
    else
        socket="NODISPLAY-$socket"
    fi
    exec geany --socket-file "/tmp/geany_socket_$socket" "$@"
else
    exec geany "$@"
fi

Go to the terminal and type geany -h it will show you all the options availible. Among them -i, --new-instance Don't open files in a running instance, force opening a new instance is exactly what you need.

HOW-TO

  1. Find that thing you are clicking.

  2. Open it in any text editor, or find a way of changing the command it is executing. (might be tricky if it's a launcher in the tray, for example).

  3. Change the command from something like geany -some_options to geany -some_options -i

--

done.