Compare commits
2 commits
2fc0c04200
...
04bb7b1c37
Author | SHA1 | Date | |
---|---|---|---|
04bb7b1c37 | |||
4c9b31164d |
3 changed files with 31 additions and 2 deletions
26
.config/fish/functions/latex-color.fish
Normal file
26
.config/fish/functions/latex-color.fish
Normal 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
|
3
Makefile
3
Makefile
|
@ -59,11 +59,12 @@ sync-dotconfig:
|
||||||
@$(WGET) $(REPO_SRC)/.config/fish/config.fish -O $(HOME)/.config/fish/config.fish
|
@$(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/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/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-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/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/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/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
|
@$(WGET) $(REPO_SRC)/.config/fish/conf.d/abbr.fish -O $(HOME)/.config/fish/conf.d/abbr.fish
|
||||||
|
|
4
meta.sh
4
meta.sh
|
@ -85,11 +85,13 @@ function main {
|
||||||
# Add aliases
|
# Add aliases
|
||||||
wget -q "${repo}"/.config/fish/conf.d/alias.fish -O "$HOME"/.config/fish/conf.d/alias.fish
|
wget -q "${repo}"/.config/fish/conf.d/alias.fish -O "$HOME"/.config/fish/conf.d/alias.fish
|
||||||
# Add functions
|
# 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/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-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/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/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 ==
|
# === Default editor ==
|
||||||
|
|
Loading…
Reference in a new issue