From 31e8c57d2b06a6b88d2919cda147d0c1dc20b206 Mon Sep 17 00:00:00 2001 From: ION606 Date: Thu, 26 Dec 2024 17:08:15 +0200 Subject: [PATCH] cosmetic fixes --- packages.txt | 2 + terminal/fish/conf.d/colors.fish | 2 +- terminal/fish/config.fish | 18 ++--- terminal/fish/functions/builtins.fish | 15 ++++ terminal/fish/functions/commands.fish | 108 ++++++++++++++++++++++++++ 5 files changed, 132 insertions(+), 13 deletions(-) create mode 100644 terminal/fish/functions/builtins.fish create mode 100644 terminal/fish/functions/commands.fish diff --git a/packages.txt b/packages.txt index 4a290d0..c4ef434 100644 --- a/packages.txt +++ b/packages.txt @@ -118,6 +118,7 @@ postgresql powertop-git prismlauncher pulseaudio-alsa +pv python-black python-certifi python-pip @@ -224,4 +225,5 @@ xorg-xev xorg-xhost xorg-xinit xorg-xlsclients +yay zip diff --git a/terminal/fish/conf.d/colors.fish b/terminal/fish/conf.d/colors.fish index cde6089..7c2f1d9 100644 --- a/terminal/fish/conf.d/colors.fish +++ b/terminal/fish/conf.d/colors.fish @@ -10,5 +10,5 @@ set -g fish_color_selection --background=#fdf6e3 --foreground=#073642 # Cream se set -g fish_color_search_match --background=#268bd2 --foreground=#ffffff # Blue search highlight set -g fish_color_operator '#859900' # Lime green set -g fish_color_escape '#d33682' # Pink -set -g fish_color_autosuggestion '#7DF9FF' # Pale aqua +set -g fish_color_autosuggestion '#B98A8F' # Dull pink set -g fish_color_end '#859900' # Lime green diff --git a/terminal/fish/config.fish b/terminal/fish/config.fish index b3c969e..ec1991f 100644 --- a/terminal/fish/config.fish +++ b/terminal/fish/config.fish @@ -1,19 +1,17 @@ -# Source global definitions (if necessary in fish) -if test -f /etc/bashrc - source /etc/bashrc +if test -f /home/ion606/.config/fish/completions/glow.fish + source /home/ion606/.config/fish/completions/glow.fish end if test -f /home/ion606/.config/fish/completions/glow.fish source /home/ion606/.config/fish/completions/glow.fish end -# Source global definitions (if necessary in fish) -if test -f /etc/bashrc - source /etc/bashrc +if test -f /home/ion606/.config/fish/functions/builtins.fish + source /home/ion606/.config/fish/functions/builtins.fish end -if test -f /home/ion606/.config/fish/completions/glow.fish - source /home/ion606/.config/fish/completions/glow.fish +if test -f /home/ion606/.config/fish/functions/commands.fish + source /home/ion606/.config/fish/functions/commands.fish end @@ -135,10 +133,6 @@ function updateDiscord end # Aliases -function submitty - bash /home/ion606/runsubmitty.sh -end - function showinfo bash /home/ion606/.customscripts/swaybackup/auto/shownotif.sh info $argv end diff --git a/terminal/fish/functions/builtins.fish b/terminal/fish/functions/builtins.fish new file mode 100644 index 0000000..fe56f33 --- /dev/null +++ b/terminal/fish/functions/builtins.fish @@ -0,0 +1,15 @@ +function animate_typing + set message $argv + echo -e $message | pv -qL 30 +end + + +function fish_greeting + toilet FIMSH! + # one for the display manager, one user one + if test (count (pgrep -x fish)) -eq 2 + animate_typing "\e[38;5;207m❥ Welcome to your Fish shell! \e[0m" + else + echo -e "\e[38;5;207m❥ Welcome to your Fish shell! \e[0m" + end +end diff --git a/terminal/fish/functions/commands.fish b/terminal/fish/functions/commands.fish new file mode 100644 index 0000000..059c3ce --- /dev/null +++ b/terminal/fish/functions/commands.fish @@ -0,0 +1,108 @@ +# Helper function to remove options from $argv +function remove_options + # Filter out arguments starting with '-' using string match + for arg in $argv + if not string match -q -- '-*' $arg + echo $arg + end + end +end + +# 'ls' wrapper +function ls_cute + echo "🌸 OWO what's this??? 🌸" + command ls $argv + echo "🌼 look at the stuffs! 🌼" +end +alias ls="ls_cute" + +# 'cd' wrapper +function cd_cute + echo "nyooming to $argv[1]! ✨" + builtin cd $argv +end +alias cd="cd_cute" + +# 'rm' wrapper +function rm_cute + echo "🗑️ oh nyo! Deleting $argv :<" + command rm $argv + + # echo "🗑️ oh nyo! Deleting $argv... Are you sure? 😿" + # read -p "type 'yes' to confirm: " confirm + # if test "$confirm" = "yes" + # command rm $argv + # echo "💔 $argv is gone... but you'll recover! qwq" + # else + # echo "😌 phew! nyo dedge :3 🌈" + # end +end +alias rm="rm_cute" + +# 'mkdir' wrapper +function mkdir_cute + echo "🏗️ building diwectowy $(remove_options $argv) uwu! 🏡" + command mkdir $argv + echo "✨ all done! $(remove_options $argv)[1] is ready for use. 🎉" +end +alias mkdir="mkdir_cute" + +# 'cp' wrapper +function cp_cute + set args (remove_options $argv) # Extract non-option arguments + echo "📂 copying $args[1] to $args[2]... Be careful with those precious files! 🛠️" + command cp $argv + echo "✨ yay! $args[1] has a shiny twin at $args[2]. 🌟" +end +alias cp="cp_cute" + +# 'mv' wrapper +function mv_cute + set args (remove_options $argv) # Extract non-option arguments + echo "🚚 moving $args[1] to $args[2] nyow... 🌈" + command mv $argv + echo "✨ done! $args[1] has found a new home at $args[2]. 🌟" +end +alias mv="mv_cute" + +# 'git' wrapper +function git_cute + echo -e "🐙 Git scawy qwq...but I'll twy to do \033[1;32mgit $argv\033[0m anyways!🌟" + command git $argv + echo "🎉 done! (phew) 🌠" +end +alias git="git_cute" + +# 'sudo' wrapper +function sudo_cute + echo "🥺 gib power pls, I pwomise I won't rm -rf / --no-preserve-root 🥺" + command sudo $argv + echo "✨ a-am big nyow! a-and scawy!!! ✨" +end +alias sudo="sudo_cute" + +# 'yay' wrapper +function yay_cute + echo "✨ Running yay with command: yay $argv" + command yay $argv + if test $status -ne 0 + echo "💔 aur naur! The command failed! 💔" + else + echo "🎉 YAY command completed! 🌟" + end +end +alias yay="yay_cute" + +# 'exit' wrapper +function exit_cute + echo "😢 qwq, you're leaving the shell... bai baiii! 👋" + builtin exit +end +alias exit="exit_cute" + +# 'clear' wrapper +function clear_cute + echo "🌈 Clearing the clutter UMU! ✨" + command clear +end +alias clear="clear_cute"