blue-build / modules

BlueBuild standard modules used for building your Atomic Images
Apache License 2.0
21 stars 27 forks source link

module idea: `motd` #271

Open fiftydinar opened 4 days ago

fiftydinar commented 4 days ago

This module would mimic the functionality of Bluefin & Bazzite images, except it would be generic & usable for other custom image variants too.

If not aware, MOTD (Message of the day) is the functionality of terminal which can be used to display useful information (or silly information if you wish). It is shown every time you launch the terminal. I think that the frequency of MOTD presence can be customized too, but not sure.

Maybe we can have some basic MOTD template, which users can build on?

Supported symbols also depend on the font & terminal used.

Any other thoughts?

xynydev commented 4 days ago

(or silly information if you wish)

Haha, love it

These seem to be the MOTD-related files in Bluefin;

I couldn't find it implemented for other shells than Fish, and I'm not quite sure how to do that in other shells.

Here's a sketch of a possible config format for such a module with implementation details scattered in as comments:

type: motd # creates an motd and related files at a standard location in /usr/share/bluebuild/, configures shells to run that script when opening an interactive shell session
# ideally support these three shells configurably by default, with the option to turn off automatic shell configuration using `shells: none` or something
shells: [fish, bash, zsh]
# message will be printed as plain text without any formatting
message: |
    ★ Welcome to my custom image! ★

    Join the community:
    - Github Discussions: https://github.com/...
    - Discord server: https://discord.gg/...

    See all available commands with `ujust --choose`
# will override the default script making it possible to implement custom features or fancy rendering (while the text from `message:` would still be supplied somewhere, probably through a file)
motd-script: custom-motd.sh