From cfc4869ac930c6bdd31d69a8631778f6da4891e7 Mon Sep 17 00:00:00 2001 From: Kristaps Kaupe Date: Wed, 3 Jun 2020 19:08:02 +0300 Subject: [PATCH] Install XDG desktop entry for JoinMarketQt --- install.sh | 13 ++++++++++++- joinmarket-qt.desktop | 8 ++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 joinmarket-qt.desktop diff --git a/install.sh b/install.sh index beda7af..978b019 100755 --- a/install.sh +++ b/install.sh @@ -276,13 +276,24 @@ joinmarket_install () { reqs=( 'base.txt' ) - if [[ ${with_qt} = "1" ]]; then + if [[ ${with_qt} == "1" ]]; then reqs+=( 'gui.txt' ) fi for req in ${reqs[@]}; do pip install -r "requirements/${req}" || return 1 done + + if [[ ${with_qt} == "1" ]]; then + if check_exists xdg-open; then + echo "Installing XDG desktop entry" + cp -f "$(dirname "$0")/docs/images/joinmarket_logo.png" \ + ~/.local/share/icons/ + cat "$(dirname "$0")/joinmarket-qt.desktop" | \ + sed "s/\\\$JMHOME/$(dirname "$(realpath "$0")" | sed 's/\//\\\//g')/" > \ + ~/.local/share/applications/joinmarket-qt.desktop + fi + fi } parse_flags () diff --git a/joinmarket-qt.desktop b/joinmarket-qt.desktop new file mode 100644 index 0000000..677388d --- /dev/null +++ b/joinmarket-qt.desktop @@ -0,0 +1,8 @@ +#!/usr/bin/env xdg-open +[Desktop Entry] +Version=1.0 +Type=Application +Terminal=false +Name=JoinMarketQt +Exec=$JMHOME/scripts/joinmarket-qt.sh +Icon=joinmarket_logo