File create-update-ubuntu-menu-shortcut of Package kimi-utils-ubuntu

#!/bin/bash
# How to create a specified Encoding
# "echo "$var" | iconv --from-code=utf-8 --to-code=utf-16le --output=file2.txt

fileDir="$(xdg-user-dir HOME)/.local/share/applications"

menuFileName="update-ubuntu.desktop"
fullFilePath="$fileDir/$menuFileName"

if test -f "$fullFilePath" ; then
  rm -f "$fullFilePath"
fi

echo "[Desktop Entry]" >> "$fullFilePath"
# echo "Encoding=UTF-8" >> "$fullFilePath"
echo "Name=Update Ubuntu" >> "$fullFilePath"
echo "Name[sv]=Uppdatera Ubuntu" >> "$fullFilePath"
echo "Comment=Update system" >> "$fullFilePath"
echo "Comment[sv]=Uppdatera systemet" >> "$fullFilePath"
echo "Type=Application" >> "$fullFilePath"
echo "Terminal=true" >> "$fullFilePath"
echo "Icon=system-software-update" >> "$fullFilePath"
echo "Exec=sh -c 'sudo update-ubuntu'" >> "$fullFilePath"
echo "StartupWMClass=system" >> "$fullFilePath"
echo "Categories=System;" >> "$fullFilePath"

if test -f "$fullFilePath" ; then
  echo "[OK] Ubuntu update menu item was created in:"
  echo "    $fullFilePath"
else
  echo "[ERROR] Ubuntu update menu item was not created."
fi
openSUSE Build Service is sponsored by