-
-
Notifications
You must be signed in to change notification settings - Fork 503
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
DietPi-Banner | Allow customisation, adding/removing info slots #2627
Comments
@msongz This fits to this idea: https://dietpi.com/phpbb/viewtopic.php?t=5257 Since the need/taste about the banner is different, I will turn this request into a DietPi-Banner customisation request to allow overriding each banner slot with a custom one, adding or hiding them. |
customize banner would be great! |
Just for reference: 4196571 Not space left but CPU temps instead 😄. However the code cleanup made it easier to implement custom banner infos. |
Another idea/request is to show the external IP/domain to easier keep apart DietPi systems on different locations connected to via SSH: https://dietpi.com/phpbb/viewtopic.php?t=5708 I added this to FeatHub, feel free to vote for it 😃: https://feathub.com/MichaIng/DietPi/+62 |
Was thinking about this in the past. We could use a simple html page on dietpi.com to display connected external IP and pull that back to users system. The only downside is bandwidth usage (would need to check server once implimented), and, required delay waiting for this info, before banner displayed. |
Hey, so the post on the forums was actually mine, I've already implemented it into the ssh banner. If its not connected to the outside world then it just states "N/A". I was using ifconfig.me to retrieve the external IP, however as you have now setup a php script on your own server you can easily change it to use that instead. I could share my 'new' banner if you wish. |
@Fourdee @MajorWolf1
I think this info should in case only be retrieved via hourly cron job and e.g. stored to So I think when using this, we should add an option to dietpi-config to allow adding a domain name, if available, otherwise static IP if available, otherwise choose "dynamic IP". The first time we require external domain/IP info (e.g. Nextcloud Talk + WireGuard install, or, when Banner when implemented) we ask user which one of above is available and store that info to /DietPi/dietpi/.network. Afterwards we never need to ask again. To change it we could add the option to dietpi-config > Security Options. Usually hostname should match external domain, but e.g. if on local network multiple servers are running that listen to different ports, that would not work, so then the external IP/domain of all of them is the same of course, but the local hostname needs to be different 🤔. (Btw. also the Debian installer asks for hostname and domain, we could follow it in how/where it applies this.) |
Using a simple curl command is the way that I'm retrieving it for the banner, (that then goes into an if statement) so i don't see why we couldn't add a cron task to curl it and store it in /DietPi/dietpi/.network on the next line down then whenever it is needed then just sed -* to that file, as you said just run it once an hour or so, this would reduce the amount of requests to the server. Ive just changed the "Dietpi" at the top of the banner to be the hostname, this means that the user can see them both if necessary. Only issue is it pushed the date and time over, could do with finding a way to keep that in the same position, if not limit the hostname to 6 characters long. Just a thought. |
@MajorWolf1 Just a little example:
The spacing is another topic that we can think about when adding customisation. I think the easiest would be to count the overall length of each line and resize the banner (green lines) to match this. Then even spaces could be added to the other lines to have all fields aligned nicely below each other. But this is also a question of performance. Loading the banner should still be quick and I am afraid that already allowing the customization (without alignment) could increase leading time quite much. Something we need to play around with when it's time. |
Ahh I see, im kinda new to this so ngl its a little trial and error. We already have the internal IP on the banner, so i just added the external IP. if it cant connect to the internet then it states "N/A". Could have the option to choose if you want the hostname or the external ip depending if its offline or not. And in my case was just to make sure ive connected to the correct pi. (not to find out if I can connect to the rpi externally) ofc this isnt gonna be the case for everyone. was just a though on something you could add at a later date. I dunno about retrieving a domain name automatically, but I'm in the process of adding the option into the dietpi-config file under security options. so it will append the domain name onto the .network then we could use that to display the domain name. (If this isn't the best place to append it then please to tell me. dont wanna break it XD) |
@Fourdee looking so great ! |
@Fourdee
Rows separated by green lines, columns separated by But however your solution looks way simpler to configure and faster to execute and beautiful, so I like it more 😃. Just one thing. To be fair to contributes, supply- and code-wise, I would not allow to hide credits? But hiding the DietPi commands for experienced users of course totally makes sense. |
Yep, good call, will make the change 👍 I also need to:
Yep, had similar thoughts aswell. The only issue is alignment of the contents in the cells. Unless we check for each string length + cut excess and/or new line it (more processing), table wouldn't line up correctly. |
+ - DietPi-Banner | You can now customise which options to display during system login. These include CPU temps, WAN IP, free disk space and more! Simply run 'dietpi-banner': #2627 + G_CHECK_FREESPACE (info_autoscale). Switched to MB as thats what G_CHECK_FREESPACE uses, and, throughout DietPi I believe.
+ dietpi-banner hostname option #2627 (comment)
@Fourdee |
Yep can do,
|
o0o0, weather option:
VPS in Germany @MichaIng 👍 |
haha, the year progress. such as https://www.yearprogressbar.com/ https://mobile.twitter.com/year_progress/status/1107673014634725378 |
We could always change the "Dietpi" in the top left of the banner into the hostname. Saves you adding another option that could be made simpler |
@MajorWolf1 @Fourdee
When
So from my point of view just show: |
@Fourdee @MajorWolf1 When selecting/enabling the "Custom" an input menu would allow you to add a custom bash command. This is then saved to a file and simply sourced when the banner is shown, if option enabled and file exists. It would be shown as last part of the upper banner. Only question is how to deal with the description. |
Hmmm, not a bad idea actually @MichaIng would be useful for people that know the script they wish to impliment but dont understand how the config files etc work. (Took me a little time for it to click). Would be useful for a lot of people tbf to make their banner as suitable and personal to them. |
@MajorWolf1 |
Would make it better for everyone tbf, meaning it a little more personal. Simplicity will mean more people can have a little more personal version. Persistence is probably the main thing people would be bothered by as they don't have to make a restore backups. Also thanks for implementing my idea. First thing I've actually contributed to and I'm glad it was with you guys. |
@MajorWolf1
You should be able to test it, if you want, by overwriting yours. It does not depend on any other updated code, AFAIK: https://raw.githubusercontent.com/MichaIng/DietPi/dev/dietpi/func/dietpi-banner @Fourdee I will also do some final tests and merge. Found that the 2 seconds curl timeout seems to be too short in some cases. WAN address sometimes does not show up. Sadly we can't use this on perhaps faster GitHub server. |
I couldn't find (quickly) an obvious command to access the edit banner menu, so here it is for posterity: |
Actually it was intended to exit directly with a meaningful error message when not executed as root (and when opening it in menu mode). Due to a bug this was not the case. Now it is 🙂: fd552c4 |
Is there a way we can install dietpi-banner onto a different OS flavor? I have a RasPi running DietPi as a WOL server and I LOVE the banner that pops on on login. Want to add it to my other Pis but I can't install DietPi on them. |
No the banner really on other DietPi scripts. It's not a software package you can install simply. |
At least it uses a bunch of functions from So if you copy that one as well to the expected location, at last on Debian and Ubuntu, it should work. But it is indeed not designed as a standalone script in the first place and does some DietPi-specific things like informing about available DietPi updates and such. |
@MichaIng very cool and useful script, though you might want to add the ability for the user to enter a location for wttr.in, their geolocation doesn't work the best for me. |
I just checked whether/how this is possible, and it is: https://github.com/chubin/wttr.in |
ADMIN EDIT
Vote for it on FeatHub: https://feathub.com/MichaIng/DietPi/+62
show storage left space info in banner using code:
df -h|grep '/dev/root'|awk '{ print $4 }'
when using sd card,especially small one, space left is always important info we need.
The text was updated successfully, but these errors were encountered: