Home > geany > Annoying behaviour in Geany when you open a file with multiple geany windows open

# Annoying behaviour in Geany when you open a file with multiple geany windows open

April 2Hits:2

In Gedit, if you have multiple Gedit windows open, and then open a file, Gedit chooses to open it in the most recently active window. I like this behaviour, i think it's intuitive.

In Geany, which i otherwise prefer to Gedit, the rule for which instance to use seems to be "the oldest one". What's worse, if that instance is open on another desktop, it moves that instance into your current desktop as well. This effectively makes it impossible to work with multiple Geany windows, which is really annoying.

Does anyone know of a way i can make Geany open files in the most recently active (ie "looked at") instance of Geany? I'm using the most up to date version (0.21).

thanks, max

Using Geany 1.22 there may be a workaround which is pretty close to what you want to do.

According to the manual on http://www.geany.org/manual/current/#command-line-options you can use

--socket-file

to specify the socket file with which to communicate with the Geany instance.

Putting the following in a script will get you an instance per workspace:

#!/bin/bash
geany --socket-file=/tmp/geany-sock-$(xprop -root _NET_CURRENT_DESKTOP | awk '{print$3}') ${1+"$@"}

(It also passes on the command line args to geany).

Sadly there is no way to configure this behaviour. Several months ago, I asked some Geany plugin developers about this and it seems the only way to change this is to write the code yourself and send them a patch.

This perhaps should have been a comment on the response of Rikard, but I will present it as an alternative response. I noticed that his solution makes the computer (with Ubuntu 14.04) non responsive if we use it when the original script (without the socket option) is already running. So, I felt it will good to make the script exit in that case. If you name the script geany, put it in a directory before /usr/bin or wherever is the original in the PATH.

#!/bin/bash
for pid in $(pgrep "geany") do cmd=$(ps -p $pid -o cmd) if [[ "$cmd" = *"/usr/bin/geany"* ]] && [[ "$cmd" != *"socket"* ]] ; then echo original geany already running exit fi done /usr/bin/geany --socket-file=/tmp/geany-sock-$(xprop -root _NET_CURRENT_DESKTOP | awk '{print $3}')${1+"\$@"}

Tags:geany

## Related Articles

• ### Annoying behaviour in Geany when you open a file with multiple geany windows openApril 2

In Gedit, if you have multiple Gedit windows open, and then open a file, Gedit chooses to open it in the most recently active window. I like this behaviour, i think it's intuitive. In Geany, which i otherwise prefer to Gedit, the rule for which insta

• ### Annoying behaviour of \vspace May 13

Possible Duplicate: Adding vertical space at the start of a page Basically I am making a title page and I want the title to be in the center of the text \documentclass[15pts]{article} \usepackage{amsmath} \usepackage{parskip} \textwidth = 500pt \text

• ### C# TableLayoutPanel and really annoying behaviourFebruary 3

I'm really tired for figuring out what's going on. http://postimg.org/image/ymotfd8ab/ Buttons on left side should be at upper left corner and scale with resized window. Button and text box in upper left corner should stick to the left side of screen

• ### Is it possible to view two files simultaneously in Geany?March 12

I tend to be a simple text editor user, but when I want IDE-like features, I've been using Geany. One thing I find bothersome about it, though, is I can see only one file at a time. Sometimes I want to edit a .cpp file while looking at a .hpp file (o

• ### Is it possible to set the default behaviour of double clicking a folder to be "Open in New Window" with PCManFM?September 19

My mother uses separate desktops heavily and finds it very irritating when she accidentally double-clicks on a folder on her desktop rather than right-clicking and choosing "open in new window" as she's trained herself to usually do. Is there a

• ### Is it normal for scheduled task behaviour to differ from running the batch file manually?February 13

I have a windows service that I need to stop and start every 30 minutes using a Windows Scheduled Task. The service itself can be manually stopped via the Services management console (right-click -> Stop, right-click -> Start). The following batch f

• ### Geany: Syntax highlighting and autocomplete doesn't work unless I have the header file open in geanyFebruary 22

I'm currently writing a program that uses the GTK library. The programs compile and run fine. The problem is - geany seems to not 'know' what structs and methods are in the GTK header file. It won't highlight structs, and doesn't offer to autocomplet

• ### Where can I find geany's default global configuration files?June 18

I was trying to install the Vibrant Ink Geany theme, and ended up with it not working. As far as I understand, the filetype defintions weren't working or something. Screenshot. I messed around with a little bit, and accidently moved my backup when re

• ### switch between file tabs in geanyJune 11

open some files with geany how to switch between tabs by key switch?For example you open file1 and file2 and file3 with geany . I am looking for key shortcut to switch between them I mean switch between tab. I do not like use mouse to select tabs!! -

• ### What behaviour is acceptable for checking data back in when a browser window is closed?July 21

I am designing a tool within a webpage where users can check out a dataset, make changes to it, then check the data back in so that another user can work on it. I have covered the eventualities of users ending their session properly, or clicking out

• ### Ubuntu blinks in DELL 2850June 30

I have just installed Ubuntu (12.0.4 TLS for Servers) on a DELL poweredge 2850. During the installation, the process goes OK. However, as soon as I start the system normally (and the text font is changed) it starts continuously blinking: 4 seconds I

• ### Prevent VLC from starting a new instance every time a media file is openedDecember 13

I'm using VLC. Its great for all media requirements. But I find this behavior annoying. Every time I open a media file, a sepearte VLC window opens up instead of stopping the current playback and play the new media. This applies to music as well as f

• ### XWindows-like mouse behaviour in Windows 7December 7

I currently use Linux as my primary desktop OS, and have done for more years than I care to remember. In recent years I've settled on GNOME and XFCE as my environments of choice. For a number of reasons (pressure to use AD-based resources, better ava

• ### Ubuntu change touchpad behaviourFebruary 26

I recently installed Ubuntu 14.10 on my AlienWare 13' Notebook and I really don't like the touchpad behaviour there. The two things I dislike are that the "right click" only works when I click the touchpad with two fingers. I'd prefer it if it r

• ### Geany: Open a new instance per workspace when opening a file in that workspaceDecember 2

I'm using Mate 1.2.0 in Linux Mint 13. 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. One thing that bugs me though is this behaviour: open

• ### Geany: lost some themes after updateDecember 2

I've just upgraded to Geany 0.25 (from 0.21) in Mate 1.2.0, Linux Mint 13. When i open a .rb (ruby) file it correctly uses my preferred theme, which is Tango Dark. But when i open an html file it uses the default (white background) theme. Before the

• ### Changing drag & drop behaviour in Windows 7's explorer for touch screen useJanuary 22

I have a new touch screen, and am playing around with its functionality. The most productive use for me is organizing files (literally) by hand. It's fun working through a list of files, dragging and dropping them to the right locations using your in

• ### How to solve missing/hidden window in Geany?November 19

I have installed Geany 0.19.1 on Windows 7, I run the Geany.exe shortcut and it appears running on my windows taskbar, if I hit Alt+Tab I see the Geany icon. But... no window is shown. Where is the Geany window? How to fix it? --------------Solutions

• ### regarding shared memory behaviourOctober 3

Noticing a strange performance behaviour while using shared memory that are file backed (i.e open user defined file and mmap() the same into process space). While doing a memcpy() into the shared memory section, sometimes a delay is observed in the o

• ### Problems with using themes in GeanyOctober 18

I'm trying to switch to the Geany editor for my web development but need to switch to a dark theme. In searching for some default themes I came across this excellent collection. I've now installed the themes and they appear when I go to View -> Edito