From ffb627522407487c4c0e9f001250dbf78d17b35f Mon Sep 17 00:00:00 2001 From: van muscari Date: Sat, 16 Nov 2024 08:04:26 -0500 Subject: [PATCH 1/4] Add Custom Header Generator Added Folder for fonts Moved down header to be able to reach fonts easily Added figlet font parser to the header file --- lua/dashboard/fonts/ANSI Regular.flf | 722 +++++++++++++++++++++++++++ lua/dashboard/fonts/ANSI Shadow.flf | 722 +++++++++++++++++++++++++++ lua/dashboard/{theme => }/header.lua | 106 +++- lua/dashboard/theme/doom.lua | 2 +- lua/dashboard/theme/hyper.lua | 2 +- 5 files changed, 1548 insertions(+), 6 deletions(-) create mode 100644 lua/dashboard/fonts/ANSI Regular.flf create mode 100644 lua/dashboard/fonts/ANSI Shadow.flf rename lua/dashboard/{theme => }/header.lua (79%) diff --git a/lua/dashboard/fonts/ANSI Regular.flf b/lua/dashboard/fonts/ANSI Regular.flf new file mode 100644 index 00000000..381f9ce7 --- /dev/null +++ b/lua/dashboard/fonts/ANSI Regular.flf @@ -0,0 +1,722 @@ +flf2a$ 7 7 13 0 7 0 64 0 +Font Author: ? + +More Info: + +https://web.archive.org/web/20120819044459/http://www.roysac.com/thedrawfonts-tdf.asp + +FIGFont created with: http://patorjk.com/figfont-editor +$ $@ +$ $@ +$ $@ +$ $@ +$ $@ +$ $@ +$ $@@ +██ @ +██ @ +██ @ +   @ +██ @ +   @ + @@ +@ +@ +@ +@ +@ +@ +@@ + ██  ██  @ +████████ @ + ██  ██  @ +████████ @ + ██  ██  @ +         @ + @@ +▄▄███▄▄·@ +██      @ +███████ @ +     ██ @ +███████ @ +  ▀▀▀   @ + @@ +██  ██ @ +   ██  @ + ██   @ + ██   @ +██  ██ @ +       @ + @@ + ██  @ + ██  @ +████████ @ +██  ██   @ +██████  @ +        @ + @@ +@ +@ +@ +@ +@ +@ +@@ + ██ @ +██  @ +██  @ +██  @ + ██ @ +    @ + @@ +██  @ + ██ @ + ██ @ + ██ @ +██  @ +    @ + @@ + @ +▄ ██ ▄@ + ████ @ +▀ ██ ▀@ +     @ + @ + @@ +@ +@ +@ +@ +@ +@ +@@ + @ + @ + @ + @ +▄█ @ +   @ + @@ + @ + @ +█████ @ +      @ + @ + @ + @@ + @ + @ + @ + @ +██ @ +   @ + @@ + ██ @ + ██  @ + ██   @ + ██   @ +██   @ +    @ + @@ + ██████  @ +██  ████ @ +██ ██ ██ @ +████  ██ @ + ██████  @ +         @ + @@ + ██ @ +███ @ + ██ @ + ██ @ + ██ @ +    @ + @@ +██████  @ +     ██ @ + █████  @ +██      @ +███████ @ +        @ + @@ +██████  @ +     ██ @ + █████  @ +     ██ @ +██████  @ +        @ + @@ +██  ██ @ +██  ██ @ +███████ @ +     ██ @ + ██ @ +    @ + @@ +███████ @ +██      @ +███████ @ +     ██ @ +███████ @ +        @ + @@ + ██████  @ +██       @ +███████  @ +██    ██ @ + ██████  @ +         @ + @@ +███████ @ +     ██ @ + ██  @ + ██   @ + ██  @ +     @ + @@ + █████  @ +██   ██ @ + █████  @ +██   ██ @ + █████  @ +        @ + @@ + █████  @ +██   ██ @ + ██████ @ +     ██ @ + █████  @ +        @ + @@ + @ +██ @ +   @ +██ @ +   @ + @ + @@ + @ +██ @ +   @ +▄█ @ +▀  @ + @ + @@ + ██ @ + ██  @ +██   @ + ██  @ +  ██ @ +    @ + @@ +@ +@ +@ +@ +@ +@ +@@ +██  @ + ██  @ +  ██ @ + ██  @ +██   @ +    @ + @@ +██████  @ +     ██ @ + ▄███  @ + ▀▀    @ + ██  @ +     @ + @@ + ██████  @ +██    ██ @ +██ ██ ██ @ +██ ██ ██ @ + █ ████  @ +         @ + @@ + █████  @ +██   ██ @ +███████ @ +██   ██ @ +██  ██ @ +       @ + @@ +██████  @ +██   ██ @ +██████  @ +██   ██ @ +██████  @ +        @ + @@ + ██████ @ +██      @ +██  @ +██  @ + ██████ @ +        @ + @@ +██████  @ +██   ██ @ +██  ██ @ +██  ██ @ +██████  @ +        @ + @@ +███████ @ +██      @ +█████  @ +██     @ +███████ @ +        @ + @@ +███████ @ +██      @ +█████  @ +██     @ +██  @ +    @ + @@ + ██████  @ +██       @ +██  ███ @ +██  ██ @ + ██████  @ +         @ + @@ +██  ██ @ +██  ██ @ +███████ @ +██   ██ @ +██  ██ @ +       @ + @@ +██ @ +██ @ +██ @ +██ @ +██ @ +   @ + @@ + ██ @ + ██ @ + ██ @ +██ ██ @ + █████  @ +        @ + @@ +██  ██ @ +██  ██  @ +█████   @ +██  ██  @ +██  ██ @ +       @ + @@ +██  @ +██  @ +██  @ +██  @ +███████ @ +        @ + @@ +███  ███ @ +████  ████ @ +██ ████ ██ @ +██  ██  ██ @ +██      ██ @ +       @ + @@ +███  ██ @ +████  ██ @ +██ ██  ██ @ +██  ██ ██ @ +██   ████ @ +         @ + @@ + ██████  @ +██    ██ @ +██  ██ @ +██  ██ @ + ██████  @ +         @ + @@ +██████  @ +██   ██ @ +██████  @ +██      @ +██  @ +    @ + @@ + ██████  @ +██    ██ @ +██  ██ @ +██ ▄▄ ██ @ + ██████  @ +    ▀▀   @ + @@ +██████  @ +██   ██ @ +██████  @ +██   ██ @ +██  ██ @ +       @ + @@ +███████ @ +██      @ +███████ @ +     ██ @ +███████ @ +        @ + @@ +████████ @ +   ██    @ + ██  @ + ██  @ + ██  @ +     @ + @@ +██  ██ @ +██  ██ @ +██  ██ @ +██  ██ @ + ██████  @ +         @ + @@ +██  ██ @ +██  ██ @ +██  ██ @ + ██  ██  @ +  ████   @ +       @ + @@ +██  ██ @ +██  ██ @ +██  █  ██ @ +██ ███ ██ @ + ███ ███  @ +          @ + @@ +██  ██ @ + ██ ██  @ +  ███   @ + ██ ██  @ +██   ██ @ +       @ + @@ +██  ██ @ + ██  ██  @ +  ████   @ +  ██   @ + ██  @ +     @ + @@ +███████ @ +   ███  @ + ███   @ + ███   @ +███████ @ +        @ + @@ +███ @ +██  @ +██  @ +██  @ +███ @ +    @ + @@ +@ +@ +@ +@ +@ +@ +@@ +███ @ + ██ @ + ██ @ + ██ @ +███ @ +    @ + @@ + ███  @ +██ ██ @ +      @ + @ + @ + @ + @@ + @ + @ + @ + @ +███████ @ +        @ + @@ +@ +@ +@ +@ +@ +@ +@@ + █████  @ +██   ██ @ +███████ @ +██   ██ @ +██  ██ @ +       @ + @@ +██████  @ +██   ██ @ +██████  @ +██   ██ @ +██████  @ +        @ + @@ + ██████ @ +██      @ +██  @ +██  @ + ██████ @ +        @ + @@ +██████  @ +██   ██ @ +██  ██ @ +██  ██ @ +██████  @ +        @ + @@ +███████ @ +██      @ +█████  @ +██     @ +███████ @ +        @ + @@ +███████ @ +██      @ +█████  @ +██     @ +██  @ +    @ + @@ + ██████  @ +██       @ +██  ███ @ +██  ██ @ + ██████  @ +         @ + @@ +██  ██ @ +██  ██ @ +███████ @ +██   ██ @ +██  ██ @ +       @ + @@ +██ @ +██ @ +██ @ +██ @ +██ @ +   @ + @@ + ██ @ + ██ @ + ██ @ +██ ██ @ + █████  @ +        @ + @@ +██  ██ @ +██  ██  @ +█████   @ +██  ██  @ +██  ██ @ +       @ + @@ +██  @ +██  @ +██  @ +██  @ +███████ @ +        @ + @@ +███  ███ @ +████  ████ @ +██ ████ ██ @ +██  ██  ██ @ +██      ██ @ +       @ + @@ +███  ██ @ +████  ██ @ +██ ██  ██ @ +██  ██ ██ @ +██   ████ @ +         @ + @@ + ██████  @ +██    ██ @ +██  ██ @ +██  ██ @ + ██████  @ +         @ + @@ +██████  @ +██   ██ @ +██████  @ +██      @ +██  @ +    @ + @@ + ██████  @ +██    ██ @ +██  ██ @ +██ ▄▄ ██ @ + ██████  @ +    ▀▀   @ + @@ +██████  @ +██   ██ @ +██████  @ +██   ██ @ +██  ██ @ +       @ + @@ +███████ @ +██      @ +███████ @ +     ██ @ +███████ @ +        @ + @@ +████████ @ +   ██    @ + ██  @ + ██  @ + ██  @ +     @ + @@ +██  ██ @ +██  ██ @ +██  ██ @ +██  ██ @ + ██████  @ +         @ + @@ +██  ██ @ +██  ██ @ +██  ██ @ + ██  ██  @ +  ████   @ +       @ + @@ +██  ██ @ +██  ██ @ +██  █  ██ @ +██ ███ ██ @ + ███ ███  @ +          @ + @@ +██  ██ @ + ██ ██  @ +  ███   @ + ██ ██  @ +██   ██ @ +       @ + @@ +██  ██ @ + ██  ██  @ +  ████   @ +  ██   @ + ██  @ +     @ + @@ +███████ @ +   ███  @ + ███   @ + ███   @ +███████ @ +        @ + @@ +@ +@ +@ +@ +@ +@ +@@ +@ +@ +@ +@ +@ +@ +@@ +@ +@ +@ +@ +@ +@ +@@ +@ +@ +@ +@ +@ +@ +@@ +@ +@ +@ +@ +@ +@ +@@ +@ +@ +@ +@ +@ +@ +@@ +@ +@ +@ +@ +@ +@ +@@ +@ +@ +@ +@ +@ +@ +@@ +@ +@ +@ +@ +@ +@ +@@ +@ +@ +@ +@ +@ +@ +@@ +@ +@ +@ +@ +@ +@ +@@ \ No newline at end of file diff --git a/lua/dashboard/fonts/ANSI Shadow.flf b/lua/dashboard/fonts/ANSI Shadow.flf new file mode 100644 index 00000000..61ee783f --- /dev/null +++ b/lua/dashboard/fonts/ANSI Shadow.flf @@ -0,0 +1,722 @@ +flf2a$ 7 7 13 0 7 0 64 0 +Font Author: ? + +More Info: + +https://web.archive.org/web/20120819044459/http://www.roysac.com/thedrawfonts-tdf.asp + +FIGFont created with: http://patorjk.com/figfont-editor +$ $@ +$ $@ +$ $@ +$ $@ +$ $@ +$ $@ +$ $@@ +██╗@ +██║@ +██║@ +╚═╝@ +██╗@ +╚═╝@ + @@ +@ +@ +@ +@ +@ +@ +@@ + ██╗ ██╗ @ +████████╗@ +╚██╔═██╔╝@ +████████╗@ +╚██╔═██╔╝@ + ╚═╝ ╚═╝ @ + @@ +▄▄███▄▄·@ +██╔════╝@ +███████╗@ +╚════██║@ +███████║@ +╚═▀▀▀══╝@ + @@ +██╗ ██╗@ +╚═╝██╔╝@ + ██╔╝ @ + ██╔╝ @ +██╔╝██╗@ +╚═╝ ╚═╝@ + @@ + ██╗ @ + ██║ @ +████████╗@ +██╔═██╔═╝@ +██████║ @ +╚═════╝ @ + @@ +@ +@ +@ +@ +@ +@ +@@ + ██╗@ +██╔╝@ +██║ @ +██║ @ +╚██╗@ + ╚═╝@ + @@ +██╗ @ +╚██╗@ + ██║@ + ██║@ +██╔╝@ +╚═╝ @ + @@ + @ +▄ ██╗▄@ + ████╗@ +▀╚██╔▀@ + ╚═╝ @ + @ + @@ +@ +@ +@ +@ +@ +@ +@@ + @ + @ + @ + @ +▄█╗@ +╚═╝@ + @@ + @ + @ +█████╗@ +╚════╝@ + @ + @ + @@ + @ + @ + @ + @ +██╗@ +╚═╝@ + @@ + ██╗@ + ██╔╝@ + ██╔╝ @ + ██╔╝ @ +██╔╝ @ +╚═╝ @ + @@ + ██████╗ @ +██╔═████╗@ +██║██╔██║@ +████╔╝██║@ +╚██████╔╝@ + ╚═════╝ @ + @@ + ██╗@ +███║@ +╚██║@ + ██║@ + ██║@ + ╚═╝@ + @@ +██████╗ @ +╚════██╗@ + █████╔╝@ +██╔═══╝ @ +███████╗@ +╚══════╝@ + @@ +██████╗ @ +╚════██╗@ + █████╔╝@ + ╚═══██╗@ +██████╔╝@ +╚═════╝ @ + @@ +██╗ ██╗@ +██║ ██║@ +███████║@ +╚════██║@ + ██║@ + ╚═╝@ + @@ +███████╗@ +██╔════╝@ +███████╗@ +╚════██║@ +███████║@ +╚══════╝@ + @@ + ██████╗ @ +██╔════╝ @ +███████╗ @ +██╔═══██╗@ +╚██████╔╝@ + ╚═════╝ @ + @@ +███████╗@ +╚════██║@ + ██╔╝@ + ██╔╝ @ + ██║ @ + ╚═╝ @ + @@ + █████╗ @ +██╔══██╗@ +╚█████╔╝@ +██╔══██╗@ +╚█████╔╝@ + ╚════╝ @ + @@ + █████╗ @ +██╔══██╗@ +╚██████║@ + ╚═══██║@ + █████╔╝@ + ╚════╝ @ + @@ + @ +██╗@ +╚═╝@ +██╗@ +╚═╝@ + @ + @@ + @ +██╗@ +╚═╝@ +▄█╗@ +▀═╝@ + @ + @@ + ██╗@ + ██╔╝@ +██╔╝ @ +╚██╗ @ + ╚██╗@ + ╚═╝@ + @@ +@ +@ +@ +@ +@ +@ +@@ +██╗ @ +╚██╗ @ + ╚██╗@ + ██╔╝@ +██╔╝ @ +╚═╝ @ + @@ +██████╗ @ +╚════██╗@ + ▄███╔╝@ + ▀▀══╝ @ + ██╗ @ + ╚═╝ @ + @@ + ██████╗ @ +██╔═══██╗@ +██║██╗██║@ +██║██║██║@ +╚█║████╔╝@ + ╚╝╚═══╝ @ + @@ + █████╗ @ +██╔══██╗@ +███████║@ +██╔══██║@ +██║ ██║@ +╚═╝ ╚═╝@ + @@ +██████╗ @ +██╔══██╗@ +██████╔╝@ +██╔══██╗@ +██████╔╝@ +╚═════╝ @ + @@ + ██████╗@ +██╔════╝@ +██║ @ +██║ @ +╚██████╗@ + ╚═════╝@ + @@ +██████╗ @ +██╔══██╗@ +██║ ██║@ +██║ ██║@ +██████╔╝@ +╚═════╝ @ + @@ +███████╗@ +██╔════╝@ +█████╗ @ +██╔══╝ @ +███████╗@ +╚══════╝@ + @@ +███████╗@ +██╔════╝@ +█████╗ @ +██╔══╝ @ +██║ @ +╚═╝ @ + @@ + ██████╗ @ +██╔════╝ @ +██║ ███╗@ +██║ ██║@ +╚██████╔╝@ + ╚═════╝ @ + @@ +██╗ ██╗@ +██║ ██║@ +███████║@ +██╔══██║@ +██║ ██║@ +╚═╝ ╚═╝@ + @@ +██╗@ +██║@ +██║@ +██║@ +██║@ +╚═╝@ + @@ + ██╗@ + ██║@ + ██║@ +██ ██║@ +╚█████╔╝@ + ╚════╝ @ + @@ +██╗ ██╗@ +██║ ██╔╝@ +█████╔╝ @ +██╔═██╗ @ +██║ ██╗@ +╚═╝ ╚═╝@ + @@ +██╗ @ +██║ @ +██║ @ +██║ @ +███████╗@ +╚══════╝@ + @@ +███╗ ███╗@ +████╗ ████║@ +██╔████╔██║@ +██║╚██╔╝██║@ +██║ ╚═╝ ██║@ +╚═╝ ╚═╝@ + @@ +███╗ ██╗@ +████╗ ██║@ +██╔██╗ ██║@ +██║╚██╗██║@ +██║ ╚████║@ +╚═╝ ╚═══╝@ + @@ + ██████╗ @ +██╔═══██╗@ +██║ ██║@ +██║ ██║@ +╚██████╔╝@ + ╚═════╝ @ + @@ +██████╗ @ +██╔══██╗@ +██████╔╝@ +██╔═══╝ @ +██║ @ +╚═╝ @ + @@ + ██████╗ @ +██╔═══██╗@ +██║ ██║@ +██║▄▄ ██║@ +╚██████╔╝@ + ╚══▀▀═╝ @ + @@ +██████╗ @ +██╔══██╗@ +██████╔╝@ +██╔══██╗@ +██║ ██║@ +╚═╝ ╚═╝@ + @@ +███████╗@ +██╔════╝@ +███████╗@ +╚════██║@ +███████║@ +╚══════╝@ + @@ +████████╗@ +╚══██╔══╝@ + ██║ @ + ██║ @ + ██║ @ + ╚═╝ @ + @@ +██╗ ██╗@ +██║ ██║@ +██║ ██║@ +██║ ██║@ +╚██████╔╝@ + ╚═════╝ @ + @@ +██╗ ██╗@ +██║ ██║@ +██║ ██║@ +╚██╗ ██╔╝@ + ╚████╔╝ @ + ╚═══╝ @ + @@ +██╗ ██╗@ +██║ ██║@ +██║ █╗ ██║@ +██║███╗██║@ +╚███╔███╔╝@ + ╚══╝╚══╝ @ + @@ +██╗ ██╗@ +╚██╗██╔╝@ + ╚███╔╝ @ + ██╔██╗ @ +██╔╝ ██╗@ +╚═╝ ╚═╝@ + @@ +██╗ ██╗@ +╚██╗ ██╔╝@ + ╚████╔╝ @ + ╚██╔╝ @ + ██║ @ + ╚═╝ @ + @@ +███████╗@ +╚══███╔╝@ + ███╔╝ @ + ███╔╝ @ +███████╗@ +╚══════╝@ + @@ +███╗@ +██╔╝@ +██║ @ +██║ @ +███╗@ +╚══╝@ + @@ +@ +@ +@ +@ +@ +@ +@@ +███╗@ +╚██║@ + ██║@ + ██║@ +███║@ +╚══╝@ + @@ + ███╗ @ +██╔██╗@ +╚═╝╚═╝@ + @ + @ + @ + @@ + @ + @ + @ + @ +███████╗@ +╚══════╝@ + @@ +@ +@ +@ +@ +@ +@ +@@ + █████╗ @ +██╔══██╗@ +███████║@ +██╔══██║@ +██║ ██║@ +╚═╝ ╚═╝@ + @@ +██████╗ @ +██╔══██╗@ +██████╔╝@ +██╔══██╗@ +██████╔╝@ +╚═════╝ @ + @@ + ██████╗@ +██╔════╝@ +██║ @ +██║ @ +╚██████╗@ + ╚═════╝@ + @@ +██████╗ @ +██╔══██╗@ +██║ ██║@ +██║ ██║@ +██████╔╝@ +╚═════╝ @ + @@ +███████╗@ +██╔════╝@ +█████╗ @ +██╔══╝ @ +███████╗@ +╚══════╝@ + @@ +███████╗@ +██╔════╝@ +█████╗ @ +██╔══╝ @ +██║ @ +╚═╝ @ + @@ + ██████╗ @ +██╔════╝ @ +██║ ███╗@ +██║ ██║@ +╚██████╔╝@ + ╚═════╝ @ + @@ +██╗ ██╗@ +██║ ██║@ +███████║@ +██╔══██║@ +██║ ██║@ +╚═╝ ╚═╝@ + @@ +██╗@ +██║@ +██║@ +██║@ +██║@ +╚═╝@ + @@ + ██╗@ + ██║@ + ██║@ +██ ██║@ +╚█████╔╝@ + ╚════╝ @ + @@ +██╗ ██╗@ +██║ ██╔╝@ +█████╔╝ @ +██╔═██╗ @ +██║ ██╗@ +╚═╝ ╚═╝@ + @@ +██╗ @ +██║ @ +██║ @ +██║ @ +███████╗@ +╚══════╝@ + @@ +███╗ ███╗@ +████╗ ████║@ +██╔████╔██║@ +██║╚██╔╝██║@ +██║ ╚═╝ ██║@ +╚═╝ ╚═╝@ + @@ +███╗ ██╗@ +████╗ ██║@ +██╔██╗ ██║@ +██║╚██╗██║@ +██║ ╚████║@ +╚═╝ ╚═══╝@ + @@ + ██████╗ @ +██╔═══██╗@ +██║ ██║@ +██║ ██║@ +╚██████╔╝@ + ╚═════╝ @ + @@ +██████╗ @ +██╔══██╗@ +██████╔╝@ +██╔═══╝ @ +██║ @ +╚═╝ @ + @@ + ██████╗ @ +██╔═══██╗@ +██║ ██║@ +██║▄▄ ██║@ +╚██████╔╝@ + ╚══▀▀═╝ @ + @@ +██████╗ @ +██╔══██╗@ +██████╔╝@ +██╔══██╗@ +██║ ██║@ +╚═╝ ╚═╝@ + @@ +███████╗@ +██╔════╝@ +███████╗@ +╚════██║@ +███████║@ +╚══════╝@ + @@ +████████╗@ +╚══██╔══╝@ + ██║ @ + ██║ @ + ██║ @ + ╚═╝ @ + @@ +██╗ ██╗@ +██║ ██║@ +██║ ██║@ +██║ ██║@ +╚██████╔╝@ + ╚═════╝ @ + @@ +██╗ ██╗@ +██║ ██║@ +██║ ██║@ +╚██╗ ██╔╝@ + ╚████╔╝ @ + ╚═══╝ @ + @@ +██╗ ██╗@ +██║ ██║@ +██║ █╗ ██║@ +██║███╗██║@ +╚███╔███╔╝@ + ╚══╝╚══╝ @ + @@ +██╗ ██╗@ +╚██╗██╔╝@ + ╚███╔╝ @ + ██╔██╗ @ +██╔╝ ██╗@ +╚═╝ ╚═╝@ + @@ +██╗ ██╗@ +╚██╗ ██╔╝@ + ╚████╔╝ @ + ╚██╔╝ @ + ██║ @ + ╚═╝ @ + @@ +███████╗@ +╚══███╔╝@ + ███╔╝ @ + ███╔╝ @ +███████╗@ +╚══════╝@ + @@ +@ +@ +@ +@ +@ +@ +@@ +@ +@ +@ +@ +@ +@ +@@ +@ +@ +@ +@ +@ +@ +@@ +@ +@ +@ +@ +@ +@ +@@ +@ +@ +@ +@ +@ +@ +@@ +@ +@ +@ +@ +@ +@ +@@ +@ +@ +@ +@ +@ +@ +@@ +@ +@ +@ +@ +@ +@ +@@ +@ +@ +@ +@ +@ +@ +@@ +@ +@ +@ +@ +@ +@ +@@ +@ +@ +@ +@ +@ +@ +@@ \ No newline at end of file diff --git a/lua/dashboard/theme/header.lua b/lua/dashboard/header.lua similarity index 79% rename from lua/dashboard/theme/header.lua rename to lua/dashboard/header.lua index 5ffbbc07..e18b7653 100644 --- a/lua/dashboard/theme/header.lua +++ b/lua/dashboard/header.lua @@ -89,6 +89,99 @@ local function default_header() } end +-- Example flf2a$ 7 7 13 0 7 0 64 0 +local function parse_flf_header(sigil_string) + local fig_header = {} + local i = 1 + for v in sigil_string:gmatch('%w+') do + if i == 2 then + fig_header['height'] = tonumber(v) + end + if i == 3 then + fig_header['baseline'] = tonumber(v) + end + if i == 4 then + fig_header['max_length'] = tonumber(v) + end + if i == 5 then + fig_header['old_layout'] = tonumber(v) + end + if i == 6 then + fig_header['comment_lines'] = tonumber(v) + end + if i == 6 then + fig_header['print_direction'] = tonumber(v) + end + if i == 6 then + fig_header['full_layout'] = tonumber(v) + end + if i == 6 then + fig_header['codetag_count'] = tonumber(v) + end + i = i + 1 + end + print(' ') + return fig_header +end + +-- WARN :This is by no means full support for fliglet fonts. +local function flf_table_gen(font_type) + local flf_table = {} + local flf = io.open(font_type, 'r') + local flf_header = nil + local value = flf:read('*l') + local i = 1 + local byte = 32 -- start byte offsest to ascii space + + while value do + if flf_header == nil then + if string.sub(value, 0, 6) == 'flf2a$' then + flf_header = parse_flf_header(value) + end + elseif i > flf_header.comment_lines + 1 then + local symbol_line = ((i - flf_header.comment_lines - 2) % flf_header.height) + 1 + if symbol_line == 1 then + flf_table[byte] = {} + end + + value = string.gsub(value, '%$', ' ') + value = string.gsub(value, '@', '') + + flf_table[byte][symbol_line] = value + if symbol_line == 7 then + byte = byte + 1 + end + end + value = flf:read('*l') + i = i + 1 + end + + return flf_table, flf_header +end + +local function string_to_bytes_list(str) + local str_bytes = {} + for i in str:gmatch('.') do + table.insert(str_bytes, string.byte(i)) + end + return str_bytes +end + +local function custom_header(input, font_type) + local input_bytes = string_to_bytes_list(input) + local font_path = './fonts/' .. font_type .. '.flf' + local tbl, head = flf_table_gen(font_path) + local output = {} + for i = 1, head['height'] do + output[i] = '' + for _, v in pairs(input_bytes) do + output[i] = output[i] .. tbl[v][i] + end + print(output[i]) + end + return output +end + local function week_header(concat, append) local week = week_ascii_text() local daysoftheweek = @@ -108,10 +201,15 @@ local function generate_header(config) vim.bo[config.bufnr].modifiable = true end if not config.command then - local header = config.week_header - and config.week_header.enable - and week_header(config.week_header.concat, config.week_header.append) - or (config.header or default_header()) + local header = nil + if config.header.type == 'week' then + header = week_header(config.header.concat, config.header.append) + elseif config.header.type == 'custom' then + header = custom_header(config.header.text, config.header.font) + else + header = default_header() + end + print(header) api.nvim_buf_set_lines(config.bufnr, 0, -1, false, utils.center_align(header)) for i, _ in ipairs(header) do diff --git a/lua/dashboard/theme/doom.lua b/lua/dashboard/theme/doom.lua index 5cad0cc2..76519bb7 100644 --- a/lua/dashboard/theme/doom.lua +++ b/lua/dashboard/theme/doom.lua @@ -208,7 +208,7 @@ end ---@private local function theme_instance(config) - require('dashboard.theme.header').generate_header(config) + require('dashboard.header').generate_header(config) generate_center(config) generate_footer(config) api.nvim_set_option_value('modifiable', false, { buf = config.bufnr }) diff --git a/lua/dashboard/theme/hyper.lua b/lua/dashboard/theme/hyper.lua index d555ae68..5d7261cf 100644 --- a/lua/dashboard/theme/hyper.lua +++ b/lua/dashboard/theme/hyper.lua @@ -525,7 +525,7 @@ local function theme_instance(config) if config.disable_move then utils.disable_move_key(config.bufnr) end - require('dashboard.theme.header').generate_header(config) + require('dashboard.header').generate_header(config) if not config.shortcut or not vim.tbl_isempty(config.shortcut) then gen_shortcut(config) end From 7c4cbd389f2cf312ea2296947c3414b769ab7bdc Mon Sep 17 00:00:00 2001 From: van muscari Date: Sat, 16 Nov 2024 08:07:37 -0500 Subject: [PATCH 2/4] Update init for custom header option --- lua/dashboard/init.lua | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lua/dashboard/init.lua b/lua/dashboard/init.lua index 7286e6c3..c3e3a497 100644 --- a/lua/dashboard/init.lua +++ b/lua/dashboard/init.lua @@ -40,10 +40,12 @@ local function default_options() buffer_name = 'Dashboard', change_to_vcs_root = false, config = { - week_header = { - enable = false, - concat = nil, - append = nil, + header = { + type = 'defualt', --defualt, week, or custom + text = 'Custom Header', --custom option + font = 'ANSI Shadow', --custom font option + concat = nil, --week option + append = nil, --week option }, }, hide = { From db5899822a962d7a0939cd19e413ac5179c130c2 Mon Sep 17 00:00:00 2001 From: Van Muscari <24694965+vamuscari@users.noreply.github.com> Date: Sat, 16 Nov 2024 08:39:24 -0500 Subject: [PATCH 3/4] [Fix] Fix flf header --- lua/dashboard/header.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lua/dashboard/header.lua b/lua/dashboard/header.lua index e18b7653..2d32454c 100644 --- a/lua/dashboard/header.lua +++ b/lua/dashboard/header.lua @@ -109,13 +109,13 @@ local function parse_flf_header(sigil_string) if i == 6 then fig_header['comment_lines'] = tonumber(v) end - if i == 6 then + if i == 7 then fig_header['print_direction'] = tonumber(v) end - if i == 6 then + if i == 8 then fig_header['full_layout'] = tonumber(v) end - if i == 6 then + if i == 9 then fig_header['codetag_count'] = tonumber(v) end i = i + 1 From 0da331d9f4800fdf764078331a9417ad6a196095 Mon Sep 17 00:00:00 2001 From: van muscari Date: Sun, 17 Nov 2024 21:12:39 -0500 Subject: [PATCH 4/4] Fix path searching for header flf file --- lua/dashboard/header.lua | 13 +++++++------ lua/dashboard/utils.lua | 4 ++++ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/lua/dashboard/header.lua b/lua/dashboard/header.lua index 2d32454c..940cb85e 100644 --- a/lua/dashboard/header.lua +++ b/lua/dashboard/header.lua @@ -120,18 +120,21 @@ local function parse_flf_header(sigil_string) end i = i + 1 end - print(' ') return fig_header end -- WARN :This is by no means full support for fliglet fonts. local function flf_table_gen(font_type) local flf_table = {} - local flf = io.open(font_type, 'r') local flf_header = nil - local value = flf:read('*l') local i = 1 local byte = 32 -- start byte offsest to ascii space + local flf, flf_err = io.open(font_type, 'r') + if flf_err then + print(flf_err) + return default_header() + end + local value = flf:read('*l') while value do if flf_header == nil then @@ -169,7 +172,7 @@ end local function custom_header(input, font_type) local input_bytes = string_to_bytes_list(input) - local font_path = './fonts/' .. font_type .. '.flf' + local font_path = utils.path_join(utils.get_plugin_path(), 'fonts', (font_type .. '.flf')) local tbl, head = flf_table_gen(font_path) local output = {} for i = 1, head['height'] do @@ -177,7 +180,6 @@ local function custom_header(input, font_type) for _, v in pairs(input_bytes) do output[i] = output[i] .. tbl[v][i] end - print(output[i]) end return output end @@ -209,7 +211,6 @@ local function generate_header(config) else header = default_header() end - print(header) api.nvim_buf_set_lines(config.bufnr, 0, -1, false, utils.center_align(header)) for i, _ in ipairs(header) do diff --git a/lua/dashboard/utils.lua b/lua/dashboard/utils.lua index 9285ce56..a2b2e85c 100644 --- a/lua/dashboard/utils.lua +++ b/lua/dashboard/utils.lua @@ -8,6 +8,10 @@ function utils.path_join(...) return table.concat({ ... }, path_sep) end +function utils.get_plugin_path() + return debug.getinfo(1).source:sub(2):match('(.*/)') +end + function utils.element_align(tbl) local lens = {} vim.tbl_map(function(k)