dotfiles

regexghost dotfiles and scripts
git clone https://git.regexghost.com/dotfiles.git
Log | Files | Refs | README

commit a9f11b59a1f6c3b8cfe642fc85926deeb9b3dd0b
parent 18cadcc499fbe3762ffb4134c6f833b6b23e6b07
Author: regexghost <dev@regexghost.com>
Date:   Tue,  2 Jun 2026 18:40:36 +0100

removed trim_history, nano tweaks

Diffstat:
Mdotfiles/.bashrc | 24+-----------------------
Mdotfiles/.config/nano/nanorc | 2+-
Mterminal-scripts/backup.sh | 6+++---
Mterminal-scripts/qmount.sh | 17++++++++++++++---
4 files changed, 19 insertions(+), 30 deletions(-)

diff --git a/dotfiles/.bashrc b/dotfiles/.bashrc @@ -17,28 +17,6 @@ fi # Add my directory_bookmarks program to the prompt when relevant PS1='\[\033[1;30m\]\u\[\033[1;31m\]@\[\033[1;32m\]\h:\[\033[1;35m\]\w\[\033[1;34m\]$(directory_bookmarks current)\[\033[1;31m\]\$\[\033[0m\] ' -## Function to remove things which aren't useful from bash history -trim_history () { - sed -i -r '/^(history|hs|qalc|vis|cava|nethogs|btop|htop|gitl|gitd|gits|x|rm|cd|c|exit|lsa|ls|l|q)$/d' ~/.bash_history - # Remove any usage of fasd z autojump command - sed -i '/^z .*/d' ~/.bash_history - sed -i '/^zz .*/d' ~/.bash_history - # Remove any usage of rm command - sed -i '/^rm .*/d' ~/.bash_history - sed -i '/^youtube .*/d' ~/.bash_history - sed -i '/^to .*/d' ~/.bash_history - - # Remove any usage of cd, ls and mpv when only going one folder deeper in file structure - sed -i -r '/^(cd|ls|mpv|mpv) [^\/\>\<|:&]*\/? ?$/d' ~/.bash_history - # Remove any usage of m, rs and pdf when not going into a different folder - sed -i -r '/^(m|rs|pdf) [^\/\>\<|:&]* ?$/d' ~/.bash_history - # Remove anything in all caps, as it will basically always be a mistype - sed -i '/^[A-Z0-9 ]*$/d' ~/.bash_history - # Remove all duplicates, keeping most recent - tac ~/.bash_history | awk '!x[$0]++' | tac > ~/.bash_history_no_dupes && command mv ~/.bash_history_no_dupes ~/.bash_history - #sed --in-place 's/[[:space:]]\+$//' .bash_history && awk -i inplace '!seen[$0]++' .bash_history -} - # Basic Aliases alias grep='grep -i --color=auto' alias greps='/usr/bin/grep --color=auto' # Case sensitive @@ -96,7 +74,7 @@ alias rmedir='find . -type d -empty -delete' alias balance='aacgain -r -m 1 *.m4a' alias vol='pactl get-sink-volume @DEFAULT_SINK@ | head -n 1 | cut -d "/" -f 2 | sed "s/ //g"' alias clearlogs='sudo journalctl --vacuum-time=2d' -alias q='trim_history && exit' +alias q='exit' alias reload='. ~/.bashrc' alias pong='ping -c 2 -W 2' alias wp='feh --bg-fill --no-fehbg ~/.config/regexghost/wallpaper.jpg' diff --git a/dotfiles/.config/nano/nanorc b/dotfiles/.config/nano/nanorc @@ -25,7 +25,7 @@ set numbercolor lightblack bind ^H chopwordleft main bind ^Q exit all -bind ^W suspend main +bind ^I suspend main bind ^S savefile main bind ^F whereis all bind ^G findnext all diff --git a/terminal-scripts/backup.sh b/terminal-scripts/backup.sh @@ -3,7 +3,7 @@ # Backup script BACKUP_FILE="$XDG_CONFIG_HOME/regexghost/backup.txt" -BACKUP_LOCATION="$HOME/Downloads/BackupMount" +BACKUP_LOCATION="$HOME/Downloads/BackupMount/MainBackup" if [ "$1" = "add" ]; then [ -e "$2" ] && echo "$2" | sed "s|$HOME||g" >> "$BACKUP_FILE" @@ -16,6 +16,6 @@ elif [ "$1" = "remove" ] || [ "$1" = "rm" ]; then elif [ "$1" = "ls" ]; then cat "$BACKUP_FILE" | sed 's/^/~/g' elif [ "$1" = "make" ]; then - rsync -arv --delete --info=progress2 "${BACKUP_LOCATION}/latest/" "${BACKUP_LOCATION}/previous/" - rsync -arv --delete --info=progress2 --files-from="${BACKUP_FILE}" "$HOME" "${BACKUP_LOCATION}/latest/" + rsync -ar --delete --info=progress2 "${BACKUP_LOCATION}/latest/" "${BACKUP_LOCATION}/previous/" + rsync -ar --delete --info=progress2 --files-from="${BACKUP_FILE}" "$HOME" "${BACKUP_LOCATION}/latest/" fi diff --git a/terminal-scripts/qmount.sh b/terminal-scripts/qmount.sh @@ -4,7 +4,7 @@ mount_points="~/Downloads/USBDrive ~/Downloads/BackupMount" root_device="$(/usr/bin/lsblk -l -n --output NAME,MOUNTPOINTS | grep '/$' | sed 's/p[0-9] \///g; s/[0-9] \///g')" -if [ "$1" = "mount" ]; then +mount () { unmounted="$(/usr/bin/lsblk -l -n --output NAME,FSTYPE,SIZE,MOUNTPOINTS,TYPE | grep "part" | grep -v "/" | grep -v "$root_device" | tr -s " " | cut -d " " -f 1-3)" chosen_partition="$(echo "$unmounted" | fzf | cut -d " " -f 1)" @@ -13,9 +13,20 @@ if [ "$1" = "mount" ]; then [ "$chosen_mount_point" = "" ] && exit sudo mount "/dev/${chosen_partition}" "$chosen_mount_point" && notify-send "Mounted Successfully" || notify-send "Mount Failed" -elif [ "$1" = "unmount" ] || [ "$1" = "umount" ]; then +} + +unmount () { mounted="$(/usr/bin/lsblk -l -n --output NAME,MOUNTPOINTS | grep "/" | grep -v "$root_device" | tr -s " ")" chosen_path="$(echo "$mounted" | fzf | cut -d " " -f 2-)" [ "$chosen_path" = "" ] && exit sudo umount "$chosen_path" && notify-send "Unmounted Successfully" || notify-send "Unmounting Failed" -fi +} + +case "$1" in + m*) + mount + ;; + u*) + unmount + ;; +esac