I like to have multiple Geany instances opened on different virtual desktops. So when opening a file I like to choose in which instance to open it.
I wrote this little bash script. It also keeps the shell clean for further usage. ```bash #!/bin/bash
instance="${1}" shift
sock_basepath="${HOME}/.config/geany/geany_socket_$(hostname)__"
if [ "${instance}" == 'GUI' ]; then instance_names=() old_ifs="${IFS}" IFS=$'\n' for sock_path in $(ls -1 "${sock_basepath}"* 2>/dev/null); do inst_name="${sock_path:${#sock_basepath}}" instance_names+=("${inst_name}") done echo "${instance_names[@]}" IFS="${old_ifs}" instance_names=("${instance_names[@]}" 0) if [ ${#instance_names[@]} -eq 2 ]; then instance_names=("${instance_names[@]}" 0) fi instance="$(zenity --width=300 --entry --title 'Geany Instance Manager' '--entry-text' "${instance_names[@]}" --text 'Select a Geany instance')" if [ $? -ne 0 ]; then exit 1 fi elif [ "${instance}" == '' ]; then instance='0' fi
geany --socket-file="${sock_basepath}${instance}" "${@}" 1>/dev/null 2>/dev/null & disown ```
Maybe someone likes to come up with something more mature.
Ideally there would be a way to open multiple Geany windows from one instance. So they share things like a common recent files history.
Note that its discouraged to run multiple instances sharing the config directory:
1. to have changed settings appear in all instances you have to manually reload configuration in all of them 2. if differing instances have different settings it will be "last closed" wins as they overwrite the settings files, so you can lose changes if you didn't do 1. 3. only one session will be saved as they overwrite, again last closed wins
You can run separate instances with `-c` to specify a different config directory for each, and if an instance is already running with that config any further instances will open files in the first one. Obviously the downside is that you need to make setting changes in each instance, not just reload, but this way each session gets saved separately and can be reloaded.
If you put all the config directories in one place you can modify your script to allow selection of one, or type a new name to create a new instance (geany will create a config dir if it doesn't exist).
Ideally there would be a way to open multiple Geany windows from one instance. So they share things like a common recent files history.
Sure, but most of Geany was written with the assumption of only one editor widget, you can see the impact of that in the problems with splitwindows. It would take a lot of re-writing, and "somebodys" gotta do it.
github-comments@lists.geany.org