Kali Linux Install Viber: Difference between revisions

From WikiMLT
m (Text replacement - "mlw-continue" to "code-continue")
 
(6 intermediate revisions by the same user not shown)
Line 18: Line 18:
</syntaxhighlight>
</syntaxhighlight>
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 <code>/usr/share/X11/xkb/symbols/us</code>. Execute the following code as single command to do that.
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 <code>/usr/share/X11/xkb/symbols/us</code>. Execute the following code as single command to do that.
<syntaxhighlight lang="shell" line="1" class="mlw-multiline-cmd mlw-shell-gray">
<syntaxhighlight lang="shell" line="1" class="multi-line-cmd mlw-shell-gray">
cat << EOF | sudo tee -a /usr/share/X11/xkb/symbols/us
cat << EOF | sudo tee -a /usr/share/X11/xkb/symbols/us


Line 66: Line 66:
nano ~/.local/share/applications/viber.desktop
nano ~/.local/share/applications/viber.desktop
</syntaxhighlight>
</syntaxhighlight>
<syntaxhighlight lang="bash" line="1" highlight="4" class="mlw-continue">
<syntaxhighlight lang="bash" line="1" highlight="4" class="code-continue">
[Desktop Entry]
[Desktop Entry]
Name=Viber
Name=Viber
Line 80: Line 80:
update-desktop-database ~/.local/share/applications/
update-desktop-database ~/.local/share/applications/
</syntaxhighlight>
</syntaxhighlight>
Thus the wrapper script will be used when you launch Viber from within the Applications menu in Gnome. In order to add an icon to the user's desktop just copy the launcher there. Then right click on the new icon and click on the <code>Allow Launching</code> option.<syntaxhighlight lang="shell" line="1">
Thus the wrapper script will be used when you launch Viber from within the Applications menu in Gnome. In order to add an icon to the user's desktop just copy the launcher there. Then right click on the new icon and choice on the <code>Allow Launching</code> option.<syntaxhighlight lang="shell" line="1">
cp ~/.local/share/applications/viber.desktop ~/Desktop
cp ~/.local/share/applications/viber.desktop ~/Desktop
</syntaxhighlight>'''Auto start.''' To start Viber at user log-in copy the desktop launcher to the directory <code>~/.config/autostart</code> and modify it in the following way to start Viber minimized. <syntaxhighlight lang="shell" line="1">
</syntaxhighlight>'''Auto start.''' To start Viber at user log-in copy the desktop launcher to the directory <code>~/.config/autostart</code> and modify it in the following way to start Viber minimized. <syntaxhighlight lang="shell" line="1">
nano ~/.config/autostart/viber.desktop
nano ~/.config/autostart/viber.desktop
</syntaxhighlight>
</syntaxhighlight>
<syntaxhighlight lang="bash" line="1" highlight="4" class="mlw-continue">
<syntaxhighlight lang="bash" line="1" highlight="4" class="code-continue">
[Desktop Entry]
[Desktop Entry]
Name=Viber
Name=Viber
Line 100: Line 100:


* Viber Home Page: [https://www.viber.com/en/download/ Download Viber]
* Viber Home Page: [https://www.viber.com/en/download/ Download Viber]
 
* Ubuntu Documentation: [https://help.ubuntu.com/community/Custom%20keyboard%20layout%20definitions Custom keyboard layout definitions]
* Simpliest.rocks: [https://simpleit.rocks/linux/switch-keyboard-layouts/ Switch between languages in Linux with xkb. Write in multiple languages with same keyboard]
* Ask Ubuntu: [https://askubuntu.com/q/434849/566421 Change keyboard layout (English UK) on command line to English US]
* Super User: [https://superuser.com/q/404457 How can I change the input keyboard layout while in the console?]
* Ask Ubuntu: [https://askubuntu.com/a/845787/566421 Viber indicator not working]
* Ask Ubuntu: [https://askubuntu.com/a/845787/566421 Viber indicator not working]
* Ask Ubuntu: [https://askubuntu.com/q/610474/566421 Can ~/.local/share/applications override /usr/share/applications?]
* Ask Ubuntu: [https://askubuntu.com/q/610474/566421 Can ~/.local/share/applications override /usr/share/applications?]
*


<noinclude>
<noinclude>
Line 109: Line 111:
{{devStage  
{{devStage  
  | Прндл  = Linux Desktop
  | Прндл  = Linux Desktop
  | Стадий = 3
  | Стадий = 6
  | Фаза  = Разработване
  | Фаза  = Утвърждаване
  | Статус = Разработван
  | Статус = Утвърден
  | ИдтПт  = Spas
  | ИдтПт  = Spas
  | РзбПт  = {{REVISIONUSER}}
  | РзбПт = Spas
| АвтПт  = Spas
| УтвПт = {{REVISIONUSER}}
  | ИдтДт  = 18.08.2022
  | ИдтДт  = 18.08.2022
  | РзбДт  = {{Today}}
  | РзбДт = 18.08.2022
| АвтДт  = 18.08.2022
| УтвДт = {{Today}}
  | ИдтРв  = [[Special:Permalink/30338|30338]]
  | ИдтРв  = [[Special:Permalink/30338|30338]]
  | РзбРв  = {{REVISIONID}}
  | РзбРв = [[Special:Permalink/30357|30357]]
| АвтРв  = [[Special:Permalink/30358|30358]]
| УтвРв = {{REVISIONID}}
}}
}}
</div>
</div>
</noinclude>
</noinclude>

Latest revision as of 07:30, 26 September 2022

This ap­proach of Viber set­up is test­ed with Kali Lin­ux 2022.04.

Down­load and in­stall Viber

Down­load the Viber's .deb pack­age and in­stall it.

wget https://download.cdn.viber.com/cdn/desktop/Linux/viber.deb -O ~/Downloads/viber.deb
sudo apt install ~/Downloads/viber.deb

Cre­ate a Fake 'us-pho­net­ic' Keymap

I'm us­ing Bul­gar­i­an (tra­di­tion­al pho­net­ic) key­board lay­out along­side Eng­lish (US). When I'm try­ing to start Viber when the Eng­lish is used as key­board lay­out the fol­low­ing er­ror pre­vents 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 it­self cause the prob­lem, but the eas­i­est workaround that could be ap­plied it to cre­ate a fake 'us-pho­net­ic' keymap in­to the file /​​​usr/​​​share/​​​X11/​​​xkb/​​​symbols/​​​us. Ex­e­cute the fol­low­ing code as sin­gle com­mand 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 In­di­ca­tor

The Viber's app in­di­ca­tor doesn't work by de­fault for a long time. The work­ing so­lu­tion is to launch it by dbus-launch.

dbus-launch /opt/viber/Viber %u

I'm us­ing the fol­low­ing wrap­per scrip that us­es al­so xdo­tool to add an op­tion to min­i­mize Viber when it is launched.

sudo nano /usr/local/bin/viber.launcher.sh && sudo chmod +x /usr/local/bin/viber.launcher.sh
#!/bin/sh

# Reference: https://wiki.metalevel.tech/wiki/Kali_Linux_Install_Viber
# /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 fol­low­ing ways from the com­mand-line.

viber.launcher.sh               # Launch Viber with App Indicator
viber.launcher.sh minimized     # Launch Viber minimized
viber.launcher.sh close         # Kill Viber

Cre­ate Cus­tom Desk­top Launch­ers

The fi­nal step is to cre­ate mod­i­fied desk­top launcher(s) for Viber which us­es the script pre­sent­ed above. You can mod­i­fy di­rect­ly di­rect­ly /usr/share/applications/viber.desktop, but I pre­fer to cre­ate a lo­cal copy with­in my user's home di­rec­to­ry.

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 wrap­per script will be used when you launch Viber from with­in the Ap­pli­ca­tions menu in Gnome. In or­der to add an icon to the user's desk­top just copy the launch­er there. Then right click on the new icon and choice on the Al­low Launch­ing op­tion.

cp ~/.local/share/applications/viber.desktop ~/Desktop

Au­to start. To start Viber at user log-in copy the desk­top launch­er to the di­rec­to­ry ~/.config/autostart and mod­i­fy it in the fol­low­ing way to start Viber min­i­mized.

nano ~/.config/autostart/viber.desktop
[Desktop Entry]
Name=Viber
Comment=Viber VoIP and messenger
Exec=/usr/local/bin/viber.launcher.sh minimized
Icon=/usr/share/pixmaps/viber.png
Terminal=false
Type=Application
Categories=Network;InstantMessaging;P2P;
MimeType=x-scheme-handler/viber;

Ref­er­ences