Format branch

main
Julius Riegel 8 months ago
parent fb44fdfb55
commit 310208dbb5

@ -145,7 +145,7 @@ export def `zjstatus powerline_left` [] {
fg: "#ffffff" fg: "#ffffff"
} }
{ {
text: $"(git rev-parse --abbrev-ref HEAD) " text: $"(branch-name) "
icon: "" icon: ""
bg: "blue" bg: "blue"
fg: $ZELLIJ_BG fg: $ZELLIJ_BG
@ -154,12 +154,23 @@ export def `zjstatus powerline_left` [] {
render powerline $ZELLIJ_BG $elements --start "" render powerline $ZELLIJ_BG $elements --start ""
} }
def branch-name [] {
let name = (git rev-parse --abbrev-ref HEAD)
let parts = ($name | split row "/")
if ($parts | length) > 1 {
$"(ansi {attr: i})($parts.0)/(ansi reset)(ansi {fg: $ZELLIJ_BG, bg: blue, attr: b})($parts | skip 1 | str join '/')"
} else {
$"(ansi {attr: b})($name)"
}
}
export def `zjstatus powerline_right` [] { export def `zjstatus powerline_right` [] {
use ci.nu use ci.nu
let sys = (sys) let sys = (sys)
let elements = ([ let elements = ([
(ci status) (try { ci status } catch { null })
{ {
text: ($sys.cpu.cpu_usage | math avg | math round -p 2 | $"($in) % " | fill -a right -c ' ' -w 8) text: ($sys.cpu.cpu_usage | math avg | math round -p 2 | $"($in) % " | fill -a right -c ' ' -w 8)
icon: "" icon: ""

Loading…
Cancel
Save