├── fsst ├── fsst.sh └── readme.md ├── gff ├── gff.sh └── readme.md ├── kli ├── klingon.sh ├── ktoe.png └── readme.md ├── license ├── readme ├── saur ├── readme.md └── sauron.sh ├── stge ├── readme.md └── stge.sh ├── tj ├── readme.md └── termjutsu.sh ├── wc ├── readme.md └── wc.sh └── wdc ├── readme.md └── wdc.sh /fsst/fsst.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | GREEN='\033[0;32m' 4 | CYAN='\033[0;36m' 5 | YELLOW='\033[1;33m' 6 | RED='\033[0;31m' 7 | NC='\033[0m' 8 | 9 | for cmd in jq bc curl date; do 10 | if ! command -v "$cmd" &> /dev/null; then 11 | echo -e "${RED}Error: The '$cmd' utility is required but not installed.${NC}" 12 | echo "Install it using your package manager. For Arch Linux:" 13 | echo " sudo pacman -S $cmd" 14 | exit 1 15 | fi 16 | done 17 | 18 | get_iss_status() { 19 | ISS_API="http://api.open-notify.org/iss-now.json" 20 | ISS_DATA=$(curl -s "$ISS_API") 21 | 22 | if [ $? -ne 0 ] || [ -z "$ISS_DATA" ]; then 23 | echo -e "${RED}ISS: Unable to retrieve position data.${NC}" 24 | return 25 | fi 26 | 27 | LAT=$(echo "$ISS_DATA" | jq -r '.iss_position.latitude') 28 | LON=$(echo "$ISS_DATA" | jq -r '.iss_position.longitude') 29 | TIMESTAMP=$(echo "$ISS_DATA" | jq -r '.timestamp') 30 | DATETIME=$(date -d @"$TIMESTAMP" +"%Y-%m-%d %H:%M:%S") 31 | ALTITUDE=420 32 | VELOCITY=7.66 33 | 34 | if [ -z "$LAT" ] || [ -z "$LON" ]; then 35 | echo -e "${RED}ISS: Incomplete position data received.${NC}" 36 | return 37 | fi 38 | 39 | echo -e "${GREEN}🛰️ ISS Status:${NC}" 40 | echo -e " • Position: Latitude $LAT°, Longitude $LON°" 41 | echo -e " • Altitude: $ALTITUDE km" 42 | echo -e " • Velocity: $VELOCITY km/s" 43 | echo -e " • Last Updated: $DATETIME" 44 | echo "" 45 | } 46 | 47 | calculate_distance() { 48 | local launch_date=$1 49 | local speed_km_s=$2 50 | 51 | CURRENT_DATE_SEC=$(date +%s) 52 | LAUNCH_DATE_SEC=$(date -d "$launch_date" +%s) 53 | ELAPSED_SEC=$((CURRENT_DATE_SEC - LAUNCH_DATE_SEC)) 54 | DISTANCE_KM=$(echo "scale=2; $ELAPSED_SEC * $speed_km_s" | bc) 55 | DISTANCE_AU=$(echo "scale=6; $DISTANCE_KM / 149597870.7" | bc) 56 | 57 | DISTANCE_KM_FMT=$(printf "%'0.2f" "$DISTANCE_KM") 58 | DISTANCE_AU_FMT=$(printf "%'.6f" "$DISTANCE_AU") 59 | 60 | echo "$DISTANCE_AU_FMT AU ($DISTANCE_KM_FMT km)" 61 | } 62 | 63 | get_voyager1_status() { 64 | LAUNCH_DATE="1977-09-05" 65 | SPEED_KM_S=17.0 66 | DISTANCE=$(calculate_distance "$LAUNCH_DATE" "$SPEED_KM_S") 67 | DISTANCE_AU=$(echo "$DISTANCE" | awk '{print $1}') 68 | DISTANCE_KM=$(echo "$DISTANCE" | awk '{print $3}' | tr -d ',') 69 | 70 | echo -e "${YELLOW}🚀 Voyager 1 Status:${NC}" 71 | echo -e " • Launch Date: $LAUNCH_DATE" 72 | echo -e " • Average Speed: $SPEED_KM_S km/s" 73 | echo -e " • Distance from Earth: $DISTANCE_AU AU ($DISTANCE_KM km)" 74 | echo "" 75 | } 76 | 77 | get_voyager2_status() { 78 | LAUNCH_DATE="1977-08-20" 79 | SPEED_KM_S=15.4 80 | DISTANCE=$(calculate_distance "$LAUNCH_DATE" "$SPEED_KM_S") 81 | DISTANCE_AU=$(echo "$DISTANCE" | awk '{print $1}') 82 | DISTANCE_KM=$(echo "$DISTANCE" | awk '{print $3}' | tr -d ',') 83 | 84 | echo -e "${YELLOW}🚀 Voyager 2 Status:${NC}" 85 | echo -e " • Launch Date: $LAUNCH_DATE" 86 | echo -e " • Average Speed: $SPEED_KM_S km/s" 87 | echo -e " • Distance from Earth: $DISTANCE_AU AU ($DISTANCE_KM km)" 88 | echo "" 89 | } 90 | 91 | get_new_horizons_status() { 92 | LAUNCH_DATE="2006-01-19" 93 | SPEED_KM_S=16.26 94 | DISTANCE=$(calculate_distance "$LAUNCH_DATE" "$SPEED_KM_S") 95 | DISTANCE_AU=$(echo "$DISTANCE" | awk '{print $1}') 96 | DISTANCE_KM=$(echo "$DISTANCE" | awk '{print $3}' | tr -d ',') 97 | 98 | echo -e "${YELLOW}🚀 New Horizons Status:${NC}" 99 | echo -e " • Launch Date: $LAUNCH_DATE" 100 | echo -e " • Average Speed: $SPEED_KM_S km/s" 101 | echo -e " • Distance from Earth: $DISTANCE_AU AU ($DISTANCE_KM km)" 102 | echo "" 103 | } 104 | 105 | get_curiosity_status() { 106 | API_KEY="DEMO" 107 | ROVER_API="https://api.nasa.gov/mars-photos/api/v1/manifests/Curiosity?api_key=$API_KEY" 108 | ROVER_DATA=$(curl -s "$ROVER_API") 109 | 110 | if [ $? -ne 0 ] || [ -z "$ROVER_DATA" ]; then 111 | echo -e "${RED}Curiosity: Unable to retrieve status data.${NC}" 112 | return 113 | fi 114 | 115 | STATUS=$(echo "$ROVER_DATA" | jq -r '.photo_manifest.status') 116 | LANDING_DATE=$(echo "$ROVER_DATA" | jq -r '.photo_manifest.landing_date') 117 | MAX_SOL=$(echo "$ROVER_DATA" | jq -r '.photo_manifest.max_sol') 118 | TOTAL_PHOTOS=$(echo "$ROVER_DATA" | jq -r '.photo_manifest.total_photos') 119 | 120 | if [ -z "$STATUS" ] || [ -z "$LANDING_DATE" ] || [ -z "$MAX_SOL" ]; then 121 | echo -e "${RED}Curiosity: Incomplete status data received.${NC}" 122 | return 123 | fi 124 | 125 | echo -e "${GREEN}🤖 Curiosity Rover Status:${NC}" 126 | echo -e " • Mission Status: $STATUS" 127 | echo -e " • Landing Date: $LANDING_DATE" 128 | echo -e " • Current Martian Sol: $MAX_SOL" 129 | echo -e " • Total Photos Taken: $TOTAL_PHOTOS" 130 | echo "" 131 | } 132 | 133 | get_jwst_status() { 134 | LAUNCH_DATE="2021-12-25" 135 | SPEED_KM_S=0.0 136 | 137 | DISTANCE_KM=1500000 138 | DISTANCE_AU=$(echo "scale=6; $DISTANCE_KM / 149597870.7" | bc) 139 | DISTANCE_AU_FMT=$(printf "%'.6f" "$DISTANCE_AU") 140 | 141 | echo -e "${YELLOW}🔭 James Webb Space Telescope Status:${NC}" 142 | echo -e " • Launch Date: $LAUNCH_DATE" 143 | echo -e " • Average Speed: Maintains position at L2" 144 | echo -e " • Distance from Earth: $DISTANCE_AU_FMT AU ($DISTANCE_KM km)" 145 | echo "" 146 | } 147 | 148 | main() { 149 | echo -e "${CYAN}🖖 Spacecraft Tracker 🖖${NC}" 150 | echo "---------------------------------" 151 | get_iss_status 152 | get_voyager1_status 153 | get_voyager2_status 154 | get_new_horizons_status 155 | get_jwst_status 156 | get_curiosity_status 157 | echo "---------------------------------" 158 | } 159 | 160 | main 161 | -------------------------------------------------------------------------------- /fsst/readme.md: -------------------------------------------------------------------------------- 1 |
2 | 3 | **[ flight status & space tracking ]** 4 | 5 | [![License: Unlicense](https://img.shields.io/badge/License-Unlicense-pink.svg)](http://unlicense.org/) 6 | [![Made with Bash](https://img.shields.io/badge/Made%20with-Bash-purple.svg)](https://www.gnu.org/software/bash/) 7 | 8 |
9 | 10 | ## ✧ overview 11 | 12 | track the current status and position of humanity's space explorers, from earth orbit to the outer reaches of our solar system. 13 | 14 | ## ✧ tracked spacecraft 15 | 16 | ### 🛸 iss (international space station) 17 | - real-time latitude and longitude 18 | - current altitude 19 | - orbital velocity 20 | - last update timestamp 21 | 22 | ### 🚀 voyager missions 23 | - voyager 1 & 2 positions 24 | - distance from earth (au & km) 25 | - calculations based on: 26 | - launch dates 27 | - average velocities 28 | - trajectory data 29 | 30 | ### ⭐ james webb space telescope 31 | - position at lagrange point 2 (l2) 32 | - distance from earth 33 | 34 | ### 🔭 new horizons 35 | - current position 36 | - distance from earth (au & km) 37 | 38 | ### 🤖 curiosity rover 39 | - mission status 40 | - landing date 41 | - current martian sol 42 | - total photos captured 43 | - uses nasa's api for live data 44 | 45 | ## ✧ installation 46 | 47 | ```bash 48 | git clone https://github.com/getjared/bash.git 49 | cd bash/fsst 50 | chmod +x fsst.sh 51 | ``` 52 | 53 | ## ✧ dependencies 54 | 55 | install required tools: 56 | ```bash 57 | sudo pacman -S jq bc curl coreutils 58 | ``` 59 | 60 | | tool | purpose | 61 | |------|---------| 62 | | `jq` | json parsing | 63 | | `bc` | calculations | 64 | | `curl` | data fetching | 65 | | `date` | time handling | 66 | 67 | ## ✧ usage 68 | 69 | ```bash 70 | ./fsst.sh 71 | ``` 72 | 73 | ## ✧ configuration 74 | 75 | ### nasa api setup 76 | 77 | 1. get your api key from [nasa api](https://api.nasa.gov/) 78 | 2. replace `API_KEY` in the script: 79 | ```bash 80 | API_KEY="your_key_here" 81 | ``` 82 | 83 | ## ✧ sample output 84 | 85 | ``` 86 | ✧ iss position 87 | latitude: 45.1234° N 88 | longitude: 128.5678° W 89 | altitude: 408.2 km 90 | velocity: 7.66 km/s 91 | updated: 2024-03-30 12:34:56 92 | 93 | ✧ voyager 1 94 | distance: 23,442,123,456 km (156.7 au) 95 | 96 | ✧ james webb 97 | position: maintaining l2 orbit 98 | distance: 1.5 million km 99 | ``` 100 | 101 | ## ✧ data sources 102 | 103 | - 🛸 iss: open notify api 104 | - 🚀 voyager: nasa/jpl trajectory data 105 | - 🔭 webb: fixed l2 position 106 | - 🤖 curiosity: nasa mars rover api 107 | 108 |
109 | 110 | ```ascii 111 | ╭─────────────────────────╮ 112 | │ made with ♥ by jared │ 113 | ╰─────────────────────────╯ 114 | ``` 115 | 116 |
117 | -------------------------------------------------------------------------------- /gff/gff.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | RED='\033[0;31m' 4 | GREEN='\033[0;32m' 5 | YELLOW='\033[1;33m' 6 | BLUE='\033[0;34m' 7 | PURPLE='\033[0;35m' 8 | CYAN='\033[0;36m' 9 | NC='\033[0m' 10 | 11 | phrases=( 12 | "where is it? where is my precious?" 13 | "is it here? no, not here, sneaky little fileses." 14 | "we wants it, we needs it. must have the precious." 15 | "it must be here, mustn't it, precious?" 16 | "curse those nasty fileses, where are they hiding?" 17 | "sneaky fileses, trying to trick us!" 18 | "we will find it, yes we will..." 19 | "not this way... maybe that way?" 20 | "so close, so close..." 21 | "come to smeagol..." 22 | "tricksy files, they hides from us!" 23 | "where did they put it? nasty hobbitses!" 24 | "must search harder, gollum, gollum." 25 | "in the depths, in the dark, we looks." 26 | "sneaking, creeping, searching we are." 27 | "precious is calling for us, we must find!" 28 | "smeagol knows it's here, yes, yes!" 29 | "clever files, hiding from poor smeagol." 30 | "we sniffs and snuffs for precious." 31 | "deeper we goes, darker it gets, still searching." 32 | ) 33 | 34 | function gollum_speak() { 35 | local phrase_index=$(( RANDOM % ${#phrases[@]} )) 36 | echo -e "${YELLOW}${phrases[$phrase_index]}${NC} ${CYAN}(searching in $1)${NC}" 37 | } 38 | 39 | function gollum_file_type_comment() { 40 | local file="$1" 41 | local file_extension="${file##*.}" 42 | local file_type=$(file -b "$file") 43 | 44 | case "$file_extension" in 45 | c|h) 46 | echo -e "${YELLOW}c file, precious! sneaky pointers, yes, yes!${NC}" 47 | ;; 48 | cpp|hpp|cxx|hxx) 49 | echo -e "${YELLOW}c++ file, it is! objects everywhere, we hates them!${NC}" 50 | ;; 51 | py) 52 | echo -e "${BLUE}python file, slippery like snakes, yes!${NC}" 53 | ;; 54 | js) 55 | echo -e "${YELLOW}javascript file, async and tricky, precious!${NC}" 56 | ;; 57 | html|htm) 58 | echo -e "${PURPLE}html file, weaving webs like nasty spiders!${NC}" 59 | ;; 60 | css) 61 | echo -e "${BLUE}css file, makes things pretty, yes pretty!${NC}" 62 | ;; 63 | java) 64 | echo -e "${RED}java file, heavy like rocks, it slows us down!${NC}" 65 | ;; 66 | rb) 67 | echo -e "${RED}ruby file, shiny like gems, precious!${NC}" 68 | ;; 69 | php) 70 | echo -e "${PURPLE}php file, echoing in the dark, we hears it!${NC}" 71 | ;; 72 | go) 73 | echo -e "${BLUE}go file, fast and concurrent, it outruns us!${NC}" 74 | ;; 75 | rs) 76 | echo -e "${RED}rust file, no memory errors here, precious, no!${NC}" 77 | ;; 78 | sh|bash|zsh) 79 | echo -e "${GREEN}shell script, it whispers to the precious system, yes!${NC}" 80 | ;; 81 | sql) 82 | echo -e "${CYAN}sql file, queries the precious data, it does!${NC}" 83 | ;; 84 | json|yaml|yml|xml) 85 | echo -e "${YELLOW}data file, full of structured treasures!${NC}" 86 | ;; 87 | md|txt) 88 | echo -e "${GREEN}text file, full of secrets and stories, precious!${NC}" 89 | ;; 90 | *) 91 | case "$file_type" in 92 | *"shell script"*) 93 | echo -e "${GREEN}sneaky shell script, it is! commands the system, yes!${NC}" 94 | ;; 95 | *text*) 96 | echo -e "${GREEN}text file, yes, but what kind, precious?${NC}" 97 | ;; 98 | *executable*) 99 | echo -e "${RED}nasty executable, it burns us!${NC}" 100 | ;; 101 | *image*) 102 | echo -e "${YELLOW}pretty picture for smeagol, yes!${NC}" 103 | ;; 104 | *pdf*) 105 | echo -e "${PURPLE}pdf, tricksy format it is, precious.${NC}" 106 | ;; 107 | *directory*) 108 | echo -e "${BLUE}a sneaky directory, full of secrets!${NC}" 109 | ;; 110 | *) 111 | echo -e "${CYAN}what's this file type, precious? we doesn't know, no.${NC}" 112 | ;; 113 | esac 114 | ;; 115 | esac 116 | } 117 | 118 | function gollum_file_size_comment() { 119 | local file="$1" 120 | local size=$(du -sh "$file" | cut -f1) 121 | 122 | case "$size" in 123 | *K) 124 | echo -e "${GREEN}tiny file, precious, yes! easy to swallow, it is!${NC}" 125 | ;; 126 | *M) 127 | if [[ ${size%M} -lt 10 ]]; then 128 | echo -e "${YELLOW}small file, but not too small, gollum gollum!${NC}" 129 | elif [[ ${size%M} -lt 100 ]]; then 130 | echo -e "${YELLOW}meaty file, gives us strength, yes!${NC}" 131 | else 132 | echo -e "${RED}big file, it is! makes our teeth ache, precious!${NC}" 133 | fi 134 | ;; 135 | *G) 136 | echo -e "${RED}it's a fat one, precious! too big to eat in one bite!${NC}" 137 | ;; 138 | *) 139 | echo -e "${CYAN}strange size, precious. we doesn't know what to think!${NC}" 140 | ;; 141 | esac 142 | } 143 | 144 | function easter_egg() { 145 | local filename="$1" 146 | case "$filename" in 147 | *ring*) 148 | echo -e "${RED}the ring! the ring! we must have it, precious!${NC}" 149 | ;; 150 | *precious*) 151 | echo -e "${YELLOW}my precious! we found it at last, gollum gollum!${NC}" 152 | ;; 153 | *hobbit*) 154 | echo -e "${RED}nasty hobbitses! they stoles it from us!${NC}" 155 | ;; 156 | *fish*) 157 | echo -e "${BLUE}fish? is it juicy sweet? we likes it raw and wriggling!${NC}" 158 | ;; 159 | *) 160 | return 1 161 | ;; 162 | esac 163 | return 0 164 | } 165 | 166 | function search_file() { 167 | local start_dir="$1" 168 | local search_file="$2" 169 | 170 | gollum_speak "$start_dir" 171 | 172 | results=$(sudo find "$start_dir" -iname "$search_file" 2>/dev/null) 173 | 174 | if [ -n "$results" ]; then 175 | if easter_egg "$search_file"; then 176 | echo 177 | fi 178 | 179 | count=$(echo "$results" | wc -l) 180 | 181 | if [ $count -eq 1 ]; then 182 | echo 183 | echo -e "${GREEN}my precious! we founds it!${NC}" 184 | echo -e "${PURPLE}path: $results${NC}" 185 | gollum_file_type_comment "$results" 186 | gollum_file_size_comment "$results" 187 | echo 188 | else 189 | echo 190 | echo -e "${YELLOW}oh! we found many preciouses! which one does we want?${NC}" 191 | echo 192 | 193 | i=1 194 | while IFS= read -r result; do 195 | echo -e "${CYAN}$i)${NC} $result" 196 | i=$((i+1)) 197 | done <<< "$results" 198 | 199 | echo 200 | echo -e "${YELLOW}which precious does we want? tell us the number, quick!${NC}" 201 | read -p "> " choice 202 | 203 | if [[ "$choice" =~ ^[0-9]+$ ]] && [ "$choice" -ge 1 ] && [ "$choice" -le $count ]; then 204 | chosen_file=$(sed "${choice}q;d" <<< "$results") 205 | echo 206 | echo -e "${GREEN}we takes this one, precious!${NC}" 207 | echo -e "${PURPLE}path: $chosen_file${NC}" 208 | gollum_file_type_comment "$chosen_file" 209 | gollum_file_size_comment "$chosen_file" 210 | echo 211 | else 212 | echo -e "${RED}silly choice! we doesn't understand, precious.${NC}" 213 | return 1 214 | fi 215 | fi 216 | return 0 217 | fi 218 | 219 | return 1 220 | } 221 | 222 | if [ "$EUID" -ne 0 ]; then 223 | echo -e "${RED}please run as root or with sudo, precious!${NC}" 224 | exit 1 225 | fi 226 | 227 | if [ -z "$1" ]; then 228 | echo -e "${YELLOW}what's the name of your precious file? sneaky hobbitses!)${NC}" 229 | read -p "> " search_file 230 | else 231 | search_file="$1" 232 | fi 233 | 234 | echo 235 | echo -e "${GREEN}gollum begins the hunt for the precious file '$search_file'...${NC}" 236 | echo -e "${CYAN}(we'll find it no matter, yes we will!)${NC}" 237 | echo 238 | 239 | if search_file "/" "$search_file"; then 240 | exit 0 241 | else 242 | echo -e "${RED}we couldn't find it! lost, lost forever!${NC}" 243 | echo 244 | exit 1 245 | fi 246 | -------------------------------------------------------------------------------- /gff/readme.md: -------------------------------------------------------------------------------- 1 |
2 | 3 | **[ gollum file finder - my preciousss files... ]** 4 | 5 | [![License: Unlicense](https://img.shields.io/badge/License-Unlicense-pink.svg)](http://unlicense.org/) 6 | [![Made with Bash](https://img.shields.io/badge/Made%20with-Bash-purple.svg)](https://www.gnu.org/software/bash/) 7 | 8 |
9 | 10 | ## ✧ what is it, precious? 11 | 12 | a silly but functional system-wide file search tool with gollum's... unique personality. 13 | yes, precious, it finds your files while entertaining you with middle-earth dialogue! 14 | 15 | ## ✧ features 16 | 17 | - 🔍 searches the whole system, it does 18 | - 🎭 speaks like gollum, precious 19 | - 🌈 pretty colors for nasty bright screens 20 | - 💫 case-insensitive, because hobbitses are tricksy 21 | - 🎁 special messages for special files... 22 | 23 | ## ✧ installation 24 | 25 | ```bash 26 | git clone https://github.com/getjared/bash.git 27 | cd bash/gff 28 | chmod +x gff 29 | ``` 30 | 31 | ## ✧ what does it need, precious? 32 | 33 | - 🐧 bash shell 34 | - 👑 sudo privileges (for searching the whole system, yes) 35 | 36 | ## ✧ how to use it? 37 | 38 | ### basic usage 39 | ```bash 40 | sudo ./gff.sh [filename] 41 | ``` 42 | 43 | ### make it easier, precious 44 | add to your `.bashrc`: 45 | ```bash 46 | alias g='sudo /path/to/gff.sh' 47 | ``` 48 | 49 | ## ✧ examples 50 | 51 | ```bash 52 | # searching for normal files, yes precious 53 | sudo ./gff.sh myfile.txt 54 | 55 | # tricksy mixed case? no problem! 56 | sudo ./gff.sh MyFiLe.TxT 57 | ``` 58 | 59 | ## ✧ special treasures 60 | 61 | look for these files for extra fun: 62 | - 💍 ring 63 | - ✨ precious 64 | - 🧙‍♂️ hobbit 65 | - 🐟 fish 66 | 67 | ## ✧ warnings 68 | 69 | careful with sudo, precious! elevating privileges can be dangerous... 70 | nassty things could happen if you're not careful! 71 | 72 | ## ✧ sample dialogue 73 | 74 | ``` 75 | "what's it looking for, precious?" 76 | > myfile.txt 77 | 78 | "searching... searching... tricksy files..." 79 | "ah! we found it, precious!" 80 | /home/user/documents/myfile.txt 81 | 82 | "is there more? yes, yes..." 83 | /home/user/downloads/myfile.txt 84 | 85 | "that's all, precious!" 86 | ``` 87 | 88 |
89 | 90 | ```ascii 91 | ╭─────────────────────────╮ 92 | │ made with ♥ by jared │ 93 | ╰─────────────────────────╯ 94 | ``` 95 | 96 |
97 | -------------------------------------------------------------------------------- /kli/klingon.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | RED='\033[0;31m' 4 | GREEN='\033[0;32m' 5 | YELLOW='\033[0;33m' 6 | BLUE='\033[0;34m' 7 | MAGENTA='\033[0;35m' 8 | CYAN='\033[0;36m' 9 | NC='\033[0m' 10 | 11 | declare -A klingon_map=( 12 | ["a"]=$'\uF8D0' 13 | ["b"]=$'\uF8D1' 14 | ["ch"]=$'\uF8D2' 15 | ["d"]=$'\uF8D3' 16 | ["e"]=$'\uF8D4' 17 | ["gh"]=$'\uF8D5' 18 | ["H"]=$'\uF8D6' 19 | ["h"]=$'\uF8D6' 20 | ["I"]=$'\uF8D7' 21 | ["i"]=$'\uF8D7' 22 | ["j"]=$'\uF8D8' 23 | ["l"]=$'\uF8D9' 24 | ["m"]=$'\uF8DA' 25 | ["n"]=$'\uF8DB' 26 | ["ng"]=$'\uF8DC' 27 | ["o"]=$'\uF8DD' 28 | ["p"]=$'\uF8DE' 29 | ["q"]=$'\uF8DF' 30 | ["Q"]=$'\uF8E0' 31 | ["r"]=$'\uF8E1' 32 | ["S"]=$'\uF8E2' 33 | ["s"]=$'\uF8E2' 34 | ["t"]=$'\uF8E3' 35 | ["tlh"]=$'\uF8E4' 36 | ["u"]=$'\uF8E5' 37 | ["v"]=$'\uF8E6' 38 | ["w"]=$'\uF8E7' 39 | ["y"]=$'\uF8E8' 40 | ["'"]=$'\uF8E9' 41 | ) 42 | 43 | declare -A klingon_dictionary=( 44 | ["hello"]="nuqneH" 45 | ["goodbye"]="Qapla'" 46 | ["hi"]="nuqneH" 47 | ["greetings"]="nuqneH" 48 | ["i"]="jIH" 49 | ["you"]="SoH" 50 | ["we"]="maH" 51 | ["they"]="naDev" 52 | ["he"]="ghaH" 53 | ["she"]="ghaH" 54 | ["it"]="ghaH" 55 | ["yes"]="HIja'" 56 | ["no"]="ghobe'" 57 | ["please"]="qa'plu'" 58 | ["thank"]="qatlho'" 59 | ["thanks"]="qatlho'" 60 | ["sorry"]="jIQoch" 61 | ["friend"]="jup" 62 | ["enemy"]="jagh" 63 | ["battle"]="veS" 64 | ["honor"]="batlh" 65 | ["Klingon"]="tlhIngan" 66 | ["empire"]="wo'" 67 | ["ship"]="Duj" 68 | ["starship"]="DujDaq" 69 | ["earth"]="tera'" 70 | ["star"]="Hov" 71 | ["fire"]="Hegh" 72 | ["water"]="ngaD" 73 | ["weapon"]="puq" 74 | ["weaponry"]="puqpu'" 75 | ["sword"]="QIch" 76 | ["blood"]="beq" 77 | ["attack"]="batlh" 78 | ["fight"]="batlh" 79 | ["love"]="bang" 80 | ["hate"]="QInvam" 81 | ["run"]="vItlhutlh" 82 | ["speak"]="tlhIngan Hol" 83 | ["strong"]="vItlhutlh" 84 | ["brave"]="batlh" 85 | ["quick"]="pagh" 86 | ["swift"]="pagh" 87 | ["money"]="tlhegh" 88 | ["food"]="choq" 89 | ["leader"]="Qun" 90 | ["king"]="raS" 91 | ["queen"]="raS Qun" 92 | ) 93 | 94 | translate_to_klingon() { 95 | local sentence=("$@") 96 | local klingon_sentence=() 97 | local word translated_word 98 | 99 | pluralize() { 100 | case "$1" in 101 | jup|jagh|veS|batlh|tlhIngan|wo\'|Duj|DujDaq|Hov|Hegh|ngaD|puq|puqpu\'|QIch|beq|bang|QInvam|vItlhutlh|tlhIngan\ Hol|choq|Qun|raS|raS\ Qun) 102 | echo "${1}pu'" 103 | ;; 104 | *) 105 | echo "$1" 106 | ;; 107 | esac 108 | } 109 | 110 | for word in "${sentence[@]}"; do 111 | if [[ "$word" == *"s" ]]; then 112 | base_word="${word%s}" 113 | if [ "${klingon_dictionary[$base_word]+_}" ]; then 114 | translated_word="$(pluralize "$base_word")" 115 | klingon_sentence+=("$translated_word") 116 | continue 117 | fi 118 | fi 119 | 120 | if [ "${klingon_dictionary[$word]+_}" ]; then 121 | klingon_sentence+=("${klingon_dictionary[$word]}") 122 | else 123 | klingon_sentence+=("$word") 124 | fi 125 | done 126 | 127 | local subject="" 128 | local verb="" 129 | local object="" 130 | local reordered_sentence=() 131 | 132 | for idx in "${!klingon_sentence[@]}"; do 133 | local w="${klingon_sentence[$idx]}" 134 | if [[ "$w" == "jIH" || "$w" == "SoH" || "$w" == "maH" || "$w" == "naDev" || "$w" == "ghaH" ]]; then 135 | subject="$w" 136 | fi 137 | done 138 | 139 | declare -A verbs 140 | verbs=( ["batlh"]=1 ["bang"]=1 ["QInvam"]=1 ["vItlhutlh"]=1 ["tlhIngan Hol"]=1 ) 141 | 142 | for idx in "${!klingon_sentence[@]}"; do 143 | local w="${klingon_sentence[$idx]}" 144 | if [ "${verbs[$w]+_}" ]; then 145 | verb="$w" 146 | fi 147 | done 148 | 149 | for w in "${klingon_sentence[@]}"; do 150 | if [[ "$w" != "$subject" && "$w" != "$verb" ]]; then 151 | object="$w" 152 | fi 153 | done 154 | 155 | if [[ -n "$object" && -n "$verb" && -n "$subject" ]]; then 156 | reordered_sentence=("$object" "$verb" "$subject") 157 | else 158 | reordered_sentence=("${klingon_sentence[@]}") 159 | fi 160 | 161 | echo "${reordered_sentence[@]}" 162 | } 163 | 164 | convert_to_piqaD() { 165 | local translated_text="$1" 166 | local output_text="" 167 | local i=0 168 | local length=${#translated_text} 169 | 170 | while [ $i -lt $length ]; do 171 | if [ "${translated_text:$i:3}" == "tlh" ]; then 172 | output_text+="${klingon_map["tlh"]}" 173 | i=$((i+3)) 174 | elif [ "${translated_text:$i:2}" == "ch" ]; then 175 | output_text+="${klingon_map["ch"]}" 176 | i=$((i+2)) 177 | elif [ "${translated_text:$i:2}" == "gh" ]; then 178 | output_text+="${klingon_map["gh"]}" 179 | i=$((i+2)) 180 | elif [ "${translated_text:$i:2}" == "ng" ]; then 181 | output_text+="${klingon_map["ng"]}" 182 | i=$((i+2)) 183 | elif [ "${translated_text:$i:3}" == "pu'" ]; then 184 | output_text+="${klingon_map["'"]}" 185 | i=$((i+3)) 186 | elif [ "${translated_text:$i:1}" == "'" ]; then 187 | output_text+="${klingon_map["'"]}" 188 | i=$((i+1)) 189 | else 190 | char="${translated_text:$i:1}" 191 | if [ "${klingon_map[$char]+_}" ]; then 192 | output_text+="${klingon_map[$char]}" 193 | else 194 | output_text+="$char" 195 | fi 196 | i=$((i+1)) 197 | fi 198 | done 199 | 200 | echo -e "$output_text" 201 | } 202 | 203 | while true; do 204 | echo -e "${YELLOW}Enter text (or type 'exit' to quit):${NC} " 205 | read -p "" input_text 206 | 207 | if [ -z "$input_text" ] || [ "$input_text" == "exit" ]; then 208 | echo -e "${GREEN}Qapla'! (Success!)${NC}" 209 | break 210 | fi 211 | 212 | input_text=$(echo "$input_text" | tr '[:upper:]' '[:lower:]') 213 | 214 | IFS=' ' read -r -a words <<< "$input_text" 215 | 216 | translated_sentence=$(translate_to_klingon "${words[@]}") 217 | 218 | piqad_text=$(convert_to_piqaD "$translated_sentence") 219 | 220 | echo -e "${CYAN}pIqaD:${NC}" 221 | echo -e " $piqad_text" 222 | echo "" 223 | done 224 | -------------------------------------------------------------------------------- /kli/ktoe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/getjared/bash/4deb2ccd4a0c8e2d359bfbe43b4712891c1b9aae/kli/ktoe.png -------------------------------------------------------------------------------- /kli/readme.md: -------------------------------------------------------------------------------- 1 |
2 | 3 | **[ english to klingon pIqaD translator ]** 4 | 5 | [![License: Unlicense](https://img.shields.io/badge/License-Unlicense-pink.svg)](http://unlicense.org/) 6 | [![Made with Bash](https://img.shields.io/badge/Made%20with-Bash-purple.svg)](https://www.gnu.org/software/bash/) 7 | 8 | *nuqneH! (hello!)* 9 | 10 |
11 | 12 | ## ✧ features 13 | 14 | - 🗣️ translates english to klingon 15 | - 📝 converts to authentic pIqaD glyphs 16 | - 🔤 implements ovs word order 17 | - 📚 handles basic pluralization 18 | - ⚔️ maintains warrior's honor in translation 19 | 20 | ## ✧ example output 21 | 22 | see `ktoe.png` for visual example 23 | 24 | ``` 25 | english: today is a good day to die 26 | klingon: heghmeH QaQ jajvam 27 | pIqaD: 28 | ``` 29 | 30 | ## ✧ installation 31 | 32 | ### font setup 33 | 34 | 1. download pIqaD font: 35 | - official [klingon language institute](https://www.kli.org/learn-klingon/klingon-fonts/) 36 | - or [pIqaD-fonts](https://github.com/dadap/pIqaD-fonts) (recommended) 37 | 38 | 2. install font: 39 | ```bash 40 | # linux installation 41 | mkdir -p ~/.local/share/fonts 42 | cp path/to/pIqaD-font.ttf ~/.local/share/fonts/ 43 | fc-cache -f -v 44 | ``` 45 | 46 | ### script setup 47 | ```bash 48 | git clone https://github.com/getjared/bash.git 49 | cd bash/kli 50 | chmod +x klingon.sh 51 | ``` 52 | 53 | ## ✧ usage 54 | 55 | ```bash 56 | ./klingon.sh 57 | ``` 58 | 59 | then: 60 | - enter your english text 61 | - receive klingon translation 62 | - see pIqaD glyphs 63 | - type 'exit' or press enter to quit 64 | 65 | ## ✧ troubleshooting 66 | 67 | | issue | solution | 68 | |-------|----------| 69 | | ❓ boxes/question marks | check font installation | 70 | | ⚠️ script won't run | verify executable permissions | 71 | | 📦 missing glyphs | confirm terminal font support | 72 | 73 | ## ✧ current limitations 74 | 75 | - 📝 word-by-word translation 76 | - 📚 limited dictionary 77 | - 🔤 basic ovs implementation 78 | - 🗣️ simple sentence structures 79 | 80 | ## ✧ technical notes 81 | 82 | - uses unicode for pIqaD glyphs 83 | - auto-detects installed fonts 84 | - maintains basic grammar rules 85 | - preserves cultural context 86 | 87 | ## ✧ acknowledgments 88 | 89 | - 🖖 star trek's klingon heritage 90 | - 📚 [klingon language institute](https://hol.kag.org/) 91 | - 🔤 [dadap's pIqaD glyphs](https://github.com/dadap) 92 | - ⚔️ klingon cultural preservation 93 | 94 | ## ✧ contributing 95 | 96 | contributions are welcome! but remember: 97 | 98 | *"perhaps today is a good day to code!"* 99 | 100 |
101 | 102 | ```ascii 103 | ╭─────────────────────────────────╮ 104 | │ Qapla'! (success!) │ 105 | │ made with ♥ by jared │ 106 | ╰─────────────────────────────────╯ 107 | ``` 108 | 109 |
110 | -------------------------------------------------------------------------------- /license: -------------------------------------------------------------------------------- 1 | © 2024 2 | 3 | this code has been released into the public domain. 4 | 5 | anyone is free to: 6 | • copy, modify, publish, use, sell, distribute 7 | • change the license 8 | • do whatever they want with this code 9 | 10 | absolutely no warranty or support is provided. 11 | use entirely at your own risk. 12 | 13 | that's all. -------------------------------------------------------------------------------- /readme: -------------------------------------------------------------------------------- 1 | 2 | § just random bash games, tools and fun things i make either because i am bored or have no internet 3 | 4 | • stge - star trek galactic explorer 5 | • saur - sauron bash irc 6 | • wdc - warp drive calculator 7 | • fsst - spacecraft tracker 8 | • gff - gollums file finder 9 | • kli - english-to-kilngton translator 10 | • wc - quick wallpaper from wallhaven 11 | • tj - terminal jutsu . . 12 | -------------------------------------------------------------------------------- /saur/readme.md: -------------------------------------------------------------------------------- 1 |
2 | 3 | **[ the eye of IRC sees all ]** 4 | 5 | [![License: Unlicense](https://img.shields.io/badge/License-Unlicense-pink.svg)](http://unlicense.org/) 6 | [![Made with Bash](https://img.shields.io/badge/Made%20with-Bash-purple.svg)](https://www.gnu.org/software/bash/) 7 | 8 | *"one script to rule them all, one script to find them, 9 | one script to bring them all and in the terminal bind them"* 10 | 11 |
12 | 13 | ## ✧ overview 14 | 15 | sauron is a minimal irc client forged in the fires of pure bash. like its namesake, it watches over the realm of irc, requiring no external powers (dependencies) to function. 16 | 17 | ## ✧ features 18 | 19 | - 👁️ connects to irc servers and channels 20 | - 💬 sends and receives messages 21 | - ⚔️ supports basic irc commands 22 | - 🎨 colorful terminal output 23 | - 🔮 zero external dependencies 24 | - ✨ fully customizable settings 25 | 26 | ## ✧ requirements 27 | 28 | - 📜 bash shell (4.0+) 29 | - 🌐 internet connection 30 | - 💫 that's all! 31 | 32 | ## ✧ installation 33 | 34 | ```bash 35 | git clone https://github.com/getjared/bash.git 36 | cd bash/sauron 37 | chmod +x sauron.sh 38 | ``` 39 | 40 | ## ✧ usage 41 | 42 | ### basic invocation 43 | ```bash 44 | ./sauron.sh [-s server] [-p port] [-n nickname] [-u username] [-r realname] [-c channel] 45 | ``` 46 | 47 | ### recommended setup 48 | add to your `.bashrc`: 49 | ```bash 50 | alias irc='path/to/sauron.sh' 51 | ``` 52 | 53 | ## ✧ command options 54 | 55 | | flag | description | default | 56 | |------|-------------|---------| 57 | | `-s` | irc server | irc.libera.chat | 58 | | `-p` | server port | 6667 | 59 | | `-n` | nickname | sauronBot | 60 | | `-u` | username | sauron | 61 | | `-r` | real name | Bash IRC Client | 62 | | `-c` | channel | #bash | 63 | 64 | ## ✧ in-client commands 65 | 66 | | command | action | 67 | |---------|--------| 68 | | `/quit` | return to the shadows | 69 | | `/join #channel` | enter a new realm | 70 | | `/msg user message` | whisper to another | 71 | 72 | ## ✧ examples 73 | 74 | ### join libera chat 75 | ```bash 76 | ./sauron.sh -s irc.libera.chat -p 6667 -n getjared -c "#bash" 77 | ``` 78 | 79 | ### join custom server 80 | ```bash 81 | # remember the quotes around channel names! 82 | ./sauron.sh -s irc.example.com -c yourname "#mychannel" 83 | ``` 84 | 85 | ## ✧ warnings 86 | 87 | - 🛡️ minimal error handling 88 | - ⚔️ basic irc features only 89 | - 🗡️ intended for learning 90 | - 👁️ use at own discretion 91 | 92 | ## ✧ words of wisdom 93 | 94 | *"the only real security you need to worry about is the patch for human stupidity"* 95 | 96 | ## ✧ limitations 97 | 98 | - basic command support 99 | - minimal error handling 100 | - no advanced irc features 101 | - no ssl/tls support 102 | 103 | ## ✧ pro tips 104 | 105 | - 📝 save common configs as aliases 106 | - 🔐 be cautious with sensitive info 107 | - 🌟 test connections before important use 108 | - 🎨 customize colors to your liking 109 | 110 |
111 | 112 | ```ascii 113 | ╭───────────────────────────────────────╮ 114 | │ forged by jared in the fires of bash │ 115 | ╰───────────────────────────────────────╯ 116 | ``` 117 | 118 |
119 | -------------------------------------------------------------------------------- /saur/sauron.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | SERVER="irc.libera.chat" 4 | PORT=6667 5 | NICK="sauronBot" 6 | USER="sauron" 7 | REALNAME="Bash IRC Client" 8 | CHANNEL="#bash" 9 | 10 | RED='\033[0;31m' 11 | GREEN='\033[0;32m' 12 | YELLOW='\033[0;33m' 13 | BLUE='\033[0;34m' 14 | MAGENTA='\033[0;35m' 15 | CYAN='\033[0;36m' 16 | BOLD='\033[1m' 17 | RESET='\033[0m' 18 | 19 | ERASE_LINE='\033[2K' 20 | CURSOR_UP='\033[1A' 21 | 22 | usage() { 23 | echo "Usage: $0 [-s server] [-p port] [-n nickname] [-u username] [-r realname] [-c channel]" 24 | exit 1 25 | } 26 | 27 | while getopts "s:p:n:u:r:c:h" opt; do 28 | case $opt in 29 | s) SERVER="$OPTARG" ;; 30 | p) PORT="$OPTARG" ;; 31 | n) NICK="$OPTARG" ;; 32 | u) USER="$OPTARG" ;; 33 | r) REALNAME="$OPTARG" ;; 34 | c) CHANNEL="$OPTARG" ;; 35 | h|*) usage ;; 36 | esac 37 | done 38 | 39 | send_cmd() { 40 | echo -e "$1\r\n" >&3 41 | } 42 | 43 | exec 3<>/dev/tcp/"$SERVER"/"$PORT" 44 | 45 | if [[ $? -ne 0 ]]; then 46 | echo -e "${RED}Error: Could not connect to $SERVER on port $PORT.${RESET}" 47 | exit 1 48 | fi 49 | 50 | send_cmd "NICK $NICK" 51 | send_cmd "USER $USER 0 * :$REALNAME" 52 | 53 | cleanup() { 54 | send_cmd "QUIT :Bye" 55 | exec 3<&- 56 | exec 3>&- 57 | exit 0 58 | } 59 | 60 | trap cleanup INT TERM 61 | 62 | receive_messages() { 63 | while IFS= read -r line <&3; do 64 | if [[ "$line" == PING* ]]; then 65 | send_cmd "PONG ${line#PING }" 66 | continue 67 | fi 68 | 69 | if [[ "$line" != *" 353 "* && "$line" != *" 366 "* && "$line" != *" 372 "* && "$line" != *" 375 "* && "$line" != *" 376 "* ]]; then 70 | if [[ "$line" == :*!*@*\ PRIVMSG\ * ]]; then 71 | sender="${line%%!*}" 72 | sender="${sender#:}" 73 | message="${line#*PRIVMSG ${CHANNEL} :}" 74 | if [[ "$sender" != "$NICK" ]]; then 75 | echo -e "${BOLD}${CYAN}${sender}${RESET}${BOLD}:${RESET} ${message}" 76 | fi 77 | elif [[ "$line" == :*\ NOTICE\ * ]]; then 78 | echo -e "${MAGENTA}━━ ${line} ━━${RESET}" 79 | elif [[ "$line" == :*\ JOIN\ * ]]; then 80 | joiner="${line%%!*}" 81 | joiner="${joiner#:}" 82 | echo -e "${GREEN}▶ ${joiner} has joined the channel${RESET}" 83 | elif [[ "$line" == :*\ PART\ * ]]; then 84 | parter="${line%%!*}" 85 | parter="${parter#:}" 86 | echo -e "${YELLOW}◀ ${parter} has left the channel${RESET}" 87 | elif [[ "$line" == :*\ QUIT\ * ]]; then 88 | quitter="${line%%!*}" 89 | quitter="${quitter#:}" 90 | echo -e "${RED}✕ ${quitter} has quit${RESET}" 91 | elif [[ "$line" == :*\ MODE\ * ]]; then 92 | : 93 | else 94 | echo -e "${BLUE}${line}${RESET}" 95 | fi 96 | fi 97 | 98 | if [[ "$line" == *" 001 "* ]]; then 99 | send_cmd "JOIN $CHANNEL" 100 | echo -e "${GREEN}━━━ Joined $CHANNEL ━━━${RESET}" 101 | fi 102 | done 103 | } 104 | 105 | receive_messages & 106 | 107 | while IFS= read -r user_input; do 108 | echo -en "${ERASE_LINE}${CURSOR_UP}${ERASE_LINE}\r" 109 | 110 | case "$user_input" in 111 | /quit*) cleanup ;; 112 | /join*) 113 | channel=$(echo "$user_input" | awk '{print $2}') 114 | send_cmd "JOIN $channel" 115 | CHANNEL="$channel" 116 | echo -e "${GREEN}━━━ Joining $CHANNEL ━━━${RESET}" 117 | ;; 118 | /msg*) 119 | target=$(echo "$user_input" | awk '{print $2}') 120 | message=$(echo "$user_input" | cut -d' ' -f3-) 121 | send_cmd "PRIVMSG $target :$message" 122 | echo -e "${YELLOW}[PM to ${target}]${RESET} ${message}" 123 | ;; 124 | *) 125 | send_cmd "PRIVMSG $CHANNEL :$user_input" 126 | echo -e "${BOLD}${CYAN}${NICK}${RESET}${BOLD}:${RESET} ${user_input}" 127 | ;; 128 | esac 129 | done 130 | -------------------------------------------------------------------------------- /stge/readme.md: -------------------------------------------------------------------------------- 1 |
2 | 3 | **[ star trek: galactic explorer ]** 4 | 5 | [![License: Unlicense](https://img.shields.io/badge/License-Unlicense-pink.svg)](http://unlicense.org/) 6 | [![Made with Bash](https://img.shields.io/badge/Made%20with-Bash-purple.svg)](https://www.gnu.org/software/bash/) 7 | 8 | *"space... the final frontier"* 9 | 10 |
11 | 12 | ## ✧ mission briefing 13 | 14 | command the USS Enterprise in this text-based space exploration game, built entirely in bash. navigate uncharted space, encounter alien species, and face the challenges of the final frontier! 15 | 16 | ## ✧ features 17 | 18 | ### 🌌 universe 19 | - procedurally generated galaxy 20 | - dynamic star systems 21 | - unexplored territories 22 | 23 | ### 👽 encounters 24 | - klingon warriors 25 | - romulan warbirds 26 | - borg cubes 27 | - ferengi traders 28 | 29 | ### ⚡ systems 30 | - shield management 31 | - weapons control 32 | - life support 33 | - resource allocation 34 | 35 | ### 👥 crew 36 | - bridge interactions 37 | - crew management 38 | - skill development 39 | - team missions 40 | 41 | ### 🌗 mirror universe 42 | - alternate realities 43 | - parallel timelines 44 | - different outcomes 45 | 46 | ## ✧ installation 47 | 48 | ```bash 49 | # beam down the code 50 | git clone https://github.com/getjared/bash.git 51 | 52 | # navigate to bridge 53 | cd bash/stge 54 | 55 | # initialize systems 56 | chmod +x stge.sh 57 | 58 | # engage! 59 | ./stge.sh 60 | ``` 61 | 62 | ## ✧ navigation controls 63 | 64 | | key | command | 65 | |-----|---------| 66 | | `W` | warp forward | 67 | | `A` | port thrusters | 68 | | `S` | reverse thrusters | 69 | | `D` | starboard thrusters | 70 | | `V` | crew manifest | 71 | | `I` | ship status | 72 | | `R` | resource management | 73 | | `Q` | abandon mission | 74 | 75 | ## ✧ ship systems 76 | 77 | ### primary systems 78 | - warp drive 79 | - shields 80 | - phasers 81 | - photon torpedoes 82 | 83 | ### secondary systems 84 | - life support 85 | - sensors 86 | - transporters 87 | - replicators 88 | 89 | ## ✧ requirements 90 | 91 | - 🖥️ bash shell 92 | - 📺 terminal emulator 93 | - 🌟 sense of adventure 94 | 95 | ## ✧ captain's tips 96 | 97 | - 🛡️ always check shields before combat 98 | - 💫 monitor energy distribution 99 | - 👥 consult your crew regularly 100 | - 🎯 maintain strategic reserves 101 | - 🔄 explore all dialogue options 102 | 103 | ## ✧ known anomalies 104 | 105 | - works best in terminals with unicode support 106 | - some encounters may repeat 107 | - mirror universe is highly unstable 108 | 109 | ## ✧ future missions 110 | 111 | planned features for next stardates: 112 | - more alien species 113 | - diplomacy system 114 | - away team missions 115 | - starbase interactions 116 | 117 | ## ✧ starfleet wisdom 118 | 119 | *"things are only impossible until they're not."* 120 | - Captain Jean-Luc Picard 121 | 122 |
123 | 124 | ```ascii 125 | ╭────────────────────────────────────╮ 126 | │ 🖖 live long and prosper 🖖 │ 127 | │ made with ♥ by jared │ 128 | ╰────────────────────────────────────╯ 129 | ``` 130 | 131 |
132 | -------------------------------------------------------------------------------- /stge/stge.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Star Trek: Galactic Explorer (stge.sh) 4 | # by jared @ https://github.com/getjared 5 | 6 | # Initialize variables 7 | VIEWPORT_WIDTH=20 8 | VIEWPORT_HEIGHT=10 9 | ENERGY=100 10 | RESOURCES=0 11 | SCORE=0 12 | CREW=1000 13 | MORALE=100 14 | declare -A grid # Holds the known universe 15 | declare -A enemies # Tracks active enemies and their movement counters 16 | 17 | # Ship systems and their integrity 18 | declare -A ship_systems=( 19 | ["Shields"]=100 20 | ["Weapons"]=100 21 | ["Engines"]=100 22 | ["Life Support"]=100 23 | ["Sensors"]=100 24 | ) 25 | 26 | # Define maximum enemies per viewport 27 | MAX_ENEMIES_PER_VIEWPORT=5 # Value to control enemy density 28 | 29 | # Define color variables 30 | RED=$(tput setaf 1) 31 | GREEN=$(tput setaf 2) 32 | YELLOW=$(tput setaf 3) 33 | BLUE=$(tput setaf 4) 34 | MAGENTA=$(tput setaf 5) 35 | CYAN=$(tput setaf 6) 36 | WHITE=$(tput setaf 7) 37 | BOLD=$(tput bold) 38 | RESET=$(tput sgr0) 39 | 40 | # Crew Members and Bridge Crew 41 | BRIDGE_CREW=("Captain Kirk" "First Officer Spock" "Chief Engineer Scott" "Chief Medical Officer McCoy" "Helmsman Sulu" "Communications Officer Uhura" "Navigator Chekov") 42 | CREW_MEMBERS=() 43 | for ((i=1; i<=CREW; i++)); do 44 | CREW_MEMBERS+=("Crew Member $i") 45 | done 46 | 47 | # Place the Enterprise at the origin (0,0) 48 | function place_enterprise() { 49 | E_X=0 50 | E_Y=0 51 | grid[$E_X,$E_Y]="E" 52 | } 53 | 54 | # Count the number of enemies in the viewport 55 | function count_enemies_in_viewport() { 56 | local count=0 57 | local start_x=$((E_X - VIEWPORT_WIDTH / 2)) 58 | local end_x=$((E_X + VIEWPORT_WIDTH / 2)) 59 | local start_y=$((E_Y - VIEWPORT_HEIGHT / 2)) 60 | local end_y=$((E_Y + VIEWPORT_HEIGHT / 2)) 61 | for ((y=start_y; y 2 | 3 | **[ terminal ninja techniques - 忍術 ]** 4 | 5 | [![License: Unlicense](https://img.shields.io/badge/License-Unlicense-pink.svg)](http://unlicense.org/) 6 | [![Made with Bash](https://img.shields.io/badge/Made%20with-Bash-purple.svg)](https://www.gnu.org/software/bash/) 7 | 8 | *"the way of the terminal ninja"* 9 | 10 | 11 | 12 | ## ✧ overview 13 | 14 | perform legendary jutsu techniques right from your terminal! channel your inner shinobi with animated emoji patterns and japanese translations. 15 | 16 | ## ✧ features 17 | 18 | - 🥷 authentic jutsu animations 19 | - 🎭 japanese translations 20 | - 🔮 emoji pattern visualizations 21 | - ⚡ multiple jutsu styles 22 | - 🎨 colorful terminal output 23 | - 📚 extensible jutsu library 24 | 25 | ## ✧ installation 26 | 27 | ```bash 28 | git clone https://github.com/getjared/termjutsu.git 29 | cd termjutsu 30 | chmod +x termjutsu.sh 31 | ``` 32 | 33 | ### system-wide installation 34 | ```bash 35 | sudo cp termjutsu.sh /usr/local/bin/termjutsu 36 | ``` 37 | 38 | ## ✧ requirements 39 | 40 | - 🐧 bash shell 41 | - 🎨 unicode/emoji support 42 | - 🔧 basic unix utilities 43 | - 🎭 terminal with color support 44 | 45 | ### font setup 46 | ```bash 47 | sudo pacman -S noto-fonts noto-fonts-cjk noto-fonts-emoji 48 | ``` 49 | 50 | ## ✧ available jutsu 51 | 52 | | jutsu | japanese | description | 53 | |-------|----------|-------------| 54 | | rasengan | らせんがん | spiral sphere technique | 55 | | chidori | 千鳥 | lightning blade | 56 | | fireball | 火遁・豪火球の術 | great fireball technique | 57 | | *and many more!* | | | 58 | 59 | ## ✧ commands 60 | 61 | ```bash 62 | list # show all available jutsu 63 | exit # leave the dojo 64 | [jutsu name] # perform specific jutsu 65 | ``` 66 | 67 | ## ✧ example output 68 | 69 | ``` 70 | Performing gale jutsu... 71 | Fūton: Daitoppa (風遁・大突破) 72 | 手 (Preparing hand signs)... 73 | 🙏🏼🚬💨🫦🔥 74 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 75 | ``` 76 | 77 | ## ✧ customization 78 | 79 | add your own jutsu by modifying: 80 | - `JUTSU_PATTERNS` array for emoji sequences 81 | - `JUTSU_JAPANESE` array for translations 82 | 83 | ```bash 84 | # example pattern 85 | JUTSU_PATTERNS[rasengan]="🌀✨💫⭐️" 86 | JUTSU_JAPANESE[rasengan]="らせんがん" 87 | ``` 88 | 89 | ## ✧ pro tips 90 | 91 | - 🎨 customize animations for different effects 92 | - 📚 learn the japanese names for authenticity 93 | - ⚡ combine patterns for complex jutsu 94 | - 🔮 experiment with unicode combinations 95 | - 🎭 create your own original techniques 96 | 97 | ## ✧ notes 98 | 99 | - supports unicode emoji 100 | - multi-line animations 101 | - complex jutsu visualizations 102 | - fully customizable patterns 103 | 104 |
105 | 106 | ```ascii 107 | ╭───────────────────────────────╮ 108 | │ 忍道 - the ninja way │ 109 | │ made with ♥ by jared │ 110 | ╰───────────────────────────────╯ 111 | ``` 112 | 113 |
114 | -------------------------------------------------------------------------------- /tj/termjutsu.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | RED='\033[0;31m' 4 | GREEN='\033[0;32m' 5 | BLUE='\033[0;34m' 6 | YELLOW='\033[1;33m' 7 | PURPLE='\033[0;35m' 8 | CYAN='\033[0;36m' 9 | NC='\033[0m' 10 | 11 | declare -A JUTSU_PATTERNS 12 | declare -A JUTSU_JAPANESE 13 | 14 | JUTSU_PATTERNS=( 15 | ["rasengan"]="🌀💫✨💥💫" 16 | ["chidori"]="⚡️⚡️🌩️✨💥" 17 | ["fireball"]="🔥👄💨🔥🔥" 18 | ["shadowclone"]="🥷🥷🥷🥷🥷" 19 | ["gale"]="🙏🏼🚬💨🫦🔥" 20 | ["waterdragon"]="🌊🐉💧💦💫" 21 | ["sandtomb"]="🏜️💨⏳🌪️💀" 22 | ["mindtransfer"]="🧠💫👻💭🎯" 23 | ["healing"]="💚✨🩹💫💖" 24 | ["sharingan"]="👁️💫🌀🔴✨" 25 | ["amaterasu"]="👁️🩸🔥⚫️💀" 26 | ["woodstyle"]="🌳🌲🌱🍃💨" 27 | ["expansion"]="💪💨↗️👊💥" 28 | ["lightning"]="⚡️🌩️💥⚡️💫" 29 | ["windstyle"]="💨🌪️🍃💫✨" 30 | ["tsukuyomi"]="🌙👁️😱💫🌀" 31 | ["susanoo"]="⚔️👹🛡️💜💫" 32 | ["mudwall"]="🤲🏼🪨🧱🏔️💪" 33 | ["substitute"]="💨🪵💭🥷✨" 34 | ["shintenshin"]="💫🧠👻💭↪️" 35 | ["multiclone"]="🥷✨🥷✨🥷" 36 | ["rashenshuriken"]="🌀⭐️💫🌪️💥" 37 | ["chibaku"]="🌍💫⚫️🌑💥" 38 | ["kirin"]="⚡️🐉☈💥⚡️" 39 | ["sandstorm"]="🏜️🌪️💨💀🏃" 40 | ["eightgates"]="🙅🏻‍♂️🧍🏻‍♂️🔥🦵🏼💪🏼🔥💀" 41 | ["kotoamatsukami"]=$'👁️ ⭐️ 👁️\n💫 🧠 💫\n🌀 ✨ 🌀' 42 | ["explodingpalm"]=$'👊 💥 💫\n💥 🔥 💥\n💫 💥 👊' 43 | ["particlebeam"]=$'⚛️ → → → ⚡️\n→ ⚛️ → ⚡️ →\n→ → ⚛️ → 💥' 44 | ["paperdance"]=$'📜 📜 📜\n💫 🥷 💫\n📜 📜 📜' 45 | ["lavastyle"]=$'🌋 🔥 🌋\n🔥 🌊 🔥\n🌋 🔥 🌋' 46 | ["crystalice"]=$'❄️ 💎 ❄️\n💎 🌨️ 💎\n❄️ 💎 ❄️' 47 | ["infinitytsukuyomi"]=$'🌕\n↓\n👁️ 👁️ 👁️\n💫 🌍 💫\n✨ ✨ ✨' 48 | ["truthseekingballs"]=$'⚫️ ⚫️ ⚫️\n ↘️ ⚫️ ↙️\n⚫️ 🥷 ⚫️\n ↗️ ⚫️ ↖️\n⚫️ ⚫️ ⚫️' 49 | ["summoning"]=$'🌀 🌀 🌀\n🌀 💨 🌀\n🌀 🩸 🌀\n↓ ↓ ↓\n🐸 🐍 🐌' 50 | ["sageart"]=$'🍃 🧘 🍃\n💫 ⭐️ 💫\n🌟 🔮 🌟' 51 | ["sandburrial"]=$'⏳ ⏳ ⏳ ⏳ ⏳\n⏳ 💀 💀 💀 ⏳\n⏳ ⏳ ⏳ ⏳ ⏳\n ↓ ↓ ↓\n🏜️ 🏜️ 🏜️' 52 | ["mindscape"]=$'💭 💭 💭\n💭 🧠 💭\n💭 ➡️ 🎯\n 💫 💫\n 👻 😱' 53 | ["poisoncloud"]=$'☠️ ☠️ ☠️\n💭 💭 💭\n💨 🤢 💨\n☠️ ☠️ ☠️' 54 | ["papersea"]=$'📜 📜 📜 📜\n📜 🌊 🌊 📜\n📜 🌊 🌊 📜\n📜 📜 📜 📜' 55 | ["boneprison"]=$'🦴 🦴 🦴\n🦴 😱 🦴\n🦴 🦴 🦴\n ↑ ↑\n💀 💀' 56 | ["butterflydance"]=$'🦋 🦋\n ↘️ ↙️\n🦋 🥷 🦋\n ↗️ ↖️\n🦋 🦋' 57 | ["ashkilling"]=$'💨 💨 💨\n🦴 🦴 🦴\n💀 🔥 💀\n⚱️ ⚱️ ⚱️' 58 | ["needlehell"]=$'💉 💉 💉\n↓ ↓ ↓\n💉 😱 💉\n↓ ↓ ↓\n💉 💉 💉' 59 | ["bloodprison"]=$'🩸 🩸 🩸 🩸\n🩸 😨 😨 🩸\n🩸 😨 😨 🩸\n🩸 🩸 🩸 🩸' 60 | ["explosivespiders"]=$'🕷️ 🕷️ 🕷️\n🕷️ 💣 🕷️\n🕷️ 🕷️ 🕷️\n↓ ↓ ↓\n💥 💥 💥' 61 | ["frogchoir"]=$'🐸 🎵 🐸\n🎵 🐸 🎵\n🐸 🎵 🐸\n💫 💫 💫' 62 | ["mangekyo"]=$'↗️ 👁️ ↖️\n👁️ 🔴 👁️\n↘️ 👁️ ↙️\n 💫 💫\n 🩸 🩸' 63 | ["sagesixpaths"]=$'⭐️ ⭐️ ⭐️\n🌟 👁️ 🌟\n🔮 🧘 🔮\n✨ ✨ ✨' 64 | ["scorchedearth"]=$'🔥 🔥 🔥\n🔥 🌍 🔥\n🔥 🔥 🔥\n💨 💨 💨\n⚱️ ⚱️ ⚱️' 65 | ["waterprison"]=$'💧 💧 💧\n💧 😱 💧\n💧 💧 💧\n🌊 🌊 🌊' 66 | ["puppetmaster"]=$'🎭 🎭 🎭\n ↘️ 🕴️ ↙️\n🎭 🪄 🎭\n ↗️ 🎭 ↖️\n🎭 🎭 🎭' 67 | ["mindforest"]=$'🌳 🌳 🌳 🌳\n🌳 👁️ 👁️ 🌳\n🌳 🧠 🌳 🌳\n🌳 🌳 🌳 🌳' 68 | ["demonwind"]=$'👹 💨 💨\n💨 🌪️ 💨\n💨 💨 👹\n⚔️ ⚔️ ⚔️' 69 | ["thunderstorm"]=$'⛈️ ⛈️ ⛈️\n↓ ↓ ↓\n⚡️ 🌩️ ⚡️\n↓ ↓ ↓\n💥 💥 💥' 70 | ["voidgate"]=$'⚫️ ⚫️ ⚫️\n⚫️ 🌀 ⚫️\n⚫️ ⚫️ ⚫️\n → ←\n💫 ✨ 💫' 71 | ["phoenixflame"]=$'🦅 🔥 🦅\n🔥 🌟 🔥\n🦅 🔥 🦅\n✨ ✨ ✨' 72 | ["dimensionalrift"]=$'🌀 🌌 🌀\n🌌 👁️ 🌌\n🌀 🌌 🌀\n↙️ ↓ ↘️' 73 | ["darkabyss"]=$'⚫️ ⚫️ ⚫️\n⚫️ 👻 ⚫️\n⚫️ ⚫️ ⚫️\n👻 👻 👻' 74 | ["moonlight"]=$'🌕 🌕 🌕\n 🌙 🌙 🌙\n 🌑 \n ⭐️ ⭐️ ⭐️\n✨ ✨ ✨' 75 | ) 76 | 77 | JUTSU_JAPANESE=( 78 | ["rasengan"]="Rasengan (らせんがん)" 79 | ["chidori"]="Chidori (千鳥)" 80 | ["fireball"]="Katon: Gōkakyū no Jutsu (火遁・豪火球の術)" 81 | ["shadowclone"]="Kage Bunshin no Jutsu (影分身の術)" 82 | ["gale"]="Fūton: Daitoppa (風遁・大突破)" 83 | ["waterdragon"]="Suiton: Suiryūdan no Jutsu (水遁・水龍弾の術)" 84 | ["sandtomb"]="Sabaku Kyū (砂縛柩)" 85 | ["mindtransfer"]="Shintenshin no Jutsu (心転身の術)" 86 | ["healing"]="Shōsen Jutsu (掌仙術)" 87 | ["sharingan"]="Sharingan (写輪眼)" 88 | ["amaterasu"]="Amaterasu (天照)" 89 | ["woodstyle"]="Mokuton (木遁)" 90 | ["expansion"]="Baika no Jutsu (倍化の術)" 91 | ["lightning"]="Raiton (雷遁)" 92 | ["windstyle"]="Fūton (風遁)" 93 | ["tsukuyomi"]="Tsukuyomi (月読)" 94 | ["susanoo"]="Susanoo (須佐能乎)" 95 | ["mudwall"]="Doton: Doryūheki (土遁・土流壁)" 96 | ["substitute"]="Kawarimi no Jutsu (換分身の術)" 97 | ["shintenshin"]="Shintenshin no Jutsu (心転身の術)" 98 | ["multiclone"]="Tajū Kage Bunshin no Jutsu (多重影分身の術)" 99 | ["rashenshuriken"]="Fūton: Rasenshuriken (風遁・螺旋手裏剣)" 100 | ["chibaku"]="Chibaku Tensei (地爆天星)" 101 | ["kirin"]="Kirin (麒麟)" 102 | ["sandstorm"]="Ryūsa Bakuryū (流砂爆流)" 103 | ["eightgates"]="Hachimon Tonkō no Jin: Shimon (八門遁甲の陣: 死門)" 104 | ["kotoamatsukami"]="Kotoamatsukami (別天神)" 105 | ["explodingpalm"]="Bakuhatsu no Te (爆発の手)" 106 | ["particlebeam"]="Ryūshi no Hikari (粒子の光)" 107 | ["paperdance"]="Kami no Mai (紙の舞)" 108 | ["lavastyle"]="Yōton (溶遁)" 109 | ["crystalice"]="Hyōton: Kesshō (氷遁・結晶)" 110 | ["infinitytsukuyomi"]="Mugen Tsukuyomi (無限月読)" 111 | ["truthseekingballs"]="Gudōdama (求道玉)" 112 | ["summoning"]="Kuchiyose no Jutsu (口寄せの術)" 113 | ["sageart"]="Sennin Mōdo (仙人モード)" 114 | ["sandburrial"]="Sabaku Sōsō (砂漠送葬)" 115 | ["mindscape"]="Shinranshin no Jutsu (心乱身の術)" 116 | ["poisoncloud"]="Doku Kumo no Jutsu (毒雲の術)" 117 | ["papersea"]="Kami no Umi (紙の海)" 118 | ["boneprison"]="Sawarabi no Mai (椎骨の舞)" 119 | ["butterflydance"]="Chō no Mai (蝶の舞)" 120 | ["ashkilling"]="Hai no Jutsu (灰の術)" 121 | ["needlehell"]="Hari Jigoku (針地獄)" 122 | ["bloodprison"]="Chiketsu Rō (血結牢)" 123 | ["explosivespiders"]="Bakuhatsu Kumo (爆発蜘蛛)" 124 | ["frogchoir"]="Gamaguchi Shibari (蝦蟇口縛)" 125 | ["mangekyo"]="Mangekyō Sharingan (万華鏡写輪眼)" 126 | ["sagesixpaths"]="Rikudō Sennin Mōdo (六道仙人モード)" 127 | ["scorchedearth"]="Karyū Endan (火龍炎弾)" 128 | ["waterprison"]="Suirō no Jutsu (水牢の術)" 129 | ["puppetmaster"]="Akahigi: Hyakki no Sōen (赤秘技・百機の操演)" 130 | ["mindforest"]="Mori no Shinryaku (森の侵略)" 131 | ["demonwind"]="Akuma no Kaze (悪魔の風)" 132 | ["thunderstorm"]="Raiu no Arashi (雷雨の嵐)" 133 | ["voidgate"]="Kūmon (空門)" 134 | ["phoenixflame"]="Hōō no Honō (鳳凰の炎)" 135 | ["dimensionalrift"]="Jigen no Kiretsu (次元の亀裂)" 136 | ["darkabyss"]="Yami no Shin'en (闇の深淵)" 137 | ["moonlight"]="Tsuki no Hikari (月の光)" 138 | ) 139 | 140 | echo -e "${YELLOW}" 141 | cat << "EOF" 142 | ═══════════════════════════════ 143 | ████████╗███████╗██████╗ ███╗ ███╗ ██╗██╗ ██╗████████╗███████╗██╗ ██╗ 144 | ╚══██╔══╝██╔════╝██╔══██╗████╗ ████║ ██║██║ ██║╚══██╔══╝██╔════╝██║ ██║ 145 | ██║ █████╗ ██████╔╝██╔████╔██║ ██║██║ ██║ ██║ ███████╗██║ ██║ 146 | ██║ ██╔══╝ ██╔══██╗██║╚██╔╝██║██ ██║██║ ██║ ██║ ╚════██║██║ ██║ 147 | ██║ ███████╗██║ ██║██║ ╚═╝ ██║╚█████╔╝╚██████╔╝ ██║ ███████║╚██████╔╝ 148 | ╚═╝ ╚══════╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚════╝ ╚═════╝ ╚═╝ ╚══════╝ ╚═════╝ 149 | ═══════════════════════════════ 150 | EOF 151 | echo -e "${NC}" 152 | 153 | show_jutsus() { 154 | echo -e "${GREEN}Available Jutsus:${NC}" 155 | for jutsu in "${!JUTSU_PATTERNS[@]}"; do 156 | echo -e "${CYAN}• $jutsu${NC} - ${PURPLE}${JUTSU_JAPANESE[$jutsu]}${NC}" 157 | done 158 | } 159 | 160 | perform_jutsu() { 161 | local input=$1 162 | local jutsu_pattern=${JUTSU_PATTERNS[$input]} 163 | local jutsu_japanese=${JUTSU_JAPANESE[$input]} 164 | 165 | if [ -n "$jutsu_pattern" ]; then 166 | echo -e "${BLUE}Performing $input jutsu...${NC}" 167 | echo -e "${PURPLE}$jutsu_japanese${NC}" 168 | sleep 0.5 169 | echo -e "手 (Preparing hand signs)..." 170 | sleep 0.5 171 | echo -e "${RED}$jutsu_pattern${NC}" 172 | echo -e "${YELLOW}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}" 173 | else 174 | echo -e "${RED}Unknown jutsu! Try one of these:${NC}" 175 | show_jutsus 176 | fi 177 | } 178 | 179 | while true; do 180 | echo -e "${YELLOW}Enter your jutsu (or 'list' for available jutsus, 'exit' to quit):${NC}" 181 | read -r input 182 | 183 | case $input in 184 | "exit") 185 | echo "さようなら (Sayonara)! 👋" 186 | exit 0 187 | ;; 188 | "list") 189 | show_jutsus 190 | ;; 191 | *) 192 | perform_jutsu "$input" 193 | ;; 194 | esac 195 | done 196 | -------------------------------------------------------------------------------- /wc/readme.md: -------------------------------------------------------------------------------- 1 |
2 | 3 | **[ wallhaven wallpaper changer ]** 4 | 5 | [![License: Unlicense](https://img.shields.io/badge/License-Unlicense-pink.svg)](http://unlicense.org/) 6 | [![Made with Bash](https://img.shields.io/badge/Made%20with-Bash-purple.svg)](https://www.gnu.org/software/bash/) 7 | 8 |
9 | 10 | ## ✧ features 11 | 12 | - 🖼️ fetches random wallpapers from wallhaven 13 | - 💾 local caching system 14 | - 🔄 easy wallpaper switching 15 | - 🎨 customizable save locations 16 | 17 | ## ✧ installation 18 | 19 | ```bash 20 | git clone https://github.com/getjared/bash.git 21 | cd bash/wc 22 | chmod +x wc.sh 23 | ``` 24 | 25 | ## ✧ dependencies 26 | 27 | install required tools: 28 | ```bash 29 | sudo pacman -S jq curl feh 30 | ``` 31 | 32 | | tool | purpose | 33 | |------|---------| 34 | | `jq` | json parsing | 35 | | `curl` | downloading images | 36 | | `feh` | setting wallpaper | 37 | 38 | ## ✧ usage 39 | 40 | ### basic commands 41 | 42 | ```bash 43 | ./wc # run with defaults 44 | ./wc -b # set random wallpaper (sfw only) 45 | ./wc -b -nsfw # set random wallpaper (including nsfw) 46 | ./wc -c # clear cache 47 | ./wc -s /path # save current to specific location 48 | ``` 49 | 50 | ### flags 51 | 52 | | flag | description | 53 | |------|-------------| 54 | | `-b` | random wallpaper | 55 | | `-nsfw` | enable nsfw content | 56 | | `-c` | clear cache | 57 | | `-s` | save to location | 58 | 59 | ## ✧ cache system 60 | 61 | - images are stored in `./cache/wc/images` 62 | - cache can be cleared with `-c` flag 63 | - saves bandwidth by reusing downloaded images 64 | 65 | ## ✧ save locations 66 | 67 | ```bash 68 | # save current wallpaper to specific folder 69 | ./wc -s /home/jared/walls 70 | 71 | # save structure 72 | ./cache/wc/images/ 73 | ├── wall1.jpg 74 | ├── wall2.png 75 | └── wall3.jpg 76 | ``` 77 | 78 | ## ✧ pro tips 79 | 80 | - 🔄 use with cron for automatic changes 81 | - 💾 regularly clean cache to save space 82 | - 🖼️ save favorites to custom location 83 | - 🎨 combine with other scripts for effects 84 | 85 |
86 | 87 | ```ascii 88 | ╭─────────────────────────╮ 89 | │ made with ♥ by jared │ 90 | ╰─────────────────────────╯ 91 | ``` 92 | 93 |
94 | -------------------------------------------------------------------------------- /wc/wc.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | CACHE_DIR="$HOME/.cache/wc/images" 4 | 5 | usage() { 6 | echo "Usage:" 7 | echo " $0 -b [-nsfw] Set a random wallpaper. Use -nsfw to allow NSFW content." 8 | echo " $0 -c Clean the wallpaper cache." 9 | echo " $0 -s Save the latest wallpaper to the specified directory." 10 | exit 1 11 | } 12 | 13 | SET_BG=false 14 | CLEAN_CACHE=false 15 | SAVE=false 16 | SAVE_DIR="" 17 | ALLOW_NSFW=false 18 | 19 | while [[ $# -gt 0 ]]; do 20 | case "$1" in 21 | -b) 22 | SET_BG=true 23 | shift 24 | ;; 25 | -c) 26 | CLEAN_CACHE=true 27 | shift 28 | ;; 29 | -s) 30 | if [[ -n "$2" && ! "$2" =~ ^- ]]; then 31 | SAVE=true 32 | SAVE_DIR="$2" 33 | shift 2 34 | else 35 | echo "Error: -s requires a directory argument." 36 | usage 37 | fi 38 | ;; 39 | -nsfw) 40 | ALLOW_NSFW=true 41 | shift 42 | ;; 43 | *) 44 | echo "Unknown option: $1" 45 | usage 46 | ;; 47 | esac 48 | done 49 | 50 | if [[ "$SET_BG" == true ]]; then 51 | mkdir -p "$CACHE_DIR" 52 | 53 | if [[ "$ALLOW_NSFW" == true ]]; then 54 | PURITY="111" # Allows SFW, Sketchy, and NSFW 55 | else 56 | PURITY="100" # Allows only SFW 57 | fi 58 | 59 | API_URL="https://wallhaven.cc/api/v1/search?sorting=random&order=desc&categories=111&purity=${PURITY}&atleast=1920x1080&resolutions=1920x1080,2560x1440,3840x2160&ratios=16x9&topRange=1M&seed=$RANDOM" 60 | 61 | RESPONSE=$(curl -s "$API_URL") 62 | IMAGE_URL=$(echo "$RESPONSE" | jq -r '.data[0].path') 63 | 64 | if [[ "$IMAGE_URL" != "null" && -n "$IMAGE_URL" ]]; then 65 | FILENAME="$CACHE_DIR/$(date +%s).jpg" 66 | curl -s -o "$FILENAME" "$IMAGE_URL" 67 | 68 | if command -v feh >/dev/null; then 69 | feh --bg-fill "$FILENAME" 70 | elif command -v nitrogen >/dev/null; then 71 | nitrogen --set-zoom "$FILENAME" 72 | elif command -v sxiv >/dev/null; then 73 | sxiv -g "$FILENAME" && pkill -USR1 sxiv 74 | else 75 | echo "No supported wallpaper setter found." 76 | fi 77 | else 78 | echo "Failed to retrieve wallpaper." 79 | fi 80 | fi 81 | 82 | if [[ "$CLEAN_CACHE" == true ]]; then 83 | rm -rf "$CACHE_DIR" 84 | echo "Cache cleaned." 85 | fi 86 | 87 | if [[ "$SAVE" == true ]]; then 88 | if [[ -z "$SAVE_DIR" ]]; then 89 | echo "Error: Save directory not specified." 90 | usage 91 | fi 92 | 93 | mkdir -p "$SAVE_DIR" 94 | LATEST_FILE=$(ls -t "$CACHE_DIR" | head -n1) 95 | 96 | if [[ -n "$LATEST_FILE" ]]; then 97 | cp "$CACHE_DIR/$LATEST_FILE" "$SAVE_DIR" 98 | echo "Wallpaper saved to $SAVE_DIR." 99 | else 100 | echo "No wallpaper to save." 101 | fi 102 | fi 103 | 104 | if [[ "$SET_BG" == false && "$CLEAN_CACHE" == false && "$SAVE" == false ]]; then 105 | usage 106 | fi 107 | -------------------------------------------------------------------------------- /wdc/readme.md: -------------------------------------------------------------------------------- 1 |
2 | 3 | **[ warp drive calculator ]** 4 | 5 | [![License: Unlicense](https://img.shields.io/badge/License-Unlicense-pink.svg)](http://unlicense.org/) 6 | [![Made with Bash](https://img.shields.io/badge/Made%20with-Bash-purple.svg)](https://www.gnu.org/software/bash/) 7 | 8 | *"the calculations are correct, captain"* 9 | 10 |
11 | 12 | ## ✧ introduction 13 | 14 | the warp drive calculator is a bash script that calculates hypothetical warp travel times between star systems using real astronomical data and star trek warp speed formulas. it allows you to select a starship, an origin star, and a destination star (including famous locations from the star trek universe), and calculates the estimated travel time at a chosen warp factor. 15 | 16 | ## ✧ features 17 | 18 | - 🚀 starship selection with authentic max warp specs 19 | - 🌟 real astronomical data integration 20 | - 📊 TNG-accurate warp calculations 21 | - 🔭 celestial coordinate computations 22 | 23 | ## ✧ usage 24 | 25 | run the script: 26 | ```bash 27 | ./wdc.sh 28 | ``` 29 | 30 | follow the prompts: 31 | 1. select a starship 32 | 2. select your origin star 33 | 3. select your destination star 34 | 4. enter a warp factor (up to the ship's maximum warp) 35 | 36 | ## ✧ mathematical framework 37 | 38 | ### warp velocity calculations 39 | 40 | For warp factors w ≤ 9: 41 | 42 | ```math 43 | v = w^{\frac{10}{3}} \times c 44 | ``` 45 | 46 | For warp factors w > 9: 47 | 48 | ```math 49 | v = e^{w} \times c 50 | ``` 51 | 52 | Where: 53 | - v = velocity (km/s) 54 | - c = speed of light (299,792.458 km/s) 55 | - e = natural logarithm base 56 | 57 | ### bash implementation 58 | 59 | Due to `bc` limitations with fractional exponents, we use: 60 | 61 | ```math 62 | v = e^{\left( \frac{10}{3} \times \ln w \right)} \times c 63 | ``` 64 | 65 | ### distance calculations 66 | 67 | 1. **Convert coordinates to decimal degrees** 68 | 69 | Right ascension (hours, minutes, seconds): 70 | ```math 71 | \alpha_{\text{deg}} = (h + \frac{m}{60} + \frac{s}{3600}) \times 15 72 | ``` 73 | 74 | Declination (degrees, arcminutes, arcseconds): 75 | ```math 76 | \delta_{\text{deg}} = d + \frac{m}{60} + \frac{s}{3600} 77 | ``` 78 | 79 | 2. **Convert degrees to radians** 80 | ```math 81 | \theta_{\text{rad}} = \theta_{\text{deg}} \times \left( \frac{\pi}{180} \right) 82 | ``` 83 | 84 | 3. **Calculate angular separation (φ)** 85 | ```math 86 | \cos \phi = \sin \delta_1 \sin \delta_2 + \cos \delta_1 \cos \delta_2 \cos(\alpha_1 - \alpha_2) 87 | ``` 88 | 89 | Note: Ensure that cos φ is within [-1, 1] due to floating-point inaccuracies. 90 | Then calculate φ using: 91 | ```math 92 | \phi = \arccos(\cos \phi) 93 | ``` 94 | 95 | 4. **Calculate distance between stars** 96 | 97 | If d₁ and d₂ are distances from Earth to each star: 98 | ```math 99 | d = \sqrt{d_1^2 + d_2^2 - 2 d_1 d_2 \cos \phi} 100 | ``` 101 | 102 | 5. **Convert to kilometers** 103 | 104 | Using 1 light-year ≈ 9.4607304725808 × 10¹² km: 105 | ```math 106 | \text{distance}_{\text{km}} = d_{\text{ly}} \times 9.4607304725808 \times 10^{12} 107 | ``` 108 | 109 | ### travel time calculations 110 | 111 | Basic time calculation: 112 | ```math 113 | \text{travel time (s)} = \frac{\text{distance}_{\text{km}}}{v} 114 | ``` 115 | 116 | Convert to appropriate units: 117 | 118 | Years: 119 | ```math 120 | \text{travel time (years)} = \frac{\text{travel time (s)}}{31,557,600} 121 | ``` 122 | 123 | Days: 124 | ```math 125 | \text{travel time (days)} = \frac{\text{travel time (s)}}{86,400} 126 | ``` 127 | 128 | Hours: 129 | ```math 130 | \text{travel time (hours)} = \frac{\text{travel time (s)}}{3,600} 131 | ``` 132 | 133 | ## ✧ example calculation 134 | 135 | **mission parameters:** 136 | - origin: earth 137 | - destination: vega 138 | - warp factor: 3 139 | - vessel: USS Enterprise-D 140 | 141 | **results:** 142 | - distance: 25.04 light-years 143 | - velocity: 1.17 × 10⁷ km/s 144 | - travel time: 0.64 years (≈234 days) 145 | 146 | ## ✧ installation 147 | 148 | ```bash 149 | git clone https://github.com/getjared/bash.git 150 | cd bash/wdc 151 | chmod +x wdc.sh 152 | ``` 153 | 154 | ## ✧ technical notes 155 | 156 | - calculations assume ideal conditions 157 | - stellar distances based on latest available data 158 | - warp formulas from TNG technical specifications 159 | - coordinate calculations use J2000 epoch 160 | - accounts for relativistic effects in warp field 161 | - compensates for subspace distortions 162 | 163 | ## ✧ acknowledgments 164 | 165 | - 🖖 gene roddenberry & star trek universe 166 | - 🔭 nasa astronomical data 167 | - 🛸 star trek: TNG technical manual 168 | - 🌟 esa star catalogues 169 | 170 | ## ✧ limitations 171 | 172 | - assumes stable warp field 173 | - doesn't account for local space phenomena 174 | - subspace interference not calculated 175 | - theoretical calculations only 176 | 177 |
178 | 179 | ```ascii 180 | ╭────────────────────────────────────╮ 181 | │ engage warp drive, number one │ 182 | │ made with ♥ by jared │ 183 | ╰────────────────────────────────────╯ 184 | ``` 185 | 186 |
187 | -------------------------------------------------------------------------------- /wdc/wdc.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | command -v bc >/dev/null 2>&1 || { echo -e >&2 "\033[0;31mThe script requires 'bc' but it's not installed. Please install it and try again.\033[0m"; exit 1; } 4 | 5 | RED='\033[0;31m' 6 | GREEN='\033[0;32m' 7 | BLUE='\033[0;34m' 8 | CYAN='\033[0;36m' 9 | YELLOW='\033[0;33m' 10 | MAGENTA='\033[0;35m' 11 | BOLD='\033[1m' 12 | RESET='\033[0m' 13 | 14 | C=299792.458 15 | 16 | warp_speed() { 17 | local wf=$1 18 | if (( $(echo "$wf <= 9" | bc -l) )); then 19 | echo "$(echo "e((10/3)*l($wf))*$C" | bc -l)" 20 | else 21 | echo "$(echo "e($wf)*$C" | bc -l)" 22 | fi 23 | } 24 | 25 | convert_ra() { 26 | local ra=$1 27 | hours=$(echo "$ra" | sed -E 's/([0-9]+)h.*/\1/') 28 | minutes=$(echo "$ra" | sed -E 's/.*h([0-9]+)m.*/\1/') 29 | seconds=$(echo "$ra" | sed -E 's/.*m([0-9.]+)s.*/\1/') 30 | echo "$(echo "($hours + $minutes/60 + $seconds/3600) * 15" | bc -l)" 31 | } 32 | 33 | convert_dec() { 34 | local dec=$1 35 | sign=$(echo "$dec" | grep -o '^[+-]') 36 | degrees=$(echo "$dec" | sed -E 's/^[+-]?([0-9]+)°.*$/\1/') 37 | minutes=$(echo "$dec" | sed -E 's/.*°([0-9]+)′.*$/\1/') 38 | seconds=$(echo "$dec" | sed -E 's/.*′([0-9.]+)″.*$/\1/') 39 | decimal=$(echo "$degrees + $minutes/60 + $seconds/3600" | bc -l) 40 | if [ "$sign" == "-" ]; then 41 | echo "-$decimal" 42 | else 43 | echo "$decimal" 44 | fi 45 | } 46 | 47 | read -r -d '' STARS << EOM 48 | Earth|0|0h0m0s|0°0′0″|G2V|1.0|1.0|Our home planet, the third planet from the Sun.|Birthplace of humanity and headquarters of the United Federation of Planets. 49 | Alpha Centauri|4.367|14h39m36.4951s|-60°50′02.308″|G2V|1.1|1.2|Closest star system to the Solar System.|Known as the location of the planet Terra Nova. 50 | Barnard's Star|5.963|17h57m48.499s|+04°41′36.207″|M4Ve|0.144|0.2|A red dwarf star, one of the closest stars to Earth.|Explored in various Star Trek novels. 51 | Sirius|8.611|06h45m08.9173s|-16°42′58.017″|A1V|2.02|1.711|The brightest star in the night sky.|Home to the planet Nausicaa. 52 | Epsilon Eridani|10.522|03h32m55.844s|-09°27′29.74″|K2V|0.82|0.74|A star similar to our Sun, hosts a planetary system.|Associated with the planet Vulcan in some fan theories. 53 | Vega|25.04|18h36m56.33635s|+38°47′01.2802″|A0V|2.135|2.362|One of the brightest stars in the night sky.|Nearby star often mentioned in Star Trek lore. 54 | Betelgeuse|642.5|05h55m10.30536s|+07°24′25.4304″|M1-2Ia-Iab|11.6|887|A red supergiant star nearing the end of its life.|Referenced as part of the Betelgeuse Trade Route. 55 | Proxima Centauri|4.2465|14h29m42.9487s|-62°40′46.141″|M5.5Ve|0.1221|0.1542|The closest star to the Sun, part of the Alpha Centauri system.|Destination of the first Warp 1 flight by Zefram Cochrane. 56 | Rigel|863|05h14m32.27210s|-08°12′05.8981″|B8Ia|21|78.9|A blue supergiant star.|Important location in Star Trek, home to the Rigel system. 57 | Polaris|323|02h31m49.09456s|+89°15′50.7923″|F7Ib|5.4|37.5|The current North Star, a supergiant.|Featured in various episodes and novels. 58 | Altair|16.73|19h50m46.9985s|+08°52′05.956″|A7V|1.79|1.63|A bright star in the constellation Aquila.|Home to Altair IV, visited in Star Trek. 59 | Vulcan|16.5|12h30m49.42338s|+12°23′28.0439″|K-class|0.81|0.76|Hypothetical location near 40 Eridani A.|Homeworld of the Vulcans, Spock's species. 60 | Qo'noS|112|19h59m28.3566s|+14°38′22.789″|M-class|N/A|N/A|Approximate location in the Beta Quadrant.|Homeworld of the Klingon Empire. 61 | Romulus|159|02h49m15s|+89°15′50.8″|K-class|N/A|N/A|Approximate location near Beta Reticuli.|Homeworld of the Romulan Star Empire. 62 | Bajor|52|17h47m00s|+35°0′0″|K5V|N/A|N/A|Approximate location in the Alpha Quadrant.|Homeworld of the Bajorans and location of Deep Space Nine. 63 | EOM 64 | 65 | IFS=$'\n' read -rd '' -a STARS_ARRAY <<< "$STARS" 66 | 67 | read -r -d '' SHIPS << EOM 68 | USS Enterprise-D|Galaxy|9.6|Flagship of the Federation in the 24th century. 69 | USS Voyager|Intrepid|9.975|Lost in the Delta Quadrant, took 70 years to return at maximum warp. 70 | USS Defiant|Defiant|9.5|A warship designed to combat the Borg. 71 | USS Enterprise|Constitution|8|The original starship Enterprise. 72 | USS Discovery|Crossfield|9.7|Equipped with experimental spore drive. 73 | EOM 74 | 75 | IFS=$'\n' read -rd '' -a SHIPS_ARRAY <<< "$SHIPS" 76 | 77 | display_stars() { 78 | echo -e "${BOLD}${CYAN}Available Stars and Planets:${RESET}" 79 | local index=1 80 | for star in "${STARS_ARRAY[@]}"; do 81 | local name=$(echo "$star" | cut -d'|' -f1) 82 | echo -e " ${YELLOW}[${index}]${RESET} ${GREEN}$name${RESET}" 83 | ((index++)) 84 | done 85 | } 86 | 87 | display_ships() { 88 | echo -e "${BOLD}${CYAN}Available Starships:${RESET}" 89 | local index=1 90 | for ship in "${SHIPS_ARRAY[@]}"; do 91 | local name=$(echo "$ship" | cut -d'|' -f1) 92 | echo -e " ${YELLOW}[${index}]${RESET} ${GREEN}$name${RESET}" 93 | ((index++)) 94 | done 95 | } 96 | 97 | get_star_data() { 98 | local index=$1 99 | echo "${STARS_ARRAY[$((index - 1))]}" 100 | } 101 | 102 | get_ship_data() { 103 | local index=$1 104 | echo "${SHIPS_ARRAY[$((index - 1))]}" 105 | } 106 | 107 | echo -e "${BOLD}${MAGENTA}Welcome to the Warp Drive Calculator!${RESET}" 108 | echo -e "${CYAN}This tool calculates hypothetical warp travel times between star systems using real astronomical data.${RESET}" 109 | echo "" 110 | echo -e "${BOLD}${MAGENTA}Mission Briefing:${RESET}" 111 | echo -e "${CYAN}You are tasked with navigating a starship between two points in the galaxy. Choose your vessel and set your course!${RESET}" 112 | echo "" 113 | 114 | display_ships 115 | echo "" 116 | read -p "$(echo -e "${BOLD}Select your starship by number:${RESET} ")" ship_index 117 | ship=$(get_ship_data "$ship_index") 118 | ship_name=$(echo "$ship" | cut -d'|' -f1) 119 | ship_class=$(echo "$ship" | cut -d'|' -f2) 120 | ship_max_warp=$(echo "$ship" | cut -d'|' -f3) 121 | ship_notes=$(echo "$ship" | cut -d'|' -f4) 122 | 123 | echo "" 124 | display_stars 125 | echo "" 126 | read -p "$(echo -e "${BOLD}Select your origin star by number:${RESET} ")" origin_index 127 | origin_star=$(get_star_data "$origin_index") 128 | origin_name=$(echo "$origin_star" | cut -d'|' -f1) 129 | origin_distance=$(echo "$origin_star" | cut -d'|' -f2) 130 | origin_ra_sex=$(echo "$origin_star" | cut -d'|' -f3) 131 | origin_dec_sex=$(echo "$origin_star" | cut -d'|' -f4) 132 | origin_spectral=$(echo "$origin_star" | cut -d'|' -f5) 133 | origin_mass=$(echo "$origin_star" | cut -d'|' -f6) 134 | origin_radius=$(echo "$origin_star" | cut -d'|' -f7) 135 | origin_fact=$(echo "$origin_star" | cut -d'|' -f8) 136 | origin_lore=$(echo "$origin_star" | cut -d'|' -f9) 137 | 138 | echo "" 139 | display_stars 140 | echo "" 141 | read -p "$(echo -e "${BOLD}Select your destination star by number:${RESET} ")" dest_index 142 | dest_star=$(get_star_data "$dest_index") 143 | dest_name=$(echo "$dest_star" | cut -d'|' -f1) 144 | dest_distance=$(echo "$dest_star" | cut -d'|' -f2) 145 | dest_ra_sex=$(echo "$dest_star" | cut -d'|' -f3) 146 | dest_dec_sex=$(echo "$dest_star" | cut -d'|' -f4) 147 | dest_spectral=$(echo "$dest_star" | cut -d'|' -f5) 148 | dest_mass=$(echo "$dest_star" | cut -d'|' -f6) 149 | dest_radius=$(echo "$dest_star" | cut -d'|' -f7) 150 | dest_fact=$(echo "$dest_star" | cut -d'|' -f8) 151 | dest_lore=$(echo "$dest_star" | cut -d'|' -f9) 152 | 153 | origin_ra=$(convert_ra "$origin_ra_sex") 154 | origin_dec=$(convert_dec "$origin_dec_sex") 155 | dest_ra=$(convert_ra "$dest_ra_sex") 156 | dest_dec=$(convert_dec "$dest_dec_sex") 157 | 158 | deg2rad=$(echo "scale=10; 4*a(1)/180" | bc -l) 159 | origin_ra_rad=$(echo "$origin_ra * $deg2rad" | bc -l) 160 | origin_dec_rad=$(echo "$origin_dec * $deg2rad" | bc -l) 161 | dest_ra_rad=$(echo "$dest_ra * $deg2rad" | bc -l) 162 | dest_dec_rad=$(echo "$dest_dec * $deg2rad" | bc -l) 163 | 164 | cos_angle=$(echo " 165 | scale=10; 166 | odr = $origin_dec_rad; 167 | ddr = $dest_dec_rad; 168 | orr = $origin_ra_rad; 169 | drr = $dest_ra_rad; 170 | cos_angle = s(odr)*s(ddr) + c(odr)*c(ddr)*c(orr - drr); 171 | cos_angle 172 | " | bc -l) 173 | 174 | cos_angle=$(echo "$cos_angle" | awk '{if ($1 > 1) print 1; else if ($1 < -1) print -1; else print $1}') 175 | 176 | pi=$(echo "scale=10; 4*a(1)" | bc -l) 177 | 178 | angle_rad=$(echo " 179 | scale=10; 180 | define arccos(x) { 181 | if (x == 1) return 0; 182 | if (x == -1) return $pi; 183 | if (x > -1 && x < 1) { 184 | return a(sqrt(1 - x*x)/x); 185 | } 186 | } 187 | arccos($cos_angle) 188 | " | bc -l) 189 | 190 | distance=$(echo " 191 | scale=10; 192 | d1 = $origin_distance; 193 | d2 = $dest_distance; 194 | angle = $angle_rad; 195 | distance = sqrt(d1^2 + d2^2 - 2*d1*d2*c(angle)); 196 | distance 197 | " | bc -l) 198 | 199 | LY_TO_KM=9460730472580.8 200 | distance_km=$(echo "$distance * $LY_TO_KM" | bc -l) 201 | 202 | echo "" 203 | echo -e "${BOLD}Maximum Warp Factor for $ship_name (${ship_class} class): ${ship_max_warp}${RESET}" 204 | read -p "$(echo -e "${BOLD}Enter warp factor (up to maximum warp):${RESET} ")" warp_factor 205 | 206 | if ! [[ "$warp_factor" =~ ^[0-9]*\.?[0-9]+$ ]] || (( $(echo "$warp_factor > $ship_max_warp" | bc -l) )); then 207 | echo -e "${RED}Invalid warp factor. Please enter a numeric value up to the ship's maximum warp factor.${RESET}" 208 | exit 1 209 | fi 210 | 211 | speed_km_s=$(warp_speed "$warp_factor") 212 | 213 | travel_time_s=$(echo "$distance_km / $speed_km_s" | bc -l) 214 | 215 | travel_time_yr=$(echo "$travel_time_s / (31557600)" | bc -l) 216 | travel_time_day=$(echo "$travel_time_s / 86400" | bc -l) 217 | travel_time_hr=$(echo "$travel_time_s / 3600" | bc -l) 218 | 219 | echo "" 220 | echo -e "${BOLD}${MAGENTA}Mission Summary:${RESET}" 221 | echo -e "${BOLD}${GREEN}Starship:${RESET} $ship_name (${ship_class} class)" 222 | echo -e " ${CYAN}Maximum Warp:${RESET} $ship_max_warp" 223 | echo -e " ${CYAN}Notes:${RESET} $ship_notes" 224 | echo "" 225 | echo -e "${BOLD}${MAGENTA}Calculating travel time from $origin_name to $dest_name at Warp $warp_factor...${RESET}" 226 | echo -e "${BLUE}------------------------------------------------------------${RESET}" 227 | echo -e "${BOLD}${GREEN}Origin Star: $origin_name${RESET}" 228 | echo -e " ${CYAN}Distance from Earth:${RESET} $origin_distance light-years" 229 | echo -e " ${CYAN}Right Ascension:${RESET} $origin_ra_sex" 230 | echo -e " ${CYAN}Declination:${RESET} $origin_dec_sex" 231 | echo -e " ${CYAN}Spectral Type:${RESET} $origin_spectral" 232 | echo -e " ${CYAN}Mass:${RESET} $origin_mass Solar Masses" 233 | echo -e " ${CYAN}Radius:${RESET} $origin_radius Solar Radii" 234 | echo -e " ${CYAN}Astronomical Facts:${RESET} $origin_fact" 235 | echo -e " ${CYAN}Star Trek Lore:${RESET} $origin_lore" 236 | echo "" 237 | echo -e "${BOLD}${GREEN}Destination Star: $dest_name${RESET}" 238 | echo -e " ${CYAN}Distance from Earth:${RESET} $dest_distance light-years" 239 | echo -e " ${CYAN}Right Ascension:${RESET} $dest_ra_sex" 240 | echo -e " ${CYAN}Declination:${RESET} $dest_dec_sex" 241 | echo -e " ${CYAN}Spectral Type:${RESET} $dest_spectral" 242 | echo -e " ${CYAN}Mass:${RESET} $dest_mass Solar Masses" 243 | echo -e " ${CYAN}Radius:${RESET} $dest_radius Solar Radii" 244 | echo -e " ${CYAN}Astronomical Facts:${RESET} $dest_fact" 245 | echo -e " ${CYAN}Star Trek Lore:${RESET} $dest_lore" 246 | echo "" 247 | echo -e "${BOLD}${YELLOW}Angular Separation:${RESET} $(echo "($angle_rad / $deg2rad)" | bc -l) degrees" 248 | echo -e "${BOLD}${YELLOW}Distance between stars:${RESET} $(printf "%.4f" $distance) light-years" 249 | echo -e "${BOLD}${YELLOW}Distance in kilometers:${RESET} $(printf "%.2e" $distance_km) km" 250 | echo -e "${BOLD}${YELLOW}Warp Factor:${RESET} $warp_factor" 251 | echo -e "${BOLD}${YELLOW}Warp Speed:${RESET} $(printf "%.2e" $speed_km_s) km/s" 252 | echo "" 253 | echo -e "${BOLD}${MAGENTA}Estimated Travel Time:${RESET}" 254 | if (( $(echo "$travel_time_yr >= 1" | bc -l) )); then 255 | echo -e " ${BOLD}$(printf "%.2f" $travel_time_yr)${RESET} years" 256 | elif (( $(echo "$travel_time_day >= 1" | bc -l) )); then 257 | echo -e " ${BOLD}$(printf "%.2f" $travel_time_day)${RESET} days" 258 | else 259 | echo -e " ${BOLD}$(printf "%.2f" $travel_time_hr)${RESET} hours" 260 | fi 261 | echo -e "${BLUE}------------------------------------------------------------${RESET}" 262 | echo -e "${CYAN}Note:${RESET} This calculation uses the Star Trek: The Next Generation warp speed scale." 263 | echo -e "For warp factors above 9, speeds increase exponentially toward Warp 10, which is infinite velocity." 264 | echo "" 265 | echo -e "${BOLD}${MAGENTA}Additional Information:${RESET}" 266 | echo -e " - ${YELLOW}Speed of Light:${RESET} $C km/s" 267 | echo -e " - ${YELLOW}1 Light-Year:${RESET} $LY_TO_KM km" 268 | echo -e " - ${YELLOW}Warp Speed Formula:${RESET} Based on the TNG Technical Manual" 269 | echo -e " - ${YELLOW}Spectral Types${RESET} indicate the star's temperature and color." 270 | echo -e " - ${YELLOW}Solar Masses and Radii${RESET} are relative to our Sun." 271 | --------------------------------------------------------------------------------