vscodium 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. #!/bin/sh
  2. APP=vscodium
  3. # CREATE THE FOLDER
  4. mkdir /opt/$APP
  5. cd /opt/$APP
  6. # ADD THE REMOVER
  7. echo '#!/bin/sh' >> /opt/$APP/remove
  8. echo "rm -R -f /usr/local/share/applications/$APP-AM.desktop /opt/$APP /usr/local/bin/$APP" >> /opt/$APP/remove
  9. chmod a+x /opt/$APP/remove
  10. # DOWNLOAD THE APPIMAGE
  11. mkdir tmp
  12. cd ./tmp
  13. v=$(curl -Ls https://api.github.com/repos/VSCodium/vscodium/releases/latest | grep -E tag_name | awk -F '[""]' '{print $4}')
  14. wget https://github.com/VSCodium/vscodium/releases/download/$v/VSCodium-linux-arm64-$v.tar.gz
  15. version=$(ls /opt/$APP/tmp)
  16. echo "$version" >> /opt/$APP/version
  17. tar fx ./*.tar.gz
  18. rm -f ./*.tar.gz
  19. cd ..
  20. mv ./tmp/* ./
  21. rmdir ./tmp
  22. # LINK
  23. ln -s /opt/$APP/codium /usr/local/bin/$APP
  24. # SCRIPT TO UPDATE THE PROGRAM
  25. echo '#!/bin/sh' >> /opt/$APP/AM-updater
  26. echo "APP=$APP" >> /opt/$APP/AM-updater
  27. echo "cd /opt/$APP" /usr/local/bin/$APP
  28. echo 'version0=$(cat /opt/$APP/version)
  29. url=https://github.com/VSCodium/vscodium/releases/latest' >> /opt/$APP/AM-updater
  30. echo 'if curl -L -s $url | grep -ioF "$version0"; then' >> /opt/$APP/AM-updater
  31. echo ' echo "Update not needed!".' >> /opt/$APP/AM-updater
  32. echo 'else' >> /opt/$APP/AM-updater
  33. echo " notify-send 'A new version of $APP is available, please wait'" >> /opt/$APP/AM-updater
  34. echo " mkdir /opt/$APP/tmp
  35. cd /opt/$APP/tmp" >> /opt/$APP/AM-updater
  36. ########################################################################################
  37. function1='$(curl -Ls https://api.github.com/repos/VSCodium/vscodium/releases/latest'
  38. part0='{print $4}'
  39. part1='[""]'
  40. function2="grep -E tag_name | awk -F '$part1' '$part0')"
  41. function3='$(ls /opt/$APP/tmp)'
  42. function4='wget https://github.com/VSCodium/vscodium/releases/download/$v/VSCodium-linux-arm64-$v.tar.gz'
  43. echo " v=$function1 | $function2
  44. $function4
  45. version=$function3" >> /opt/$APP/AM-updater
  46. ########################################################################################
  47. echo ' cd ..
  48. if test -f ./tmp/*tar.gz; then rm ./version
  49. fi
  50. echo "$version" >> ./version' >> /opt/$APP/AM-updater
  51. echo " tar fx ./tmp/*.tar.gz
  52. rm ./tmp/*.tar.gz
  53. mv ./tmp/* ./
  54. rmdir ./tmp
  55. fi" >> /opt/$APP/AM-updater
  56. chmod a+x /opt/$APP/AM-updater
  57. # LAUNCHER
  58. rm -f /usr/local/share/applications/$APP-AM.desktop
  59. echo "[Desktop Entry]
  60. Name=VSCodium
  61. Comment=Code Editing. Redefined.
  62. GenericName=Text Editor
  63. Exec=vscodium --unity-launch %F
  64. Icon=/opt/$APP/$APP.svg
  65. Type=Application
  66. StartupNotify=false
  67. StartupWMClass=VSCodium
  68. Categories=Utility;TextEditor;Development;IDE;
  69. MimeType=text/plain;inode/directory;application/x-codium-workspace;
  70. Actions=new-empty-window;
  71. Keywords=vscode;
  72. X-AppImage-Version=1.59.1-1629418630.glibc2.17
  73. [Desktop Action new-empty-window]
  74. Name=New Empty Window
  75. Exec=vscodium --new-window %F
  76. Icon=/opt/$APP/$APP.svg" >> /usr/local/share/applications/$APP-AM.desktop
  77. # ICON
  78. wget https://raw.githubusercontent.com/ivan-hc/AM-application-manager/main/programs/.icons/$APP/$APP.svg