fixed a lot of stuff

This commit is contained in:
Honney
2026-06-23 00:23:16 +02:00
parent 74f4b9b1be
commit 6591f6b020
24 changed files with 626 additions and 455 deletions
+3 -9
View File
@@ -3,17 +3,11 @@
# Fixing some Programs that do not know Kitty or Alacritty
# Check if the local terminal supports color (kitty, alacritty, etc.)
if test "$TERM" = "xterm-kitty" -o "$TERM" = "alacritty"
# If we're in a non-standard terminal, force TERM=xterm-256color for SSH
alias ssh 'env TERM=xterm-256color ssh'
if test "$TERM" = "xterm-kitty"; or test "$TERM" = "alacritty"
alias ssh='env TERM=xterm-256color ssh'
end
if test -f $HOME/.config/fish/alias.fish
source $HOME/.config/fish/alias.fish
end
if test -e /usr/bin/zoxide
eval (zoxide init fish)
if command -q zoxide
zoxide init fish | source
alias cd='z'
end
+212 -189
View File
@@ -2,223 +2,259 @@
# In ~/.config/fish/configs/alias_useful.fish
#
################# STUFF YOU HAVE INSTALLED #####################################
################ COMMON ALIASES ################################################
alias remount='sudo mount -a'
alias mount_config='sudo nano /etc/fstab'
alias force_delete='sudo rm -rf' # Delete Folder/Files with included Folder/Files
alias own='sudo chown -R "$USER":"$USER" themes'
alias own='sudo chown -R "$USER":"$USER"'
alias right='sudo chmod -R 755'
alias reload='clear && omf reload'
alias fish_config='nano $HOME/.config/fish/config.fish'
alias ip='ip -color'
alias psmem='ps auxf | sort -nr -k 4'
alias psmem10='ps auxf | sort -nr -k 4 | head -10'
alias jctl='journalctl -p 3 -xb'
alias ...='cd ../..'
alias ....='cd ../../..'
alias .....='cd ../../../..'
alias ......='cd ../../../../..'
alias dir='dir --color=auto'
alias vdir='vdir --color=auto'
alias tarnow='tar -acf'
alias untar='tar -zxvf'
alias fish_config='nano $HOME/.config/fish/config.fish' # Open the fish Config in Text editor
alias ip 'ip -color'
alias psmem 'ps auxf | sort -nr -k 4'
alias psmem10 'ps auxf | sort -nr -k 4 | head -10'
alias jctl 'journalctl -p 3 -xb'
# Common use
alias ... 'cd ../..'
alias .... 'cd ../../..'
alias ..... 'cd ../../../..'
alias ...... 'cd ../../../../..'
alias dir 'dir --color=auto'
alias vdir 'vdir --color=auto'
alias tarnow 'tar -acf '
alias untar 'tar -zxvf '
################# HELPER #####################################################
################ HELPERS ######################################################
function help_pdf
echo "Best Tool to combine pdf: PDF Arranger"
echo "Best Tool for OCR: OCRMYPDF but you need to install the teseracts for your languages"
echo "Best Tool for OCR: OCRMYPDF but you need to install the tesseracts for your languages"
echo "Best Tool to write in PDFs: XOURNAL++"
end
################# STUFF YOU MAY NOT HAVE #####################################
if test -e /usr/bin/rsync
function rcp
if test (count $argv) -lt 2
echo "Usage: rcp SOURCE... DESTINATION"
return 1
end
rsync -avh --progress $argv
end
function rmv
if test (count $argv) -lt 2
echo "Usage: rmv SOURCE... DESTINATION"
return 1
end
rsync -avh --progress --remove-source-files $argv
end
else
function rcp
echo "'rsync' is not installed. Install it via your package manager."
end
function rmv
echo "'rsync' is not installed. Install it via your package manager."
end
end
if test -e /usr/bin/nano
function nanorm
if test (count $argv) -lt 1
echo "Usage: nanorm {FILE}"
return 1
end
nano $argv[1]
end
else
function nanorm
echo "'nano' is not installed. Install it via your package manager."
end
end
function source --description "Source files with auto-detection (replaces builtin source)"
if test (count $argv) -eq 0
builtin source
return
end
set file $argv[1]
set -e argv[1]
if string match -q -- "--*" $file
builtin source $file $argv
return
end
if not test -f "$file"
echo "source: No such file: '$file'" >&2
return 1
end
if string match -q "*.bash" -- $file
if command -q bass
bass source $file $argv
else
echo "source: 'bass' is not installed. Install it to source .bash files." >&2
return 1
end
else
builtin source $file $argv
end
end
################ TERMINAL-SPECIFIC ############################################
if test "$TERM" = "xterm-kitty"
alias icat='kitty +kitten icat'
end
################ PYTHON #######################################################
if test -e /usr/bin/python3
alias python='python3'
alias py='python3'
end
# Easier Ollama Commands
if test -e /usr/bin/ollama
alias llama_start='ollama serve' # Start the LLama server
alias llama3='ollama run llama3' # Start the LLama Chat
end
if test -e /usr/bin/btop
alias tasks='btop'
end
if test -e /usr/bin/mpv
alias uni_play='mpv --vo=tct' # Plays a video in terminal with Unicode
alias asci_play='mpv --vo=caca' # Plays a video in terminal with ASCII
else
for cmd in uni_play asci_play
function $cmd
echo "You need to install mpv Inorder to use these commands: https://github.com/mpv-player/mpv"
if test -e /usr/bin/python3
function mkvenv
if not python3 -c "import venv" ^/dev/null
echo "Python3 'venv' module is not available. Install python3-venv via your package manager."
return 1
end
if test (count $argv) -lt 1
echo "Usage: mkvenv {folder name}"
return 1
end
python3 -m venv $argv[1]
if test -f $argv[1]/bin/activate.fish
source $argv[1]/bin/activate.fish
else
echo "Error: Could not find activate.fish in $argv[1]/bin/"
return 1
end
end
end
function mkvenv
if not type -q python3
else
function mkvenv
echo "Python3 is not installed. Please install Python3 to use mkvenv."
return 1
end
if not python3 -c "import venv" ^/dev/null
echo "Python3 'venv' module is not available. Please install it (e.g., 'python3-venv' on Debian/Ubuntu)."
return 1
end
if test (count $argv) -lt 1
echo "Usage: mkvenv {folder name}"
return 1
end
python3 -m venv $argv[1]
if test -f $argv[1]/bin/activate.fish
source $argv[1]/bin/activate.fish
else
echo "Error: Could not find activate.fish in $argv[1]/bin/"
return 1
end
end
function src
# Check if venv directory exists
if not test -d .venv
echo "Cannot activate: .venv directory does not exist."
if test -e /usr/bin/python3
function src
if not test -d .venv
echo "Cannot activate: .venv directory does not exist."
return 1
end
if not test -d .venv/bin
echo "Cannot activate: .venv/bin directory does not exist."
return 1
end
if test -f .venv/bin/activate.fish
source .venv/bin/activate.fish
return 0
end
if test -f .venv/bin/activate.bash
if test -e /usr/bin/bass
bass source .venv/bin/activate.bash
return 0
else
echo "'bass' is not installed. Install it via your package manager to source bash scripts."
return 1
end
end
echo "No usable activation script found in .venv/bin/"
return 1
end
if not test -d .venv/bin
echo "Cannot activate: .venv/bin directory does not exist."
return 1
end
# Prefer Fish activation script
if test -f .venv/bin/activate.fish
source .venv/bin/activate.fish
return 0
end
# Fallback to bash activation via bass
if test -f .venv/bin/activate.bash
bass source .venv/bin/activate.bash
return 0
end
echo "No usable activation script found in .venv/bin/"
return 1
end
# Check if eza exists in either location
if test -x /usr/bin/eza -o -x $HOME/.cargo/bin/eza
function ls
command eza -a --color=always --group-directories-first --icons $argv # Just more beautiful
end
function lr
command eza -al --color=always --group-directories-first --icons $argv # With rights and Owner
end
function ll
command eza -l --color=always --group-directories-first --icons $argv # Hidden Stuff is hidden
end
function lt
command eza -aT --color=always --group-directories-first --icons $argv # Tree View may take some time
end
function l.
command eza -ald --color=always --group-directories-first --icons .* $argv # Only Hidden Stuff
end
function lf
command eza -aD --color=always --group-directories-first --icons $argv # Only Folder
end
else
# Define dummy functions that remind user to install eza
function src
echo "Python3 is not installed. Please install Python3 to use src."
end
end
################ OLLAMA ######################################################
if test -e /usr/bin/ollama
alias llama_start='ollama serve'
alias llama3='ollama run llama3'
end
################ EZA ##########################################################
if test -x /usr/bin/eza
function ls
command eza -a --color=always --group-directories-first --icons $argv
end
function lr
command eza -al --color=always --group-directories-first --icons $argv
end
function ll
command eza -l --color=always --group-directories-first --icons $argv
end
function lt
command eza -aT --color=always --group-directories-first --icons $argv
end
function l.
command eza -ald --color=always --group-directories-first --icons .* $argv
end
function lf
command eza -aD --color=always --group-directories-first --icons $argv
end
else
for cmd in lr ll lt l. lf
function $cmd
function $cmd --inherit-variable cmd
echo "The command 'eza' is not installed. Please install 'eza' to use this: https://github.com/eza-community/eza"
end
end
end
if test -e /usr/bin/ugrep
alias grep 'ugrep --color=auto'
alias egrep 'ugrep -E --color=auto'
alias fgrep 'ugrep -F --color=auto'
################ BTOP #########################################################
if test -e /usr/bin/btop
alias tasks='btop'
end
################ MPV ##########################################################
if test -e /usr/bin/mpv
alias uni_play='mpv --vo=tct'
alias asci_play='mpv --vo=caca'
else
for cmd in egrep fgrep
function $cmd
echo "The command 'ugrep' is not installed. Please install 'ugrep' to use this: https://github.com/Genivia/ugrep"
for cmd in uni_play asci_play
function $cmd --inherit-variable cmd
echo "The command 'mpv' is not installed. Please install mpv to use this: https://github.com/mpv-player/mpv"
end
end
end
if test -e /usr/bin/wget
alias wget 'wget -c '
################ GREP #########################################################
if test -e /usr/bin/ugrep
alias grep='ugrep --color=auto'
alias egrep='ugrep -E --color=auto'
alias fgrep='ugrep -F --color=auto'
else
alias egrep='grep -E'
alias fgrep='grep -F'
end
################ WGET #########################################################
if test -e /usr/bin/wget
alias wget='wget -c'
end
################ OCRMYPDF #####################################################
if test -e /usr/bin/ocrmypdf
alias ocrmypdf 'ocrmypdf --deskew --clean --rotate-pages'
alias ocrmypdf='ocrmypdf --deskew --clean --rotate-pages'
else
alias ocrmypdf 'echo "The command 'ocrmypdf' is not installed. Please install 'ocrmypdf' to use this: https://github.com/ocrmypdf/OCRmyPDF"'
end
function rcp
if test (count $argv) -lt 2
echo "Usage: rcp SOURCE... DESTINATION"
return 1
function ocrmypdf
echo "The command 'ocrmypdf' is not installed. Install it via your package manager: https://github.com/ocrmypdf/OCRmyPDF"
end
rsync -avh --progress $argv
end
function rmv
if test (count $argv) -lt 2
echo "Usage: rmv SOURCE... DESTINATION"
return 1
end
rsync -avh --progress --remove-source-files $arg
end
################ YAZI #########################################################
function nanorm
if test (count $argv) -lt 1
echo "Usage: nanorm {FILE}"
return 1
end
set arg $argv[1]
if test -f $arg
rm $arg
end
nano $arg
end
if test -e /usr/bin/reflector
alias mirror='sudo reflector -f 30 -l 30 --number 10 --verbose --save /etc/pacman.d/mirrorlist'
alias mirrora='sudo reflector --latest 50 --number 20 --sort age --save /etc/pacman.d/mirrorlist'
alias mirrord='sudo reflector --latest 50 --number 20 --sort delay --save /etc/pacman.d/mirrorlist'
alias mirrors='sudo reflector --latest 50 --number 20 --sort score --save /etc/pacman.d/mirrorlist'
end
if test -e $HOME/.config/sway/config
alias sway_config='nano $HOME/.config/sway/config' # Open the fish Config in Text editor
end
if test -e /usr/bin/yazi -o -e /usr/local/bin/yazi
if test -e /usr/bin/yazi
function y
set tmp (mktemp -t "yazi-cwd.XXXXXX")
yazi $argv --cwd-file="$tmp"
@@ -228,15 +264,21 @@ if test -e /usr/bin/yazi -o -e /usr/local/bin/yazi
rm -f -- "$tmp"
end
else
function yazi
echo "The command 'yazi' is not installed. Please install 'yazi' to use this: https://github.com/sxyazi/yazi"
for cmd in yazi y
function $cmd --inherit-variable cmd
echo "The command 'yazi' is not installed. Please install 'yazi' to use this: https://github.com/sxyazi/yazi"
end
end
end
################ SUDO #########################################################
if test -e /usr/bin/sudo-rs
alias sudo=sudo-rs
end
################ FLASH ISO ####################################################
if test -e /usr/bin/dd
function flashiso --description "Flash an ISO to a target drive with dd"
if test (count $argv) -ne 2
@@ -244,25 +286,6 @@ if test -e /usr/bin/dd
echo "Example: flashiso ubuntu-25.10-desktop-amd64.iso /dev/sdb"
return 1
end
set iso $argv[1]
set drive $argv[2]
sudo dd if=$iso of=$drive bs=4M status=progress oflag=sync
end
end
#### SOURCE of bash
function smart_source
set file $argv[1]
if string match -q "*.bash" -- $file
bass source $file
else if string match -q "*.fish" -- $file
builtin source $file
else
# fallback: try fish source by default
builtin source $file
sudo dd if=$argv[1] of=$argv[2] bs=4M status=progress oflag=sync
end
end
+48 -32
View File
@@ -4,13 +4,6 @@
source $HOME/.config/fish/configs/uni.fish
alias git_update='$HOME/.config/fish/scripts/git-update.sh'
alias mount_all='$HOME/.config/fish/scripts/mount.sh'
alias umount_all='$HOME/.config/fish/scripts/umount.sh'
alias print_cam='ssh honney@192.168.1.184'
function updateall
# Get current Discord version (if installed)
if pacman -Q discord >/dev/null 2>&1
@@ -35,11 +28,15 @@ function updateall
set discord_version_after ""
end
# Compare versions
# Compare discord versions
if test "$discord_version_before" != "$discord_version_after"
echo "Discord version changed: $discord_version_before -> $discord_version_after"
echo "Running extra command..."
sh -c "$(curl -sS https://raw.githubusercontent.com/Vendicated/VencordInstaller/main/install.sh)"
if test -e /usr/bin/curl
echo "Running Vencord installer..."
sh -c "$(curl -sS https://raw.githubusercontent.com/Vendicated/VencordInstaller/main/install.sh)"
else
echo "'curl' is not installed. Install it to update Discord plugins."
end
end
if test -e /usr/bin/flatpak
@@ -57,9 +54,9 @@ function updateall
set kernel_version_after ""
end
if test "$kernel_version_before" != "$kernel_version_after"
echo "Discord version changed: $kernel_version_before -> $kernel_version_after"
echo "Kernel changed: $kernel_version_before -> $kernel_version_after"
echo -n "Reboot now? [y/N]: "
read answer
if test "$answer" = "y" -o "$answer" = "Y"
@@ -70,30 +67,49 @@ function updateall
end
end
alias fixpacman='sudo rm /var/lib/pacman/db.lck'
alias gitpkg='pacman -Q | grep -i "\-git" | wc -l' # List amount of -git packages
alias fixpacman='sudo rm -f /var/lib/pacman/db.lck'
if test -e /usr/bin/expac
alias rip 'expac --timefmt="%Y-%m-%d %T" "%l\t%n %v" | sort | tail -200 | nl'
alias big='expac -H M "%m\t%n" | sort -h | nl' # Sort installed packages according to size in MB (expac must be installed)
alias rip='expac --timefmt="%Y-%m-%d %T" "%l\t%n %v" | sort | tail -200 | nl'
alias big='expac -H M "%m\t%n" | sort -h | nl'
else
alias rip="echo 'expac is not installed. Install it to list last deinstalled packages.'"
alias big="echo 'expac is not installed. Install it to list biggest packages.'"
end
function cleanup
while pacman -Qdtq
sudo pacman -R (pacman -Qdtq)
while pacman -Qdtq >/dev/null 2>&1
set orphans (pacman -Qdtq 2>/dev/null)
if test -z "$orphans"
break
end
sudo pacman -R $orphans
end
echo "No more orphaned packages."
end
if test -x $HOME/.local/python-3.11.9/bin/python3.11
alias py311="$HOME/.local/python-3.11.9/bin/python3.11"
end
if test -e /usr/bin/tmux
function quickshell-reload
if test -e /usr/bin/quickshell
tmux kill-session -t qs 2>/dev/null
tmux new-session -d -s qs 'quickshell'
else
echo "'quickshell' is not installed. Install it via your package manager."
end
end
else
function quickshell-reload
echo "'tmux' is not installed. Install it via your package manager."
end
end
set -x XCURSOR_THEME "DJ-FOX-C"
set -x XCURSOR_SIZE 24
alias py311="$HOME/.local/python-3.11.9/bin/python3.11"
function quickshell-reload
if test -e /usr/bin/quickshell
tmux kill-session -t qs
tmux new-session -d -s qs 'quickshell'
else
echo "quickshell not installed"
end
end
if test -e /usr/bin/reflector
alias mirror='sudo reflector -f 30 -l 30 --number 10 --verbose --save /etc/pacman.d/mirrorlist'
alias mirrora='sudo reflector --latest 50 --number 20 --sort age --save /etc/pacman.d/mirrorlist'
alias mirrord='sudo reflector --latest 50 --number 20 --sort delay --save /etc/pacman.d/mirrorlist'
alias mirrors='sudo reflector --latest 50 --number 20 --sort score --save /etc/pacman.d/mirrorlist'
end
+1 -1
View File
@@ -3,5 +3,5 @@
#
if test -d $HOME/.bin
set -U fish_user_paths $HOME/.bin $fish_user_paths
fish_add_path $HOME/.bin
end
+6 -2
View File
@@ -5,6 +5,10 @@
alias updateall='sudo dnf upgrade --refresh && flatpak update'
if test -e $HOME/.cargo/bin/eza
set -gx PATH $HOME/.cargo/bin $PATH $PATH
if test -x $HOME/.cargo/bin/eza
fish_add_path $HOME/.cargo/bin
end
if test -f $HOME/.config/fish/configs/uni.fish
source $HOME/.config/fish/configs/uni.fish
end
+5 -42
View File
@@ -1,46 +1,9 @@
# Load pywal colors (extract from ~/.cache/wal/colors.json)
if test -e $HOME/.cache/wal/colors.json1
set -g theme_0 (jq -r '.colors.color0' ~/.cache/wal/colors.json) # Primary color
set -g theme_1 (jq -r '.colors.color1' ~/.cache/wal/colors.json) # Secondary color (e.g., for git, @)
set -g theme_2 (jq -r '.colors.color2' ~/.cache/wal/colors.json) # Third color (e.g., for hostname)
set -g background_color (jq -r '.special.background' ~/.cache/wal/colors.json) # Background color
set -g foreground_color (jq -r '.special.foreground' ~/.cache/wal/colors.json) # Foreground color
else
set -g background_color "#1e1e2e" # Dark slate
set -g foreground_color "#cdd6f4" # Soft white/light gray
# Primary and accent colors
set -g theme_0 "#a6e3a1" # Green - success, directories
set -g theme_1 "#f38ba8" # Red - errors, git changes
set -g theme_2 "#89b4fa" # Blue - hostnames, info
# Extra accent colors
set -g theme_3 "#f9e2af" # Yellow - warnings
set -g theme_4 "#cba6f7" # Magenta - user prompts
set -g theme_5 "#94e2d5" # Cyan - secondary info
# load matugen-generated colors
if test -f $HOME/.config/fish/configs/colors.fish
source $HOME/.config/fish/configs/colors.fish
end
# BOBTHEFISH COLORING: Apply pywal colors to the bobthefish theme
# Username Color
set -g theme_username_color $theme_0
# Hostname Color
set -g theme_hostname_color $theme_2
# Git prompt color
set -g theme_git_branch_color $theme_1
set -g theme_git_dirty_color $theme_1
set -g theme_git_staged_color $theme_2
# Current directory color
set -g theme_pwd_color $theme_0
# Set background and foreground based on pywal theme
set -g theme_background_color $background_color
set -g theme_foreground_color $foreground_color
# Retain all existing theme settings (don't overwrite the options you have)
# Bobthefish display settings
set -g theme_display_git yes
set -g theme_display_git_dirty no
set -g theme_display_git_untracked no
@@ -80,4 +43,4 @@ set -g theme_color_scheme dark
set -g fish_prompt_pwd_dir_length 0
set -g theme_project_dir_length 1
set -g theme_newline_cursor yes
set -g theme_newline_prompt '$ '
set -g theme_newline_prompt '$ '
+3 -1
View File
@@ -5,4 +5,6 @@
alias updateall='sudo apt upgrade -y && sudo apt update -y'
alias uninstall='sudo apt purge -y'
source $HOME/.config/fish/configs/uni.fish
if test -f $HOME/.config/fish/configs/uni.fish
source $HOME/.config/fish/configs/uni.fish
end
+6 -8
View File
@@ -1,19 +1,17 @@
if test -x /usr/bin/pacman
if command -q pacman
if test -d ~/Nextcloud/UNI/26_TI/RISC-V
set -U fish_user_paths ~/Nextcloud/UNI/26_TI/RISC-V/xpack-riscv-none-elf-gcc-15.2.0-1-linux-x64/xpack-riscv-none-elf-gcc-15.2.0-1/bin $fish_user_paths
set -U fish_user_paths ~/Nextcloud/UNI/26_TI/RISC-V/verible-v0.0-4053-g89d4d98a-linux-static-x86_64/verible-v0.0-4053-g89d4d98a/bin $fish_user_paths
fish_add_path ~/Nextcloud/UNI/26_TI/RISC-V/xpack-riscv-none-elf-gcc-15.2.0-1-linux-x64/xpack-riscv-none-elf-gcc-15.2.0-1/bin
fish_add_path ~/Nextcloud/UNI/26_TI/RISC-V/verible-v0.0-4053-g89d4d98a-linux-static-x86_64/verible-v0.0-4053-g89d4d98a/bin
end
if test -d ~/Projects/RISC-V
set -gx XILINX_VIVADO ~/Projects/RISC-V/vivado/Vivado/2022.2
set -U fish_user_paths ~/Projects/RISC-V/vivado/Vivado/2022.2/bin $fish_user_paths
fish_add_path ~/Projects/RISC-V/vivado/Vivado/2022.2/bin
set -gx LM_LICENSE_FILE ~/Projects/RISC-V/intel/LR-160568_License.dat
set -gx SALT_LICENSE_SERVER $LM_LICENSE_FILE
set -U fish_user_paths ~/Projects/RISC-V/intel/questa_fse/bin $fish_user_paths
fish_add_path ~/Projects/RISC-V/intel/questa_fse/bin
end
end
set in_container (test -f /.dockerenv; or test -f /run/.containerenv; and echo yes; or echo no)
if test "in_container" = yes
if test -f /.dockerenv; or test -f /run/.containerenv
echo "In Container"
end