fixed some stuff and made it compatable with fisher
This commit is contained in:
+2
-1
@@ -1,2 +1,3 @@
|
|||||||
configs/colors.fish
|
configs/colors.fish
|
||||||
fish_variables
|
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)
|
# Replace frozen key bindings migration (deletes fish_frozen_key_bindings.fish)
|
||||||
set --global fish_key_bindings fish_default_key_bindings
|
set --global fish_key_bindings fish_default_key_bindings
|
||||||
|
|
||||||
|
#
|
||||||
|
# for fisher: ~/.config/fish/conf.d/00_fisher_path.fish
|
||||||
|
#
|
||||||
|
|
||||||
if status is-interactive
|
if status is-interactive
|
||||||
# Get distro ID from /etc/os-release
|
# Get distro ID from /etc/os-release
|
||||||
if test -f /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'
|
alias ssh='env TERM=xterm-256color ssh'
|
||||||
end
|
end
|
||||||
|
|
||||||
if command -q zoxide
|
# if command -q zoxide
|
||||||
zoxide init fish | source
|
# zoxide init fish | source
|
||||||
alias cd='z'
|
# 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
|
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
|
||||||
+74
-37
@@ -8,7 +8,14 @@ alias remount='sudo mount -a'
|
|||||||
alias mount_config='sudo nano /etc/fstab'
|
alias mount_config='sudo nano /etc/fstab'
|
||||||
alias own='sudo chown -R "$USER":"$USER"'
|
alias own='sudo chown -R "$USER":"$USER"'
|
||||||
alias right='sudo chmod -R 755'
|
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 fish_config='nano $HOME/.config/fish/config.fish'
|
||||||
alias ip='ip -color'
|
alias ip='ip -color'
|
||||||
alias psmem='ps auxf | sort -nr -k 4'
|
alias psmem='ps auxf | sort -nr -k 4'
|
||||||
@@ -71,33 +78,82 @@ else
|
|||||||
end
|
end
|
||||||
|
|
||||||
function source --description "Source files with auto-detection (replaces builtin source)"
|
function source --description "Source files with auto-detection (replaces builtin source)"
|
||||||
if test (count $argv) -eq 0
|
# --- 0. Handle standard input piping (Fixes background script sourcing) ---
|
||||||
builtin source
|
if not isatty stdin
|
||||||
|
builtin source $argv
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
set file $argv[1]
|
# --- 1. Handle Flags First ---
|
||||||
set -e argv[1]
|
if test (count $argv) -gt 0; and string match -q -- "--*" $argv[1]
|
||||||
|
builtin source $argv
|
||||||
if string match -q -- "--*" $file
|
|
||||||
builtin source $file $argv
|
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
if not test -f "$file"
|
# --- 2. Check: Is a file/argument given? ---
|
||||||
echo "source: No such file: '$file'" >&2
|
if test (count $argv) -gt 0
|
||||||
return 1
|
set file $argv[1]
|
||||||
end
|
set -e argv[1]
|
||||||
|
|
||||||
if string match -q "*.bash" -- $file
|
# Check if the explicit path actually exists as a file
|
||||||
if command -q bass
|
if not test -f "$file"
|
||||||
bass source $file $argv
|
echo "source: No such file: '$file'" >&2
|
||||||
else
|
|
||||||
echo "source: 'bass' is not installed. Install it to source .bash files." >&2
|
|
||||||
return 1
|
return 1
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# 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
|
||||||
|
return 1
|
||||||
|
end
|
||||||
|
# Logic: Else (unknown file type)
|
||||||
|
else
|
||||||
|
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
|
else
|
||||||
builtin source $file $argv
|
# 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
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -306,23 +362,4 @@ function git_cred
|
|||||||
echo "no .git/config file"
|
echo "no .git/config file"
|
||||||
echo "could not add the credentials helper"
|
echo "could not add the credentials helper"
|
||||||
end
|
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
|
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() {
|
main() {
|
||||||
install_fish
|
install_fish
|
||||||
install_omf
|
install_omf # add way to choose fisher and add ln -s $fisher_path/themes $__fish_config_dir/themes
|
||||||
install_bobthefish
|
install_bobthefish
|
||||||
set_default_shell
|
set_default_shell
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user