AppImage for Linux

It would be great to have Zotero as AppImage.
I've just created Zotero-5.0.86_linux-x86_64.AppImage using a modified version of this script:
https://github.com/Eothred/zotero/blob/appimage/packaging/AppImage/build.sh
It's working fine in Linux Mint 19.3.
  • Here is the modified script. It will:
    1) download the latest Zotero-${VERSION}_linux-x86_64.tar.bz2
    2) download the latest appimagetool needed to build the AppImage file
    3) uncompress, modify and build Zotero-${VERSION}_linux-x86_64.AppImage
    4) remove temporary files and folders

    Just copy following code into a zotero_to_appimage.sh
    ---------------------------------------
    # Create Zotero-${VERSION}_linux-x86_64.AppImage from latest version
    # Coder: omvsj
    # Version: 1

    content=$(wget https://www.zotero.org/download -q -O -)
    VERSION=$(echo $content | grep -o -P '(?<="linux-x86_64":").*(?="})')

    if [ ! -e Zotero-${VERSION}_linux-x86_64.tar.bz2 ]
    then
    wget "https://www.zotero.org/download/client/dl?channel=release&platform=linux-x86_64&version=$VERSION" -O Zotero-${VERSION}_linux-x86_64.tar.bz2
    fi

    if [ -d Zotero-${VERSION}_linux-x86_64 ]
    then
    rm -rf Zotero-${VERSION}_linux-x86_64
    fi
    echo "Extracting..."
    tar -jxf Zotero-${VERSION}_linux-x86_64.tar.bz2
    mv Zotero_linux-x86_64 Zotero-${VERSION}_linux-x86_64

    if [ ! -f appimagetool-x86_64.AppImage ]
    then
    wget "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage"
    chmod +x appimagetool-x86_64.AppImage
    fi

    echo "Configuring..."
    cd Zotero-${VERSION}_linux-x86_64
    mv zotero AppRun
    sed "s/Exec=.*/Exec=zotero-bin -url %U/g" zotero.desktop | sed "s#MimeType=text/plain#MimeType=text/plain;#" | sed "s/zotero.ico/zotero/g"> zotero-new.desktop
    mv zotero-new.desktop zotero.desktop

    cp chrome/icons/default/main-window.ico zotero.ico
    convert zotero.ico zotero.png
    mv zotero-0.png zotero.png
    rm zotero-*.png zotero.ico

    echo "Packaging..."

    cd ..
    ./appimagetool-x86_64.AppImage Zotero-${VERSION}_linux-x86_64
    mv Zotero-x86_64.AppImage Zotero-${VERSION}_linux-x86_64.AppImage

    rm -rf Zotero-${VERSION}_linux-x86_64
    rm Zotero-${VERSION}_linux-x86_64.tar.bz2
    rm appimagetool-x86_64.AppImage
  • FWIW, I've slightly improved this script for my own use so that it's a bit safer, see https://github.com/cadadr/configuration/blob/master/lib/zotero-appimage.bash

    This script can be run from anywhere, and doesn't have any scary "rm -rf"s in it. It would be great if Zotero distributed these images, they're really handy and quick to build, and easier to install, without need to create a .desktop file manually.
  • edited June 7, 2020
    Mind that container-based distributions in my experience limit what folders are accessible to Zotero and I have at least one instance (for a flatpack) where that disabled some features of BBT.
  • Excelent, cadadr.

    I would keep this two lines to "find" latest version:
    content=$(wget https://www.zotero.org/download -q -O -)
    version=$(echo $content | grep -o -P '(?<="linux-'${arch}'":").*(?="})')
  • I have the same problem as https://forums.zotero.org/profile/1535871/emilianoeheyns above with the Zotero flatpak. You can't escape the walled garden!!! The only place it looks for a folder is those physically stored on the current partition (very non UNIXy!!). On Windows 7 (RIP) you can put a folder anywhere with a drive letter (C: thru Z:) ... Possibly a feature request
  • edited June 13, 2020
    It is configurable, but I don't know how. To my knowledge you can't access all of the folders of the partition it's installed on by default, just a few select folders.

    Not that I think that drive letters are a great idea. A throwback to the days that the fortunate would have two floppy drives instead of one that we still live with today. Can't even put the user data on a 2nd drive.
  • I love the idea of an AppImage for Linux!

    On a related issue, I guess, as things stand now, for me, an unskilled Linux user, it would be great if after install Zotero could have a script to register the application for launcher/OS searches like other applications do. I couldn't manage to do it myself.

    The recommended set_launcher_icon script could do that I guess.

    For instance I have installed OBS project using `sudo apt-get install obs-studio' and it is immeadiately available to launch by the main OS search (on xfce/Xubuntu).
  • For systems that have apt, https://github.com/retorquere/zotero-deb will install Zotero without container config.
Sign In or Register to comment.