nu_scripts/modules/prompt/powerline
fj0r c39a41ad2d
replace def-env with def --env (#641)
- upgrade to 0.86

Co-authored-by: agent <agent@nuc>
2023-10-18 06:25:54 -05:00
..
power_git.nu use $env. instead of let-env (#543) 2023-07-01 10:40:16 +02:00
power_kube.nu Replace use of $nothing with null (#621) 2023-09-26 18:52:49 +02:00
power_utils.nu improve kconf import (#481) 2023-05-11 06:37:39 -05:00
power.nu replace def-env with def --env (#641) 2023-10-18 06:25:54 -05:00
README.md upgrade to 0.86 (#640) 2023-10-17 20:34:20 -05:00

configuration

use power.nu
    use power_git.nu
    power inject 0 1 {source: git,   color: '#504945'}
    use power_kube.nu
    power inject 1 2 {source: kube,  color: '#504945'} {
        context: cyan
    } {
        reverse: true
        separator: '@'
    }
    use power_utils.nu
    power inject 0 1 {source: atuin, color: '#4C4B4A'}
    power set time null { style: compact }
power init

or

$env.NU_POWER_SCHEMA = [
    [
        {source: pwd,   color: '#353230'}
        {source: git,   color: '#504945'}
    ]
    [
        {source: proxy, color: 'dark_gray'}
        {source: host,  color: '#353230'}
        {source: kube,  color: '#504945'}
        {source: time,  color: '#666560'}
    ]
]

use power.nu
    use power_git.nu
    use power_kube.nu
power init

$env.NU_POWER_SCHEMA support configuring dynamically

mode

  • $env.NU_POWER_MODE = '<power|fast>' fast mode and default mode (experimental)
  • $env.NU_POWER_DECORATOR = '<power|plain>' power mode and plain mode
  • $env.NU_POWER_FRAME = '<default|fill>' two line prompt (experimental)

benchmark

$env.NU_POWER_BENCHMARK = true

Then execute a few commands casually, such as pressing the Enter key continuously. then execute

$env.NU_POWER_MODE = 'fast' # or 'power'

Go ahead and press enter, Execute power timelog to analyze the results.

power analyze

todo

  • source return null for hiding
  • in fast mode, there is still a problem with hideable components on the left
  • proxy stat invalid in plain mode
    • '<<' not longer hide separator in fast mode
  • implement power eject
  • $env.config.menus[].maker can be restored
  • support color theme
  • refactor: theme/decorator/frame/schema