Note
Most of people and most of stars are coming from those looking to get that juicy header image generation on their own. I myself have lost motivation (and interest) towards maintaining this repository as a Neovim repository, which it used to be. I have personally switched to LazyVim and I maintain my own set of plugins there. Having the ability to simply download an Extra for a certain language (C#/Java/Go / whatever) is a bliss and I refuse to compete with that. I am leaving this readme purely as a tutorial on how to set up those alpha-nvim images. Alpha-nvim config should still be reliable to use from this config (as well as generated images and commands in obsidian plugin).
How do I set my own dashboard images? Very easy! We're going to use Asthestarsfalll's img2art github repository but with a quick style fix from me, that's going to speed up the process by 90%.
Important
For more details or custom output options visit Asthestarsfalll's img2art github repository
Without him none of this would be possible!
Due to the fix that we had to apply make sure that You have python's poetry installed on your system.
- Clone my fork of ASthestarsfalll's repository.
git clone https://github.com/nxtkofi/img2art - Install requirements inside the project root
cd img2art
python -m venv ./venv
source venv/bin/activate
pip install typer opencv-python numpy
- We're now ready to go! Run:
poetry run python -m img2art.cli ~/path/to/picture.jpg --scale 0.3 --threshold 20 --save-raw ./test.lua --alpha
What does it do:
--scale 0.3This is scaling for our image. Pick a value so it fits into Your dashboard--threshold 20This is black-white threshold point. I suggest You play around it for a bit to see what's the best outcome for Your picture. Usually it's something between 20-150./test.luaThis is where our output file will go and what name will it receive. Leave .lua extension. You may change the name.--alphaThis makes sure that we get our picture in desired output style (ready to paste into alpha's dashboard!).
You should have Your output file now!
Move it into header_img folder.
Now to set a header image go ahead and check out my ./lua/custom/plugins/alpha.lua file.
Function load_random_header() loads random header image from header_img folder on nvim startup.
Important
Make sure you add local header = load_random_header() - otherwise Your image will not get initialized.
Tip
I also wrote a function change_header() which let's you change header when you press w in dashboard.
All keymaps are defined in /lua/keymaps.lua (except for those that were defined in plugin files - those are listed at the end of keymaps.lua so You can easily find them!)





