Lungiselela iBas Prompt nge-Powerline-Shell-Master

Uma ungithanda, ungumthandi we- Bash futhi ngenxa yezizathu zomkhuba noma i-whim, awuzizwa uthanda ukusebenzisa zsh y oh zsh wami ukunikeza ukuthuthuka okuthe xaxa esigungwini sakho. Ngesikhathi esihle, lesi sifundo sikukhombisa ukuthi ungamisa kanjani igxathu negxathu i-powerline-shell-master futhi umnikeze ukubukeka okuhle ngokushesha ngawe ibhande legobolondo. Ngamafuphi, lesi sifundo sizokukwenza ube yinhloko ye- Ukwenza ngokwezifiso kweBash Prompt

Yini i-bash?

IBash (iBourne futhi igobolondo) wuhlelo lwekhompyutha, olunomsebenzi wokuhumusha imiyalo, nolimi lohlelo lwekhonsoli. Kususelwa kugobolondo le-Unix futhi kuyahambisana ne-POSIX.

Yini okusheshayo?

Uhlamvu noma iqoqo lezinhlamvu eziboniswa kulayini womyalo libizwa nge-prompt ukukhombisa ukuthi lilindele imiyalo. Lokhu kungahluka ngokuya ngeShell futhi imvamisa kuyalungiswa.

Ukulanda i-Powerline-Shell-Master

I-Powerline-Shell-Master iphrojekthi yamahhala futhi itholakala ku- https://github.com/banga/powerline-shell

i-github powerline-Shell
Siya kulo mzila bese siyilayisha njengakwifomethi ye-zip.

Landa i-PLS

Singakwenza futhi kusuka kukhonsoli ngomyalo olandelayo:

git clone https://github.com/banga/powerline-shell.git

Ilungiselela iPowerLine-Shell-Master

Lapho iphrojekthi isilandiwe, siyayivula ku-zip:

$ cd / Ukulanda $ unzip powerline-shell-master.zip $ cd powerline-shell-master

Sihlela ifayela lokumisa i-config.py.dist ukulayisha ingqikithi eyisisekelo

$ nano config.py.dist
    Kulayini wokugcina wefayela shintsha umugqa THEME = 'default' uye ku-
    ISIHLOKO = 'okuyisisekelo'
Phuma futhi ulondoloze izinguquko

Ukuhlelwa kweNanoEPLPL

Sikhipha ukufaka.py ukulayisha izinguquko ezintsha zokumiswa:

$ python ukufaka.py
  Kufanele ibuyise umphumela olandelayo:
    Kudalwe i-config.py yomuntu siqu ngokwezifiso zakho i-powerline-shell.py igcinwe ngempumelelo
  Uma ukwenziwa kuphumelele, sizobona amanye amafayela amathathu:
    i-config.pyc, i-config.py ne-powerline-shell.py

Faka i -PLS

Manje kufanele sithole ifolda kuphela lapho kufanele iye khona noma kufanele kube lula nokuhleleka, sihambisa ifolda iye / ekhaya / umsebenzisi uyiqamba kabusha njenge .power-line-Shell-master, iphuzu elandulela igama ukuyifihla.

Uma sisengaphakathi kwesiqondisi sibuyela emuva:
$ cd .. $ mv powerline-shell-master $ IKHAYA / .powerline-shell-master

mvPLS

Ukusetha i-Bash Prompt

Ukulungiselela i-bash Prompt kulula impela ngoba kwincwajana ye-powerline-Shell kukhona ukumiswa okufanele kwe-bash, kepha noma kunjalo kunqunyelwe, ngakho-ke ngizokushiya ukumiswa kwe-.bashrc ukuze ukunamathisele kufayela lakho. bashrc njengoba kunjalo, esikhundleni sokumiswa kwangaphambilini.

Uma sisesendleleni yokulanda siya kufolda yomuntu siqu
$ cd ~
Senza ikhophi eyisipele yefayela lethu le-.bashrc
$ cp .bashrc .bashrc_old
Sivula ifayela le-.bashrc ngesihleli sombhalo ukulihlela
$ nano .bashrc
Uma sekuvuliwe, sisusa okuqukethwe kwayo bese sikufaka esikhundleni sokulandelayo:
# ~ / .bashrc: kubulawa ngu-bash (1) wamagobolondo angenayo ukungena ngemvume.
 # see / usr / share / doc / bash / example / file-startup (in the package bash-doc) # for example # Uma kungasebenzi ngokusebenzisana, ungenzi lutho icala $ - in * i *) ;; *) buyela ;; esac # ungabeki imigqa eyimpinda noma imigqa eqala ngesikhala emlandweni.
 _ usayizi wewindi ngemuva komyalo ngamunye futhi, uma kunesidingo, # buyekeza amanani we-LINES ne-COLUMNS.
 shopt -s checkwinsize # Uma isethiwe, iphethini "**" esetshenziswe kumongo wokunwetshwa kwegama lendlela izofana nawo wonke amafayela ne-zero noma izinkomba eziningi nama-subdirectories.
 #shopt -s globstar # yenza ubungani obuncane kumafayela wokufaka okungewona umbhalo, bona ipayipi elincane (1) [-x / usr / bin / lesspipe] && eval "$ (SHELL = / bin / sh lesspipe)" # set set variable identifying i-chroot osebenza kuyo (esetshenziswe ekwazisweni ngezansi) uma [-z "$ {debian_chroot: -}"] && [-r / etc / debian_chroot]; bese debian_chroot = $ (ikati / njll / debian_chroot) fi # setha i-Prompt fancy (non-color, ngaphandle kokuthi sazi ukuthi "sifuna" color case) "$ TERM" in xterm-color | * -256color) color_prompt = yes ;; esac # uncomment ye-Prompt enemibala, uma i-terminal inamandla; icishe i- # ngokuzenzakalela ukuze ingaphazamisi umsebenzisi: ukugxila efasiteleni lokugcina # kufanele kube kukhishwa kwemiyalo, hhayi ku-prompt # force_color_prompt = yebo uma [-n "$ force_color_prompt"]; khona-ke uma [-x / usr / bin / tput] && tput setaf 1> & / dev / null; bese # Sinokusekelwa kombala; cabanga ukuthi iyahambisana ne-Ecma-48 # (ISO / IEC-6429).  . bese # PS1 = '$ {debian_chroot: + ($ debian_chroot)} \ [\ 033 [01; 32m \] \ u @ \ h \ [\ 033 [00m \]: \ [033 [01; 34m \] \ w \ [\ 033 [00m \] \ $ '#else # PS1 =' $ {debian_chroot: + ($ debian_chroot)} \ u @ \ h: \ w \ $ '#fi #unset color_prompt force_color_prompt # Uma lokhu kuyi- I-xterm isethe isihloko kumsebenzisi @ umphathi: dir #case "$ TERM" ku- # xterm * | rxvt *) # PS1 = "\ [\ e] 0; $ {debian_chroot: + ($ debian_chroot)} \ u @ \ h : \ w \ a \] $ PS1 "# ;; # *) # ;; #esac # vumela ukusekelwa kombala kwama-ls futhi ungeze ama-aliases alusizo uma [-x / usr / bin / dircolors]; bese u-test -r ~ / .dircolors && eval "$ (dircolors -b ~ / .dircolors)" || eval "$ (dircolors -b)" alias ls = 'ls --color = auto' #alias dir = 'dir --color = auto' #alias vdir = 'vdir --color = auto' alias grep = 'grep - -color = auto 'alias fgrep =' fgrep --color = auto 'alias egrep =' egrep --color = auto 'fi # color GCC izexwayiso namaphutha #export GCC_COLORS =' error = 01; 31: warning = 01; 35 : note = 01; 36: caret = 01; 32: locus = 01: quote = 01 '# amanye ama-ls alias alias ll =' ls -alF 'alias la =' ls -A 'alias l =' ls -CF ' ## Ama-alias abuyekeza i-operative system alias system-update = "sudo apt-get update && sudo apt-get upgrade" # Faka igama elithi "uqaphile" ngemiyalo esebenza isikhathi eside. Sebenzisa kanjena: # ukulala 10; isexway alias alert = 'notify-send --urgency = low -i "$ ([$?  = 0] && ukuphela kwe-echo || iphutha le-echo) "" $ (umlando | umsila -n1 | sed -e '\' 's / ^ \ s * [0-9] \ + \ s * //; s / [; & |] \ s * isexwayiso $ // '\' ') "' # Izichasiso zezincazelo.
 # Ungahle uthande ukubeka konke okungeziwe kufayela elihlukile elifana ne- # ~ / .bash_aliases, esikhundleni sokungeza lapha ngqo.
 # Bona / usr / share / doc / bash-doc / izibonelo kuphakheji ye-bash-doc.
 uma [-f ~ / .bash_aliases]; lapho-ke.  ~ / .bash_aliases fi #grep command color color activation GREP_OPTIONS = - color # sikwazi izici zokuqedela ezihleliwe (awudingi ukunika amandla i- # this, uma isivele inikwe amandla ku- /etc/bash.bashrc kanye / etc / profile # sources njll / bash.bashrc).
 uma!  shopt -oq posix; khona-ke uma [-f / usr / share / bash-completed / bash_completion]; lapho-ke.  / usr / share / bash-completed / bash_completion elif [-f / etc / bash_completion]; lapho-ke.  / etc / bash_completion fi fi #Configuration powerline-shell-master function _update_ps1 () {PS1 = "$ ($ HOME / .powerline-shell-master / powerline-shell.py $? 

Ekupheleni kokumiswa, uma uvula i-terminal, izokhonjiswa ngokulandelayo.

okokugcinaPLS

Kubalulekile uma ufuna ukwaziswa kwakho lapho ungena ngemvume njengempande, kukhonjiswa okufanayo nakumsebenzisi wakho kufanele uthumele i-.bashrc osuyilungisile ku- / root path

Ukusetha ukwaziswa kwempande

nombonoRootPLS

Uma ufunda isexwayiso futhi uthathe ukubaluleka, ake siqhubeke futhi silungiselele i-root propt, lokhu ngeke kuthathe isikhathi eside, kumane kukukopisha ifayela .bashrc kuhlelwe phambilini bese uyithumela emzileni / impande.

Ngaphakathi kwendlela yefolda yethu yomuntu siqu
$ sudo cp -f .bashrc /root/.bashrc [sudo] iphasiwedi ye (umsebenzisi):
Lapho sengikwenzile lokhu, sibheka ukuthi ifayili / le-root/.bashrc linokumiswa okufanayo
$ sudo cat /root/.bashrc

Ukwenza ngokwezifiso kweBash Prompt

Ngiyabonga ngokubuka lesi sifundo, futhi uma ungomunye walabo abakusebenzisa ngesikhathi esihle ngiyajabula ukuthi kunjalo, ngoba le ncwajana noma isifundo senziwe ngenhloso yokuba lusizo. Ngiyazi ukuthi kwabaningi lokhu akuyona inkinga enempikiswano kodwa kwesinye isikhathi kuyadina ukusebenza ne-terminal engathandeki, i-hehe ndaba yokunambitheka.


Okuqukethwe yi-athikili kunamathela ezimisweni zethu ze izimiso zokuhlelela. Ukubika iphutha chofoza lapha.

Amazwana ayi-7, shiya okwakho

Shiya umbono wakho

Ikheli lakho le ngeke ishicilelwe. Ezidingekayo ibhalwe nge *

*

*

  1. Ubhekele imininingwane: Miguel Ángel Gatón
  2. Inhloso yedatha: Lawula Ugaxekile, ukuphathwa kwamazwana.
  3. Ukusemthethweni: Imvume yakho
  4. Ukuxhumana kwemininingwane: Imininingwane ngeke idluliselwe kubantu besithathu ngaphandle kwesibopho esisemthethweni.
  5. Isitoreji sedatha: Idatabase ebanjwe yi-Occentus Networks (EU)
  6. Amalungelo: Nganoma yisiphi isikhathi ungakhawulela, uthole futhi ususe imininingwane yakho.

  1.   Gerard kusho

    Sawubona!!

    Ngikuthandile okuthunyelwe kwakho, ngikuhlolile ku-Mint 18.1 entsha futhi lapho ukumba umphumela bekungafani ...

    Kubukeka sengathi anginawo amafonti wohlelo afanele ukukhombisa kahle ukwenziwa ngemicibisholo, ngoba imibala ikhonjiswa kahle.

    Angazi noma omunye umuntu wehlelwa yikho kepha ngithanda ukwazi ukuthi ngabe kukhona isixazululo, noma ikhasi lokulanda elivela emithonjeni efanelekile ukuze livele.

    Siyabonga!

    1.    I-Nexcoyotl kusho

      Sawubona mngani, ngiyabonga ngokuphawula, uma ngabe ngikhohliwe ukusho ukuthi kudinga imithombo efanelekile yokwenza ukubukeka. Lawa mafonti angamaFonti e-Powerline futhi ungawathola ku- https://github.com/powerline/fonts

    2.    uJesu kusho

      Bekufanele ngiguqule kokuncamelayo kokugcina, inketho yama-'Encodings 'kuya ku-'UTF-8 Unicode' futhi ngayixazulula nayo.

      1.    I-Nexcoyotl kusho

        Uma empeleni ngisebenza nokufaka ikhodi kwe-'utf-8 unicode ', ngiyabonga ngamazwana 😀

  2.   Abathandwa kusho

    I-Ohm, ayibukeki kahle kuphela uma ingenzi ukufunda kube lula, iTuto enhle.

  3.   indida kusho

    Sawubona, kuhle kakhulu ukubonga kokuthunyelwe, yize kwenzeke kimi ukuthi yonke imibala / izingxenye zebha zivele zimpunga, kanye nokwaziswa kwalolu hlobo xxxxxx   ~  $  yini okufanele ngiyenze ukulungisa lokho? Ngiyabonga kakhulu, umnikelo omuhle kakhulu, imikhonzo

  4.   umagazine kusho

    Ngizamile futhi ikhonsoli yasebenza kepha ngaphuma ngokushesha, ngiyabonga ukuthi bekungeyona into ebucayi futhi bengingayilungisa.