Created
December 26, 2023 00:05
-
-
Save luisadha/866f2e54a34dc6b1de8885665a7fe814 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo "[$(date | awk '{print $4}' | cut -c 1,2,4,5,7,8)] Load from.. (.bashrc) " | |
# ========================================= bashrc configuration by luisadha ============================================== | |
case $- in | |
*i*) ;; | |
*) return;; | |
esac | |
function tanya() { | |
local tindakan="${3}" | |
local pertanyaan="${1}" | |
local subjek="${2}" | |
local keputusan='[Y/n]' | |
read -p "${pertanyaan} ${subjek}? ${keputusan} " mengambil_keputusan | |
case "$mengambil_keputusan" in | |
"" ) | |
termux-toast "Tunggu dong..." | |
${tindakan} ;; | |
y|Y ) | |
termux-toast "Tunggu dong..." | |
${tindakan} ;; | |
n|N ) | |
echo "Baiklah."; | |
return 1 ;; | |
* ) | |
echo "Opsi tidak dikenal '${mengambil_keputusan}'" ;; | |
esac | |
} | |
. ~/.aliases | |
alias animasi='echo "$(input keyevent 47)$(input keyevent 40)$(input keyevent 23)"' | |
alias volup='input keyevent 24' | |
alias voldo='input keyevent 25' | |
alias ⏸='termux-media-player pause' | |
alias ►='termux-media-player play' | |
alias r='fc -e -' | |
alias ak='exa' | |
alias ex='exa' # untuk mengulangi perintah barusan atau dikenal dengan replay | |
alias ⌂='z luis' | |
alias altest="alrc init" | |
alias archlinux="proot-distro login archlinux" | |
timestmpedt=$(echo "${c3}[$(date | awk '{print $4}' | cut -c 1,2,4,5,7,8)]") | |
req_78cols=78 | |
req_41lines=41 | |
export OPENAI_API_KEY='' | |
export PLAYX_VAR_REQUIRE="playx102-sc.sh" | |
#export ANIMATION_MESSAGE="${timestmpedt}${c0} BrandomusicX: Memilih lagu.." | |
export ALRC_USE_ALFETCH="true" | |
export SARAN="ON" | |
export BRANDO_RESPONSE="y" BRANDO_NO_CACHE="true" | |
export PATH="$PATH:~/.local/bin:/system/bin:$HOME/.cargo/bin" # mendaftarkan local bin dan system bin ke dalam variabel lingkungan path | |
#echo -en "[$(date | awk '{print $4}' | cut -c 1,2,4,5,7,8)] " | |
#drawercli -w | |
: " | |
if [ $(tput cols) -lt $req_78cols ] || [ $(tput lines) -lt $req_41lines ]; then | |
echo "`basename $0` needs a $req_78cols-cols X $req_41lines-lines terminal." | |
echo "Your terminal is $(tput cols)-cols X $(tput lines)-lines." | |
return 1 | |
fi # ini akan memerikasa ukuran layar termux | |
" | |
: " | |
if [[ -x $(command -v alfetch 2> /dev/null) ]]; then | |
echo -en "$timestmpedt Updating alfetch.. " | |
# Update section | |
if timeout 10s curl -fSsl "https://raw.githubusercontent.com/luisadha/alfetch/main/alfetch" -o ~/.local/bin/alfetch 2> /dev/null && chmod +x ~/.local/bin/alfetch; then | |
echo -n "Success!" | |
else | |
echo -n "Failed. Timeout or network issue." | |
fi | |
else | |
# Download section | |
echo -en "$timestmpedt Downloading alfetch.. " | |
if timeout 10s curl -fSsl "https://raw.githubusercontent.com/luisadha/alfetch/main/alfetch" -o ~/.local/bin/alfetch 2> /dev/null && chmod +x ~/.local/bin/alfetch; then | |
echo -n "Success!" | |
else | |
echo -n "Failed. Timeout or network issue." | |
fi | |
fi | |
" | |
: " | |
echo | |
if [[ -x $(command -v drawercli 2> /dev/null) ]]; then | |
echo -en "$timestmpedt Updating drawercli.. "; | |
if timeout 10s curl -fSsl "https://raw.githubusercontent.com/luisadha/drawercli/main/drawercli" -o ~/.local/bin/drawercli 2> /dev/null && chmod +x ~/.local/bin/drawercli; then echo -n "Success!"; | |
else | |
echo -n "Failed. Timeout or network issue."; fi | |
else | |
echo -en "$timestmpedt Downloading drawercli.. "; | |
if timeout 10s curl -fSsl "https://raw.githubusercontent.com/luisadha/drawercli/main/drawercli" -o ~/.local/bin/drawercli 2> /dev/null && chmod +x ~/.local/bin/drawercli; then echo -en "drawercli was downloaded!"; | |
else echo -en "Failed. Timeout or network issue."; fi | |
fi | |
" | |
echo | |
if [[ -x $(which zoxide 2> /dev/null) ]]; then | |
eval "$(zoxide init bash)" # inisialisasi zoxide | |
echo -e "$timestmpedt Init zoxide" | |
fi | |
if [[ -x $(which starship 2> /dev/null) ]]; then | |
eval "$(starship init bash)" # inisialisasi prompt keren dari starship | |
echo -e "$timestmpedt Init starship" | |
fi | |
aktifkan_alrc_termux() { | |
if [[ -x $(which alrc 2> /dev/null) ]]; then | |
source <(~/.local/bin/alrc env)> /dev/null 2>&1; # inisialisasi alrc-termux | |
echo -e "$timestmpedt Init alrc-termux.. version ${ALRC_VERSION:-unknwon} (${ALRC_UDATE:-""})" | |
else | |
echo "Alrc-termux tidak di-install"; | |
fi | |
} | |
tanya "Apakah ingin mengaktifkan" "alrc-termux?" aktifkan_alrc_termux; | |
al_include_brandomusicv 2> /dev/null | |
al_exclude_brandomusic 2> /dev/null | |
# al_include_drawercli 2> /dev/null | |
: " al_include_drawercli 2> /dev/null" | |
#al_exclude_brandomusicx | |
alias al_no_addon='source remove_addon_files.sh' | |
al_no_addon 2> /dev/null | |
unalias al_no_addon | |
source $HOME/storage/shared/termuxlauncher/.apps-launcher 2> /dev/null # inisialisasi termuxlauncher, ini akan membaca seluruh aplikasi pengguna yang diinstall di perangkat | |
echo -e "$timestmpedt Init .apps-launcher (termuxlauncher)" | |
source ~/.config/termuxlauncher_config_by_luisadha.config 2> /dev/null # inisialisasi konfig termuxlauncher unofficial ini akan mempersingkat perintah seperti launch Mobile Legends: Bang Bang ke l $mlbb | |
echo -e "$timestmpedt Init CONFIG termuxlauncher_config_by_luisadha (termuxlauncher)" | |
# -- Silahkan pilih interface | |
#+dengan mematikan salah satu interface, caranya beri tanda pagar di setiap bagian kode dari interface | |
# 1). Antarmuka horizontal dengan warna | |
# echo "Daftar Aplikasi : " | figlet | |
# echo | |
# echo -e "Usage : l \$wabisnis (config)\n" | |
# echo -e " l firefox (default)\n" | |
# echo -e "\nDownload termuxlauncher apk's first!\n" | |
# | |
# echo -e "Powered by termuxlauncher\nConfig by @luisadha\n" | |
# launch -l | grep -Exo '[a-z0-9:_-]+' | sort -u | xargs | lolcat -r | |
# 2). Antarmuka vertikal dengan sentuhan interaktif (digunakan) | |
# Apps recomendation | |
# drawercli -S 3 | |
# App most usage | |
# drawercli -u | |
# Do nothing | |
# drawercli --skip | |
# App refresh list | |
# drawercli -r | |
# Drawer | |
# ====================================================================end============== | |
# Enable the subsequent settings only in interactive sessions | |
case $- in | |
*i*) ;; | |
*) return;; | |
esac | |
# Path to your oh-my-bash installation. | |
export OSH='/data/data/com.termux/files/home/.oh-my-bash' | |
# Set name of the theme to load. Optionally, if you set this to "random" | |
# it'll load a random theme each time that oh-my-bash is loaded. | |
#OSH_THEME="cupcake" | |
#OSH_THEME="vscode" | |
#OSH_THEME="random" | |
# Uncomment the following line to use case-sensitive completion. | |
# CASE_SENSITIVE="true" | |
# Uncomment the following line to use hyphen-insensitive completion. Case | |
# sensitive completion must be off. _ and - will be interchangeable. | |
# HYPHEN_INSENSITIVE="true" | |
# Uncomment the following line to disable bi-weekly auto-update checks. | |
# DISABLE_AUTO_UPDATE="true" | |
# Uncomment the following line to change how often to auto-update (in days). | |
# export UPDATE_OSH_DAYS=13 | |
# Uncomment the following line to disable colors in ls. | |
# DISABLE_LS_COLORS="true" | |
# Uncomment the following line to disable auto-setting terminal title. | |
# DISABLE_AUTO_TITLE="true" | |
# Uncomment the following line to enable command auto-correction. | |
# ENABLE_CORRECTION="true" | |
# Uncomment the following line to display red dots whilst waiting for completion. | |
# COMPLETION_WAITING_DOTS="true" | |
# Uncomment the following line if you want to disable marking untracked files | |
# under VCS as dirty. This makes repository status check for large repositories | |
# much, much faster. | |
# DISABLE_UNTRACKED_FILES_DIRTY="true" | |
# Uncomment the following line if you want to change the command execution time | |
# stamp shown in the history command output. One of the following values can | |
# be used to specify the timestamp format. | |
# * 'mm/dd/yyyy' # mm/dd/yyyy + time | |
# * 'dd.mm.yyyy' # dd.mm.yyyy + time | |
# * 'yyyy-mm-dd' # yyyy-mm-dd + time | |
# * '[mm/dd/yyyy]' # [mm/dd/yyyy] + [time] with colors | |
# * '[dd.mm.yyyy]' # [dd.mm.yyyy] + [time] with colors | |
# * '[yyyy-mm-dd]' # [yyyy-mm-dd] + [time] with colors | |
# If not set, the default value is 'yyyy-mm-dd'. | |
# HIST_STAMPS='yyyy-mm-dd' | |
# Uncomment the following line if you do not want OMB to overwrite the existing | |
# aliases by the default OMB aliases defined in lib/*.sh | |
# OMB_DEFAULT_ALIASES="check" | |
# Would you like to use another custom folder than $OSH/custom? | |
# OSH_CUSTOM=/path/to/new-custom-folder | |
# To disable the uses of "sudo" by oh-my-bash, please set "false" to | |
# this variable. The default behavior for the empty value is "true". | |
OMB_USE_SUDO=true | |
# Which completions would you like to load? (completions can be found in ~/.oh-my-bash/completions/*) | |
# Custom completions may be added to ~/.oh-my-bash/custom/completions/ | |
# Example format: completions=(ssh git bundler gem pip pip3) | |
# Add wisely, as too many completions slow down shell startup. | |
completions=( | |
git | |
composer | |
ssh | |
todo | |
system | |
dirs | |
) | |
# Which aliases would you like to load? (aliases can be found in ~/.oh-my-bash/aliases/*) | |
# Custom aliases may be added to ~/.oh-my-bash/custom/aliases/ | |
# Example format: aliases=(vagrant composer git-avh) | |
# Add wisely, as too many aliases slow down shell startup. | |
aliases=( | |
general | |
) | |
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-bash/plugins/*) | |
# Custom plugins may be added to ~/.oh-my-bash/custom/plugins/ | |
# Example format: plugins=(rails git textmate ruby lighthouse) | |
# Add wisely, as too many plugins slow down shell startup. | |
plugins=( | |
git | |
bashmarks | |
battery | |
progress | |
pyenv | |
) | |
# Which plugins would you like to conditionally load? (plugins can be found in ~/.oh-my-bash/plugins/*) | |
# Custom plugins may be added to ~/.oh-my-bash/custom/plugins/ | |
# Example format: | |
# if [ "$DISPLAY" ] || [ "$SSH" ]; then | |
# plugins+=(tmux-autoattach) | |
# fi | |
source "$OSH"/oh-my-bash.sh | |
echo -e "$timestmpedt Init oh-my-bash" | |
# User configuration | |
# export MANPATH="/usr/local/man:$MANPATH" | |
# You may need to manually set your language environment | |
# export LANG=en_US.UTF-8 | |
# Preferred editor for local and remote sessions | |
# if [[ -n $SSH_CONNECTION ]]; then | |
# export EDITOR='vim' | |
# else | |
# export EDITOR='mvim' | |
# fi | |
# Compilation flags | |
# export ARCHFLAGS="-arch x86_64" | |
# ssh | |
# export SSH_KEY_PATH="~/.ssh/rsa_id" | |
# Set personal aliases, overriding those provided by oh-my-bash libs, | |
# plugins, and themes. Aliases can be placed here, though oh-my-bash | |
# users are encouraged to define aliases within the OSH_CUSTOM folder. | |
# For a full list of active aliases, run `alias`. | |
# | |
# Example aliases | |
# alias bashconfig="mate ~/.bashrc" | |
# alias ohmybash="mate ~/.oh-my-bash" | |
# HSTR configuration - add this to ~/.bashrc | |
alias hh=hstr # hh to be alias for hstr | |
export HSTR_CONFIG=hicolor # get more colors | |
shopt -s histappend # append new history items to .bash_history | |
export HISTCONTROL=ignorespace # leading space hides commands from history | |
export HISTFILESIZE=10000 # increase history file size (default is 500) | |
export HISTSIZE=${HISTFILESIZE} # increase history size (default is 500) | |
# ensure synchronization between bash memory and history file | |
export PROMPT_COMMAND="history -a; history -n; ${PROMPT_COMMAND}" | |
function hstrnotiocsti { | |
{ READLINE_LINE="$( { </dev/tty hstr ${READLINE_LINE}; } 2>&1 1>&3 3>&- )"; } 3>&1; | |
READLINE_POINT=${#READLINE_LINE} | |
} | |
# if this is interactive shell, then bind hstr to Ctrl-r (for Vi mode check doc) | |
if [[ $- =~ .*i.* ]]; then bind -x '"\C-r": "hstrnotiocsti"'; fi | |
export HSTR_TIOCSTI=n | |
echo -e "$timestmpedt Init CONFIG HSTR" | |
# If not running interactively, don't do anything | |
case $- in | |
*i*) ;; | |
*) return;; | |
esac | |
# Path to the bash it configuration | |
export BASH_IT="/data/data/com.termux/files/home/.bash_it.git" | |
# Lock and Load a custom theme file. | |
# Leave empty to disable theming. | |
# location /.bash_it/themes/ | |
: 'export BASH_IT_THEME='' 2> /dev/null' | |
# Some themes can show whether `sudo` has a current token or not. | |
# Set `$THEME_CHECK_SUDO` to `true` to check every prompt: | |
#THEME_CHECK_SUDO='true' | |
# (Advanced): Change this to the name of your remote repo if you | |
# cloned bash-it with a remote other than origin such as `bash-it`. | |
# export BASH_IT_REMOTE='bash-it' | |
# (Advanced): Change this to the name of the main development branch if | |
# you renamed it or if it was changed for some reason | |
# export BASH_IT_DEVELOPMENT_BRANCH='master' | |
# Your place for hosting Git repos. I use this for private repos. | |
export GIT_HOSTING='git@git.domain.com' | |
# Don't check mail when opening terminal. | |
unset MAILCHECK | |
# Change this to your console based IRC client of choice. | |
export IRC_CLIENT='irssi' | |
# Set this to the command you use for todo.txt-cli | |
export TODO="t" | |
# Set this to the location of your work or project folders | |
#BASH_IT_PROJECT_PATHS="${HOME}/Projects:/Volumes/work/src" | |
# Set this to false to turn off version control status checking within the prompt for all themes | |
export SCM_CHECK=true | |
# Set to actual location of gitstatus directory if installed | |
#export SCM_GIT_GITSTATUS_DIR="$HOME/gitstatus" | |
# per default gitstatus uses 2 times as many threads as CPU cores, you can change this here if you must | |
#export GITSTATUS_NUM_THREADS=8 | |
# Set Xterm/screen/Tmux title with only a short hostname. | |
# Uncomment this (or set SHORT_HOSTNAME to something else), | |
# Will otherwise fall back on $HOSTNAME. | |
#export SHORT_HOSTNAME=$(hostname -s) | |
# Set Xterm/screen/Tmux title with only a short username. | |
# Uncomment this (or set SHORT_USER to something else), | |
# Will otherwise fall back on $USER. | |
#export SHORT_USER=${USER:0:8} | |
# If your theme use command duration, uncomment this to | |
# enable display of last command duration. | |
#export BASH_IT_COMMAND_DURATION=true | |
# You can choose the minimum time in seconds before | |
# command duration is displayed. | |
#export COMMAND_DURATION_MIN_SECONDS=1 | |
# Set Xterm/screen/Tmux title with shortened command and directory. | |
# Uncomment this to set. | |
#export SHORT_TERM_LINE=true | |
# Set vcprompt executable path for scm advance info in prompt (demula theme) | |
# https://github.com/djl/vcprompt | |
#export VCPROMPT_EXECUTABLE=~/.vcprompt/bin/vcprompt | |
# (Advanced): Uncomment this to make Bash-it reload itself automatically | |
# after enabling or disabling aliases, plugins, and completions. | |
# export BASH_IT_AUTOMATIC_RELOAD_AFTER_CONFIG_CHANGE=1 | |
# Uncomment this to make Bash-it create alias reload. | |
# export BASH_IT_RELOAD_LEGACY=1 | |
# Load Bash It | |
source "$BASH_IT"/bash_it.sh | |
echo -e "$timestmpedt Init bash-it" | |
[ -f ~/.fzf.bash ] && source ~/.fzf.bash | |
echo -e "$timestmpedt Init fzf" | |
echo -e "$timestmpedt Timg opening.." | |
timg ~/downloads/miku_75949 | |
echo | |
bash ~/.scripts/automations/aphroditeascii_tasker.sh | |
function fetchDate() { | |
echo -e "$(date '+%A, %B %d, %Y at %H:%M')" | lolcat # motd sederhana | |
} | |
function musik() { | |
echo -e "$(fetchDate)\n-----------------------------------" | lolcat | |
echo -n "Music's Today :" | lolcat | |
brandomusicx shuffle > /dev/null 2>&1; | |
python3 ~/.scripts/automations/fetchSongTitle_animation.py | |
} | |
if [ $SARAN == "ON" ]; then | |
tanya "Apakah anda ingin mendengarkan" "lagu" musik; | |
fi | |
echo | |
alfetch | |
echo | |
fortune | boxes -a c -d parchment | lolcat | |
echo | |
alias ls='fzf | termux-clipboard-set' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment