Skip to content

Commit

Permalink
feat: accent color theming for fastfetch and MOTD (#2007)
Browse files Browse the repository at this point in the history
  • Loading branch information
tulilirockz authored Dec 5, 2024
1 parent 4b7abfb commit 882d749
Show file tree
Hide file tree
Showing 15 changed files with 856 additions and 5 deletions.
2 changes: 1 addition & 1 deletion system_files/kinoite/etc/profile.d/aurora-fastfetch.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/sh

alias fastfetch="/usr/bin/fastfetch --file /usr/share/ublue-os/aurora-logo.txt --logo-type file --logo-color-1 94 --logo-color-2 95 --logo-color-3 91 --logo-color-4 97 -c /usr/share/ublue-os/ublue-os.jsonc"
alias fastfetch='/usr/bin/fastfetch --color $(/usr/libexec/ublue-bling-fastfetch) --file /usr/share/ublue-os/aurora-logo.txt --logo-type file --logo-color-1 94 --logo-color-2 95 --logo-color-3 91 --logo-color-4 97 -c /usr/share/ublue-os/ublue-os.jsonc'
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/fish
#shellcheck disable=all
alias fastfetch="/usr/bin/fastfetch --file /usr/share/ublue-os/aurora-logo.txt --logo-type file --logo-color-1 94 --logo-color-2 95 --logo-color-3 91 --logo-color-4 97 -c /usr/share/ublue-os/ublue-os.jsonc"
alias fastfetch='/usr/bin/fastfetch --color (/usr/libexec/ublue-bling-fastfetch) --file /usr/share/ublue-os/aurora-logo.txt --logo-type file --logo-color-1 94 --logo-color-2 95 --logo-color-3 91 --logo-color-4 97 -c /usr/share/ublue-os/ublue-os.jsonc'
38 changes: 38 additions & 0 deletions system_files/shared/usr/libexec/ublue-bling-fastfetch
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/usr/bin/env bash

THEME=$(gsettings get org.gnome.desktop.interface accent-color || echo "'slate'")
THEME=${THEME//\'/}

FASTFETCH_COLOR_SET="38;2;53;132;228"
case $THEME in
"blue")
FASTFETCH_COLOR_SET="38;2;53;132;228"
;;
"green")
FASTFETCH_COLOR_SET="38;2;58;148;74"
;;
"orange")
FASTFETCH_COLOR_SET="38;2;237;91;0"
;;
"pink")
FASTFETCH_COLOR_SET="38;2;213;97;153"
;;
"purple")
FASTFETCH_COLOR_SET="38;2;139;62;165"
;;
"red")
FASTFETCH_COLOR_SET="38;2;230;45;66"
;;
"slate")
FASTFETCH_COLOR_SET="38;2;111;131;150"
;;
"teal")
FASTFETCH_COLOR_SET="38;2;33;144;164"
;;
"yellow")
FASTFETCH_COLOR_SET="38;2;200;136;0"
;;
esac

echo $FASTFETCH_COLOR_SET
exit 0
5 changes: 4 additions & 1 deletion system_files/shared/usr/libexec/ublue-motd
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,11 @@ KEY_WARN_FILE="/run/user-motd-sbkey-warn.md"
[ -e $KEY_WARN_FILE ] && KEY_WARN="**WARNING**: $(cat $KEY_WARN_FILE)"
KEY_WARN_ESCAPED=$(escape "$KEY_WARN")

THEME=$(gsettings get org.gnome.desktop.interface accent-color || echo "'slate'")
THEME=${THEME//\'/}

sed -e "s/%IMAGE_NAME%/$IMAGE_NAME_ESCAPED/g" \
-e "s/%IMAGE_TAG%/$IMAGE_TAG_ESCAPED/g" \
-e "s/%TIP%/$TIP_ESCAPED/g" \
-e "s/%KEY_WARN%/$KEY_WARN_ESCAPED/g" \
/usr/share/ublue-os/motd/bluefin.md | tr '~' '\n' | /usr/bin/glow -s auto -w 78 -
/usr/share/ublue-os/motd/bluefin.md | tr '~' '\n' | /usr/bin/glow -s /usr/share/ublue-os/motd/themes/$THEME.json -w 78 -
90 changes: 90 additions & 0 deletions system_files/shared/usr/share/ublue-os/motd/themes/blue.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
{
"document": {
"margin": 2
},
"block_quote": {
"indent": 1,
"indent_token": ""
},
"paragraph": {},
"list": {
"level_indent": 2
},
"heading": {
"block_suffix": "\n",
"color": "33",
"bold": true
},
"h1": {
"block_prefix": "\n",
"block_suffix": "\n"
},
"h2": {
"prefix": ""
},
"h3": {
"prefix": ""
},
"h4": {
"prefix": ""
},
"h5": {
"prefix": ""
},
"h6": {
"prefix": "",
"bold": false
},
"text": {},
"strikethrough": {
"crossed_out": true
},
"emph": {
"italic": true
},
"strong": {
"bold": true
},
"hr": {
"color": "33",
"format": "\n──────\n"
},
"item": {
"block_prefix": ""
},
"enumeration": {
"block_prefix": ". "
},
"task": {
"ticked": "[✓] ",
"unticked": "[ ] "
},
"link": {
"color": "69",
"underline": true
},
"link_text": {
"bold": true
},
"image": {
"underline": true
},
"image_text": {
"format": "Image: {{.text}}"
},
"code": {
"prefix": " ",
"suffix": " ",
"color": "33",
"background_color": "236"
},
"code_block": {},
"table": {},
"definition_list": {},
"definition_term": {},
"definition_description": {
"block_prefix": "\n🠶 "
},
"html_block": {},
"html_span": {}
}
90 changes: 90 additions & 0 deletions system_files/shared/usr/share/ublue-os/motd/themes/green.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
{
"document": {
"margin": 2
},
"block_quote": {
"indent": 1,
"indent_token": ""
},
"paragraph": {},
"list": {
"level_indent": 2
},
"heading": {
"block_suffix": "\n",
"color": "34",
"bold": true
},
"h1": {
"block_prefix": "\n",
"block_suffix": "\n"
},
"h2": {
"prefix": ""
},
"h3": {
"prefix": ""
},
"h4": {
"prefix": ""
},
"h5": {
"prefix": ""
},
"h6": {
"prefix": "",
"bold": false
},
"text": {},
"strikethrough": {
"crossed_out": true
},
"emph": {
"italic": true
},
"strong": {
"bold": true
},
"hr": {
"color": "34",
"format": "\n──────\n"
},
"item": {
"block_prefix": ""
},
"enumeration": {
"block_prefix": ". "
},
"task": {
"ticked": "[✓] ",
"unticked": "[ ] "
},
"link": {
"color": "28",
"underline": true
},
"link_text": {
"bold": true
},
"image": {
"underline": true
},
"image_text": {
"format": "Image: {{.text}}"
},
"code": {
"prefix": " ",
"suffix": " ",
"color": "34",
"background_color": "236"
},
"code_block": {},
"table": {},
"definition_list": {},
"definition_term": {},
"definition_description": {
"block_prefix": "\n🠶 "
},
"html_block": {},
"html_span": {}
}
90 changes: 90 additions & 0 deletions system_files/shared/usr/share/ublue-os/motd/themes/orange.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
{
"document": {
"margin": 2
},
"block_quote": {
"indent": 1,
"indent_token": ""
},
"paragraph": {},
"list": {
"level_indent": 2
},
"heading": {
"block_suffix": "\n",
"color": "208",
"bold": true
},
"h1": {
"block_prefix": "\n",
"block_suffix": "\n"
},
"h2": {
"prefix": ""
},
"h3": {
"prefix": ""
},
"h4": {
"prefix": ""
},
"h5": {
"prefix": ""
},
"h6": {
"prefix": "",
"bold": false
},
"text": {},
"strikethrough": {
"crossed_out": true
},
"emph": {
"italic": true
},
"strong": {
"bold": true
},
"hr": {
"color": "208",
"format": "\n──────\n"
},
"item": {
"block_prefix": ""
},
"enumeration": {
"block_prefix": ". "
},
"task": {
"ticked": "[✓] ",
"unticked": "[ ] "
},
"link": {
"color": "130",
"underline": true
},
"link_text": {
"bold": true
},
"image": {
"underline": true
},
"image_text": {
"format": "Image: {{.text}}"
},
"code": {
"prefix": " ",
"suffix": " ",
"color": "208",
"background_color": "236"
},
"code_block": {},
"table": {},
"definition_list": {},
"definition_term": {},
"definition_description": {
"block_prefix": "\n🠶 "
},
"html_block": {},
"html_span": {}
}
Loading

0 comments on commit 882d749

Please sign in to comment.