diff --git a/dots/bash/.bashrc b/dots/bash/.bashrc index a68e154..747f702 100644 --- a/dots/bash/.bashrc +++ b/dots/bash/.bashrc @@ -5,15 +5,47 @@ # If not running interactively, don't do anything [[ $- != *i* ]] && return + +alias mamapscii='telnet mapscii.me' alias ls='ls --color=auto' alias grep='grep --color=auto' +alias azurevpnclient="/opt/microsoft/microsoft-azurevpnclient/microsoft-azurevpnclient" +alias ct="sudo ct" +alias ct+="sudo ct dots+" +alias ctd="sudo ct dots" +alias cts="sudo ct sw" +alias ffind="sudo find / -type f -name" +alias gparted="sudo gparted" +alias keymap="setxkbmap -model pc105 -layout us,no -option grp:caps_toggle,grp_led:scroll" +alias myip="echo $(wget http://ipinfo.io/ip -qO -)" +alias tp="tp.sh" +alias package-updates="pacman -Qu" +#alias dpi="xrandr --dpi" +#alias nr="nitrogen --restore" +#alias sb="source ~/.bashrc" +#alias cp="cp -i" # confirm before overwriting something +#alias df='df -h' # human-readable sizes +#alias free='free -m' # show sizes in MB +#alias np='nano -w PKGBUILD' +#alias more=less + + +# x terminal shell start string PS1='[\u@\h \W]\$ ' +# change the window title of x terminals +case ${TERM} in + xterm*|rxvt*|Eterm*|aterm|kterm|gnome*|interix|konsole*) + PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/\~}\007"' + ;; + screen*) + PROMPT_COMMAND='echo -ne "\033_${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/\~}\033\\"' + ;; +esac + # https://github.com/gsamokovarov/jump eval "$(jump shell --bind=j)" -alias mamapscii='telnet mapscii.me' - # # ex - archive extractor # # usage: ex ex () @@ -38,21 +70,6 @@ ex () fi } -alias azurevpnclient="/opt/microsoft/microsoft-azurevpnclient/microsoft-azurevpnclient" -alias curae="sudo curae" -alias curd+="sudo curae dots+" -alias curd="sudo curae dots" -alias curs="sudo curae sw" -alias dpi="xrandr --dpi" -alias ffind="sudo find / -type f -name" -alias gparted="sudo gparted" -alias keymap="setxkbmap -model pc105 -layout us,no -option grp:caps_toggle,grp_led:scroll" -alias myip="echo $(wget http://ipinfo.io/ip -qO -)" -alias nr="nitrogen --restore" -alias sb="source ~/.bashrc" -alias tp="tp.sh" -alias package-updates="pacman -Qu" - nmrestart() { systemctl restart NetworkManager systemctl status NetworkManager @@ -131,22 +148,6 @@ rshift() { redshift -P -O ${temperature} } -# # Change the window title of X terminals -# case ${TERM} in -# xterm*|rxvt*|Eterm*|aterm|kterm|gnome*|interix|konsole*) -# PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/\~}\007"' -# ;; -# screen*) -# PROMPT_COMMAND='echo -ne "\033_${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/\~}\033\\"' -# ;; -# esac - -# alias cp="cp -i" # confirm before overwriting something -# alias df='df -h' # human-readable sizes -# alias free='free -m' # show sizes in MB -# alias np='nano -w PKGBUILD' -# #alias more=less - # --- # sys stuff # --- @@ -228,16 +229,16 @@ podigy() { # --- # hummed # --- -hummed-activate() { - cd /home/poq/syncDir/gitRepos/gt.op.fo/hummed/src - source venv/bin/activate -} -hummed() { - hummed-activate - python /home/poq/syncDir/gitRepos/gt.op.fo/hummed/src/archi.py "$@" - deactivate - jump-to-downloads -} +#hummed-activate() { +# cd /home/poq/syncDir/gitRepos/gt.op.fo/hummed/src +# source venv/bin/activate +#} +#hummed() { +# hummed-activate +# python /home/poq/syncDir/gitRepos/gt.op.fo/hummed/src/archi.py "$@" +# deactivate +# jump-to-downloads +#} # --- # jeton diff --git a/scripts/curae.sh b/scripts/ct.sh similarity index 96% rename from scripts/curae.sh rename to scripts/ct.sh index d9632b6..c23bfa9 100755 --- a/scripts/curae.sh +++ b/scripts/ct.sh @@ -1,8 +1,7 @@ #!/usr/bin/env bash # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# what: curae is latin an means to take care. this script takes care -# of the system (adjusted for arch linux). +# what: ct - for caretaker # author: fk # started: may 2024 # @@ -16,12 +15,12 @@ # WARNING: EXAMINE THE CONTENT BEFORE EXECUTION. RUN AT YOUR OWN RISK. # ############################################################################# -echo "<< curae.sh >>" +echo "<< ct.sh >>" base_url=https://gt.op.fo/fro/lnx-arch/raw/branch/master scripts_url=${base_url}/scripts home_dir=/usr/local/bin -this_file=curae.sh +this_file=ct.sh # https://stackoverflow.com/questions/18215973/how-to-check-if-running-as-root-in-a-bash-script diff --git a/scripts/ctsetup.sh b/scripts/ctsetup.sh new file mode 100755 index 0000000..79a079e --- /dev/null +++ b/scripts/ctsetup.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env bash + +# klevstul + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# how to download this script (as root): +# +# cd /tmp +# wget https://gt.op.fo/fro/lnx-arch/raw/branch/master/scripts/ctsetup.sh +# cat ctsetup.sh # verify the downloaded script (IMPORTANT!) +# chmod 755 ctsetup.sh # make the script executable +# ./ctsetup.sh # run the script +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +echo "<< ctsetup.sh >>" + +if [ "$EUID" -ne 0 ] + then echo "error: run as 'root'" + exit +fi + +base_url=https://gt.op.fo/fro/lnx-arch/raw/branch/master +src_url=${base_url}/scripts/ct.sh +home_dir=/usr/local/bin + +mkdir -p ${home_dir} +wget -q ${src_url} -O ${home_dir}/ct.sh +chmod 755 ${home_dir}/ct.sh + +ln -s ${home_dir}/ct.sh /usr/local/bin/ct + +echo "a fresh copy of ct.sh is now located at '${home_dir}/ct.sh'" diff --git a/scripts/curae_setup.sh b/scripts/curae_setup.sh deleted file mode 100755 index 91656af..0000000 --- a/scripts/curae_setup.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env bash - -# klevstul - -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# how to download this script (as root): -# -# cd /tmp -# wget https://gt.op.fo/fro/lnx-arch/raw/branch/master/scripts/curae_setup.sh -# cat curae_setup.sh # verify the downloaded script (IMPORTANT!) -# chmod 755 curae_setup.sh # make the script executable -# ./curae_setup.sh # run the script -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -echo "<< curae_setup.sh >>" - -if [ "$EUID" -ne 0 ] - then echo "error: run as 'root'" - exit -fi - -base_url=https://gt.op.fo/fro/lnx-arch/raw/branch/master -src_url=${base_url}/scripts/curae.sh -home_dir=/usr/local/bin -this_file_name=fk-arc3 - -mkdir -p ${home_dir} -wget -q ${src_url} -O ${home_dir}/curae.sh -chmod 755 ${home_dir}/curae.sh - -ln -s ${home_dir}/curae.sh /usr/local/bin/curae - -echo "a fresh copy of curae.sh is now located at '${home_dir}/curae.sh'"