Pinfo=$(ss -lpxH | grep "pid=$pid" | grep geany_socket) # Get listening unix domain sockets from the PID # Verify the pid corresponds to a process named 'geany' # Verify the process user is the same as the current one # which of them was focused more recently # Check for instances in the current workspace, keep the pids # If a new instance is not requested, look for existing instances
![geany d setup geany d setup](https://www.geany.org/manual/0.15/images/pref_dialog_edit_completions.png)
socket-file ) SKIP=true ARG2="$2" shift 2 i | -new-instance ) NEW_INSTANCE=true ARG1="" shift h | -help | -help-all | -help-gtk) SKIP=true shift OPTS=$(getopt -o hc:gPil:mnprstvV -l help,help-all,help-gtk,column:,config:,ft-names,generate-tags,no-preprocessing,new-instance,socket-file:,list-documents,line:,no-msgwin,no-ctags,no-plugins,print-prefix,read-only,no-session,no-terminal,vte-lib:,verbose,version,display: -n geanywl - set - "$OPTS" Here is the current version of the script, but be sure to also check on the gist above for any updates.
![geany d setup geany d setup](https://windows-cdn.softpedia.com/screenshots/Geany-Portable_1.png)
I had trouble getting Olivier's answer to work so I thought I would include more detailed instructions on his answer in case others have trouble too (all credit goes to him, upvote him instead of/as well as mine). This became too long for a comment so I'm posting it as an answer instead. I can't see an option relating to this in the settings. no: open a new Geany in this workspace and open the file in that.On opening a file: is there a Geany running in this workspace?.Is there a way i can change this behaviour? I'd like it to be like so: So it's like it always opens a file in the "primary" Geany, and switches to whatever workspace that happens to be in. the desktop switches to workspace 1 again and opens the file in the first instance of Geany.
![geany d setup geany d setup](https://cdn.sparkfun.com/assets/learn_tutorials/2/3/7/build-options-2.png)
start a new instance of Geany from the program menu (so i now have one per workspace).I can start another instance of Geany from the programs menu, and move one into the other workspace, but it doesn't change the behaviour: I then see this:
![geany d setup geany d setup](https://opensource.com/sites/default/files/lead-images/web_browser_desktop_devlopment_design_system_computer.jpg)
When i do this in Gedit, it opens a new instance of Gedit in that workspace, which suits my style of working perfectly, where i have different projects open in each workspace. the desktop switches to workspace 1 again and opens the file in Geany.double click a file to open it (in Geany).One thing that bugs me though is this behaviour: The two text editors i use are Gedit and Geany (v0.25): i use Geany for all my coding as i prefer the syntax highlighting and some other interface features.