1
Fork 0
mirror of https://github.com/Steffo99/config-fish.git synced 2025-02-14 07:33:57 +00:00

Compare commits

...

7 commits

11 changed files with 52 additions and 53 deletions

5
.gitignore vendored
View file

@ -1,4 +1,3 @@
/fish_variables
/conf.d/*
!/conf.d/pipx.fish
!/conf.d/rubygems.fish
/functions/sysupdate.fish
/conf.d

View file

@ -31,3 +31,9 @@ complete \
--short-option="x" \
--long-option="tag" \
--description="Add tag"
complete \
--command='ntfy' \
--short-option="m" \
--long-option="markdown" \
--description="Use Markdown"

View file

@ -16,6 +16,3 @@ set -U "fish_color_operator" "cyan"
set -U "fish_color_escape" "green"
set -U "fish_color_autosuggestion" "brblack"
set -U "fish_color_cancel" "white" "--background=brred"
# Logging level
set -U "DOTFISH_LOG_LEVEL" "50"

View file

@ -4,7 +4,7 @@ if [ $status -eq 0 ]
log-t "Creating" "Akkoma" "directory..."
command mkdir --parents "Akkoma"
log-d "Processing" "$argv[1]" "for Akkoma use..."
command magick -background none "$argv[1]"'[106x106]' -gravity 'center' -extent '106x106' $argv[2..-1] "Akkoma/$argv[1]"
command magick -background none "$argv[1]"'[106x106]' -gravity 'center' -extent '106x106' $argv[2..-1] "Akkoma/$argv[1].png"
log-t "Done! Emoji added to the" "Akkoma" "directory!"
end
end

View file

@ -4,7 +4,7 @@ if [ $status -eq 0 ]
log-t "Creating" "Discord" "directory..."
command mkdir --parents "Discord"
log-d "Processing" "$argv[1]" "for Discord use..."
command magick -background none "$argv[1]"'[128x128]' -gravity 'center' -extent '128x128' $argv[2..-1] "Discord/$argv[1]"
command magick -background none "$argv[1]"'[128x128]' -gravity 'center' -extent '128x128' $argv[2..-1] "Discord/$argv[1].png"
log-t "Done! Emoji added to the" "Discord" "directory!"
end
end

View file

@ -1,10 +0,0 @@
which magick --skip-functions >/dev/null 2>/dev/null
if [ $status -eq 0 ]
function gen-emojis-akkoma
for arg in $argv
log-i "Processing" "$arg" "..."
gen-emoji-akkoma "$arg"
end
log-s "All emojis generated successfully!"
end
end

View file

@ -1,12 +0,0 @@
which magick --skip-functions >/dev/null 2>/dev/null
if [ $status -eq 0 ]
function gen-emojis-all
for arg in $argv
log-i "Processing" "$arg" "..."
gen-emoji-akkoma "$arg"
gen-emoji-discord "$arg"
gen-emoji-telegram "$arg"
end
log-s "All emojis generated successfully!"
end
end

View file

@ -1,10 +0,0 @@
which magick --skip-functions >/dev/null 2>/dev/null
if [ $status -eq 0 ]
function gen-emojis-discord
for arg in $argv
log-i "Processing" "$arg" "..."
gen-emoji-discord "$arg"
end
log-s "All emojis generated successfully!"
end
end

View file

@ -1,10 +0,0 @@
which magick --skip-functions >/dev/null 2>/dev/null
if [ $status -eq 0 ]
function gen-emojis-telegram
for arg in $argv
log-i "Processing" "$arg" "..."
gen-emoji-telegram "$arg"
end
log-s "All emojis generated successfully!"
end
end

27
functions/gen-emojis.fish Normal file
View file

@ -0,0 +1,27 @@
which magick --skip-functions >/dev/null 2>/dev/null
if [ $status -eq 0 ]
function gen-emojis
for arg in $argv
log-i "Processing" "$arg" "..."
for arg in $argv
log-i "Processing" "$arg" "..."
gen-emoji-akkoma "$arg"
end
log-s "All emojis generated successfully!"
for arg in $argv
log-i "Processing" "$arg" "..."
gen-emoji-discord "$arg"
end
log-s "All emojis generated successfully!"
for arg in $argv
log-i "Processing" "$arg" "..."
gen-emoji-telegram "$arg"
end
log-s "All emojis generated successfully!"
end
log-s "All emojis generated successfully!"
end
end

View file

@ -6,6 +6,7 @@ if [ $status -eq 0 ]
(fish_opt --short="t" --long="title" --optional-val) \
(fish_opt --short="p" --long="priority" --optional-val) \
(fish_opt --short="x" --long="tag" --multiple-vals) \
(fish_opt --short="m" --long="markdown") \
-- $argv
if [ $status -ne 0 ]
@ -18,11 +19,17 @@ if [ $status -eq 0 ]
log-t "Title is:" "$_flag_title"
log-t "Priority is:" "$_flag_priority"
log-t "Tags are:" "$_flag_tag"
log-t "Markdown is:" "$_flag_markdown"
log-t "Message is:" "$argv"
if [ -z "$_flag_topic" ]
log-f "Missing" "topic" "."
return 2
if [ -z "$hostname" ]
log-d "Missing" "topic and hostname" ", defaulting to 'general'."
set _flag_topic "general"
else
log-d "Missing" "topic" ", defaulting to 'host_$hostname'."
set _flag_topic "host_$hostname"
end
end
if [ -z "$_flag_priority" ]
@ -44,7 +51,11 @@ if [ $status -eq 0 ]
set header_tags "X-Tags: $_flag_tag"
log-t "Created header:" "$header_tags"
end
if [ -n "$_flag_markdown" ]
set header_markdown "X-Markdown: 1"
log-t "Created header:" "$header_markdown"
end
log-i "Sending $_flag_priority notification to" "$_flag_topic" " with tags [$_flag_tag]..."
@ -54,6 +65,7 @@ if [ $status -eq 0 ]
--header "$header_title" \
--header "$header_priority" \
--header "$header_tags" \
--header "$header_markdown" \
--data "$argv" \
--silent
)