Giter VIP home page Giter VIP logo

appimage-desktop-entry's Introduction

Bash script that creates desktop entry for an .AppImage

Usage

Create desktop entry:

./appimage-desktop-entry.sh /path/to/Example.AppImage

Remove desktop entry:

./appimage-desktop-entry.sh /path/to/Example.AppImage --remove

appimage-desktop-entry's People

Contributors

un1t avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

appimage-desktop-entry's Issues

Shellcheck finds a few potential issues

I decided to use the tool shellcheck as a linter for this script. It did find a few potential issues. This issues are not show-stoppers. I'm providing this bug report in the spirit of trying to be helpful, to spread the word of a useful tool called shellcheck. If you don't feel the need for a linter, please feel free to close this issue.

Thank you for making this useful script!

$ shellcheck appimage-desktop-entry.sh 

In appimage-desktop-entry.sh line 11:
    echo "File not found:" $APPIMAGE_PATH
                           ^------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
    echo "File not found:" "$APPIMAGE_PATH"


In appimage-desktop-entry.sh line 21:
cd /tmp/
^------^ SC2164 (warning): Use 'cd ... || exit' or 'cd ... || return' in case cd fails.

Did you mean: 
cd /tmp/ || exit


In appimage-desktop-entry.sh line 23:
cd /tmp/squashfs-root/
^--------------------^ SC2164 (warning): Use 'cd ... || exit' or 'cd ... || return' in case cd fails.

Did you mean: 
cd /tmp/squashfs-root/ || exit


In appimage-desktop-entry.sh line 26:
FILENAMES=($(ls -d *.png))
           ^------------^ SC2207 (warning): Prefer mapfile or read -a to split command output (or quote to avoid splitting).
                   ^-- SC2035 (info): Use ./*glob* or -- *glob* so names with dashes won't become options.


In appimage-desktop-entry.sh line 28:
for filename in ${FILENAMES[*]}
                ^-------------^ SC2048 (warning): Use "${array[@]}" (with quotes) to prevent whitespace problems.


In appimage-desktop-entry.sh line 30:
    printf " %d) %s\n" $i  $filename
                       ^-- SC2086 (info): Double quote to prevent globbing and word splitting.
                           ^-------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
    printf " %d) %s\n" "$i"  "$filename"


In appimage-desktop-entry.sh line 31:
    i=$(expr $i + 1)
        ^--^ SC2003 (style): expr is antiquated. Consider rewriting this using $((..)), ${} or [[ ]].
             ^-- SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
    i=$(expr "$i" + 1)


In appimage-desktop-entry.sh line 34:
read SELECTED_INDEX
^--^ SC2162 (info): read without -r will mangle backslashes.


In appimage-desktop-entry.sh line 36:
ICON_SRC=${FILENAMES[$(expr $SELECTED_INDEX - 1)]}
                       ^--^ SC2003 (style): expr is antiquated. Consider rewriting this using $((..)), ${} or [[ ]].
                            ^-------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
ICON_SRC=${FILENAMES[$(expr "$SELECTED_INDEX" - 1)]}


In appimage-desktop-entry.sh line 57:
    rm $ICON_DST
       ^-------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
    rm "$ICON_DST"


In appimage-desktop-entry.sh line 58:
    rm $DESKTOP_ENTRY_PATH
       ^-----------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
    rm "$DESKTOP_ENTRY_PATH"

For more information:
  https://www.shellcheck.net/wiki/SC2048 -- Use "${array[@]}" (with quotes) t...
  https://www.shellcheck.net/wiki/SC2164 -- Use 'cd ... || exit' or 'cd ... |...
  https://www.shellcheck.net/wiki/SC2207 -- Prefer mapfile or read -a to spli...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.