From 44cd746ccb84f4d256bdda8e5d387322eeb7c6b6 Mon Sep 17 00:00:00 2001 From: iVAN <88724353+ivan-hc@users.noreply.github.com> Date: Sun, 12 Mar 2023 01:03:28 +0100 Subject: [PATCH] Add junest-export This is the first draft of a tool to export apps inside Junest to the local home directory --- bin/junest-export | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 bin/junest-export diff --git a/bin/junest-export b/bin/junest-export new file mode 100644 index 0000000..4ebcbb7 --- /dev/null +++ b/bin/junest-export @@ -0,0 +1,24 @@ +#!/bin/sh + +case "$1" in + '-a'|'-app') + if [ -n "$SUDO_COMMAND" ]; then echo -e "\n WARNING: You don't need to run the option '$1' with SUDO.\n"; exit; fi + while [ -n "$1" ] + do + mkdir ~/.cache/junest-export + cp ~/.junest/usr/share/applications/*$2* ~/.cache/junest-export + launchername=$(ls ~/.cache/junest-export) + appbinary=$(cat ~/.cache/junest-export/$launchername | grep Exec | cut -c 6- | head -1) + appiconname=$(cat ~/.cache/junest-export/$launchername | grep Icon | cut -c 6- | head -1) + sed -i "s#Exec=$appbinary#Exec=sh -c '~/.local/share/junest/bin/junest -- $appbinary'#g" ~/.cache/junest-export/$launchername + mkdir -p ~/.local/share/applications + mv ~/.cache/junest-export/$launchername ~/.local/share/applications/ + rm -R -f ~/.cache/junest-export + mkdir -p ~/.local/share/icons + ln -s ~/.junest/usr/share/icons/hicolor ~/.local/share/icons/hicolor > /dev/null 2>&1 + cp ~/.junest/usr/share/pixmaps/*$appiconname* ~/.local/share/icons/ > /dev/null 2>&1 + echo " $2 has been successfully exported!" + exit + done +esac + \ No newline at end of file