2023-01-18 19:58:54 +01:00
#!/bin/bash
2023-01-16 22:29:09 +01:00
script_dir = $( dirname " $( readlink -f " $0 " ) " )
out_dir = ~/.local/share/applications
2025-03-12 17:39:36 +05:00
version = " $( echo ${ APPIMAGE } | rev | cut -d '-' -f1,2 | rev | sed 's/\.AppImage$//' ) "
out_file_name = " ${ out_dir } /Zano- ${ version } .desktop "
2023-01-16 22:29:09 +01:00
2023-01-17 15:48:15 +01:00
export QTWEBENGINE_DISABLE_SANDBOX = 1
2023-01-16 22:29:09 +01:00
call_app( )
{
pushd $script_dir
usr/bin/Zano " $@ "
2023-01-18 18:36:25 +01:00
if [ $? -ne 0 ] ; then
2023-01-18 20:27:15 +01:00
echo $'\n\n\x1b[1mIf Zano fails to launch, it might need to install xinerama extension for the X C Binding with this command:\n\x1b[2m sudo apt-get install libxcb-xinerama0\n\n'
2023-01-18 18:36:25 +01:00
fi
2023-01-16 22:29:09 +01:00
popd
exit
}
create_desktop_icon( )
{
target_file_name = $1
echo " Generating icon file: $target_file_name ... "
rm -f " ${ out_dir } /Zano.png "
rm -f $target_file_name
2023-01-18 15:15:13 +01:00
cp -Rv " ${ APPDIR } /usr/share/icons/hicolor/256x256/apps/Zano.png " " ${ out_dir } /Zano.png "
2023-01-16 22:29:09 +01:00
echo [ Desktop Entry] | tee -a $target_file_name > /dev/null
echo Version = 1.0 | tee -a $target_file_name > /dev/null
echo Name = Zano | tee -a $target_file_name > /dev/null
echo GenericName = Zano | tee -a $target_file_name > /dev/null
echo Comment = Privacy blockchain | tee -a $target_file_name > /dev/null
2023-01-18 15:15:13 +01:00
echo Icon = ${ out_dir } /Zano.png | tee -a $target_file_name > /dev/null
2025-03-20 19:02:39 +05:00
echo TryExec = " ${ APPIMAGE } " | tee -a " ${ target_file_name } " >/dev/null
echo Exec = $APPIMAGE --deeplink-params= \\ \\ \\ \" %u\\ \\ \\ \" | tee -a $target_file_name > /dev/null
2023-12-01 12:23:01 +01:00
echo Terminal = false | tee -a $target_file_name > /dev/null
2023-01-16 22:29:09 +01:00
echo Type = Application | tee -a $target_file_name > /dev/null
echo "Categories=Qt;Utility;" | tee -a $target_file_name > /dev/null
echo "MimeType=x-scheme-handler/zano;" | tee -a $target_file_name > /dev/null
2023-01-17 15:48:15 +01:00
echo "StartupWMClass=Zano" | tee -a $target_file_name > /dev/null
2023-01-16 22:29:09 +01:00
}
create_desktop_icon $out_file_name
xdg-mime default Zano.desktop x-scheme-handler/zano
2025-03-20 19:02:39 +05:00
xdg-desktop-menu install --novendor " ${ out_file_name } "
2023-01-16 22:29:09 +01:00
2023-01-18 15:15:13 +01:00
call_app " $@ "