From dce910e6cace64d0e0e1df90fb6f8a02ee2ccdda Mon Sep 17 00:00:00 2001 From: Melissa Dumont Date: Mon, 7 Jul 2025 21:16:49 -0400 Subject: [PATCH] termux, steam draft --- .termux/shell | 2 +- scripts/AM-INSTALLER | 106 ++++++++++++++++++++++++++++++++++++++++++ scripts/couch-mode.sh | 6 +++ 3 files changed, 113 insertions(+), 1 deletion(-) create mode 100755 scripts/AM-INSTALLER create mode 100755 scripts/couch-mode.sh diff --git a/.termux/shell b/.termux/shell index 6a9e552..0b91e5c 120000 --- a/.termux/shell +++ b/.termux/shell @@ -1 +1 @@ -/data/data/com.termux/files/usr/bin/zsh \ No newline at end of file +/data/data/com.termux/files/usr/bin/fish \ No newline at end of file diff --git a/scripts/AM-INSTALLER b/scripts/AM-INSTALLER new file mode 100755 index 0000000..c44bea2 --- /dev/null +++ b/scripts/AM-INSTALLER @@ -0,0 +1,106 @@ +#!/bin/sh + +set -e + +# Colors +RED='\033[0;31m'; LightBlue='\033[1;34m'; Green='\033[0;32m' + +# For developers +AM_BRANCH="main" + +# Check dependencies for this script +_check_dependency() { + AMDEPENDENCES="chmod chown curl grep wget" + for dependency in $AMDEPENDENCES; do + if ! command -v "$dependency" >/dev/null 2>&1; then + printf "\n %b💀 ERROR! MISSING ESSENTIAL COMMAND \033[0m: %b\n\n Install the above and try again! \n\n" "${RED}" "$dependency" + exit 1 + fi + done +} + +_check_dependency + +# Function to check online connections (uses github.com by default, as the database and CLI itself are stored/hosted there) +_online_check() { + if ! wget -q --tries=3 --timeout=10 --spider https://github.com; then + printf "\n Installer wouldn't work offline\n\n Please check your internet connection and try again\n\n" + exit 1 + fi +} + +_online_check + +# INSTALL "AM" SYSTEM-WIDE +_install_am() { + CACHEDIR="${XDG_CACHE_HOME:-$HOME/.cache}" + mkdir -p "$CACHEDIR" || true + rm -f "$CACHEDIR"/INSTALL-AM.sh || true + wget -q "https://raw.githubusercontent.com/ivan-hc/AM/$AM_BRANCH/INSTALL" -O "$CACHEDIR"/INSTALL-AM.sh && chmod a+x "$CACHEDIR"/INSTALL-AM.sh + #cp ./INSTALL "$CACHEDIR"/INSTALL-AM.sh && chmod a+x "$CACHEDIR"/INSTALL-AM.sh # for developers + if command -v sudo >/dev/null 2>&1; then + SUDOCMD="sudo" + elif command -v doas >/dev/null 2>&1; then + SUDOCMD="doas" + else + echo 'ERROR: No sudo or doas found' + exit 1 + fi + $SUDOCMD "$CACHEDIR"/INSTALL-AM.sh && rm -f "$CACHEDIR"/INSTALL-AM.sh +} + +# INSTALL "AM" LOCALLY, AS "APPMAN" +_install_appman() { + ZSHRC="${ZDOTDIR:-$HOME}/.zshrc" + BINDIR="${XDG_BIN_HOME:-$HOME/.local/bin}" + mkdir -p "$BINDIR" + if ! echo $PATH | grep "$BINDIR" >/dev/null 2>&1; then + echo '--------------------------------------------------------------------------' + echo " Adding $BINDIR to PATH, you might need to" + echo " close and reopen the terminal for this to take effect." + if [ -e ~/.bashrc ] && ! grep 'PATH="$PATH:$BINDIR"' ~/.bashrc >/dev/null 2>&1; then + printf '\n%s\n' 'BINDIR="${XDG_BIN_HOME:-$HOME/.local/bin}"' >> ~/.bashrc + printf '\n%s\n' 'if ! echo $PATH | grep "$BINDIR" >/dev/null 2>&1; then' >> ~/.bashrc + printf ' export PATH="$PATH:$BINDIR"\nfi\n' >> ~/.bashrc + fi + if [ -e "$ZSHRC" ] && ! grep 'PATH="$PATH:$BINDIR"' "$ZSHRC" >/dev/null 2>&1; then + printf '\n%s\n' 'BINDIR="${XDG_BIN_HOME:-$HOME/.local/bin}"' >> "$ZSHRC" + printf '\n%s\n' 'if ! echo $PATH | grep "$BINDIR" >/dev/null 2>&1; then' >> "$ZSHRC" + printf ' export PATH="$PATH:$BINDIR"\nfi\n' >> "$ZSHRC" + fi + fi + wget -q "https://raw.githubusercontent.com/ivan-hc/AM/$AM_BRANCH/APP-MANAGER" -O "$BINDIR"/appman && chmod a+x "$BINDIR"/appman +} + +# CHOOSE BETWEEN "AM" AND "APPMAN" +printf " Choose how to install \"AM\" and all its managed applications. + + 1) As \"${RED}AM\033[0m\", command \"${Green}am\033[0m\", this is a system-wide installation: + - the command is a symlink /usr/local/bin/am for /opt/am/APP-MANAGER + - install and manage both system (default, require \"root\") and local apps + - choose wherever you want to install local apps + - you are the one with read-write permissions for \"AM\" and system programs + - other users can only use programs you have installed, nothing else + - other users can still use \"AppMan mode\" for their rootless configurations + + 2) As \"${LightBlue}AppMan\033[0m\", command \"${Green}appman\033[0m\", local installation: + - the command is the script ~/.local/bin/appman + - install and manage only local apps + - choose wherever you want to install local apps + - you can replicate your configurations on every system you want + - more storage space required, if more users use \"AppMan\" + +" +read -r -p "Choose between \"AM\" (type 1) and \"AppMan\" (2), or leave blank to exit: " response +case "$response" in + 1) _install_am || exit 1 + ;; + 2) _install_appman || exit 1 + echo '--------------------------------------------------------------------------' + printf " ${Green}\"AppMan\" has been successfully installed!\033[0m\n" + printf " Please, run \"${LightBlue}appman -h\033[0m\" to see the list of the options.\n" + echo '--------------------------------------------------------------------------' + ;; + ''|*) echo "Installation aborted, exiting." && exit 1 + ;; +esac diff --git a/scripts/couch-mode.sh b/scripts/couch-mode.sh new file mode 100755 index 0000000..32d4fd8 --- /dev/null +++ b/scripts/couch-mode.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +# autorandr to one screen +# steam big picture +# move to dedicated i3 window +# change to i3 window