From e58f4341f8a7e0980c3685d617f759a9bebac51a Mon Sep 17 00:00:00 2001 From: Dilan Gilluly Date: Wed, 3 Dec 2025 21:25:16 -0500 Subject: [PATCH] Bash stuff --- .bashrc | 25 +++++++++++++++++++++++++ .config/dg-bash/aliases.sh | 5 +++++ .config/dg-bash/functions.sh | 20 ++++++++++++++++++++ make-links.sh | 6 ++++++ 4 files changed, 56 insertions(+) create mode 100644 .bashrc create mode 100644 .config/dg-bash/aliases.sh create mode 100644 .config/dg-bash/functions.sh diff --git a/.bashrc b/.bashrc new file mode 100644 index 0000000..07c4300 --- /dev/null +++ b/.bashrc @@ -0,0 +1,25 @@ +if [ -z "$PS1" ]; then + exit 0 +fi + +unset HISTFILE + +export PS1="\u@\h \W \$ " + +if [ -f ~/.config/dg-bash/aliases.sh ]; then + source ~/.config/dg-bash/aliases.sh +fi + +if [ -f ~/.config/dg-bash/functions.sh ]; then + source ~/.config/dg-bash/functions.sh +fi + +if [ -x "$(command -v fastfetch)" ]; then + if [ -f ~/.config/fastfetch/minimal.jsonc ]; then + fastfetch -c ~/.config/fastfetch/minimal.jsonc + else + fastfetch + fi +fi + +echo -e "\nShall we play a game?" diff --git a/.config/dg-bash/aliases.sh b/.config/dg-bash/aliases.sh new file mode 100644 index 0000000..83f2765 --- /dev/null +++ b/.config/dg-bash/aliases.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +alias c="clear" +alias pbcopy="xsel -i -b" +alias pbpaste="xsel -o -b" diff --git a/.config/dg-bash/functions.sh b/.config/dg-bash/functions.sh new file mode 100644 index 0000000..f9d18f0 --- /dev/null +++ b/.config/dg-bash/functions.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +function cv() { + mkdir -p ~/python-venv + python -m venv "~/python-venv/$1" + source "~/python-venv/$1/bin/activate" +} + +function av() { + if [ -d "~/python-venv/$1" ]; then + source "~/python-venv/$1/bin/activate" + else + echo "Error: Venv does not exist" + fi +} + +function mkcd() { + mkdir -p $1 + cd $1 +} diff --git a/make-links.sh b/make-links.sh index 443db9a..63f596b 100755 --- a/make-links.sh +++ b/make-links.sh @@ -46,3 +46,9 @@ echo "Making links for shell" ln -sf $PWD/.config/.dg-shell.zsh ~/.config/.dg-shell.zsh ln -sf $PWD/.zshrc ~/.zshrc echo "Shell links... Done." + +# Link for dg-bash +echo "Making Links for bash" +ln -sf $PWD/.config/dg-bash ~/.config/dg-bash +ln -sf $PWD/.bashrc ~/.bashrc +echo "Bash links... Done."