fixed some stuff and made it compatable with fisher
This commit is contained in:
@@ -1,2 +1,3 @@
|
||||
configs/colors.fish
|
||||
fish_variables
|
||||
themes
|
||||
@@ -0,0 +1,20 @@
|
||||
# 1. Point to your custom Fisher repository
|
||||
set -gx fisher_path ~/.config/fisher
|
||||
if test -d $fisher_path
|
||||
# 2. Append the custom folders to Fish's native search lists if they aren't already there
|
||||
if not contains $fisher_path/functions $fish_function_path
|
||||
set fish_function_path $fisher_path/functions $fish_function_path
|
||||
end
|
||||
|
||||
if not contains $fisher_path/completions $fish_complete_path
|
||||
set fish_complete_path $fisher_path/completions $fish_complete_path
|
||||
end
|
||||
|
||||
# 3. Simulate the conf.d execution by natively sourcing third-party configuration files
|
||||
for file in $fisher_path/conf.d/*.fish
|
||||
if not test -s $file
|
||||
continue
|
||||
end
|
||||
source $file
|
||||
end
|
||||
end
|
||||
@@ -1,6 +1,10 @@
|
||||
# Replace frozen key bindings migration (deletes fish_frozen_key_bindings.fish)
|
||||
set --global fish_key_bindings fish_default_key_bindings
|
||||
|
||||
#
|
||||
# for fisher: ~/.config/fish/conf.d/00_fisher_path.fish
|
||||
#
|
||||
|
||||
if status is-interactive
|
||||
# Get distro ID from /etc/os-release
|
||||
if test -f /etc/os-release
|
||||
|
||||
@@ -7,7 +7,40 @@ if test "$TERM" = "xterm-kitty"; or test "$TERM" = "alacritty"
|
||||
alias ssh='env TERM=xterm-256color ssh'
|
||||
end
|
||||
|
||||
if command -q zoxide
|
||||
zoxide init fish | source
|
||||
alias cd='z'
|
||||
# if command -q zoxide
|
||||
# zoxide init fish | source
|
||||
# alias cd='z'
|
||||
# end
|
||||
|
||||
set -gx fisher_path ~/.config/fisher
|
||||
|
||||
################ FIX STEAM ####################################################
|
||||
|
||||
function steam_fix
|
||||
if test -f /usr/share/applications/steam.desktop
|
||||
# Check if the credential helper is already in the file
|
||||
if ! grep -q "PrefersNonDefaultGPU=true" -q '/X-KDE-RunOnDiscreteGpu=true' /usr/share/applications/steam.desktop
|
||||
echo "Steam is allready fixed"
|
||||
else
|
||||
echo "Fixing Steam"
|
||||
# Remove the specific GPU lines using sudo and sed
|
||||
sudo sed -i -e '/PrefersNonDefaultGPU=true/d' -e '/X-KDE-RunOnDiscreteGpu=true/d' /usr/share/applications/steam.desktop
|
||||
echo "Steam has been fixed."
|
||||
end
|
||||
else
|
||||
echo "no /usr/share/applications/steam.desktop file"
|
||||
echo "could not fix steam"
|
||||
end
|
||||
end
|
||||
|
||||
################ FIX BRAVE ####################################################
|
||||
|
||||
function brave_fix
|
||||
if test -f ~/.config/BraveSoftware/Brave-Browser/SingletonLock
|
||||
# Check if the credential helper is already in the file
|
||||
rm ~/.config/BraveSoftware/Brave-Browser/SingletonLock
|
||||
else
|
||||
echo "Brave not blocked by SingletonLock"
|
||||
echo "could not fix brave"
|
||||
end
|
||||
end
|
||||
+67
-30
@@ -8,7 +8,14 @@ alias remount='sudo mount -a'
|
||||
alias mount_config='sudo nano /etc/fstab'
|
||||
alias own='sudo chown -R "$USER":"$USER"'
|
||||
alias right='sudo chmod -R 755'
|
||||
alias reload='clear && omf reload'
|
||||
function reload
|
||||
if command -q omf
|
||||
omf reload
|
||||
else
|
||||
clear
|
||||
exec fish
|
||||
end
|
||||
end
|
||||
alias fish_config='nano $HOME/.config/fish/config.fish'
|
||||
alias ip='ip -color'
|
||||
alias psmem='ps auxf | sort -nr -k 4'
|
||||
@@ -71,33 +78,82 @@ else
|
||||
end
|
||||
|
||||
function source --description "Source files with auto-detection (replaces builtin source)"
|
||||
if test (count $argv) -eq 0
|
||||
builtin source
|
||||
# --- 0. Handle standard input piping (Fixes background script sourcing) ---
|
||||
if not isatty stdin
|
||||
builtin source $argv
|
||||
return
|
||||
end
|
||||
|
||||
# --- 1. Handle Flags First ---
|
||||
if test (count $argv) -gt 0; and string match -q -- "--*" $argv[1]
|
||||
builtin source $argv
|
||||
return
|
||||
end
|
||||
|
||||
# --- 2. Check: Is a file/argument given? ---
|
||||
if test (count $argv) -gt 0
|
||||
set file $argv[1]
|
||||
set -e argv[1]
|
||||
|
||||
if string match -q -- "--*" $file
|
||||
builtin source $file $argv
|
||||
return
|
||||
end
|
||||
|
||||
# Check if the explicit path actually exists as a file
|
||||
if not test -f "$file"
|
||||
echo "source: No such file: '$file'" >&2
|
||||
return 1
|
||||
end
|
||||
|
||||
if string match -q "*.bash" -- $file
|
||||
# Logic: Is it .fish?
|
||||
if string match -q "*.fish" -- $file
|
||||
builtin source $file $argv
|
||||
return
|
||||
# Logic: Is it .bash?
|
||||
else if string match -q "*.bash" -- $file or string match -q "*.sh" -- $file
|
||||
if command -q bass
|
||||
bass source $file $argv
|
||||
return
|
||||
else
|
||||
echo "source: 'bass' is not installed. Install it to source .bash files." >&2
|
||||
echo "source: 'bass' is not installed. Install it to source bash files." >&2
|
||||
return 1
|
||||
end
|
||||
# Logic: Else (unknown file type)
|
||||
else
|
||||
builtin source $file $argv
|
||||
echo "source: Unknown file extension for '$file'. Please specify a .fish or .bash file." >&2
|
||||
return 1
|
||||
end
|
||||
|
||||
# --- 3. No file given: Check for local venv directories ---
|
||||
else
|
||||
# Target directories to check in order of preference
|
||||
set venv_dirs .venv venv
|
||||
|
||||
for dir in $venv_dirs
|
||||
if test -d "$dir"
|
||||
# Check for .fish activator first
|
||||
if test -f "$dir/bin/activate.fish"
|
||||
builtin source "$dir/bin/activate.fish"
|
||||
return
|
||||
|
||||
# Check for .bash activator second
|
||||
else if test -f "$dir/bin/activate" or test -f "$dir/bin/activate.bash"
|
||||
# Resolve which bash file exists
|
||||
set bash_act "$dir/bin/activate"
|
||||
if test -f "$dir/bin/activate.bash"
|
||||
set bash_act "$dir/bin/activate.bash"
|
||||
end
|
||||
|
||||
if command -q bass
|
||||
bass source $bash_act
|
||||
return
|
||||
else
|
||||
echo "source: Found bash virtual env in '$dir', but 'bass' is not installed." >&2
|
||||
return 1
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# Logic: Else error (No venv found and no args provided)
|
||||
echo "source: No file specified and no local venv or .venv directory found." >&2
|
||||
return 1
|
||||
end
|
||||
end
|
||||
|
||||
@@ -307,22 +363,3 @@ function git_cred
|
||||
echo "could not add the credentials helper"
|
||||
end
|
||||
end
|
||||
|
||||
################ FIX STEAM ####################################################
|
||||
|
||||
function steam_fix
|
||||
if test -f /usr/share/applications/steam.desktop
|
||||
# Check if the credential helper is already in the file
|
||||
if ! grep -q "PrefersNonDefaultGPU=true" -q '/X-KDE-RunOnDiscreteGpu=true' /usr/share/applications/steam.desktop
|
||||
echo "Steam is allready fixed"
|
||||
else
|
||||
echo "Fixing Steam"
|
||||
# Remove the specific GPU lines using sudo and sed
|
||||
sudo sed -i -e '/PrefersNonDefaultGPU=true/d' -e '/X-KDE-RunOnDiscreteGpu=true/d' /usr/share/applications/steam.desktop
|
||||
echo "Steam has been fixed."
|
||||
end
|
||||
else
|
||||
echo "no /usr/share/applications/steam.desktop file"
|
||||
echo "could not fix steam"
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,15 @@
|
||||
jorgebucaran/fisher
|
||||
jorgebucaran/humantime.fish
|
||||
ilancosman/tide@v6
|
||||
patrickf1/fzf.fish
|
||||
franciscolourenco/done
|
||||
jhillyerd/plugin-git
|
||||
icezyclon/zoxide.fish
|
||||
jorgebucaran/spark.fish
|
||||
meaningful-ooo/sponge
|
||||
jorgebucaran/autopair.fish
|
||||
nickeb96/puffer-fish
|
||||
mattmc3/magic-enter.fish
|
||||
gazorby/fish-abbreviation-tips
|
||||
lgathy/google-cloud-sdk-fish-completion
|
||||
ankitsumitg/docker-fish-completions
|
||||
Executable → Regular
+1
-1
@@ -72,7 +72,7 @@ set_default_shell() {
|
||||
|
||||
main() {
|
||||
install_fish
|
||||
install_omf
|
||||
install_omf # add way to choose fisher and add ln -s $fisher_path/themes $__fish_config_dir/themes
|
||||
install_bobthefish
|
||||
set_default_shell
|
||||
|
||||
|
||||
Reference in New Issue
Block a user