Compare commits

...

2 commits

Author SHA1 Message Date
04bb7b1c37
add latex-color function 2024-10-06 18:07:45 +02:00
4c9b31164d
reorder and add update-theme to installation 2024-10-06 18:07:33 +02:00
3 changed files with 31 additions and 2 deletions

View file

@ -0,0 +1,26 @@
function latexcolor --description "Get the LaTeX color from HEX code"
# Declare our arguments
argparse h/help -- $argv
# Get function name
set current_name $(status current-function)
# Check if not enough arguments provided, or help menu
if set -ql _flag_help || test -z $argv[2]
echo -e "Usage: $current_name hex"
echo -e " $current_name [-h|--help] \t\t - Show this help message"
return 0
end
set hex $argv[1]
if string match -r '^#' -- $hex
set hex (string sub -s 2 $hex)
end
# Convert hex to RGB
set r (math "0x${hex[1..2]} / 255")
set g (math "0x${hex[3..4]} / 255")
set b (math "0x${hex[5..6]} / 255")
printf "{%.2f, %.2f, %.2f}\n" $r $g $b
end

View file

@ -59,11 +59,12 @@ sync-dotconfig:
@$(WGET) $(REPO_SRC)/.config/fish/config.fish -O $(HOME)/.config/fish/config.fish
@$(WGET) $(REPO_SRC)/.config/fish/functions/fish_prompt.fish -O $(HOME)/.config/fish/functions/fish_prompt.fish
@$(WGET) $(REPO_SRC)/.config/fish/functions/catall.fish -O $(HOME)/.config/fish/functions/catall.fish
@$(WGET) $(REPO_SRC)/.config/fish/functions/latex-color.fish -O $(HOME)/.config/fish/functions/latex-color.fish
@$(WGET) $(REPO_SRC)/.config/fish/functions/makeaway.fish -O $(HOME)/.config/fish/functions/makeaway.fish
@$(WGET) $(REPO_SRC)/.config/fish/functions/ssh-export.fish -O $(HOME)/.config/fish/functions/ssh-export.fish
@$(WGET) $(REPO_SRC)/.config/fish/functions/ssh-import.fish -O $(HOME)/.config/fish/functions/ssh-import.fish
@$(WGET) $(REPO_SRC)/.config/fish/functions/ugc.fish -O $(HOME)/.config/fish/functions/ugc.fish
@$(WGET) $(REPO_SRC)/.config/fish/functions/catall.fish -O $(HOME)/.config/fish/functions/catall.fish
@$(WGET) $(REPO_SRC)/.config/fish/functions/update-theme.fish -O $(HOME)/.config/fish/functions/update-theme.fish
@$(WGET) $(REPO_SRC)/.config/fish/conf.d/abbr.fish -O $(HOME)/.config/fish/conf.d/abbr.fish

View file

@ -85,11 +85,13 @@ function main {
# Add aliases
wget -q "${repo}"/.config/fish/conf.d/alias.fish -O "$HOME"/.config/fish/conf.d/alias.fish
# Add functions
wget -q "${repo}"/.config/fish/functions/catall.fish -P "$HOME"/.config/fish/functions/
wget -q "${repo}"/.config/fish/functions/latex-color.fish -P "$HOME"/.config/fish/functions/
wget -q "${repo}"/.config/fish/functions/makeaway.fish -P "$HOME"/.config/fish/functions/
wget -q "${repo}"/.config/fish/functions/ssh-export.fish -P "$HOME"/.config/fish/functions/
wget -q "${repo}"/.config/fish/functions/ssh-import.fish -P "$HOME"/.config/fish/functions/
wget -q "${repo}"/.config/fish/functions/ugc.fish -P "$HOME"/.config/fish/functions/
wget -q "${repo}"/.config/fish/functions/catall.fish -P "$HOME"/.config/fish/functions/
wget -q "${repo}"/.config/fish/functions/update-theme.fish -P "$HOME"/.config/fish/functions/
# === Default editor ==