Giter VIP home page Giter VIP logo

pwr's Introduction

PWR a minimal shell prompt written in Rust

RIP PWR

pwr: [p]ure [w]ritten in [R]ust. is shell prompt inspired by purs and git-status inspired by Git Super Status II Turbo: Hyper Fighting https://github.com/xxzozaxx/pwr/blob/master/screenshot/2018-09-05-212858_934x531_scrot.png?raw=true

Installation

  1. clone this repo
  2. run “`cargo build –release“`
  3. put the follow in your shell config file
    • mksh:
      PS1=$'\n$(/PATH/TO/pwr)'
              
    • Bash
      export PS1='$(/home/master/Documents/Programming/Rust/Apps/pwr/target/debug/pwr)'
              
    • zsh: IT SUCK. I searched and found nothing to do.

Configuration

you could change color, Symbols or pre-command symbol (λ in picture) be change the const in source code file. it locate in pwr/src/main.rs you will find the follow block

/* Config START here*/
/* Colors */
const AHEAD_COLOR:     ansi_term::Colour = Green;
const BEHIND_COLOR:    ansi_term::Colour = Red;
const BRANCH_COLOR:    ansi_term::Colour = Blue;
const CHANGED_COLOR:   ansi_term::Colour = Purple;
const CLEAN_COLOR:     ansi_term::Colour = Green;
const DIR_COLOR:       ansi_term::Colour = Cyan;
const STAGED_COLOR:    ansi_term::Colour = Yellow;
const UNTRACKED_COLOR: ansi_term::Colour = Blue;
/* Symbols */
const AHEAD_SYMBOL     :&str = ">";
const BEHIND_SYMBOL    :&str = "<";
const CHANGED_SYMBOL   :&str = "+";
const CLEAN_SYMBOL     :&str = "=";
const PRECOMND         :&str = "λ";
const STAGED_SYMBOL    :&str = "-";
const STATUS_PREFIX    :&str = "(";
const STATUS_SEPARATOR :&str = "|";
const STATUS_SUFFIX    :&str = ")";
const UNTRACKED_SYMBOL :&str = "_";
/* Conifg END here*/

Note

  • please don’t comment out or delete any line, instead just put blank string as ""
  • I declare only these colours Cyan, Blue, Red, Green, Purple, Yellow, so if you want more please checkout ansi_term colours

Why

  1. To know more about Rust
  2. To know more about Git
  3. GOTO 1
  4. also, because purs didn’t compile.

Contribute

feel free to pull requiest, any feature. also I hope if you know more about rust to review my code :). also this is the first rust code I ever write.

minimal

Command being timed: "./target/release/pwr"
User time (seconds): 0.02
System time (seconds): 0.00
Percent of CPU this job got: 90%
Elapsed (wall clock) time (h:mm:ss or m:ss): 0:00.03
Average shared text size (kbytes): 0
Average unshared data size (kbytes): 0
Average stack size (kbytes): 0
Average total size (kbytes): 0
Maximum resident set size (kbytes): 11400
Average resident set size (kbytes): 0
Major (requiring I/O) page faults: 0
Minor (reclaiming a frame) page faults: 790
Voluntary context switches: 1
Involuntary context switches: 1
Swaps: 0
File system inputs: 0
File system outputs: 0
Socket messages sent: 0
Socket messages received: 0
Signals delivered: 0
Page size (bytes): 4096
Exit status: 0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.