-
-
Notifications
You must be signed in to change notification settings - Fork 141
Text startup banner. #157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Text startup banner. #157
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some implementation explanation.
@jcs090218 thank you so much for this work! Every pice of work is always welcome 😄 Have you tried it? I've tried to use this branch but it didn't work for me. Even if I set up The problem is in the I think the key of this feature is not about adding a new variable, but modifying Feel free to ask any doubts you may have. |
Also, remember that adding new features / improving current ones may require an update of the documentation too 😉 |
I did test it, and it works for me. Did you try it in the terminal? Cuz this would only works inside terminal? :/
Not quite sure what do you mean by this. In the function
Thanks for letting me know! I will do this when I have time! :D
And this too! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Attempt 1. This is the version if not using the dashboard-logo-banner-text
.
I think the key of this feature is not about adding a new variable, but modifying dashboard-choose-banner to check if the file extension is txt and loading it as a text banner.
Still not quite sure what exactly you want because whatever returns from dashboard-choose-banner
, that's what you will load. So by checking the img
or txt
wouldn't matter, would it?
(image-type-available-p (intern (file-name-extension | ||
dashboard-startup-banner))) | ||
(display-graphic-p)) | ||
((stringp dashboard-startup-banner) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might sounds stupid, but I changed to check if the value is string and ignore to check if it is image and display-graphic-p
. So just let the user decide what file to load? Just mention this in the README file to prefer setting the variable this way.
(setq dashboard-startup-banner (if (display-graphic-p) "path/to/image.png" "path/to/text.txt")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like your suggestion on how to setup dashboard-startup-banner
, I would like to see the README.md
updated with that.
But this line change would break backwards compatibility. Until now, people set dashboard-startup-banner
like this:
(dashboard-startup-banner "/tmp/emacs-dashboard/banners/logo.png")
If you start emacs in terminal with the variable like set like that, it would fail to start. I think you should handle what happens if the value is a png
file but emacs is started with now window system.
Maybe there should be always a default txt banner to fallback (i.e. banner 1.txt).
@JesusMtnez What do you think about this patch? |
@jcs090218 Sorry, but I couldn't take a look. I'll try to review it before next week to give you some feedback. Thank you for your patience. |
@JesusMtnez Any progress on this patch? :D |
@jcs090218 Sorry, I'm pretty busy these days. I'll try to review it this week. |
@JesusMtnez No worries, I don't mean to rush you! :D |
@jcs090218 Any plans on updating this work to latest |
I think the latest post is about the review? The conflict must have a write access to this branch hence I couldn't resolve it! You might have to resolve or else I would have open another PR? Thanks! 😄 |
Move to #246. Close this now! |
This is a quick implementation for text banner. See #153. The benefits are this is down compatible if the user want to use default
1.txt
,2.txt
and3.txt
banner files. Otherwise, they can just set thedashboard-banner-logo-text
variable like the line of code below. If they want the default banner just set to nil.Edit: This implementation may not be the best solution, because I don't know what the author of
dashboard
wants. So I guess this PR is just an advice.