chore: Enhance MOTD tip display by allowing formatting of tips with md, use automatic theme to fix light mode.

This commit is contained in:
Kyle Gospodnetich 2024-01-28 19:42:03 -08:00
parent 674fc08a5e
commit 97540cb15c
5 changed files with 8 additions and 202 deletions

View File

@ -1,9 +1,9 @@
#!/usr/bin/bash
TIP_FILE=$(ls "/usr/share/ublue-os/motd/tips/"* | shuf -n 1)
TIP_FILE=$(ls "/usr/share/ublue-os/motd/tips/"*".md" | shuf -n 1)
if [[ -f "$TIP_FILE" ]]; then
IMAGE_INFO="/usr/share/ublue-os/image-info.json"
IMAGE_NAME=$(jq -r '."image-name"' < $IMAGE_INFO)
IMAGE_TAG=$(jq -r '."image-tag"' < $IMAGE_INFO)
TIP=$(shuf -n 1 "$TIP_FILE")
/usr/bin/glow -s /usr/share/ublue-os/motd/design/dark.json /usr/share/ublue-os/motd/design/bazzite.md | sed -e "s/%IMAGE_NAME%/$IMAGE_NAME/g" -e "s/%IMAGE_TAG%/$IMAGE_TAG/g" -e "s/%TIP%/$TIP/g"
sed -e "s/%IMAGE_NAME%/$IMAGE_NAME/g" -e "s/%IMAGE_TAG%/$IMAGE_TAG/g" -e "s/%TIP%/$TIP/g" /usr/share/ublue-os/motd/bazzite.md | /usr/bin/glow -s auto -
fi

View File

@ -8,5 +8,6 @@
| `neofetch` | View system information |
*󰋼 %TIP%*
- [ Report an issue](https://github.com/ublue-os/bazzite/issues)
- [󰙯 Discord](https://discord.bazzite.gg/)
- [󰈙 Documentation](http://docs.bazzite.gg/)

View File

@ -1,195 +0,0 @@
{
"document": {
"block_prefix": "\n",
"block_suffix": "\n",
"color": "252",
"margin": 2
},
"block_quote": {
"indent": 1,
"indent_token": "│ "
},
"paragraph": {},
"list": {
"level_indent": 2
},
"heading": {
"block_suffix": "\n",
"color": "39",
"bold": true
},
"h1": {
"prefix": " ",
"suffix": " ",
"color": "228",
"background_color": "63",
"bold": true
},
"h2": {
"prefix": "## "
},
"h3": {
"prefix": "### "
},
"h4": {
"prefix": "#### "
},
"h5": {
"prefix": "##### "
},
"h6": {
"prefix": "###### ",
"color": "35",
"bold": false
},
"text": {},
"strikethrough": {
"crossed_out": true
},
"emph": {
"italic": true
},
"strong": {
"bold": true
},
"hr": {
"color": "240",
"format": "\n--------\n"
},
"item": {
"block_prefix": "• "
},
"enumeration": {
"block_prefix": ". "
},
"task": {
"ticked": "[✓] ",
"unticked": "[ ] "
},
"link": {
"color": "30",
"underline": true
},
"link_text": {
"color": "35",
"bold": true
},
"image": {
"color": "212",
"underline": true
},
"image_text": {
"color": "243",
"format": "Image: {{.text}} →"
},
"code": {
"prefix": " ",
"suffix": " ",
"color": "203",
"background_color": "236"
},
"code_block": {
"color": "244",
"margin": 2,
"chroma": {
"text": {
"color": "#C4C4C4"
},
"error": {
"color": "#F1F1F1",
"background_color": "#F05B5B"
},
"comment": {
"color": "#676767"
},
"comment_preproc": {
"color": "#FF875F"
},
"keyword": {
"color": "#00AAFF"
},
"keyword_reserved": {
"color": "#FF5FD2"
},
"keyword_namespace": {
"color": "#FF5F87"
},
"keyword_type": {
"color": "#6E6ED8"
},
"operator": {
"color": "#EF8080"
},
"punctuation": {
"color": "#E8E8A8"
},
"name": {
"color": "#C4C4C4"
},
"name_builtin": {
"color": "#FF8EC7"
},
"name_tag": {
"color": "#B083EA"
},
"name_attribute": {
"color": "#7A7AE6"
},
"name_class": {
"color": "#F1F1F1",
"underline": true,
"bold": true
},
"name_constant": {},
"name_decorator": {
"color": "#FFFF87"
},
"name_exception": {},
"name_function": {
"color": "#00D787"
},
"name_other": {},
"literal": {},
"literal_number": {
"color": "#6EEFC0"
},
"literal_date": {},
"literal_string": {
"color": "#C69669"
},
"literal_string_escape": {
"color": "#AFFFD7"
},
"generic_deleted": {
"color": "#FD5B5B"
},
"generic_emph": {
"italic": true
},
"generic_inserted": {
"color": "#00D787"
},
"generic_strong": {
"bold": true
},
"generic_subheading": {
"color": "#777777"
},
"background": {
"background_color": "#373737"
}
}
},
"table": {
"center_separator": "┼",
"column_separator": "│",
"row_separator": "─"
},
"definition_list": {},
"definition_term": {},
"definition_description": {
"block_prefix": "\n🠶 "
},
"html_block": {},
"html_span": {}
}

View File

@ -1,5 +0,0 @@
It is always better to install packages with Distrobox than to layer them with rpm-ostree.
Packages installed in Distrobox can be exported to appear like any other application.
Update break something? You can roll back and pin the previous release or rebase by build date.
Lutris is pre-installed for better handling of non-Steam games.
BTRFS is used by default for external drives, and we recommend that or EXT4 over NTFS.

View File

@ -0,0 +1,5 @@
It is *always* better to install packages with Distrobox than to layer them with rpm-ostree.
Packages installed in Distrobox can be exported to appear like any other application ([View documentation](https://github.com/89luca89/distrobox/blob/main/docs/usage/distrobox-export.md)).
Update break something? You can roll back and pin the previous release or rebase by build date ([View our guide](https://universal-blue.discourse.group/docs?topic=513)).
Lutris is pre-installed for better handling of non-Steam games.
BTRFS is used by default for external drives, and we recommend that or EXT4 over NTFS ([More info here](https://github.com/ValveSoftware/Proton/wiki/Using-a-NTFS-disk-with-Linux-and-Windows)).