
sm: Display a fullscreen message
What is sm?
sm displays a short message fullscreen in your terminal. It’s handy for announcements, banners, or focus prompts. The syntax is simple: pass the message inside double braces and add optional flags for styling.
Quick start examples
- Basic message (fullscreen):
sm "{{Hello World!}}"
- Inverted colors (bright text on dark):
sm {{[-i|--invert]}} "{{Hello World!}}"
- Custom foreground color:
sm {{[-f|--foreground]}} {{blue}} "{{Hello World!}}"
- Custom background color:
sm {{[-b|--background]}} {{#008888}} "{{Hello World!}}"
- Rotate the message 3 times (each step is 90 degrees counterclockwise):
sm {{[-r|--rotate]}} {{3}} "{{Hello World!}}"
- Pipe input from another command:
{{echo "Hello World!"}} | sm -
Common pitfalls and tips
- Message content: Put the text inside {{…}} exactly as shown. Extra spaces can affect rendering.
- Color names and hex: You can use standard color names like blue, or hex colors like #00FF00. Some terminals may render colors slightly differently.
- Inversion side effects: —invert flips colors for the entire screen. If you have a complex shell prompt visible, you might still see it beneath the fullscreen message in some cases.
- Rotation caveats: Rotating 3 times is equivalent to rotating -1 time. If you expect a particular orientation, test with 0, 1, 2, and 3 to confirm.
- Piping: Using a pipe reads from stdin. If the input is empty, sm may display nothing or a default message depending on implementation.
Quick troubleshooting
- If you don’t see the message, try running without fullscreen requirements or ensure your terminal supports the necessary capabilities.
- If colors aren’t applying, verify the color syntax and try a simple option like —foreground blue to confirm color rendering.
Practical demo snippets
- Fullscreen with warning style:
sm {{[-i]}} {{Attention: maintenance in 5 minutes}}
- Send a multi-line message (copy/paste may be needed depending on your shell):
sm {{Hello\nWorld!}}
TL;DR
- Use sm with a message in double braces for fullscreen display.
- Add -i/—invert, -f/—foreground, -b/—background, -r/—rotate as needed.
- Pipe input to sm for dynamic messages.
See Also
- How to Use the fdisk Command for Effective Disk Management
- pg: View files one page at a time (pager)
- What Can You Do with the ncal Command in Linux?
- How to Use the lscpu Command for CPU Insights in Linux
- How to Use the adduser Command in Linux
- How to Use the lshw Command for Comprehensive Hardware Insights