This procedure will use account switching, but only once during setup. Use of Viber will be possible then without switching GUI sessions, but only with su
command in terminal.
I assume that Viber for primary user (user1 for instance) is installed and running OK.
Create another user. Go to Settings -> Users -> Add User. Choose name user2 for instance.
Switch login to this user and run Viber, register Viber for another phone number.
Uncheck "Launch Viber in background", for convinience.
Logout from user2 and switch back to user1.
Now, in terminal, as user1, create script viber2.sh
with the following commands:
# Allow user2 connect to X server:
xhost +SI:localuser:user2
# or simply run xhost +, if you do not care about security.
# Run the second Viber instance:
sudo su user2 -c "/opt/viber/Viber"
Execute script and window with second Viber will appear.
This procedure works for me on Ubuntu 20.04 with Gnome, but I believe with Mate it will be OK too.
You may see error message from script: XDG_RUNTIME_DIR not set in the environment.
Just ignore it unless you badly need to use sound in second Viber instance and ready to setup pulseaudio in insecure way by running pulse with '--system' setting.
(Sound for user1's Viber should work fine.)
Note, there are some nuances exiting second Viber instance: if you simply close Viber window, process will still be running. Only Ctrl+C in terminal will actually kill the process. I haven't found better solution for this (yet).
To avoid entering password each time executing script, add this line:
user1 ALL=(ALL:ALL) NOPASSWD: /usr/bin/su user2 -c /opt/viber/Viber
to sudoers
:
visudo /etc/sudoers.d/viber2_sudoers