Multiple versions of gSender on Linux

I found a way to have multiple versions of gSender installed without creating a separate user.

First I created this file structure in my home directory.

.my_gsenders/
β”œβ”€β”€ 1.4.12
β”‚   └── gSender-1.4.12-Linux-Intel-64Bit.AppImage
└── 1.5.2
    └── gSender-1.5.2-Linux-Intel-64Bit.AppImage

Then you need a folder that is in your $PATH. I recommend using a folder that is only in the path for the user and not the system. I use ~/.local/bin and have added the following to my ~/.bashrc file.

export PATH=~/.local/bin:$PATH

Then in ~/.local/bin I have a bash script for each version of gSender.

~/.local/bin/gSender-1.4.12

#!/bin/bash

HOME=${HOME}.my_gsenders/1.4.12/
XDG_CONFIG_HOME="${HOME}/.config/"
XDG_DATA_HOME="${HOME}/.local/share/"
XDG_STATE_HOME="${HOME}/.local/state/"
XDG_CACHE_HOME="${HOME}/.cache/"

/home/${USER}/.my_gsenders/1.4.12/gSender-1.4.12-Linux-Intel-64Bit.AppImage &

Scripts for other versions are the same with only the version number changed.

After running both versions that I have installed my ~/.my_gsenders file structure looks like this.

.my_gsenders/
β”œβ”€β”€ 1.4.12
β”‚   β”œβ”€β”€ .cache
β”‚   β”œβ”€β”€ .config
β”‚   β”œβ”€β”€ gSender-1.4.12-Linux-Intel-64Bit.AppImage
β”‚   β”œβ”€β”€ .local
β”‚   β”œβ”€β”€ .pki
β”‚   β”œβ”€β”€ .sender_rc
β”‚   └── .sienci-sessions
└── 1.5.2
    β”œβ”€β”€ .cache
    β”œβ”€β”€ .config
    β”œβ”€β”€ gSender-1.5.2-Linux-Intel-64Bit.AppImage
    β”œβ”€β”€ .pki
    β”œβ”€β”€ .sender_rc
    └── .sienci-sessions

You can see that gSender has created the directories it needs in separate locations. I think some extra trickery would be need to use the .deb package because one install would overwrite the other.

I have also created .desktop files in /usr/share/applications

/usr/share/applications/gsender-1.4.12.desktop

[Desktop Entry]
Type=Application
Version=1.4.12
Name=gSender-1.4.12
GenericName=G-code Sender
Comment=Controls grbl based CNC machines
Exec=/home/${USER}/.local/bin/gSender-1.4.12
Terminal=false

Again just change the version number in the name of the file and in the contents of the file for other versions. Now you can launch using your application menu.

I don’t have Windows or Macintosh so I can’t test but something similar should be possible.

One thing I did notice is because $HOME was changed the file picker starts in the new home and I had to navigate from the root of the filesystem to get to my real Documents directory etc. I can live with that and it can probably be fixed with some symbolic links.

Enjoy!

1 Like