Kali Linux Install Viber
This approach of Viber setup is tested with Kali Linux 2022.04.
Download and install Viber
Download the Viber's .deb package and install it.
wget https://download.cdn.viber.com/cdn/desktop/Linux/viber.deb -O ~/Downloads/viber.deb
sudo apt install ~/Downloads/viber.deb
Create a Fake 'us-phonetic' Keymap
I'm using Bulgarian (traditional phonetic) keyboard layout alongside English (US). When I'm trying to start Viber when the English is used as keyboard layout the following error prevents Viber from start.
viber
xkbcommon: ERROR: Couldn't process include statement for 'us(phonetic)'
xkbcommon: ERROR: Abandoning symbols file "(unnamed)"
xkbcommon: ERROR: Failed to compile xkb_symbols
xkbcommon: ERROR: Failed to compile keymap
[14547:14573:0818/213359.103080:FATAL:xkb_keyboard_layout_engine.cc(640)] Keymap file failed to load: us-phonetic
I do not have idea does Viber, or Gnome 42 or Kali itself cause the problem, but the easiest workaround that could be applied it to create a fake 'us-phonetic' keymap into the file /usr/share/X11/xkb/symbols/us
. Execute the following code as single command to do that.
cat << EOF | sudo tee -a /usr/share/X11/xkb/symbols/us
// Reference: https://wiki.metalevel.tech/wiki/Kali_Linux_Install_Viber
partial alphanumeric_keys
xkb_symbols "phonetic" {
include "us(basic)"
name[Group1]= "English (US, Viber workaround by MLT)";
};
EOF
Fix the App Indicator
The Viber's app indicator doesn't work by default for a long time. The working solution is to launch it by dbus-launch
.
dbus-launch /opt/viber/Viber %u
I'm using the following wrapper scrip that uses also xdotool
to add an option to minimize Viber when it is launched.
sudo nano /usr/local/bin/viber.launcher.sh && sudo chmod +x /usr/local/bin/viber.launcher.sh
#!/bin/sh
# /usr/share/applications/viber.desktop
# Exec=/usr/local/bin/viber.launcher.sh [minimized|close]
if [ "$1" = "close" ]; then
pkill -9 Viber >/dev/null 2>&1
exit
else
dbus-launch /opt/viber/Viber %u &
if [ "$1" = "minimized" ]; then
sleep 2 && xdotool windowminimize "$(xdotool search --name "Viber" | tail -1)"
# The command 'xdotool windowclose' also can be used
fi
fi
The script viber.launcher.sh
can be used in the following ways from the command-line.
viber.launcher.sh # Launch Viber with App Indicator
viber.launcher.sh minimized # Launch Viber minimized
viber.launcher.sh close # Kill Viber
Create Custom Desktop Launchers
The final step is to create modified desktop launcher(s) for Viber which uses the script presented above. You can modify directly directly /usr/share/applications/viber.desktop
, but I prefer to create a local copy within my user's home directory.
nano ~/.local/share/applications/viber.desktop
[Desktop Entry]
Name=Viber
Comment=Viber VoIP and messenger
Exec=/usr/local/bin/viber.launcher.sh
Icon=/usr/share/pixmaps/viber.png
Terminal=false
Type=Application
Categories=Network;InstantMessaging;P2P;
MimeType=x-scheme-handler/viber;
update-desktop-database ~/.local/share/applications/
Thus the wrapper script will be used when you launch Viber from within the Applications menu in Gnome. In order to ad an icont to the user's desktop just copy the launcher there.
cp ~/.local/share/applications/viber.desktop ~/Desktop
Then right click on the new icon and click on the Allow Launching
option.
References
- Viber Home Page: Download Viber
- Ask Ubuntu: Viber indicator not working