Skip to content

Commit

Permalink
Merge pull request #6 from RandomCoderOrg/nc-h-s-01
Browse files Browse the repository at this point in the history
Nc h s 01
  • Loading branch information
SaicharanKandukuri authored Sep 30, 2021
2 parents 0732c2c + c47703d commit 6099672
Show file tree
Hide file tree
Showing 12 changed files with 67 additions and 67 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -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)
<!--
## Target to V01
- [X] upgrade system
- [X] launch shorcuts vncserver and others ( [0530e7965907002c614e70c6f8a398c6b9d13fd8](https://github.com/RandomCoderOrg/fs-manager-hippo/commit/0530e7965907002c614e70c6f8a398c6b9d13fd8) to [5a4ee56e9219988b24204e8b49787a8f7ed3b8ef](https://github.com/RandomCoderOrg/fs-manager-hippo/commit/5a4ee56e9219988b24204e8b49787a8f7ed3b8ef) )
- [X] launch shorcuts vncserver and others ( [0530e7965907002c614e70c6f8a398c6b9d13fd8](https://github.com/RandomCoderOrg/fs-manager-udroid/commit/0530e7965907002c614e70c6f8a398c6b9d13fd8) to [5a4ee56e9219988b24204e8b49787a8f7ed3b8ef](https://github.com/RandomCoderOrg/fs-manager-udroid/commit/5a4ee56e9219988b24204e8b49787a8f7ed3b8ef) )
-->
2 changes: 1 addition & 1 deletion etc/proot-env/Hidpi/README.txt
Original file line number Diff line number Diff line change
@@ -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
8 changes: 4 additions & 4 deletions etc/proot-env/Hidpi/hidpi/app.desktop
Original file line number Diff line number Diff line change
@@ -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;
Keyboards=display;screen;hidpi;udroid;
4 changes: 2 additions & 2 deletions etc/proot-env/Hidpi/hidpi/app.sh
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
8 changes: 4 additions & 4 deletions etc/proot-env/Hidpi/hidpi/install.sh
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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

Expand Down
8 changes: 4 additions & 4 deletions etc/proot-env/Hidpi/xhidpi/app.desktop
Original file line number Diff line number Diff line change
@@ -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;
Keyboards=display;screen;hidpi;udroid;
4 changes: 2 additions & 2 deletions etc/proot-env/Hidpi/xhidpi/app.sh
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
8 changes: 4 additions & 4 deletions etc/proot-env/Hidpi/xhidpi/install.sh
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion etc/scripts/pulseeffects/README.txt
Original file line number Diff line number Diff line change
@@ -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
66 changes: 33 additions & 33 deletions etc/scripts/hippo/hippo.sh → etc/scripts/udroid/udroid.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ 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"
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"
# HIPPO_SCRIPT_FILE="${SCRIPT_DIR}/udroid.sh"

# * Usefull functions
# die() exit with code 1 with printing given string
Expand Down Expand Up @@ -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"
}

Expand Down Expand Up @@ -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 || {
Expand All @@ -127,43 +127,43 @@ 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"
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 "------------------"
}

Expand All @@ -176,32 +176,32 @@ 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
#######################################################################################################
# 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"
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
Expand All @@ -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 "$@";;
Expand Down
4 changes: 2 additions & 2 deletions etc/scripts/vncserver/startvnc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ 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;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
14 changes: 7 additions & 7 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6099672

Please sign in to comment.