/ .bashrc cleanup

This commit is contained in:
committer@tuxwarrior
2025-04-12 11:49:58 -05:00
parent 759f1ccf33
commit 2154224899
2 changed files with 90 additions and 60 deletions

View File

@@ -1,10 +1,28 @@
#
# ~/.bashrc
# ~/.bashrc :: by frode klevstul
#
# ---
# special stuff
# ---
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
# https://github.com/gsamokovarov/jump
eval "$(jump shell --bind=j)"
# ---
# environment variables
# ---
# see `dots/environment/environment`
# ---
# miscellaneous aliases
# ---
alias azurevpnclient="/opt/microsoft/microsoft-azurevpnclient/microsoft-azurevpnclient"
alias ct="sudo ct"
@@ -29,6 +47,10 @@ alias tp="tp.sh"
#alias nr="nitrogen --restore"
# ---
# terminal
# ---
# x terminal shell start string | https://askubuntu.com/questions/1340319/ps1-string-full-documentation-and-reference-page
PS1='[\u@\h \W]\$ '
@@ -42,33 +64,29 @@ case ${TERM} in
;;
esac
# https://github.com/gsamokovarov/jump
eval "$(jump shell --bind=j)"
# # ex - archive extractor
# # usage: ex <file>
ex ()
{
if [ -f $1 ] ; then
case $1 in
*.tar.bz2) tar xjf $1 ;;
*.tar.gz) tar xzf $1 ;;
*.bz2) bunzip2 $1 ;;
*.rar) unrar x $1 ;;
*.gz) gunzip $1 ;;
*.tar) tar xf $1 ;;
*.tbz2) tar xjf $1 ;;
*.tgz) tar xzf $1 ;;
*.zip) unzip $1 ;;
*.Z) uncompress $1;;
*.7z) 7z x $1 ;;
*) echo "'$1' cannot be extracted via ex()" ;;
esac
else
echo "'$1' is not a valid file"
fi
# ---
# networking
# ---
nmrestart() {
systemctl restart NetworkManager
systemctl status NetworkManager
}
# ---
# screens / displays / power management
# ---
# https://en.wikipedia.org/wiki/List_of_common_resolutions
# DP-2 is laptop display
#alias res-low="xrandr --output DP-2 --size 1920x1080"
#alias res-med="xrandr --output DP-2 --size 2560x1440"
#alias res-high="xrandr --output DP-2 --size 3840x2160"
alias res-low="xrandr -s 1920x1080"
alias res-med="xrandr -s 2560x1440"
alias res-high="xrandr -s 3840x2160"
monitor() {
cmd="info"
if [[ -n $1 ]]; then
@@ -93,11 +111,6 @@ monitor() {
fi
}
nmrestart() {
systemctl restart NetworkManager
systemctl status NetworkManager
}
screensaver() {
cmd="info"
if [[ -n $1 ]]; then
@@ -177,8 +190,9 @@ rshift() {
redshift -P -O ${temperature}
}
# ---
# sys stuff
# mounting
# ---
alias nas-mount="sudo systemctl start mnt-nas.mount"
alias nas-unmount="sudo systemctl stop mnt-nas.mount"
@@ -186,9 +200,7 @@ alias nas-mount-2="sudo mount -v -t cifs //192.168.1.222/fro /mnt/nas -o credent
alias nas-unmount-2="sudo umount /mnt/nas"
nas() {
if [[ -n $1 ]] ; then
if [[ $1 == "umount" ]] || [[ $1 == "unmount" ]] ; then
echo "umount /mnt/nas"
sudo umount /mnt/nas
@@ -199,32 +211,22 @@ nas() {
else
echo "missing the ip when doing a mount? or, just trying a weird command? try: 'nas {mount,umount} {ip?}'"
fi
else
echo "sry, bud! try: 'nas {mount,umount} {ip?}'"
fi
}
# iso-mount() {
# sudo mount -o loop "$1" /media/iso
# }
# alias iso-unmount="sudo umount /media/iso"
#
# https://en.wikipedia.org/wiki/List_of_common_resolutions
# DP-2 is laptop display
alias res-low="xrandr --output DP-2 --size 1920x1080"
alias res-med="xrandr --output DP-2 --size 2560x1440"
alias res-high="xrandr --output DP-2 --size 3840x2160"
# # ---
# # misc
# # ---
# ---
# multimedia
# ---
# downstream() {
# output="output.mp4"
# # https://stackoverflow.com/questions/3601515/how-to-check-if-a-variable-is-set-in-bash
@@ -235,17 +237,6 @@ alias res-high="xrandr --output DP-2 --size 3840x2160"
# }
alias videoCompressor="/home/poq/syncDir/gitRepos/gt.op.fo/miniProjects/2104_videoCompressor/src/vc_v2.sh"
# alias videoWatermark="/home/poq/syncDir/gitRepos/gt.op.fo/miniProjects/2104_videoCompressor/src/vcwm_v1.sh"
# alias webserver-start="/home/poq/syncDir/gitRepos/gt.op.fo/localWebServer/sh/startWebserver.sh"
# gpx2jon() {
# cd /home/poq/syncDir/gitRepos/gt.op.fo/gpx2jon/src
# source venv/bin/activate
# python archi.py -s /home/poq/syncDir/gitRepos/gt.op.fo/fiodb/db/gpx2jon/sites
# deactivate
# }
# gpx2jon-with-build-all() {
# gpx2jon
# frodr.com-build-all
# }
alias notesArchiver='/home/poq/syncDir/gitRepos/gt.op.fo/miniProjects/2306_notesArchiver/notesArchiver.sh'
alias toJpg='/home/poq/syncDir/gitRepos/gt.op.fo/miniProjects/2306_toJpg/toJpg.sh'
alias gpxImporter='python /home/poq/syncDir/gitRepos/gt.op.fo/miniProjects/2308_gpxImporter/importer.py'
@@ -259,6 +250,7 @@ pdfCompressor() {
-dNOPAUSE -dQUIET -dBATCH -sOutputFile=$1.compressed.pdf $1
}
# ---
# ajp related
# ---
@@ -295,6 +287,7 @@ podigy() {
# jump-to-downloads
#}
# ---
# jeton
# ---
@@ -319,17 +312,31 @@ jeton() {
# rsync -v -a --progress --stats -e 'ssh -p 1808' trunk@135.181.193.110:/home/trunk/.ssh/ /home/poq/syncDir/gitRepos/gt.op.fo/srv.guru/trunk/.ssh/
# }
# ---
# misc websites
# ---
alias 00101111.xyz-deploy="rsync -v -a --progress --stats --delete-delay -e 'ssh -p 1808' /home/poq/syncDir/gitRepos/gt.op.fo/00101111.xyz/www/ trunk@167.235.77.26:/var/www/00101111.xyz/"
alias op.fo-deploy="rsync -v -a --progress --stats --delete-delay -e 'ssh -p 1808' /home/poq/syncDir/gitRepos/gt.op.fo/op.fo/www/ trunk@167.235.77.26:/var/www/op.fo/"
# gpx2jon() {
# cd /home/poq/syncDir/gitRepos/gt.op.fo/gpx2jon/src
# source venv/bin/activate
# python archi.py -s /home/poq/syncDir/gitRepos/gt.op.fo/fiodb/db/gpx2jon/sites
# deactivate
# }
# gpx2jon-with-build-all() {
# gpx2jon
# frodr.com-build-all
# }
# # ---
# # pusterom.com
# # ---
# alias pusterom.com-themeUpd="rsync -v -a --progress --stats --delete-delay -e 'ssh -p 22' /home/poq/syncDir/gitRepos/gt.op.fo/pusterom-hht/src/Pusterom/ root@209.38.217.93:/var/www/humhub/themes/Pusterom/"
# ---
# jongleur
# ---
@@ -476,5 +483,3 @@ christcast.org-build-all() {
jump-to-downloads
}
alias christcast.org-deploy="rsync -v -a --progress --stats --delete-delay -e 'ssh -p 1808' /home/poq/syncDir/gitRepos/gt.op.fo/christcast.org/jongleur/html_export/ trunk@167.235.77.26:/var/www/christcast.org/jongleur/"
#export PATH=$PATH:/home/poq/.cargo/bin