Add jj/kitty/nvim/opencode/paru/fish/yazi/jjui
This commit is contained in:
186
fish/files/completions/bun.fish
Normal file
186
fish/files/completions/bun.fish
Normal file
@@ -0,0 +1,186 @@
|
||||
# This is terribly complicated
|
||||
# It's because:
|
||||
# 1. bun run has to have dynamic completions
|
||||
# 2. there are global options
|
||||
# 3. bun {install add remove} gets special options
|
||||
# 4. I don't know how to write fish completions well
|
||||
# Contributions very welcome!!
|
||||
|
||||
function __fish__get_bun_bins
|
||||
string split ' ' (bun getcompletes b)
|
||||
end
|
||||
|
||||
function __fish__get_bun_scripts
|
||||
set -lx SHELL bash
|
||||
set -lx MAX_DESCRIPTION_LEN 40
|
||||
string trim (string split '\n' (string split '\t' (bun getcompletes z)))
|
||||
end
|
||||
|
||||
function __fish__get_bun_packages
|
||||
if test (commandline -ct) != ""
|
||||
set -lx SHELL fish
|
||||
string split ' ' (bun getcompletes a (commandline -ct))
|
||||
end
|
||||
end
|
||||
|
||||
function __history_completions
|
||||
set -l tokens (commandline --current-process --tokenize)
|
||||
history --prefix (commandline) | string replace -r \^$tokens[1]\\s\* "" | string replace -r \^$tokens[2]\\s\* "" | string split ' '
|
||||
end
|
||||
|
||||
function __fish__get_bun_bun_js_files
|
||||
string split ' ' (bun getcompletes j)
|
||||
end
|
||||
|
||||
set -l bun_install_boolean_flags yarn production optional development no-save dry-run force no-cache silent verbose global
|
||||
set -l bun_install_boolean_flags_descriptions "Write a yarn.lock file (yarn v1)" "Don't install devDependencies" "Add dependency to optionalDependencies" "Add dependency to devDependencies" "Don't update package.json or save a lockfile" "Don't install anything" "Always request the latest versions from the registry & reinstall all dependencies" "Ignore manifest cache entirely" "Don't output anything" "Excessively verbose logging" "Use global folder"
|
||||
|
||||
set -l bun_builtin_cmds_without_run dev create help bun upgrade discord install remove add init pm x
|
||||
set -l bun_builtin_cmds_accepting_flags create help bun upgrade discord run init link unlink pm x
|
||||
|
||||
function __bun_complete_bins_scripts --inherit-variable bun_builtin_cmds_without_run -d "Emit bun completions for bins and scripts"
|
||||
# Do nothing if we already have a builtin subcommand,
|
||||
# or any subcommand other than "run".
|
||||
if __fish_seen_subcommand_from $bun_builtin_cmds_without_run
|
||||
or not __fish_use_subcommand && not __fish_seen_subcommand_from run
|
||||
return
|
||||
end
|
||||
# Do we already have a bin or script subcommand?
|
||||
set -l bins (__fish__get_bun_bins)
|
||||
if __fish_seen_subcommand_from $bins
|
||||
return
|
||||
end
|
||||
# Scripts have descriptions appended with a tab separator.
|
||||
# Strip off descriptions for the purposes of subcommand testing.
|
||||
set -l scripts (__fish__get_bun_scripts)
|
||||
if __fish_seen_subcommand_from (string split \t -f 1 -- $scripts)
|
||||
return
|
||||
end
|
||||
# Emit scripts.
|
||||
for script in $scripts
|
||||
echo $script
|
||||
end
|
||||
# Emit binaries and JS files (but only if we're doing `bun run`).
|
||||
if __fish_seen_subcommand_from run
|
||||
for bin in $bins
|
||||
echo "$bin"\t"package bin"
|
||||
end
|
||||
for file in (__fish__get_bun_bun_js_files)
|
||||
echo "$file"\t"Bun.js"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
# Clear existing completions
|
||||
complete -e -c bun
|
||||
|
||||
# Dynamically emit scripts and binaries
|
||||
complete -c bun -f -a "(__bun_complete_bins_scripts)"
|
||||
|
||||
# Complete flags if we have no subcommand or a flag-friendly one.
|
||||
set -l flag_applies "__fish_use_subcommand; or __fish_seen_subcommand_from $bun_builtin_cmds_accepting_flags"
|
||||
complete -c bun \
|
||||
-n $flag_applies --no-files -s 'u' -l 'origin' -r -d 'Server URL. Rewrites import paths'
|
||||
complete -c bun \
|
||||
-n $flag_applies --no-files -s 'p' -l 'port' -r -d 'Port number to start server from'
|
||||
complete -c bun \
|
||||
-n $flag_applies --no-files -s 'd' -l 'define' -r -d 'Substitute K:V while parsing, e.g. --define process.env.NODE_ENV:\"development\"'
|
||||
complete -c bun \
|
||||
-n $flag_applies --no-files -s 'e' -l 'external' -r -d 'Exclude module from transpilation (can use * wildcards). ex: -e react'
|
||||
complete -c bun \
|
||||
-n $flag_applies --no-files -l 'use' -r -d 'Use a framework (ex: next)'
|
||||
complete -c bun \
|
||||
-n $flag_applies --no-files -l 'hot' -r -d 'Enable hot reloading in Bun\'s JavaScript runtime'
|
||||
|
||||
# Complete dev and create as first subcommand.
|
||||
complete -c bun \
|
||||
-n "__fish_use_subcommand" -a 'dev' -d 'Start dev server'
|
||||
complete -c bun \
|
||||
-n "__fish_use_subcommand" -a 'create' -f -d 'Create a new project from a template'
|
||||
|
||||
# Complete "next" and "react" if we've seen "create".
|
||||
complete -c bun \
|
||||
-n "__fish_seen_subcommand_from create" -a 'next' -d 'new Next.js project'
|
||||
|
||||
complete -c bun \
|
||||
-n "__fish_seen_subcommand_from create" -a 'react' -d 'new React project'
|
||||
|
||||
# Complete "upgrade" as first subcommand.
|
||||
complete -c bun \
|
||||
-n "__fish_use_subcommand" -a 'upgrade' -d 'Upgrade bun to the latest version' -x
|
||||
# Complete "-h/--help" unconditionally.
|
||||
complete -c bun \
|
||||
-s "h" -l "help" -d 'See all commands and flags' -x
|
||||
|
||||
# Complete "-v/--version" if we have no subcommand.
|
||||
complete -c bun \
|
||||
-n "not __fish_use_subcommand" -l "version" -s "v" -d 'Bun\'s version' -x
|
||||
|
||||
# Complete additional subcommands.
|
||||
complete -c bun \
|
||||
-n "__fish_use_subcommand" -a 'discord' -d 'Open bun\'s Discord server' -x
|
||||
|
||||
|
||||
complete -c bun \
|
||||
-n "__fish_use_subcommand" -a 'bun' -d 'Generate a new bundle'
|
||||
|
||||
|
||||
complete -c bun \
|
||||
-n "__fish_seen_subcommand_from bun" -F -d 'Bundle this'
|
||||
|
||||
complete -c bun \
|
||||
-n "__fish_seen_subcommand_from create; and __fish_seen_subcommand_from react next" -F -d "Create in directory"
|
||||
|
||||
|
||||
complete -c bun \
|
||||
-n "__fish_use_subcommand" -a 'init' -F -d 'Start an empty Bun project'
|
||||
|
||||
complete -c bun \
|
||||
-n "__fish_use_subcommand" -a 'install' -f -d 'Install packages from package.json'
|
||||
|
||||
complete -c bun \
|
||||
-n "__fish_use_subcommand" -a 'add' -F -d 'Add a package to package.json'
|
||||
|
||||
complete -c bun \
|
||||
-n "__fish_use_subcommand" -a 'remove' -F -d 'Remove a package from package.json'
|
||||
|
||||
|
||||
for i in (seq (count $bun_install_boolean_flags))
|
||||
complete -c bun \
|
||||
-n "__fish_seen_subcommand_from install add remove" -l "$bun_install_boolean_flags[$i]" -d "$bun_install_boolean_flags_descriptions[$i]"
|
||||
end
|
||||
|
||||
complete -c bun \
|
||||
-n "__fish_seen_subcommand_from install add remove" -l 'cwd' -d 'Change working directory'
|
||||
|
||||
complete -c bun \
|
||||
-n "__fish_seen_subcommand_from install add remove" -l 'cache-dir' -d 'Choose a cache directory (default: $HOME/.bun/install/cache)'
|
||||
|
||||
complete -c bun \
|
||||
-n "__fish_seen_subcommand_from add" -d 'Popular' -a '(__fish__get_bun_packages)'
|
||||
|
||||
complete -c bun \
|
||||
-n "__fish_seen_subcommand_from add" -d 'History' -a '(__history_completions)'
|
||||
|
||||
complete -c bun \
|
||||
-n "__fish_seen_subcommand_from pm; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts) cache;" -a 'bin ls cache hash hash-print hash-string' -f
|
||||
|
||||
complete -c bun \
|
||||
-n "__fish_seen_subcommand_from pm; and __fish_seen_subcommand_from cache; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts);" -a 'rm' -f
|
||||
|
||||
# Add built-in subcommands with descriptions.
|
||||
complete -c bun -n "__fish_use_subcommand" -a "create" -f -d "Create a new project from a template"
|
||||
complete -c bun -n "__fish_use_subcommand" -a "build bun" --require-parameter -F -d "Transpile and bundle one or more files"
|
||||
complete -c bun -n "__fish_use_subcommand" -a "upgrade" -d "Upgrade Bun"
|
||||
complete -c bun -n "__fish_use_subcommand" -a "run" -d "Run a script or package binary"
|
||||
complete -c bun -n "__fish_use_subcommand" -a "install" -d "Install dependencies from package.json" -f
|
||||
complete -c bun -n "__fish_use_subcommand" -a "remove" -d "Remove a dependency from package.json" -f
|
||||
complete -c bun -n "__fish_use_subcommand" -a "add" -d "Add a dependency to package.json" -f
|
||||
complete -c bun -n "__fish_use_subcommand" -a "init" -d "Initialize a Bun project in this directory" -f
|
||||
complete -c bun -n "__fish_use_subcommand" -a "link" -d "Register or link a local npm package" -f
|
||||
complete -c bun -n "__fish_use_subcommand" -a "unlink" -d "Unregister a local npm package" -f
|
||||
complete -c bun -n "__fish_use_subcommand" -a "pm" -d "Additional package management utilities" -f
|
||||
complete -c bun -n "__fish_use_subcommand" -a "x" -d "Execute a package binary, installing if needed" -f
|
||||
complete -c bun -n "__fish_use_subcommand" -a "outdated" -d "Display the latest versions of outdated dependencies" -f
|
||||
complete -c bun -n "__fish_use_subcommand" -a "publish" -d "Publish your package from local to npm" -f
|
||||
14
fish/files/conf.d/fish_frozen_key_bindings.fish
Normal file
14
fish/files/conf.d/fish_frozen_key_bindings.fish
Normal file
@@ -0,0 +1,14 @@
|
||||
# This file was created by fish when upgrading to version 4.3, to migrate
|
||||
# the 'fish_key_bindings' variable from its old default scope (universal)
|
||||
# to its new default scope (global). We recommend you delete this file
|
||||
# and configure key bindings in ~/.config/fish/config.fish if needed.
|
||||
|
||||
set --global fish_key_bindings fish_vi_key_bindings
|
||||
|
||||
# Prior to version 4.3, fish shipped an event handler that runs
|
||||
# `set --universal fish_key_bindings fish_default_key_bindings`
|
||||
# whenever the fish_key_bindings variable is erased.
|
||||
# This means that as long as any fish < 4.3 is still running on this system,
|
||||
# we cannot complete the migration.
|
||||
# As a workaround, erase the universal variable at every shell startup.
|
||||
set --erase --universal fish_key_bindings
|
||||
37
fish/files/conf.d/fish_frozen_theme.fish
Normal file
37
fish/files/conf.d/fish_frozen_theme.fish
Normal file
@@ -0,0 +1,37 @@
|
||||
# This file was created by fish when upgrading to version 4.3, to migrate
|
||||
# theme variables from universal to global scope.
|
||||
# Don't edit this file, as it will be written by the web-config tool (`fish_config`).
|
||||
# To customize your theme, delete this file and see
|
||||
# help interactive#syntax-highlighting
|
||||
# or
|
||||
# man fish-interactive | less +/^SYNTAX.HIGHLIGHTING
|
||||
# for appropriate commands to add to ~/.config/fish/config.fish instead.
|
||||
# See also the release notes for fish 4.3.0 (run `help relnotes`).
|
||||
|
||||
set --global fish_color_autosuggestion brblack
|
||||
set --global fish_color_cancel -r
|
||||
set --global fish_color_command normal
|
||||
set --global fish_color_comment red
|
||||
set --global fish_color_cwd green
|
||||
set --global fish_color_cwd_root red
|
||||
set --global fish_color_end green
|
||||
set --global fish_color_error brred
|
||||
set --global fish_color_escape brcyan
|
||||
set --global fish_color_history_current --bold
|
||||
set --global fish_color_host normal
|
||||
set --global fish_color_host_remote yellow
|
||||
set --global fish_color_normal normal
|
||||
set --global fish_color_operator brcyan
|
||||
set --global fish_color_param cyan
|
||||
set --global fish_color_quote yellow
|
||||
set --global fish_color_redirection cyan --bold
|
||||
set --global fish_color_search_match white --background=brblack
|
||||
set --global fish_color_selection white --bold --background=brblack
|
||||
set --global fish_color_status red
|
||||
set --global fish_color_user brgreen
|
||||
set --global fish_color_valid_path --underline
|
||||
set --global fish_pager_color_completion normal
|
||||
set --global fish_pager_color_description yellow -i
|
||||
set --global fish_pager_color_prefix normal --bold --underline
|
||||
set --global fish_pager_color_progress brwhite --background=cyan
|
||||
set --global fish_pager_color_selected_background -r
|
||||
1
fish/files/conf.d/rustup.fish
Normal file
1
fish/files/conf.d/rustup.fish
Normal file
@@ -0,0 +1 @@
|
||||
source "$HOME/.cargo/env.fish"
|
||||
2
fish/files/conf.d/uv.env.fish
Normal file
2
fish/files/conf.d/uv.env.fish
Normal file
@@ -0,0 +1,2 @@
|
||||
|
||||
source "$HOME/.local/bin/env.fish"
|
||||
152
fish/files/config.fish
Normal file
152
fish/files/config.fish
Normal file
@@ -0,0 +1,152 @@
|
||||
# Only execute this file once per shell.
|
||||
set -q __fish_home_manager_config_sourced; and exit
|
||||
set -g __fish_home_manager_config_sourced 1
|
||||
|
||||
|
||||
# Add ROCm bin directory to PATH
|
||||
set -gx PATH "/opt/rocm/bin" $PATH
|
||||
|
||||
|
||||
set --export VOLTA_HOME "$HOME/.volta"
|
||||
set --export PATH "$VOLTA_HOME/bin" $PATH
|
||||
|
||||
set --export EDITOR "nvim"
|
||||
|
||||
|
||||
status is-login; and begin
|
||||
|
||||
# Login shell initialisation
|
||||
|
||||
|
||||
end
|
||||
|
||||
status is-interactive; and begin
|
||||
|
||||
# Abbreviations
|
||||
|
||||
|
||||
# Aliases
|
||||
alias che chezmoi
|
||||
alias gb 'git branch'
|
||||
alias gca 'git commit --amend'
|
||||
alias gchd 'git checkout develop'
|
||||
alias gchm 'git checkout main'
|
||||
alias gcho 'git checkout'
|
||||
alias gcnv 'git commit --no-verify'
|
||||
alias gd 'git diff'
|
||||
alias gdc 'git diff --cached'
|
||||
alias gdt 'git diff-tree --no-commit-id --name-only -r'
|
||||
alias gf 'git fetch'
|
||||
alias gl 'git pull'
|
||||
alias gm 'git merge'
|
||||
alias gp 'git push'
|
||||
alias gpuoh 'git push --set-upstream origin HEAD'
|
||||
alias gr 'git remote'
|
||||
alias gra 'git remote add'
|
||||
alias grr 'git remote remove'
|
||||
alias grv 'git remote -v'
|
||||
alias gs 'git status'
|
||||
alias nv nvim
|
||||
# alias yay paru
|
||||
alias wo 'pomodoro work'
|
||||
alias br 'pomodoro break'
|
||||
|
||||
# Interactive shell initialisation
|
||||
fish_config theme choose rose-pine-moon
|
||||
set fish_greeting # Disable greeting
|
||||
test -f /run/current-system/sw/share/autojump/autojump.fish; and source /run/current-system/sw/share/autojump/autojump.fish
|
||||
[ -f /opt/homebrew/share/autojump/autojump.fish ]; and source /opt/homebrew/share/autojump/autojump.fish
|
||||
|
||||
test -f ~/.env; and source ~/.env
|
||||
test -f ~/.config/myvars; and source ~/.config/myvars
|
||||
|
||||
nerdfetch
|
||||
|
||||
if test "$TERM" != dumb
|
||||
eval (starship init fish)
|
||||
fzf --fish | source
|
||||
end
|
||||
|
||||
# add completions generated by Home Manager to $fish_complete_path
|
||||
begin
|
||||
set -l joined (string join " " $fish_complete_path)
|
||||
set -l prev_joined (string replace --regex "[^\s]*generated_completions.*" "" $joined)
|
||||
set -l post_joined (string replace $prev_joined "" $joined)
|
||||
set -l prev (string split " " (string trim $prev_joined))
|
||||
set -l post (string split " " (string trim $post_joined))
|
||||
set fish_complete_path $prev "/home/thomasgl/.local/share/fish/home-manager_generated_completions" $post
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
# pnpm
|
||||
switch (uname)
|
||||
case Linux
|
||||
set -gx PNPM_HOME "/home/thomasgl/.local/share/pnpm"
|
||||
case Darwin
|
||||
set -gx PNPM_HOME "/Users/thomasglopes/.local/share/pnpm"
|
||||
end
|
||||
|
||||
if not string match -q -- $PNPM_HOME $PATH
|
||||
set -gx PATH "$PNPM_HOME" $PATH
|
||||
end
|
||||
# pnpm end
|
||||
|
||||
set -Ux ENV ~/.config/fish/config.fish
|
||||
|
||||
if not set -q SSH_AUTH_SOCK
|
||||
# Check if ssh-agent is already running and accessible
|
||||
set -l agent_pid (pgrep ssh-agent | head -n 1)
|
||||
|
||||
if test -n "$agent_pid"
|
||||
# Try to find existing socket
|
||||
set -l sock_path (find /tmp -name "ssh-*" -type d 2>/dev/null | \
|
||||
xargs -I {} find {} -name "agent.*" 2>/dev/null | head -n 1)
|
||||
|
||||
if test -n "$sock_path"
|
||||
set -gx SSH_AUTH_SOCK "$sock_path"
|
||||
set -gx SSH_AGENT_PID "$agent_pid"
|
||||
|
||||
# Test if agent is responsive
|
||||
if ssh-add -l >/dev/null 2>&1
|
||||
# echo "Connected to existing ssh-agent (PID: $agent_pid)"
|
||||
return 0
|
||||
else
|
||||
# Clean up stale variables
|
||||
set -e SSH_AUTH_SOCK SSH_AGENT_PID
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# Start new ssh-agent
|
||||
# echo "Starting new ssh-agent..."
|
||||
set -l agent_output (ssh-agent -c)
|
||||
|
||||
# Parse output and set variables
|
||||
for line in $agent_output
|
||||
if string match -qr '^setenv SSH_AUTH_SOCK' "$line"
|
||||
set -gx SSH_AUTH_SOCK (string replace -r '^setenv SSH_AUTH_SOCK (.+);$' '$1' "$line" | string trim -c '"')
|
||||
else if string match -qr '^setenv SSH_AGENT_PID' "$line"
|
||||
set -gx SSH_AGENT_PID (string replace -r '^setenv SSH_AGENT_PID (.+);$' '$1' "$line" | string trim -c '"')
|
||||
end
|
||||
end
|
||||
|
||||
# Verify agent started successfully
|
||||
if test -z "$SSH_AUTH_SOCK" -o -z "$SSH_AGENT_PID"
|
||||
# echo "Error: Failed to start ssh-agent" >&2
|
||||
return 1
|
||||
end
|
||||
|
||||
# echo "ssh-agent started (PID: $SSH_AGENT_PID)"
|
||||
end
|
||||
|
||||
|
||||
# bun
|
||||
set --export BUN_INSTALL "$HOME/.bun"
|
||||
set --export PATH $BUN_INSTALL/bin $PATH
|
||||
|
||||
# opencode
|
||||
fish_add_path /home/thomasgl/.opencode/bin
|
||||
|
||||
source ~/.safe-chain/scripts/init-fish.fish # Safe-chain Fish initialization script
|
||||
7
fish/files/config.fish.backup
Normal file
7
fish/files/config.fish.backup
Normal file
@@ -0,0 +1,7 @@
|
||||
source /usr/share/cachyos-fish-config/cachyos-config.fish
|
||||
|
||||
# overwrite greeting
|
||||
# potentially disabling fastfetch
|
||||
#function fish_greeting
|
||||
# # smth smth
|
||||
#end
|
||||
30
fish/files/functions/bw-create-note.fish
Normal file
30
fish/files/functions/bw-create-note.fish
Normal file
@@ -0,0 +1,30 @@
|
||||
function bw-create-note
|
||||
function bw-create-note --argument-names content_or_name name
|
||||
if isatty stdin
|
||||
# Direct input mode
|
||||
set notes_content $content_or_name
|
||||
set note_name $name
|
||||
else
|
||||
# Pipe mode
|
||||
read -z notes_content
|
||||
set note_name $content_or_name
|
||||
end
|
||||
|
||||
# If no name provided, use default
|
||||
if test -z "$note_name"
|
||||
set note_name secure-note
|
||||
end
|
||||
|
||||
# If no content, show usage
|
||||
if test -z "$notes_content"
|
||||
echo "Usage: bw-create-note 'content' 'note name'"
|
||||
echo "Or: command | bw-create-note 'note name'"
|
||||
return 1
|
||||
end
|
||||
|
||||
bw get template item | jq --arg folderId (bw list folders | jq -r '.[] | select(.name == "chezmoi") | .id') \
|
||||
--arg notes "$notes_content" \
|
||||
--arg name "$note_name" \
|
||||
'.type = 2 | .secureNote.type = 0 | .notes=$notes | .name = $name | .folderId=$folderId' | bw encode | bw create item
|
||||
end
|
||||
end
|
||||
3
fish/files/functions/bw-unlock.fish
Normal file
3
fish/files/functions/bw-unlock.fish
Normal file
@@ -0,0 +1,3 @@
|
||||
function bw-unlock
|
||||
set -Ux BW_SESSION (bw unlock --raw || echo "Error unlocking BW")
|
||||
end
|
||||
11
fish/files/functions/pomodoro.fish
Normal file
11
fish/files/functions/pomodoro.fish
Normal file
@@ -0,0 +1,11 @@
|
||||
function pomodoro --argument type
|
||||
set -l durations work 45 break 10
|
||||
set -l idx (contains -i -- $type $durations)
|
||||
|
||||
if test -n "$idx"
|
||||
set -l minutes $durations[(math $idx + 1)]
|
||||
echo $type | lolcat
|
||||
timer {$minutes}m
|
||||
espeak "$type session done"
|
||||
end
|
||||
end
|
||||
6
fish/files/functions/reload-env.fish
Normal file
6
fish/files/functions/reload-env.fish
Normal file
@@ -0,0 +1,6 @@
|
||||
function reload-env
|
||||
for line in (grep -v '^#' /etc/environment | grep '=')
|
||||
set -l pair (string split -m 1 '=' $line)
|
||||
set -gx $pair[1] $pair[2]
|
||||
end
|
||||
end
|
||||
8
fish/files/functions/y.fish
Normal file
8
fish/files/functions/y.fish
Normal file
@@ -0,0 +1,8 @@
|
||||
function y
|
||||
set tmp (mktemp -t "yazi-cwd.XXXXXX")
|
||||
yazi $argv --cwd-file="$tmp"
|
||||
if set cwd (command cat -- "$tmp"); and [ -n "$cwd" ]; and [ "$cwd" != "$PWD" ]
|
||||
builtin cd -- "$cwd"
|
||||
end
|
||||
rm -f -- "$tmp"
|
||||
end
|
||||
49
fish/files/script.sh
Executable file
49
fish/files/script.sh
Executable file
@@ -0,0 +1,49 @@
|
||||
|
||||
|
||||
#!/bin/bash
|
||||
|
||||
# Directory to process
|
||||
TARGET_DIR="/home/thomasgl/.config/fish-backup" # Make sure this is the correct, full path
|
||||
|
||||
# Check if the directory exists
|
||||
if [ ! -d "$TARGET_DIR" ]; then
|
||||
echo "Error: Directory '$TARGET_DIR' not found."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Find symlinks and process them
|
||||
find "$TARGET_DIR" -type l -print0 | while IFS= read -r -d $'\0' SYMLINK; do
|
||||
echo "Processing symlink: $SYMLINK"
|
||||
|
||||
# Get the target of the symlink
|
||||
TARGET=$(readlink "$SYMLINK")
|
||||
|
||||
# Check if readlink was successful and the target exists
|
||||
if [ $? -eq 0 ] && [ -e "$TARGET" ]; then
|
||||
echo " Target: $TARGET"
|
||||
|
||||
# *** Explicitly remove the symlink BEFORE copying ***
|
||||
echo " Removing symlink: $SYMLINK"
|
||||
rm "$SYMLINK"
|
||||
|
||||
# Check if removal was successful
|
||||
if [ $? -eq 0 ]; then
|
||||
# Copy the target file to the location where the symlink was
|
||||
echo " Copying target to $SYMLINK"
|
||||
cp "$TARGET" "$SYMLINK"
|
||||
|
||||
if [ $? -eq 0 ]; then
|
||||
echo " Replaced symlink with a copy of the target."
|
||||
else
|
||||
echo " Error: Failed to copy target to $SYMLINK."
|
||||
fi
|
||||
else
|
||||
echo " Error: Failed to remove symlink: $SYMLINK. Cannot proceed with copy."
|
||||
fi
|
||||
|
||||
else
|
||||
echo " Warning: Could not resolve target for '$SYMLINK' or target does not exist."
|
||||
fi
|
||||
done
|
||||
|
||||
echo "Processing complete."
|
||||
41
fish/files/themes/rose-pine-moon.theme
Normal file
41
fish/files/themes/rose-pine-moon.theme
Normal file
@@ -0,0 +1,41 @@
|
||||
# syntax highlighting variables
|
||||
# https://fishshell.com/docs/current/interactive.html#syntax-highlighting-variables
|
||||
fish_color_normal e0def4
|
||||
fish_color_command c4a7e7
|
||||
fish_color_keyword 9ccfd8
|
||||
fish_color_quote f6c177
|
||||
fish_color_redirection 3e8fb0
|
||||
fish_color_end 908caa
|
||||
fish_color_error eb6f92
|
||||
fish_color_param ea9a97
|
||||
fish_color_comment 908caa
|
||||
# fish_color_match --background=brblue
|
||||
fish_color_selection --reverse
|
||||
# fish_color_history_current --bold
|
||||
fish_color_operator e0def4
|
||||
fish_color_escape 3e8fb0
|
||||
fish_color_autosuggestion 908caa
|
||||
fish_color_cwd ea9a97
|
||||
# fish_color_cwd_root red
|
||||
fish_color_user f6c177
|
||||
fish_color_host 9ccfd8
|
||||
fish_color_host_remote c4a7e7
|
||||
fish_color_cancel e0def4
|
||||
fish_color_search_match --background=232136
|
||||
fish_color_valid_path
|
||||
|
||||
# pager color variables
|
||||
# https://fishshell.com/docs/current/interactive.html#pager-color-variables
|
||||
fish_pager_color_progress ea9a97
|
||||
fish_pager_color_background --background=2a273f
|
||||
fish_pager_color_prefix 9ccfd8
|
||||
fish_pager_color_completion 908caa
|
||||
fish_pager_color_description 908caa
|
||||
fish_pager_color_secondary_background
|
||||
fish_pager_color_secondary_prefix
|
||||
fish_pager_color_secondary_completion
|
||||
fish_pager_color_secondary_description
|
||||
fish_pager_color_selected_background --background=393552
|
||||
fish_pager_color_selected_prefix 9ccfd8
|
||||
fish_pager_color_selected_completion e0def4
|
||||
fish_pager_color_selected_description e0def4
|
||||
Reference in New Issue
Block a user