fix(scripts): keep top bar clock rightmost
- commit
- efbf525183910532491d46fe83edfd8c780d4485
- author
- brice · · 2026-07-07 10:52 UTC
- parent
- bf27175
- signature
- GPG Verified
CD88F9E564E0102646FB6077A1A07C7C7C3E349D· arch-gpg Verified for the committer email
2 files · +10 -7
M README.md +1 -1
| @@ -107,7 +107,7 @@ Key specs support `alt+<char>`, `alt+space`, and `alt+left/right/up/down`; digit | |||
| 107 | 107 | ||
| 108 | 108 | ### Bar right anchors | |
| 109 | 109 | ||
| 110 | - | The top and bottom bar right anchors run configurable commands on the daemon host. By default, `bar.top-right = vev-bar-top-right` prints hour, CPU, and memory text, and `bar.bottom-right = vev-bar-bottom-right` prints compact git state for the focused pane's `VEV_PANE_CWD`. Set either value empty to disable that anchor, or set it to another command to replace it. | |
| 110 | + | The top and bottom bar right anchors run configurable commands on the daemon host. By default, `bar.top-right = vev-bar-top-right` prints CPU, memory, and hour text, and `bar.bottom-right = vev-bar-bottom-right` prints compact git state for the focused pane's `VEV_PANE_CWD`. Set either value empty to disable that anchor, or set it to another command to replace it. | |
| 111 | 111 | ||
| 112 | 112 | Both anchors share `bar.interval`, which defaults to `5s`; values below `1s` are clamped to `1s`. vev also refreshes around attach, resize, focus, and copy-feedback changes. Commands are bounded by a timeout and output limit. On failure or timeout, vev keeps the last good value; if there is none, the anchor is empty. | |
| 113 | 113 | ||
| @@ -107,7 +107,7 @@ Key specs support `alt+<char>`, `alt+space`, and `alt+left/right/up/down`; digit | |||||
| 107 | 107 | ||||
| 108 | ### Bar right anchors | 108 | ### Bar right anchors | ||
| 109 | 109 | ||||
| 110 | - | The top and bottom bar right anchors run configurable commands on the daemon host. By default, `bar.top-right = vev-bar-top-right` prints hour, CPU, and memory text, and `bar.bottom-right = vev-bar-bottom-right` prints compact git state for the focused pane's `VEV_PANE_CWD`. Set either value empty to disable that anchor, or set it to another command to replace it. | 110 | + | The top and bottom bar right anchors run configurable commands on the daemon host. By default, `bar.top-right = vev-bar-top-right` prints CPU, memory, and hour text, and `bar.bottom-right = vev-bar-bottom-right` prints compact git state for the focused pane's `VEV_PANE_CWD`. Set either value empty to disable that anchor, or set it to another command to replace it. |
| 111 | 111 | ||||
| 112 | Both anchors share `bar.interval`, which defaults to `5s`; values below `1s` are clamped to `1s`. vev also refreshes around attach, resize, focus, and copy-feedback changes. Commands are bounded by a timeout and output limit. On failure or timeout, vev keeps the last good value; if there is none, the anchor is empty. | 112 | Both anchors share `bar.interval`, which defaults to `5s`; values below `1s` are clamped to `1s`. vev also refreshes around attach, resize, focus, and copy-feedback changes. Commands are bounded by a timeout and output limit. On failure or timeout, vev keeps the last good value; if there is none, the anchor is empty. | ||
| 113 | 113 | ||||
M scripts/vev-bar-top-right +9 -6
| @@ -38,19 +38,22 @@ if [ -r /proc/meminfo ]; then | |||
| 38 | 38 | ) | |
| 39 | 39 | fi | |
| 40 | 40 | ||
| 41 | - | line=$now | |
| 41 | + | line= | |
| 42 | 42 | if [ -n "$cpu_pct" ]; then | |
| 43 | + | line="C $cpu_pct%" | |
| 44 | + | fi | |
| 45 | + | if [ -n "$mem_pct" ]; then | |
| 43 | 46 | if [ -n "$line" ]; then | |
| 44 | - | line="$line cpu $cpu_pct%" | |
| 47 | + | line="$line M $mem_pct%" | |
| 45 | 48 | else | |
| 46 | - | line="cpu $cpu_pct%" | |
| 49 | + | line="M $mem_pct%" | |
| 47 | 50 | fi | |
| 48 | 51 | fi | |
| 49 | - | if [ -n "$mem_pct" ]; then | |
| 52 | + | if [ -n "$now" ]; then | |
| 50 | 53 | if [ -n "$line" ]; then | |
| 51 | - | line="$line mem $mem_pct%" | |
| 54 | + | line="$line $now" | |
| 52 | 55 | else | |
| 53 | - | line="mem $mem_pct%" | |
| 56 | + | line="$now" | |
| 54 | 57 | fi | |
| 55 | 58 | fi | |
| 56 | 59 | ||
| @@ -38,19 +38,22 @@ if [ -r /proc/meminfo ]; then | |||||
| 38 | ) | 38 | ) | ||
| 39 | fi | 39 | fi | ||
| 40 | 40 | ||||
| 41 | - | line=$now | 41 | + | line= |
| 42 | if [ -n "$cpu_pct" ]; then | 42 | if [ -n "$cpu_pct" ]; then | ||
| 43 | + | line="C $cpu_pct%" | |||
| 44 | + | fi | |||
| 45 | + | if [ -n "$mem_pct" ]; then | |||
| 43 | if [ -n "$line" ]; then | 46 | if [ -n "$line" ]; then | ||
| 44 | - | line="$line cpu $cpu_pct%" | 47 | + | line="$line M $mem_pct%" |
| 45 | else | 48 | else | ||
| 46 | - | line="cpu $cpu_pct%" | 49 | + | line="M $mem_pct%" |
| 47 | fi | 50 | fi | ||
| 48 | fi | 51 | fi | ||
| 49 | - | if [ -n "$mem_pct" ]; then | 52 | + | if [ -n "$now" ]; then |
| 50 | if [ -n "$line" ]; then | 53 | if [ -n "$line" ]; then | ||
| 51 | - | line="$line mem $mem_pct%" | 54 | + | line="$line $now" |
| 52 | else | 55 | else | ||
| 53 | - | line="mem $mem_pct%" | 56 | + | line="$now" |
| 54 | fi | 57 | fi | ||
| 55 | fi | 58 | fi | ||
| 56 | 59 | ||||