Compare commits
2 Commits
fbf80f998e
...
95cf86ae5f
| Author | SHA1 | Date | |
|---|---|---|---|
| 95cf86ae5f | |||
| f4ab71c1fc |
@@ -204,3 +204,22 @@ else
|
|||||||
echo "The command 'yazi' is not installed. Please install 'yazi' to use this: https://github.com/sxyazi/yazi"
|
echo "The command 'yazi' is not installed. Please install 'yazi' to use this: https://github.com/sxyazi/yazi"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if test -e /usr/bin/sudo-rs
|
||||||
|
alias sudo=sudo-rs
|
||||||
|
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
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|||||||
@@ -2,6 +2,8 @@
|
|||||||
# ~/.config/fish/configs/arch_config.fish
|
# ~/.config/fish/configs/arch_config.fish
|
||||||
#
|
#
|
||||||
|
|
||||||
|
source $HOME/.config/fish/configs/uni.fish
|
||||||
|
|
||||||
alias git_update='$HOME/.config/fish/scripts/git-update.sh'
|
alias git_update='$HOME/.config/fish/scripts/git-update.sh'
|
||||||
|
|
||||||
alias mount_all='$HOME/.config/fish/scripts/mount.sh'
|
alias mount_all='$HOME/.config/fish/scripts/mount.sh'
|
||||||
@@ -12,9 +14,15 @@ alias print_cam='ssh honney@192.168.1.184'
|
|||||||
function updateall
|
function updateall
|
||||||
# Get current Discord version (if installed)
|
# Get current Discord version (if installed)
|
||||||
if pacman -Q discord >/dev/null 2>&1
|
if pacman -Q discord >/dev/null 2>&1
|
||||||
set version_before (pacman -Q discord)
|
set discord_version_before (pacman -Q discord)
|
||||||
else
|
else
|
||||||
set version_before ""
|
set discord_version_before ""
|
||||||
|
end
|
||||||
|
|
||||||
|
if pacman -Q linux-zen >/dev/null 2>&1
|
||||||
|
set kernel_version_before (pacman -Q linux-zen)
|
||||||
|
else
|
||||||
|
set kernel_version_before ""
|
||||||
end
|
end
|
||||||
|
|
||||||
# Run updates
|
# Run updates
|
||||||
@@ -22,20 +30,39 @@ function updateall
|
|||||||
|
|
||||||
# Get new Discord version (if installed)
|
# Get new Discord version (if installed)
|
||||||
if pacman -Q discord >/dev/null 2>&1
|
if pacman -Q discord >/dev/null 2>&1
|
||||||
set version_after (pacman -Q discord)
|
set discord_version_after (pacman -Q discord)
|
||||||
else
|
else
|
||||||
set version_after ""
|
set discord_version_after ""
|
||||||
end
|
end
|
||||||
|
|
||||||
# Compare versions
|
# Compare versions
|
||||||
if test "$version_before" != "$version_after"
|
if test "$discord_version_before" != "$discord_version_after"
|
||||||
echo "Discord version changed: $version_before -> $version_after"
|
echo "Discord version changed: $discord_version_before -> $discord_version_after"
|
||||||
echo "Running extra command..."
|
echo "Running extra command..."
|
||||||
sh -c "$(curl -sS https://raw.githubusercontent.com/Vendicated/VencordInstaller/main/install.sh)"
|
sh -c "$(curl -sS https://raw.githubusercontent.com/Vendicated/VencordInstaller/main/install.sh)"
|
||||||
end
|
end
|
||||||
|
|
||||||
flatpak update
|
flatpak update
|
||||||
yay -Sua --sudoloop
|
paru -Sua --sudoloop
|
||||||
|
|
||||||
|
# Get new Discord version (if installed)
|
||||||
|
if pacman -Q linux-zen >/dev/null 2>&1
|
||||||
|
set kernel_version_after (pacman -Q linux-zen)
|
||||||
|
else
|
||||||
|
set kernel_version_after ""
|
||||||
|
end
|
||||||
|
if test "$kernel_version_before" != "$kernel_version_after"
|
||||||
|
echo "Discord version changed: $kernel_version_before -> $kernel_version_after"
|
||||||
|
echo -n "Reboot now? [y/N]: "
|
||||||
|
|
||||||
|
read answer
|
||||||
|
|
||||||
|
if test "$answer" = "y" -o "$answer" = "Y"
|
||||||
|
reboot
|
||||||
|
else
|
||||||
|
echo "Skipping reboot."
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
alias big='expac -H M "%m\t%n" | sort -h | nl' # Sort installed packages according to size in MB (expac must be installed)
|
alias big='expac -H M "%m\t%n" | sort -h | nl' # Sort installed packages according to size in MB (expac must be installed)
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
# Load pywal colors (extract from ~/.cache/wal/colors.json)
|
# Load pywal colors (extract from ~/.cache/wal/colors.json)
|
||||||
if test -e $HOME/.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_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_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 theme_2 (jq -r '.colors.color2' ~/.cache/wal/colors.json) # Third color (e.g., for hostname)
|
||||||
|
|||||||
@@ -4,3 +4,5 @@
|
|||||||
|
|
||||||
alias updateall='sudo apt upgrade -y && sudo apt update -y'
|
alias updateall='sudo apt upgrade -y && sudo apt update -y'
|
||||||
alias uninstall='sudo apt purge -y'
|
alias uninstall='sudo apt purge -y'
|
||||||
|
|
||||||
|
source $HOME/.config/fish/configs/uni.fish
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
if test -x /usr/bin/pacman
|
||||||
|
if test -d ~/Nextcloud/UNI/26_TI/RISC-V
|
||||||
|
set -U fish_user_paths ~/mount/Storage/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 ~/mount/Storage/Nextcloud/UNI/26_TI/RISC-V/verible-v0.0-4053-g89d4d98a-linux-static-x86_64/verible-v0.0-4053-g89d4d98a/bin $fish_user_paths
|
||||||
|
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
|
||||||
|
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
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
set in_container (test -f /.dockerenv; or test -f /run/.containerenv; and echo yes; or echo no)
|
||||||
|
|
||||||
|
if test "in_container" = yes
|
||||||
|
echo "In Container"
|
||||||
|
end
|
||||||
+1
-1
@@ -4,4 +4,4 @@ SETUVAR __done_min_cmd_duration:5000
|
|||||||
SETUVAR __done_notify_sound:1
|
SETUVAR __done_notify_sound:1
|
||||||
SETUVAR __done_sway_ignore_visible:0
|
SETUVAR __done_sway_ignore_visible:0
|
||||||
SETUVAR __fish_initialized:4300
|
SETUVAR __fish_initialized:4300
|
||||||
SETUVAR fish_user_paths:/home/honney/\x2ebin\x1e/home/honney/\x2elocal/bin
|
SETUVAR fish_user_paths:/home/honney/projects/RISC\x2dV/intel/questa_fse/bin\x1e/home/honney/projects/RISC\x2dV/vivado/Vivado/2022\x2e2/bin\x1e/home/honney/mount/Storage/Nextcloud/UNI/26_TI/RISC\x2dV/verible\x2dv0\x2e0\x2d4053\x2dg89d4d98a\x2dlinux\x2dstatic\x2dx86_64/verible\x2dv0\x2e0\x2d4053\x2dg89d4d98a/bin\x1e/home/honney/mount/Storage/Nextcloud/UNI/26_TI/RISC\x2dV/xpack\x2driscv\x2dnone\x2delf\x2dgcc\x2d15\x2e2\x2e0\x2d1\x2dlinux\x2dx64/xpack\x2driscv\x2dnone\x2delf\x2dgcc\x2d15\x2e2\x2e0\x2d1/bin\x1e/home/honney/projects/RISC\x2dV/intelFPGA_pro/22\x2e4/questa_fse/bin\x1e/home/honney/projects/vivado/Vivado/2022\x2e2/bin\x1e/home/honney/\x2ebin\x1e/home/honney/\x2elocal/bin\x1e/opt/rocm/bin
|
||||||
|
|||||||
+37
-22
@@ -4,24 +4,25 @@ function extract
|
|||||||
return 1
|
return 1
|
||||||
end
|
end
|
||||||
|
|
||||||
set output_dir "."
|
|
||||||
set archives $argv
|
set archives $argv
|
||||||
|
set output_dir "."
|
||||||
|
set use_custom_dir 0
|
||||||
|
|
||||||
# If there's more than one argument, check the last one for a directory
|
# If exactly 2 args and second is a directory (or doesn't exist yet), treat it as output dir
|
||||||
if test (count $argv) -gt 1
|
if test (count $argv) -eq 2
|
||||||
set maybe_dir $argv[-1]
|
set maybe_dir $argv[2]
|
||||||
if not test -f $maybe_dir
|
if test -d "$maybe_dir"; or not test -e "$maybe_dir"
|
||||||
set output_dir $maybe_dir
|
set output_dir "$maybe_dir"
|
||||||
mkdir -p $output_dir
|
mkdir -p "$output_dir"
|
||||||
set archives $argv[1..-2]
|
set archives $argv[1]
|
||||||
|
set use_custom_dir 1
|
||||||
end
|
end
|
||||||
else
|
|
||||||
# If only one argument and it's a file, create directory with same name as archive (without extension)
|
|
||||||
set archive $argv[1]
|
|
||||||
if test -f "$archive"
|
|
||||||
set output_dir (string replace -r '\.(tar\.gz|tgz|tar\.bz2|tbz2|tar\.xz|txz|gz|bz2|xz|zst|zip|7z|rar)$' '' (basename "$archive"))
|
|
||||||
mkdir -p $output_dir
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Detect multiple archives
|
||||||
|
set multi 0
|
||||||
|
if test (count $archives) -gt 1
|
||||||
|
set multi 1
|
||||||
end
|
end
|
||||||
|
|
||||||
for archive in $archives
|
for archive in $archives
|
||||||
@@ -30,25 +31,39 @@ function extract
|
|||||||
continue
|
continue
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Determine base name (strip extensions)
|
||||||
|
set base (string replace -r '\.(tar\.gz|tgz|tar\.bz2|tbz2|tar\.xz|txz|gz|bz2|xz|zst|zip|7z|rar)$' '' (basename "$archive"))
|
||||||
|
|
||||||
|
# Decide target directory
|
||||||
|
if test $multi -eq 1
|
||||||
|
set target_dir "$base"
|
||||||
|
else if test $use_custom_dir -eq 1
|
||||||
|
set target_dir "$output_dir"
|
||||||
|
else
|
||||||
|
set target_dir "$base"
|
||||||
|
end
|
||||||
|
|
||||||
|
mkdir -p "$target_dir"
|
||||||
|
|
||||||
set mime (file --mime-type -b "$archive")
|
set mime (file --mime-type -b "$archive")
|
||||||
|
|
||||||
switch $mime
|
switch $mime
|
||||||
case 'application/x-tar'
|
case 'application/x-tar'
|
||||||
tar -xvf "$archive" -C "$output_dir"
|
tar -xvf "$archive" -C "$target_dir"
|
||||||
case 'application/gzip'
|
case 'application/gzip'
|
||||||
tar xvzf "$archive" -C "$output_dir"
|
tar xvzf "$archive" -C "$target_dir"
|
||||||
case 'application/x-bzip2'
|
case 'application/x-bzip2'
|
||||||
tar xvjf "$archive" -C "$output_dir"
|
tar xvjf "$archive" -C "$target_dir"
|
||||||
case 'application/x-xz'
|
case 'application/x-xz'
|
||||||
tar xvJf "$archive" -C "$output_dir"
|
tar xvJf "$archive" -C "$target_dir"
|
||||||
case 'application/zstd'
|
case 'application/zstd'
|
||||||
tar --zstd -xvf "$archive" -C "$output_dir"
|
tar --zstd -xvf "$archive" -C "$target_dir"
|
||||||
case 'application/zip'
|
case 'application/zip'
|
||||||
unzip -j "$archive" -d "$output_dir"
|
unzip "$archive" -d "$target_dir"
|
||||||
case 'application/x-7z-compressed'
|
case 'application/x-7z-compressed'
|
||||||
7z x "$archive" -o"$output_dir"
|
7z x "$archive" -o"$target_dir"
|
||||||
case 'application/x-rar' 'application/vnd.rar'
|
case 'application/x-rar' 'application/vnd.rar'
|
||||||
unrar x -o+ "$archive" "$output_dir"
|
unrar x -o+ "$archive" "$target_dir"
|
||||||
case '*'
|
case '*'
|
||||||
echo "extract: unknown file type for '$archive' ($mime)"
|
echo "extract: unknown file type for '$archive' ($mime)"
|
||||||
continue
|
continue
|
||||||
|
|||||||
Reference in New Issue
Block a user