From 597dd32cafd45a247639e692c51962c17d9f3d45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Wed, 24 Jul 2024 15:32:20 +0800 Subject: [PATCH] Presets: simplify `examples/2.jsonc` with builtin icon feature --- presets/examples/2.jsonc | 163 ++++++++++----------------------------- 1 file changed, 39 insertions(+), 124 deletions(-) diff --git a/presets/examples/2.jsonc b/presets/examples/2.jsonc index ba8fe4ee9..55d278934 100644 --- a/presets/examples/2.jsonc +++ b/presets/examples/2.jsonc @@ -12,8 +12,12 @@ "display": { "separator": "  ", "constants": [ - "───────────────" - ] + "─────────────────" // {$1}, used in Custom module + ], + "key": { + "type": "icon", + "paddingLeft": 2 + } }, "modules": [ { @@ -21,142 +25,53 @@ // {#1} is equivalent to `\u001b[1m`. {#} is equivalent to `\u001b[m` "format": "┌{$1} {#1}Hardware Information{#} {$1}┐" }, - { - "type": "host", - "key": " 󰌢" - }, - { - "type": "cpu", - "key": " 󰻠" - }, - { - "type": "gpu", - "key": " 󰍛" - }, - { - "type": "disk", - "key": " " - }, - { - "type": "memory", - "key": " 󰑭" - }, - { - "type": "swap", - "key": " 󰓡" - }, - { - "type": "display", - "key": " 󰍹" - }, - { - "type": "brightness", - "key": " 󰃞" - }, - { - "type": "battery", - "key": " " - }, - { - "type": "poweradapter", - "key": " " - }, - { - "type": "bluetooth", - "key": " " - }, - { - "type": "sound", - "key": " " - }, - { - "type": "gamepad", - "key": " " - }, + "host", + "cpu", + "gpu", + "disk", + "memory", + "swap", + "display", + "brightness", + "battery", + "poweradapter", + "bluetooth", + "sound", + "gamepad", { "type": "custom", // SoftwareStart "format": "├{$1} {#1}Software Information{#} {$1}┤" }, { "type": "title", - "key": " ", - "format": "{1}${2}" - }, - { - "type": "os", - "key": " " // Just get your distro's logo off nerdfonts.com - }, - { - "type": "kernel", - "key": " ", - "format": "{1} {2}" - }, - { - "type": "lm", - "key": " 󰧨" - }, - { - "type": "de", - "key": " " - }, - { - "type": "wm", - "key": " " - }, - { - "type": "shell", - "key": " " - }, - { - "type": "terminal", - "key": " " - }, - { - "type": "terminalfont", - "key": " " - }, - { - "type": "theme", - "key": " 󰉼" - }, - { - "type": "icons", - "key": " 󰀻" - }, - { - "type": "wallpaper", - "key": " 󰸉" - }, - { - "type": "packages", - "key": " 󰏖" - }, - { - "type": "uptime", - "key": " 󰅐" - }, - { - "type": "media", - "key": " 󰝚" + "keyIcon": "", + "key": "Title", // Title module has no key by default, so that icon is not displayed + "format": "{user-name}@{host-name}" }, + "os", + "kernel", + "lm", + "de", + "wm", + "shell", + "terminal", + "terminalfont", + "theme", + "icons", + "wallpaper", + "packages", + "uptime", + "media", { "type": "localip", - "key": " 󰩟", "compact": true }, - { - "type": "publicip", - "key": " 󰩠" - }, + "publicip", { "type": "wifi", - "key": " ", - "format": "{4}" // ssid - }, - { - "type": "locale", - "key": " " + "format": "{ssid}" }, + "locale", { "type": "custom", // InformationEnd "format": "└{$1}──────────────────────{$1}┘"