[    [    [    [    [    [    [    b l o g g i n   s p a c e    wiki   ]    ]    ]    ]    ]    ]    ]

Welcome.sh

From blogginpedia
Jump to navigation Jump to search

~/.bashrc

#!/data/data/com.termux/files/usr/bin/bash

# Termux Welcome Screen
# Displays on session start with greeting, historical event, Fort Wayne weather, AL East standings, and links

# ANSI color codes (matching your scripts)
BLUE="\e[34m"
CYAN="\e[36m"
GREEN="\e[32m"
YELLOW="\e[33m"
RED="\e[31m"
BOLD="\e[1m"
RESET="\e[0m"
PURPLE="\e[35m"
ORANGE="\e[38;5;208m"
WHITE="\e[37m"
GRAY="\e[90m"
PINK="\e[38;5;205m"
TEAL="\e[38;5;51m"
LIME="\e[38;5;154m"


# Check dependencies
if ! command -v curl &> /dev/null || ! command -v jq &> /dev/null; then
    echo -e "${RED}Error: curl and jq are required. Install them using: pkg install curl jq${RESET}"
    exit 1
fi
# Clear screen
clear
cat << "EOF"

┌──────────────────────────────────────────────────────────┐
│       __                    __         _                 │
│      / /_____  __  ______ _/ /_  _____(_)__ _      __    │
│     / __/ __ \/ / / / __ `/ __ \/ ___/ / _ \ | /| / /    │
│    / /_/ /_/ / /_/ / /_/ / / / (__  ) /  __/ |/ |/ /     │
│    \__/ .___/\__,_/\__,_/_/ /_/____/_/\___/|__/|__/      │
│      /_/                                                 │
└──────────────────────────────────────────────────────────┘
EOF

# Personalized greeting (replace 'User' with your name)
echo -e "${BLUE}${BOLD}Welcome tpuahsiew, it's time to UPSET the fuckos...${RESET}"
echo -e "${WHITE}------------------------------------------------------------${RESET}"
echo -e "${PURPLE}${BOLD}Date: $(date)${RESET}"
echo -e
# Fetch weather for Fort Wayne, Indiana
echo -e "${BLUE}${BOLD}Just look out the window, dipshit${RESET}"
echo -e "${WHITE}------------------------------------------------------------${RESET}"
weather=$(curl -s -4 wttr.in/Fort_Wayne,Indiana?format="%c+%t+%f+%w&u" 2>/dev/null)
if [[ -n "$weather" && ! "$weather" =~ "ERROR" ]]; then
    echo -e "${CYAN}${weather}${RESET}"
else
    echo -e "${RED}Weather unavailable${RESET}"
fi
echo
# Common Aliases
echo -e "${BLUE}${BOLD}Quick Stuff${RESET}"
echo -e "${WHITE}------------------------------------------------------------${RESET}"
echo -e "${CYAN}• brave • twit • myfiles • firefox •"
echo -e "${CYAN}• blogup • workup • pol • you • vid •"
echo -e "${CYAN}• blog • startweb • tid • notes • grok •"
echo
# Fetch AL East standings (division ID 201)
echo -e "${BLUE}${BOLD}MLB AL BEAST${RESET}"
response=$(curl -s "http://statsapi.mlb.com/api/v1/standings?leagueId=103&season=2025")
teams=$(echo "$response" | jq '.records[] | select(.division.id==201)')

if [[ -n "$teams" && "$teams" != "null" ]]; then
    echo -e "${CYAN}Team                     W   L   PCT   GB${RESET}"
echo -e "${WHITE}------------------------------------------------------------${RESET}"
    echo "$teams" | jq -r '.teamRecords[] | "\(.team.name)|\(.wins)|\(.losses)|\(.winningPercentage)|\(.gamesBack)"' | while IFS='|' read -r team wins losses pct gb; do
        pct=$(echo "$pct" | sed 's/^\.//')
        if [[ "$gb" == "-" ]]; then
            printf "${GREEN}${BOLD}%-25s${RESET}${GREEN} %-3s %-3s .%-3s %-5s${RESET}\n" "$team" "$wins" "$losses" "$pct" "$gb"
        else
            printf "${BOLD}%-25s${RESET} %-3s %-3s .%-3s %-5s\n" "$team" "$wins" "$losses" "$pct" "$gb"
        fi
    done
else
    echo -e "${RED}Standings unavailable${RESET}"
fi
echo
# Fetch System Information
echo -e "${BLUE}${BOLD}What the tablet is doing${RESET}"
echo -e "${WHITE}------------------------------------------------------------${RESET}"
/data/data/com.termux/files/home/storage_gauge.sh
storage=$(du -sh $HOME 2>/dev/null | awk '{print $1 " used in home"}' || echo "Storage info unavailable")
echo -e "${CYAN}Storage: ${storage}${RESET}"
echo
/data/data/com.termux/files/home/battery_gauge.sh
battery=$(termux-battery-status 2>/dev/null | jq -r '"\(.percentage)% (\(.status))"' || echo "Battery info unavailable")
echo -e "${CYAN}Battery: ${battery}${RESET}"
echo
/data/data/com.termux/files/home/memory_gauge.sh
mem=$(free -h 2>/dev/null | awk 'NR==2 {print $3 " used / " $2 " total"}' || echo "Memory info unavailable")
echo -e "${CYAN}Memory: ${mem}${RESET}"
echo
echo -e "${CYAN}Uptime: $(uptime -p)${RESET}"
echo
# Run the battery gauge script
#/data/data/com.termux/files/home/battery_gauge.sh
# Alias for memory gauge script
#/data/data/com.termux/files/home/memory_gauge.sh

Aliases

alias brave='am start com.brave.browser'
alias myfiles='am start -a android.intent.action.GET_CONTENT -t "*/*"'
alias firefox='am start -n org.mozilla.firefox/.App'
alias grok='termux-open https://grok.com'
alias notes="termux-open https://bloggin.space/home"
alias blog="termux-open https://bloggin.space/wiki"
alias vid="termux-open https://bloggin.space/wiki/index.php/Youtube"
alias blogup="termux-open https://bloggin.space/wiki/index.php/Special:Upload"
alias workup="termux-open https://bloggin.space/home/index.php/Special:Upload"
alias twit="termux-open https://x.com/home"
alias pol="termux-open https://boards.4 chan.org/pol/"
alias you="termux-open https://youtube.com"
alias tid="termux-open http://localhost:8090"
alias dialer='am start -a android.intent.action.DIAL'
alias sms='am start -a android.intent.action.VIEW -t "vnd.android-dir/mms-sms"'
alias settings='am start -a android.intent.action.MAIN -n com.android.settings/.Settings'
alias browser='am start -a android.intent.action.VIEW -d "https://www.google.com"'
alias gallery='am start -a android.intent.action.VIEW -t "image/*"'
alias contacts='am start -a android.intent.action.VIEW -t "vnd.android.cursor.dir/contact"'
alias downloads='am start -a android.intent.action.VIEW_DOWNLOADS'
alias battery='termux-battery-status'
alias ebash='nano ~/.bashrc'
alias net='termux-wifi-connectioninfo'
alias cpu='cat /proc/cpuinfo'
alias uptime='termux-info'
alias gallery='am start -a android.intent.action.VIEW -t "image/*"'
alias splashtop='am start -n com.splashtop.remote.business/.BusinessActivity'