Advertisement
Guest User

Untitled

a guest
Apr 8th, 2024
22
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.91 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. APP=deadbeef
  4.  
  5. # Create folders
  6. if [ -z "$APP" ]; then exit 1; fi
  7. mkdir -p ./$APP/tmp && cd ./$APP/tmp
  8.  
  9. # DOWNLOAD THE ARCHIVE
  10. version=$(wget -q https://sourceforge.net/projects/deadbeef/files/travis/linux/master/ -O - | grep -Eo "(http|https)://[a-zA-Z0-9./?=_%:-]*" | sort -u | grep "x86_64.tar.bz2")
  11. wget $version -O download.tar.bz2
  12. echo "$version" >> ./version
  13. tar fx ./*tar*
  14. cd ..
  15. mkdir ./$APP.AppDir
  16. mv --backup=t ./tmp/*/* ./$APP.AppDir
  17. rm -rf "./tmp"
  18.  
  19. cd ./$APP.AppDir
  20.  
  21. # DESKTOP ENTRY
  22. echo "[Desktop Entry]
  23. Type=Application
  24. Name=DeaDBeeF Nightly
  25.  
  26. Exec=deadbeef %F
  27. Icon=deadbeef
  28.  
  29. GenericName=Audio Player
  30. GenericName[pt_BR]=Reprodutor de áudio
  31. GenericName[ru]=Аудио плеер
  32. GenericName[zh_CN]=音频播放器
  33. GenericName[zh_TW]=音樂播放器
  34. Comment=Listen to music
  35. Comment[pt_BR]=Escute músicas
  36. Comment[ru]=Слушай музыку
  37. Comment[zh_CN]=倾听音乐
  38. Comment[zh_TW]=聆聽音樂
  39. MimeType=application/ogg;audio/x-vorbis+ogg;application/x-ogg;audio/mp3;audio/prs.sid;audio/x-flac;audio/mpeg;audio/x-mpeg;audio/x-mod;audio/x-it;audio/x-s3m;audio/x-xm;audio/x-mpegurl;audio/x-scpls;application/x-cue;
  40. Categories=Audio;AudioVideo;Player;GTK;
  41. Keywords=Sound;Music;Audio;Player;Musicplayer;MP3;
  42. Terminal=false
  43. Actions=Play;Pause;Toggle-Pause;Stop;Next;Prev;
  44. X-Ayatana-Desktop-Shortcuts=Play;Pause;Stop;Next;Prev;
  45. X-PulseAudio-Properties=media.role=music
  46.  
  47. [Desktop Action Play]
  48. Name=Play
  49. Name[zh_CN]=播放
  50. Name[zh_TW]=播放
  51. Exec=deadbeef --play
  52.  
  53. [Desktop Action Pause]
  54. Name=Pause
  55. Name[zh_CN]=暂停
  56. Name[zh_TW]=暫停
  57. Exec=deadbeef --pause
  58.  
  59. [Desktop Action Toggle-Pause]
  60. Name=Toggle Pause
  61. Name[zh_CN]=播放/暂停
  62. Name[zh_TW]=播放/暫停
  63. Exec=deadbeef --toggle-pause
  64.  
  65. [Desktop Action Stop]
  66. Name=Stop
  67. Name[zh_TW]=停止
  68. Exec=deadbeef --stop
  69.  
  70. [Desktop Action Next]
  71. Name=Next
  72. Name[zh_TW]=下一首
  73. Exec=deadbeef --next
  74.  
  75. [Desktop Action Prev]
  76. Name=Prev
  77. Name[zh_TW]=上一首
  78. Exec=deadbeef --prev" >> ./$APP.desktop
  79.  
  80. # Icon
  81. wget https://raw.githubusercontent.com/DeaDBeeF-Player/deadbeef/master/icons/scalable/deadbeef.svg -O ./deadbeef.svg 2> /dev/null
  82. ln -s ./deadbeef.svg ./.DirIcon
  83.  
  84. # AppRun
  85. cat >> ./AppRun << 'EOF'
  86. #!/bin/sh
  87. CURRENTDIR="$(readlink -f "$(dirname "$0")")"
  88. exec "$CURRENTDIR"/deadbeef "$@"
  89. EOF
  90. chmod a+x ./AppRun
  91.  
  92. # MAKE APPIMAGE
  93. cd ..
  94. wget -q $(wget -q https://api.github.com/repos/probonopd/go-appimage/releases -O - | grep -v zsync | grep -i continuous | grep -i appimagetool | grep -i x86_64 | grep browser_download_url | cut -d '"' -f 4 | head -1) -O appimagetool
  95. chmod a+x ./appimagetool
  96.  
  97. # Do the thing!
  98. ARCH=x86_64 VERSION=$(./appimagetool -v | grep -o '[[:digit:]]*') ./appimagetool -s ./$APP.AppDir &&
  99. ls ./*.AppImage || { echo "appimagetool failed to make the appimage"; exit 1; }
  100.  
  101. # Clean up
  102. if [ -z "$APP" ]; then exit 1; fi # Being extra safe lol
  103. rm -rf "./$APP.AppDir"
  104. rm ./appimagetool
  105. echo "All Done!"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement