From 635151b769f25ee87cba435a1b33e401925fc00d Mon Sep 17 00:00:00 2001 From: saicharankandukuri Date: Thu, 30 Sep 2021 17:40:54 +0530 Subject: [PATCH 1/3] =?UTF-8?q?changed=20script=20=E2=86=92=20udroid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- etc/scripts/udroid/udroid.sh | 242 +++++++++++++++++++++++++++++++++++ 1 file changed, 242 insertions(+) create mode 100644 etc/scripts/udroid/udroid.sh diff --git a/etc/scripts/udroid/udroid.sh b/etc/scripts/udroid/udroid.sh new file mode 100644 index 0000000..6cde13d --- /dev/null +++ b/etc/scripts/udroid/udroid.sh @@ -0,0 +1,242 @@ +#!/usr/bin/env bash + +version=2 + +if [ -n "$HIPPO_BRANCH" ]; then + BRANCH="$HIPPO_BRANCH" +fi + +CACHE_ROOT="${HOME}/.uoa-cache-root" +TPREFIX="/data/data/com.termux/files" + +SCRIPT_DIR="${TPREFIX}/usr/etc/proot-distro" +INSTALL_FOLDER="${TPREFIX}/usr/var/lib/proot-distro/installed-rootfs" + +HIPPO_DIR="${INSTALL_FOLDER}/udroid" +HIPPO_SCRIPT_FILE="${SCRIPT_DIR}/udroid.sh" + +SOCIAL_PLATFORM="\e[34mhttps://discord.gg/TAqaG5sEfW" + +# HIPPO_DIR = "${INSTALL_FOLDER}/${HIPPO_DEFAULT}" +# HIPPO_SCRIPT_FILE="${SCRIPT_DIR}/hippo.sh" + +# * Usefull functions +# die() exit with code 1 with printing given string +# warn() like die() without exit status (used when exit is not necessary) +# shout() pring messege in a good way with some lines +# lshout() print messege in a standard way +# msg() print's normal echo + +die () { echo -e "${RED}Error ${*}${RST}";exit 1 ;:;} +warn () { echo -e "${RED}Error ${*}${RST}";:;} +shout () { echo -e "${DS}////////";echo -e "${*}";echo -e "////////${RST}";:; } +lshout () { echo -e "${DC}";echo -e "${*}";echo -e "${RST}";:; } +msg () { echo -e "\e[38;5;228m ${*} \e[0m" >&2 ;:; } + + +function __check_for_hippo() { + if [ -d ${HIPPO_DIR} ] && [ -f ${HIPPO_SCRIPT_FILE} ]; then + return 0; + else + return 1; + fi +} + +function __check_for_plugin() { + + if [ -f ${HIPPO_SCRIPT_FILE} ]; then + return 0 + else + return 1 + fi + +} + +function __check_for_filesystem() { + + if [ -d ${HIPPO_DIR}/bin ]; then + return 0 + else + return 1 + fi +} + +function __verify_bin_path() +{ + BINPATH="${SHELL}" + + if [ -z "$BINPATH" ]; then + if [ "$BINPATH" != "/data/data/com.termux/files/*" ]; then + msg "This has to be done inside termux environment" + die "\$SHELL != $BINPATH" + exit 1 + fi + fi +} + +function __upgrade() { + # setup downloader + if ! command -v axel >> /dev/null; then + apt install axel -y + fi + + mkdir -p "${CACHE_ROOT}" + axel -o "${CACHE_ROOT}"/version https://raw.githubusercontent.com/RandomCoderOrg/fs-manager-hippo/main/version >> /dev/null || { + die "error" + } + + origin_version=$(cat "${CACHE_ROOT}"/version) + + rm -rf "${CACHE_ROOT}" + + if [ "$origin_version" -gt "$version" ]; then + lshout "upgrdae avalibe to \e[1;32mV${origin_version}\e[0m" + elif [ "$origin_version" -eq "$version" ]; then + lshout "You are on latest version \e[1;32mV${origin_version}\e[0m" + exit 0 + else + die "Upgrader hit unexpected condition..." + exit 1 + fi + + if start_upgrade; then + bash -x "${CACHE_ROOT}"/upgrade --summary + rm -rf "${CACHE_ROOT}" + else + die "Error" + fi + + +} + +function start_upgrade() { + mkdir -p "${CACHE_ROOT}" + axel -o "${CACHE_ROOT}"/upgrade.sh https://raw.githubusercontent.com/RandomCoderOrg/fs-manager-hippo/main/etc/scripts/upgrade_patch/upgrade.sh >> /dev/null || { + die "Error"; exit 1 + } + bash -x upgrade.sh || { + return 1 + } + return 0 +} + + + +function __force_uprade_hippo() +{ + if [ ! -d "$CACHE_ROOT" ]; then + mkdir "$CACHE_ROOT" + else + rm -rf "${CACHE_ROOT}/fs-manager-hippo" + fi + + FSM_URL="https://github.com/RandomCoderOrg/fs-manager-hippo" + + if [ -z "${BRANCH}" ]; then + git clone ${FSM_URL} "${CACHE_ROOT}/fs-manager-hippo" || die "failed to clone repo" + else + git clone -b "${BRANCH}" "${CACHE_ROOT}/fs-manager-hippo" || die "failed to clone repo" + fi + + if [ -f "${CACHE_ROOT}"/fs-manager-hippo/install.sh ]; then + cd "${CACHE_ROOT}"/fs-manager-hippo || die "failed to cd ..." + bash install.sh || die "failed to install manager..." + fi +} + +function __help() +{ + msg "hippo - termux Version ${version} by saicharankandukuri" + msg + msg "A bash script to make basic action(login, vncserver) easier for ubuntu-on-android project" + msg + msg "Usage ${0} [options]" + msg + msg "Options:" + msg "--install To try installing hippo" + msg "--help To display this message" + msg "--enable-dbus To start terminal session with dbus enabled" + msg "--force-upgrade To reinstall this script of origin" + msg "startvnc To start hippo vncserver" + msg "stopvnc To stop hippo vncserver" + msg "--enable-dbus-startvnc To start vnc with dbus" + msg "------------------"#links goes here + msg "for additional documentation see: \e[1;34mhttps://github.com/RandomCoderOrg/ubuntu-on-android#basic-usage" + msg "report issues and feature requests at: \e[1;34mhttps://github.com/RandomCoderOrg/ubuntu-on-android/issues" + msg "Join the community at DISCORD -> $SOCIAL_PLATFORM" + msg "------------------" +} + +function _lauch_or_install() +{ + if ! __check_for_plugin; then + echo -e "Plugin at ${HIPPO_SCRIPT_FILE} is missing ......" + echo -e "May be this not a correct installation...." + echo -e "Try to notice us at \e[34m${SOCIAL_PLATFORM}\e[0m" + exit 1 + fi + if ! __check_for_filesystem; then + echo -e "Installing hippo..........." + if proot-distro install hippo; then + echo -e "Installation Done......\a\a" # \a triggers vibration in termux + echo "Waiting..." + sleep 4 + clear + echo -e "Now You can launch your ubuntu 21.04 with command \e[1;32mhippo\e[0m" + echo -e "use hippo --help for more option and comming up features" + fi + else + ####################################################################################################### + # Thanks to @GxmerSam Sam Alarie, @mizzunet, @Andre-cmd-rgb for the issues randome ideas and suggestion + + + pulseaudio --start --load="module-native-protocol-tcp auth-ip-acl=127.0.0.1 auth-anonymous=1" --exit-idle-time=-1 >> /dev/null + if [[ -f "${CACHE_ROOT}"/fs-manager-hippo/etc/scripts/vncserver/startvnc.sh ]] && [[ ! -f ${HIPPO_DIR}/bin/startvnc ]]; then + DIR="${CACHE_ROOT}/fs-manager-hippo/etc/scripts/vncserver/startvnc.sh" + cp "${DIR}" ${HIPPO_DIR}/bin/startvnc + proot-distro login hippo -- chmod 775 /bin/startvnc + fi + if [ -f "${CACHE_ROOT}"/fs-manager-hippo/etc/scripts/vncserver/stopvnc.sh ] && [ ! -f ${HIPPO_DIR}/bin/stopvnc ]; then + DIR="${CACHE_ROOT}/fs-manager-hippo/etc/scripts/vncserver/stopvnc.sh" + cp "${DIR}" ${HIPPO_DIR}/bin/stopvnc + proot-distro login hippo -- chmod 775 /bin/stopvnc + fi + proot-distro login hippo "$@" || warn "program exited unexpectedly..." + fi +} +__verify_bin_path +if [ $# -ge 1 ]; then + case "$1" in + upgrade) __upgrade;; + + --force-upgrade) __force_uprade_hippo;; + --enable-dbus) shift 1; _lauch_or_install --bind /dev/null:/proc/sys/kernel/cap_last_cap "$@" ;; + "--enable-dbus-startvnc") shift 1; _lauch_or_install --bind /dev/null:/proc/sys/kernel/cap_last_cap -- startvnc "$@" ;; + "--enable-dbus-stopvnc") shift 1; _lauch_or_install --bind /dev/null:/proc/sys/kernel/cap_last_cap -- stopvnc "$@" ;; # no use + --install) _lauch_or_install;; + --help) __help;; + + startvnc) + if __check_for_hippo; then + proot-distro login hippo --no-kill-on-exit -- startvnc + else + echo -e "This command is supposed to run after installing hippo" + echo -e "Use \e[1;32mhippo --install\e[0m install" + echo -e "\e[32mError:\e[0m Hippo not found" + fi + ;; + + stoptvnc) + if __check_for_hippo; then + proot-distro login hippo --no-kill-on-exit -- stoptvnc + else + echo -e "This command is supposed to run after installing hippo" + echo -e "Use \e[1;32mhippo --install\e[0m install" + echo -e "\e[32mError:\e[0m Hippo not found" + fi + ;; + *) _lauch_or_install "$@";; + esac +else + _lauch_or_install "$@" +fi From 23d06d6a650f35e9b4b4ff7120ca0b5a34490b4e Mon Sep 17 00:00:00 2001 From: saicharankandukuri Date: Thu, 30 Sep 2021 17:49:04 +0530 Subject: [PATCH 2/3] . --- etc/proot-env/Hidpi/hidpi/app.sh | 4 +- etc/proot-env/Hidpi/xhidpi/app.sh | 4 +- etc/scripts/hippo/hippo.sh | 242 ------------------------------ etc/scripts/udroid/udroid.sh | 4 +- etc/scripts/vncserver/startvnc.sh | 2 +- install.sh | 14 +- 6 files changed, 14 insertions(+), 256 deletions(-) delete mode 100644 etc/scripts/hippo/hippo.sh diff --git a/etc/proot-env/Hidpi/hidpi/app.sh b/etc/proot-env/Hidpi/hidpi/app.sh index 5b010ab..ad3f6e7 100644 --- a/etc/proot-env/Hidpi/hidpi/app.sh +++ b/etc/proot-env/Hidpi/hidpi/app.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -SETTINGS_DIR=~/.config/hippo-HiDPI/ +SETTINGS_DIR=~/.config/udroid-HiDPI/ DESKTOP="$XDG_CURRENT_DESKTOP" case "$DESKTOP" in @@ -72,5 +72,5 @@ toggle_hidpi() { } toggle_hidpi -zenity --question --title='hippo HiDPI mode(experimental)' --text 'Do you want to keep this window-scaling mode?\n(prefer no if things look bad)' --timeout=15 --width=200 || \ +zenity --question --title='udroid HiDPI mode(experimental)' --text 'Do you want to keep this window-scaling mode?\n(prefer no if things look bad)' --timeout=15 --width=200 || \ toggle_hidpi diff --git a/etc/proot-env/Hidpi/xhidpi/app.sh b/etc/proot-env/Hidpi/xhidpi/app.sh index 5db0a07..fafde9c 100644 --- a/etc/proot-env/Hidpi/xhidpi/app.sh +++ b/etc/proot-env/Hidpi/xhidpi/app.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -SETTINGS_DIR=~/.config/hippo-HiDPI/ +SETTINGS_DIR=~/.config/udroid-HiDPI/ DESKTOP="$XDG_CURRENT_DESKTOP" case "$DESKTOP" in @@ -72,5 +72,5 @@ toggle_hidpi() { } toggle_hidpi -zenity --question --title='hippo HiDPI mode(experimental)' --text 'Do you want to keep this window-scaling mode?\n(prefer no if things look bad)' --timeout=15 --width=200 || \ +zenity --question --title='udroid HiDPI mode(experimental)' --text 'Do you want to keep this window-scaling mode?\n(prefer no if things look bad)' --timeout=15 --width=200 || \ toggle_hidpi diff --git a/etc/scripts/hippo/hippo.sh b/etc/scripts/hippo/hippo.sh deleted file mode 100644 index 3d06d94..0000000 --- a/etc/scripts/hippo/hippo.sh +++ /dev/null @@ -1,242 +0,0 @@ -#!/usr/bin/env bash - -version=2 - -if [ -n "$HIPPO_BRANCH" ]; then - BRANCH="$HIPPO_BRANCH" -fi - -CACHE_ROOT="${HOME}/.uoa-cache-root" -TPREFIX="/data/data/com.termux/files" - -SCRIPT_DIR="${TPREFIX}/usr/etc/proot-distro" -INSTALL_FOLDER="${TPREFIX}/usr/var/lib/proot-distro/installed-rootfs" - -HIPPO_DIR="${INSTALL_FOLDER}/hippo" -HIPPO_SCRIPT_FILE="${SCRIPT_DIR}/hippo.sh" - -SOCIAL_PLATFORM="\e[34mhttps://discord.gg/TAqaG5sEfW" - -# HIPPO_DIR = "${INSTALL_FOLDER}/${HIPPO_DEFAULT}" -# HIPPO_SCRIPT_FILE="${SCRIPT_DIR}/hippo.sh" - -# * Usefull functions -# die() exit with code 1 with printing given string -# warn() like die() without exit status (used when exit is not necessary) -# shout() pring messege in a good way with some lines -# lshout() print messege in a standard way -# msg() print's normal echo - -die () { echo -e "${RED}Error ${*}${RST}";exit 1 ;:;} -warn () { echo -e "${RED}Error ${*}${RST}";:;} -shout () { echo -e "${DS}////////";echo -e "${*}";echo -e "////////${RST}";:; } -lshout () { echo -e "${DC}";echo -e "${*}";echo -e "${RST}";:; } -msg () { echo -e "\e[38;5;228m ${*} \e[0m" >&2 ;:; } - - -function __check_for_hippo() { - if [ -d ${HIPPO_DIR} ] && [ -f ${HIPPO_SCRIPT_FILE} ]; then - return 0; - else - return 1; - fi -} - -function __check_for_plugin() { - - if [ -f ${HIPPO_SCRIPT_FILE} ]; then - return 0 - else - return 1 - fi - -} - -function __check_for_filesystem() { - - if [ -d ${HIPPO_DIR}/bin ]; then - return 0 - else - return 1 - fi -} - -function __verify_bin_path() -{ - BINPATH="${SHELL}" - - if [ -z "$BINPATH" ]; then - if [ "$BINPATH" != "/data/data/com.termux/files/*" ]; then - msg "This has to be done inside termux environment" - die "\$SHELL != $BINPATH" - exit 1 - fi - fi -} - -function __upgrade() { - # setup downloader - if ! command -v axel >> /dev/null; then - apt install axel -y - fi - - mkdir -p "${CACHE_ROOT}" - axel -o "${CACHE_ROOT}"/version https://raw.githubusercontent.com/RandomCoderOrg/fs-manager-hippo/main/version >> /dev/null || { - die "error" - } - - origin_version=$(cat "${CACHE_ROOT}"/version) - - rm -rf "${CACHE_ROOT}" - - if [ "$origin_version" -gt "$version" ]; then - lshout "upgrdae avalibe to \e[1;32mV${origin_version}\e[0m" - elif [ "$origin_version" -eq "$version" ]; then - lshout "You are on latest version \e[1;32mV${origin_version}\e[0m" - exit 0 - else - die "Upgrader hit unexpected condition..." - exit 1 - fi - - if start_upgrade; then - bash -x "${CACHE_ROOT}"/upgrade --summary - rm -rf "${CACHE_ROOT}" - else - die "Error" - fi - - -} - -function start_upgrade() { - mkdir -p "${CACHE_ROOT}" - axel -o "${CACHE_ROOT}"/upgrade.sh https://raw.githubusercontent.com/RandomCoderOrg/fs-manager-hippo/main/etc/scripts/upgrade_patch/upgrade.sh >> /dev/null || { - die "Error"; exit 1 - } - bash -x upgrade.sh || { - return 1 - } - return 0 -} - - - -function __force_uprade_hippo() -{ - if [ ! -d "$CACHE_ROOT" ]; then - mkdir "$CACHE_ROOT" - else - rm -rf "${CACHE_ROOT}/fs-manager-hippo" - fi - - FSM_URL="https://github.com/RandomCoderOrg/fs-manager-hippo" - - if [ -z "${BRANCH}" ]; then - git clone ${FSM_URL} "${CACHE_ROOT}/fs-manager-hippo" || die "failed to clone repo" - else - git clone -b "${BRANCH}" "${CACHE_ROOT}/fs-manager-hippo" || die "failed to clone repo" - fi - - if [ -f "${CACHE_ROOT}"/fs-manager-hippo/install.sh ]; then - cd "${CACHE_ROOT}"/fs-manager-hippo || die "failed to cd ..." - bash install.sh || die "failed to install manager..." - fi -} - -function __help() -{ - msg "hippo - termux Version ${version} by saicharankandukuri" - msg - msg "A bash script to make basic action(login, vncserver) easier for ubuntu-on-android project" - msg - msg "Usage ${0} [options]" - msg - msg "Options:" - msg "--install To try installing hippo" - msg "--help To display this message" - msg "--enable-dbus To start terminal session with dbus enabled" - msg "--force-upgrade To reinstall this script of origin" - msg "startvnc To start hippo vncserver" - msg "stopvnc To stop hippo vncserver" - msg "--enable-dbus-startvnc To start vnc with dbus" - msg "------------------"#links goes here - msg "for additional documentation see: \e[1;34mhttps://github.com/RandomCoderOrg/ubuntu-on-android#basic-usage" - msg "report issues and feature requests at: \e[1;34mhttps://github.com/RandomCoderOrg/ubuntu-on-android/issues" - msg "Join the community at DISCORD -> $SOCIAL_PLATFORM" - msg "------------------" -} - -function _lauch_or_install() -{ - if ! __check_for_plugin; then - echo -e "Plugin at ${HIPPO_SCRIPT_FILE} is missing ......" - echo -e "May be this not a correct installation...." - echo -e "Try to notice us at \e[34m${SOCIAL_PLATFORM}\e[0m" - exit 1 - fi - if ! __check_for_filesystem; then - echo -e "Installing hippo..........." - if proot-distro install hippo; then - echo -e "Installation Done......\a\a" # \a triggers vibration in termux - echo "Waiting..." - sleep 4 - clear - echo -e "Now You can launch your ubuntu 21.04 with command \e[1;32mhippo\e[0m" - echo -e "use hippo --help for more option and comming up features" - fi - else - ####################################################################################################### - # Thanks to @GxmerSam Sam Alarie, @mizzunet, @Andre-cmd-rgb for the issues randome ideas and suggestion - - - pulseaudio --start --load="module-native-protocol-tcp auth-ip-acl=127.0.0.1 auth-anonymous=1" --exit-idle-time=-1 >> /dev/null - if [[ -f "${CACHE_ROOT}"/fs-manager-hippo/etc/scripts/vncserver/startvnc.sh ]] && [[ ! -f ${HIPPO_DIR}/bin/startvnc ]]; then - DIR="${CACHE_ROOT}/fs-manager-hippo/etc/scripts/vncserver/startvnc.sh" - cp "${DIR}" ${HIPPO_DIR}/bin/startvnc - proot-distro login hippo -- chmod 775 /bin/startvnc - fi - if [ -f "${CACHE_ROOT}"/fs-manager-hippo/etc/scripts/vncserver/stopvnc.sh ] && [ ! -f ${HIPPO_DIR}/bin/stopvnc ]; then - DIR="${CACHE_ROOT}/fs-manager-hippo/etc/scripts/vncserver/stopvnc.sh" - cp "${DIR}" ${HIPPO_DIR}/bin/stopvnc - proot-distro login hippo -- chmod 775 /bin/stopvnc - fi - proot-distro login hippo "$@" || warn "program exited unexpectedly..." - fi -} -__verify_bin_path -if [ $# -ge 1 ]; then - case "$1" in - upgrade) __upgrade;; - - --force-upgrade) __force_uprade_hippo;; - --enable-dbus) shift 1; _lauch_or_install --bind /dev/null:/proc/sys/kernel/cap_last_cap "$@" ;; - "--enable-dbus-startvnc") shift 1; _lauch_or_install --bind /dev/null:/proc/sys/kernel/cap_last_cap -- startvnc "$@" ;; - "--enable-dbus-stopvnc") shift 1; _lauch_or_install --bind /dev/null:/proc/sys/kernel/cap_last_cap -- stopvnc "$@" ;; # no use - --install) _lauch_or_install;; - --help) __help;; - - startvnc) - if __check_for_hippo; then - proot-distro login hippo --no-kill-on-exit -- startvnc - else - echo -e "This command is supposed to run after installing hippo" - echo -e "Use \e[1;32mhippo --install\e[0m install" - echo -e "\e[32mError:\e[0m Hippo not found" - fi - ;; - - stoptvnc) - if __check_for_hippo; then - proot-distro login hippo --no-kill-on-exit -- stoptvnc - else - echo -e "This command is supposed to run after installing hippo" - echo -e "Use \e[1;32mhippo --install\e[0m install" - echo -e "\e[32mError:\e[0m Hippo not found" - fi - ;; - *) _lauch_or_install "$@";; - esac -else - _lauch_or_install "$@" -fi diff --git a/etc/scripts/udroid/udroid.sh b/etc/scripts/udroid/udroid.sh index 6cde13d..0c0d8aa 100644 --- a/etc/scripts/udroid/udroid.sh +++ b/etc/scripts/udroid/udroid.sh @@ -15,7 +15,7 @@ INSTALL_FOLDER="${TPREFIX}/usr/var/lib/proot-distro/installed-rootfs" HIPPO_DIR="${INSTALL_FOLDER}/udroid" HIPPO_SCRIPT_FILE="${SCRIPT_DIR}/udroid.sh" -SOCIAL_PLATFORM="\e[34mhttps://discord.gg/TAqaG5sEfW" +# SOCIAL_PLATFORM="\e[34mhttps://discord.gg/TAqaG5sEfW" # HIPPO_DIR = "${INSTALL_FOLDER}/${HIPPO_DEFAULT}" # HIPPO_SCRIPT_FILE="${SCRIPT_DIR}/hippo.sh" @@ -163,7 +163,7 @@ function __help() msg "------------------"#links goes here msg "for additional documentation see: \e[1;34mhttps://github.com/RandomCoderOrg/ubuntu-on-android#basic-usage" msg "report issues and feature requests at: \e[1;34mhttps://github.com/RandomCoderOrg/ubuntu-on-android/issues" - msg "Join the community at DISCORD -> $SOCIAL_PLATFORM" + # msg "Join the community at DISCORD -> $SOCIAL_PLATFORM" msg "------------------" } diff --git a/etc/scripts/vncserver/startvnc.sh b/etc/scripts/vncserver/startvnc.sh index 16916d7..b0e6c3e 100644 --- a/etc/scripts/vncserver/startvnc.sh +++ b/etc/scripts/vncserver/startvnc.sh @@ -30,5 +30,5 @@ if ! $vnc; then vncserver -xstartup "${DEFAULT_XSTARTUP}" -desktop "Hippo Default VNC" :${port} else echo "A vncserver lock is found for port ${port}" - echo -e "Use \e[1;32mhippo stoptvnc\e[0m or \e[1;32mstopvnc\e[0m to stop it and try again..." + echo -e "Use \e[1;32mudroid stoptvnc\e[0m or \e[1;32mstopvnc\e[0m to stop it and try again..." fi diff --git a/install.sh b/install.sh index 6328883..444aa22 100644 --- a/install.sh +++ b/install.sh @@ -3,15 +3,15 @@ TPREFIX="/data/data/com.termux/files" BIN_DIR="${TPREFIX}/usr/bin" -echo "setting hippo..." +echo "setting udroid..." -if [ -f etc/scripts/hippo/hippo.sh ]; then - FILE="etc/scripts/hippo/hippo.sh" - if [ -f ${BIN_DIR}/hippo.sh ]; then - rm -rf "${BIN_DIR}/hippo.sh" +if [ -f etc/scripts/udroid/udroid.sh ]; then + FILE="etc/scripts/udroid/udroid.sh" + if [ -f ${BIN_DIR}/udroid.sh ]; then + rm -rf "${BIN_DIR}/udroid.sh" fi - cp ${FILE} ${BIN_DIR}/hippo - chmod 775 ${BIN_DIR}/hippo + cp ${FILE} ${BIN_DIR}/udroid + chmod 775 ${BIN_DIR}/udroid else echo "Installation Failed..." exit 1 From c47703dbe20750d7afd262f9181caedbddc39e87 Mon Sep 17 00:00:00 2001 From: saicharankandukuri Date: Thu, 30 Sep 2021 18:02:47 +0530 Subject: [PATCH 3/3] .. --- README.md | 6 +-- etc/proot-env/Hidpi/README.txt | 2 +- etc/proot-env/Hidpi/hidpi/app.desktop | 8 ++-- etc/proot-env/Hidpi/hidpi/install.sh | 8 ++-- etc/proot-env/Hidpi/xhidpi/app.desktop | 8 ++-- etc/proot-env/Hidpi/xhidpi/install.sh | 8 ++-- etc/scripts/pulseeffects/README.txt | 2 +- etc/scripts/udroid/udroid.sh | 58 +++++++++++++------------- etc/scripts/vncserver/startvnc.sh | 2 +- 9 files changed, 51 insertions(+), 51 deletions(-) diff --git a/README.md b/README.md index 0957c70..95775d6 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ -# fs-manager-hippo +# fs-manager-udroid A tool manage common things with ubuntu-on-android & some scripts and linux apps -[![CodeFactor](https://www.codefactor.io/repository/github/randomcoderorg/fs-manager-hippo/badge)](https://www.codefactor.io/repository/github/randomcoderorg/fs-manager-hippo) +[![CodeFactor](https://www.codefactor.io/repository/github/randomcoderorg/fs-manager-udroid/badge)](https://www.codefactor.io/repository/github/randomcoderorg/fs-manager-udroid) diff --git a/etc/proot-env/Hidpi/README.txt b/etc/proot-env/Hidpi/README.txt index 99f78c3..841f176 100644 --- a/etc/proot-env/Hidpi/README.txt +++ b/etc/proot-env/Hidpi/README.txt @@ -1,6 +1,6 @@ hidipi -This apps comes preinstalled in hippo +This apps comes preinstalled in udroid scripts in this folders are prconfigured to run with WhiteSur Theme diff --git a/etc/proot-env/Hidpi/hidpi/app.desktop b/etc/proot-env/Hidpi/hidpi/app.desktop index 19137fd..081cd87 100644 --- a/etc/proot-env/Hidpi/hidpi/app.desktop +++ b/etc/proot-env/Hidpi/hidpi/app.desktop @@ -1,8 +1,8 @@ [Desktop Entry] -Name=Hippo HiDPI Mode -Exec=hippo-hidpi-mode +Name=udroid HiDPI Mode +Exec=udroid-hidpi-mode Terminal=false Type=Application -Icon=/usr/share/hippo/hidpi-logo.png +Icon=/usr/share/udroid/hidpi-logo.png OnlyShowIn=XFCE -Keyboards=display;screen;hidpi;hippo; \ No newline at end of file +Keyboards=display;screen;hidpi;udroid; \ No newline at end of file diff --git a/etc/proot-env/Hidpi/hidpi/install.sh b/etc/proot-env/Hidpi/hidpi/install.sh index a3951da..98bbd75 100644 --- a/etc/proot-env/Hidpi/hidpi/install.sh +++ b/etc/proot-env/Hidpi/hidpi/install.sh @@ -1,10 +1,10 @@ #!/usr/bin/env bash -ICONDIR="/usr/share/hippo" +ICONDIR="/usr/share/udroid" if [ -f app.sh ]; then - cp app.sh /bin/hippo-hidpi-mode - chmod 775 /bin/hippo-hidpi-mode + cp app.sh /bin/udroid-hidpi-mode + chmod 775 /bin/udroid-hidpi-mode fi if [ -f logo.png ]; then @@ -19,7 +19,7 @@ fi if [ -f app.desktop ]; then if [ -d /usr/share/applications ]; then - cp app.desktop /usr/share/applications/hippo-hidpi-mode.desktop + cp app.desktop /usr/share/applications/udroid-hidpi-mode.desktop fi fi diff --git a/etc/proot-env/Hidpi/xhidpi/app.desktop b/etc/proot-env/Hidpi/xhidpi/app.desktop index cfef26f..e582443 100644 --- a/etc/proot-env/Hidpi/xhidpi/app.desktop +++ b/etc/proot-env/Hidpi/xhidpi/app.desktop @@ -1,8 +1,8 @@ [Desktop Entry] -Name=Hippo XHiDPI Mode -Exec=hippo-xhidpi-mode +Name=udroid XHiDPI Mode +Exec=udroid-xhidpi-mode Terminal=false Type=Application -Icon=/usr/share/hippo/xhidpi-logo.png +Icon=/usr/share/udroid/xhidpi-logo.png OnlyShowIn=XFCE -Keyboards=display;screen;hidpi;hippo; \ No newline at end of file +Keyboards=display;screen;hidpi;udroid; \ No newline at end of file diff --git a/etc/proot-env/Hidpi/xhidpi/install.sh b/etc/proot-env/Hidpi/xhidpi/install.sh index 27d10ac..c16c2f1 100644 --- a/etc/proot-env/Hidpi/xhidpi/install.sh +++ b/etc/proot-env/Hidpi/xhidpi/install.sh @@ -1,10 +1,10 @@ #!/usr/bin/env bash -ICONDIR="/usr/share/hippo" +ICONDIR="/usr/share/udroid" if [ -f app.sh ]; then - cp app.sh /bin/hippo-xhidpi-mode - chmod 775 /bin/hippo-xhidpi-mode + cp app.sh /bin/udroid-xhidpi-mode + chmod 775 /bin/udroid-xhidpi-mode fi if [ -f logo.png ]; then @@ -19,7 +19,7 @@ fi if [ -f app.desktop ]; then if [ -d /usr/share/applications ]; then - cp app.desktop /usr/share/applications/hippo-xhidpi-mode.desktop + cp app.desktop /usr/share/applications/udroid-xhidpi-mode.desktop fi fi diff --git a/etc/scripts/pulseeffects/README.txt b/etc/scripts/pulseeffects/README.txt index 5f11769..89b1e67 100644 --- a/etc/scripts/pulseeffects/README.txt +++ b/etc/scripts/pulseeffects/README.txt @@ -1,3 +1,3 @@ -this is a script to install pulseeffects in hippo or any ubuntu/debian based system +this is a script to install pulseeffects in udroid or any ubuntu/debian based system MIT Copyright (c) 2021 Saicharan Kandukuri diff --git a/etc/scripts/udroid/udroid.sh b/etc/scripts/udroid/udroid.sh index 0c0d8aa..dfe083f 100644 --- a/etc/scripts/udroid/udroid.sh +++ b/etc/scripts/udroid/udroid.sh @@ -18,7 +18,7 @@ HIPPO_SCRIPT_FILE="${SCRIPT_DIR}/udroid.sh" # SOCIAL_PLATFORM="\e[34mhttps://discord.gg/TAqaG5sEfW" # HIPPO_DIR = "${INSTALL_FOLDER}/${HIPPO_DEFAULT}" -# HIPPO_SCRIPT_FILE="${SCRIPT_DIR}/hippo.sh" +# HIPPO_SCRIPT_FILE="${SCRIPT_DIR}/udroid.sh" # * Usefull functions # die() exit with code 1 with printing given string @@ -81,7 +81,7 @@ function __upgrade() { fi mkdir -p "${CACHE_ROOT}" - axel -o "${CACHE_ROOT}"/version https://raw.githubusercontent.com/RandomCoderOrg/fs-manager-hippo/main/version >> /dev/null || { + axel -o "${CACHE_ROOT}"/version https://raw.githubusercontent.com/RandomCoderOrg/fs-manager-udroid/main/version >> /dev/null || { die "error" } @@ -111,7 +111,7 @@ function __upgrade() { function start_upgrade() { mkdir -p "${CACHE_ROOT}" - axel -o "${CACHE_ROOT}"/upgrade.sh https://raw.githubusercontent.com/RandomCoderOrg/fs-manager-hippo/main/etc/scripts/upgrade_patch/upgrade.sh >> /dev/null || { + axel -o "${CACHE_ROOT}"/upgrade.sh https://raw.githubusercontent.com/RandomCoderOrg/fs-manager-udroid/main/etc/scripts/upgrade_patch/upgrade.sh >> /dev/null || { die "Error"; exit 1 } bash -x upgrade.sh || { @@ -127,38 +127,38 @@ function __force_uprade_hippo() if [ ! -d "$CACHE_ROOT" ]; then mkdir "$CACHE_ROOT" else - rm -rf "${CACHE_ROOT}/fs-manager-hippo" + rm -rf "${CACHE_ROOT}/fs-manager-udroid" fi - FSM_URL="https://github.com/RandomCoderOrg/fs-manager-hippo" + FSM_URL="https://github.com/RandomCoderOrg/fs-manager-udroid" if [ -z "${BRANCH}" ]; then - git clone ${FSM_URL} "${CACHE_ROOT}/fs-manager-hippo" || die "failed to clone repo" + git clone ${FSM_URL} "${CACHE_ROOT}/fs-manager-udroid" || die "failed to clone repo" else - git clone -b "${BRANCH}" "${CACHE_ROOT}/fs-manager-hippo" || die "failed to clone repo" + git clone -b "${BRANCH}" "${CACHE_ROOT}/fs-manager-udroid" || die "failed to clone repo" fi - if [ -f "${CACHE_ROOT}"/fs-manager-hippo/install.sh ]; then - cd "${CACHE_ROOT}"/fs-manager-hippo || die "failed to cd ..." + if [ -f "${CACHE_ROOT}"/fs-manager-udroid/install.sh ]; then + cd "${CACHE_ROOT}"/fs-manager-udroid || die "failed to cd ..." bash install.sh || die "failed to install manager..." fi } function __help() { - msg "hippo - termux Version ${version} by saicharankandukuri" + msg "udroid - termux Version ${version} by saicharankandukuri" msg msg "A bash script to make basic action(login, vncserver) easier for ubuntu-on-android project" msg msg "Usage ${0} [options]" msg msg "Options:" - msg "--install To try installing hippo" + msg "--install To try installing udroid" msg "--help To display this message" msg "--enable-dbus To start terminal session with dbus enabled" msg "--force-upgrade To reinstall this script of origin" - msg "startvnc To start hippo vncserver" - msg "stopvnc To stop hippo vncserver" + msg "startvnc To start udroid vncserver" + msg "stopvnc To stop udroid vncserver" msg "--enable-dbus-startvnc To start vnc with dbus" msg "------------------"#links goes here msg "for additional documentation see: \e[1;34mhttps://github.com/RandomCoderOrg/ubuntu-on-android#basic-usage" @@ -176,14 +176,14 @@ function _lauch_or_install() exit 1 fi if ! __check_for_filesystem; then - echo -e "Installing hippo..........." - if proot-distro install hippo; then + echo -e "Installing udroid..........." + if proot-distro install udroid; then echo -e "Installation Done......\a\a" # \a triggers vibration in termux echo "Waiting..." sleep 4 clear echo -e "Now You can launch your ubuntu 21.04 with command \e[1;32mhippo\e[0m" - echo -e "use hippo --help for more option and comming up features" + echo -e "use udroid --help for more option and comming up features" fi else ####################################################################################################### @@ -191,17 +191,17 @@ function _lauch_or_install() pulseaudio --start --load="module-native-protocol-tcp auth-ip-acl=127.0.0.1 auth-anonymous=1" --exit-idle-time=-1 >> /dev/null - if [[ -f "${CACHE_ROOT}"/fs-manager-hippo/etc/scripts/vncserver/startvnc.sh ]] && [[ ! -f ${HIPPO_DIR}/bin/startvnc ]]; then - DIR="${CACHE_ROOT}/fs-manager-hippo/etc/scripts/vncserver/startvnc.sh" + if [[ -f "${CACHE_ROOT}"/fs-manager-udroid/etc/scripts/vncserver/startvnc.sh ]] && [[ ! -f ${HIPPO_DIR}/bin/startvnc ]]; then + DIR="${CACHE_ROOT}/fs-manager-udroid/etc/scripts/vncserver/startvnc.sh" cp "${DIR}" ${HIPPO_DIR}/bin/startvnc - proot-distro login hippo -- chmod 775 /bin/startvnc + proot-distro login udroid -- chmod 775 /bin/startvnc fi - if [ -f "${CACHE_ROOT}"/fs-manager-hippo/etc/scripts/vncserver/stopvnc.sh ] && [ ! -f ${HIPPO_DIR}/bin/stopvnc ]; then - DIR="${CACHE_ROOT}/fs-manager-hippo/etc/scripts/vncserver/stopvnc.sh" + if [ -f "${CACHE_ROOT}"/fs-manager-udroid/etc/scripts/vncserver/stopvnc.sh ] && [ ! -f ${HIPPO_DIR}/bin/stopvnc ]; then + DIR="${CACHE_ROOT}/fs-manager-udroid/etc/scripts/vncserver/stopvnc.sh" cp "${DIR}" ${HIPPO_DIR}/bin/stopvnc - proot-distro login hippo -- chmod 775 /bin/stopvnc + proot-distro login udroid -- chmod 775 /bin/stopvnc fi - proot-distro login hippo "$@" || warn "program exited unexpectedly..." + proot-distro login udroid "$@" || warn "program exited unexpectedly..." fi } __verify_bin_path @@ -218,21 +218,21 @@ if [ $# -ge 1 ]; then startvnc) if __check_for_hippo; then - proot-distro login hippo --no-kill-on-exit -- startvnc + proot-distro login udroid --no-kill-on-exit -- startvnc else - echo -e "This command is supposed to run after installing hippo" + echo -e "This command is supposed to run after installing udroid" echo -e "Use \e[1;32mhippo --install\e[0m install" - echo -e "\e[32mError:\e[0m Hippo not found" + echo -e "\e[32mError:\e[0m udroid not found" fi ;; stoptvnc) if __check_for_hippo; then - proot-distro login hippo --no-kill-on-exit -- stoptvnc + proot-distro login udroid --no-kill-on-exit -- stoptvnc else - echo -e "This command is supposed to run after installing hippo" + echo -e "This command is supposed to run after installing udroid" echo -e "Use \e[1;32mhippo --install\e[0m install" - echo -e "\e[32mError:\e[0m Hippo not found" + echo -e "\e[32mError:\e[0m udroid not found" fi ;; *) _lauch_or_install "$@";; diff --git a/etc/scripts/vncserver/startvnc.sh b/etc/scripts/vncserver/startvnc.sh index b0e6c3e..2eb3ab9 100644 --- a/etc/scripts/vncserver/startvnc.sh +++ b/etc/scripts/vncserver/startvnc.sh @@ -27,7 +27,7 @@ fi if ! $vnc; then - vncserver -xstartup "${DEFAULT_XSTARTUP}" -desktop "Hippo Default VNC" :${port} + vncserver -xstartup "${DEFAULT_XSTARTUP}" -desktop "udroid Default VNC" :${port} else echo "A vncserver lock is found for port ${port}" echo -e "Use \e[1;32mudroid stoptvnc\e[0m or \e[1;32mstopvnc\e[0m to stop it and try again..."