Txhim Kho Bash Txiaj Ntsig nrog Powerline-Plhaub-Master

Yog hais tias zoo li kuv, koj yog ib tus hlub ntawm bash thiab rau cov laj thawj ntawm lub cwj pwm los yog whim, koj tsis xav zoo li siv zsh y oh kuv zsh kom muab kev txhim kho zoo ntxiv rau koj cov davhlau ya nyob twg. Zoo, hauv lub sijhawm zoo, qhov kev qhia no qhia koj yuav ua li cas txhim kho cov kauj ruam los ntawm kauj ruam powerline-plhaub-tus tswv thiab muab nws zoo tsos sai li sai tau los ntawm koj plhaub plhawsCov. Hauv ntej, qhov kev qhia no yuav ua rau koj tus tswv ntawm cov Bash Qhia kev ceev kom haum

Dab tsi yog bash?

Bash (Bourne rov plhaub) yog qhov program program hauv koos pis tawj, nws txoj haujlwm yog los txhais cov lus txib, thiab lus console cov lus. Nws yog ua raws Unix plhaub thiab yog POSIX ua raws.

Dab tsi yog qhov ua kom sai?

Cov cim los yog cov cim sau tso rau ntawm kab ntawm kab hais kom ua lub suab hu tam sim ntawd los qhia tias nws tseem tos cov lus txib. Qhov no tuaj yeem sib txawv raws li lub plhaub thiab feem ntau yog kho tau.

Daus Hwj Hwj Hwj-Quav-Tswv

Powerline-Plhaub-Master yog qhov phiaj xwm pub dawb thiab tuaj yeem pom hauv https://github.com/banga/powerline-shell

github powerline-plhaub
Peb mus rau txoj kev no thiab rub tawm nws raws li hauv zip hom.

Rub PLS

Peb tseem tuaj yeem ua nws los ntawm cov console nrog cov lus txib nram qab no:

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

Kev teeb tsa PowerLine-Shell-Master

Thaum peb tes num downloaded, peb unzip nws:

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

Peb hloov kho cov ntaub ntawv teeb tsa config.py.dist los thauj cov ntsiab lus yooj yim

$ nano config.py.dist
    Hauv kab kawg ntawm cov ntawv hloov pauv kab THEME = 'default' rau
    THEME = 'theem pib'
Tawm thiab txuag kev hloov pauv

NanoEditPLS

Peb tuag nruab.py Txhawm rau thauj cov qauv tshiab hloov pauv:

$ $ sej install.py
  Nws yuav tsum xa cov khoom nram qab no:
    Tsim tus kheej config.py rau koj customizations powerline-shell.py tau txais kev cawmdim ntse
  Yog tias kev ua tiav tiav, peb yuav pom peb daim ntawv ntxiv:
    config.pyc, config.py thiab powerline-shell.py

Nruab PLS

Tam sim no peb tsuas yog mus nrhiav daim nplaub tshev qhov chaw nws yuav tsum mus los yog yuav tsum yog rau kev yooj yim thiab kev txiav txim, peb tsiv lub nplaub tshev rau / tsev / neeg siv hloov nws li .power-line-shell-master, cov ntsiab lus ua ntej lub npe yog mus nkaum nws. Cov.

Yog tias peb tseem nyob hauv phau ntawv qhia peb rov mus:
$ cd .. $ mv powerline-shell-master $ HOME / .powerline-shell-master

mvPLS

Teem Qhov Tsho Tawm Txiaj Ntsig

Txhawm rau txhim kho lub bash sai yog yooj yim heev txij li nyob hauv phau ntawv hluav taws xob-plhaub phau ntawv muaj qhov tsim nyog rau bash, tab sis txawm li cas los nws yog qee qhov txwv, yog li kuv yuav tawm .bashrc teeb tsa rau koj kom cia li muab tshuaj txhuam rau hauv koj cov ntaub ntawv. yog, hloov ua ntej dhau los kev teeb tsa.

Yog tias peb tseem nyob rau txoj kev rub tawm peb mus rau koj tus kheej daim nplaub tshev
$ cd ~
Peb ua tus thaub qab ntawm peb cov .bashrc cov ntaub ntawv
$ cp .bashrc .bashrc_old
Peb qhib .bashrc ntawv nrog cov ntawv nyeem kho kom raug nws
$ nano .bashrc
Thaum qhib, peb rho tawm nws cov ntsiab lus thiab hloov nws nrog cov hauv qab no:
# ~ / .bashrc: tua los ntawm bash (1) rau cov plhaub tsis nkag.
 # pom / usr / share / doc / bash / example / startup-files (hauv pob bash-doc) # piv txwv # Yog tias tsis khiav sib cuam tshuam, tsis txhob ua dab tsi rau $ - hauv * i *); *) rov qab ;; esac # tsis txhob tso cov kab lossis cov kab pib ntawm qhov chaw hauv keeb kwm.
 # Saib bash (1) rau ntau txoj kev xaiv HISTCONTROL = ignboth # ntxiv rau cov ntaub ntawv keeb kwm, tsis txhob tso nws lub khw -s keeb kwm # rau kev tsim keeb kwm ntev saib HISTSIZE thiab HISTFILESIZE hauv bash (1) HISTSIZE = 1000 HISTFILESIZE = 2000 # tshawb lub qhov rai loj tom qab txhua nqe lus txib thiab, yog tias tsim nyog, # hloov kho qhov tseem ceeb ntawm LINES thiab COLUMNS.
 shopt -s checkwinsize # Yog hais tias teev, tus qauv "**" siv nyob hauv cov npe hu ua pathname expansion ntsiab lus yuav # phim txhua cov ntaub ntawv thiab xoom lossis ntau dua phau ntawv sau npe thiab subdirectories.
 #shopt -s globstar # ua kom tsawg dua tus phooj ywg rau cov ntawv tsis yog cov ntawv nkag, pom lesspipe (1) [-x / usr / bin / lesspipe] && eval "$ (SHELL = / bin / sh lesspipe)" # teeb tsa kev paub meej chroot koj ua haujlwm nyob rau hauv (siv tam sim ntawd hauv qab) yog [-z "$ {debian_chroot: -}"] && [-r / etc / debian_chroot]; tom qab ntawd debian_chroot = $ (miv / thiab lwm yam / debian_chroot) fi # teeb qhov zoo nkauj (tsis yog xim, tshwj tsis yog peb paub peb "xav tau" xim) rooj plaub "$ TERM" hauv xterm-xim | * -256color) color_prompt = yog ;; esac # tsis sib haum rau lub ntsej muag xim, yog tias cov davhlau ya nyob twg muaj peev xwm; muab kaw # los ntawm lub neej ntawd kom tsis txhob cuam tshuam tus neeg siv: qhov kub siab rau lub davhlau ya nyob twg qhov rai # yuav tsum yog nyob rau ntawm cov zis ntawm cov lus txib, tsis yog nyob ntawm qhov # #____or__tompt = yog tias yog [-n "$ force_color_prompt"]; tom qab ntawd yog [-x / usr / rau hauv / cov lus hais] && tput setaf 1> & / dev / thov; ces # Peb muaj xim txhawb nqa; xav tias nws ua tau raws li Ecma-48 # (ISO / IEC-6429).  (Tsis muaj cov kev pab txhawb ntawd tsis tshua muaj neeg pom, thiab xws li # ib rooj plaub feem ntau yuav pab txhawb teeb tsa tsis yog setaf.) Color_prompt = yog muaj lwm qhov xim_prompt = fi fi #config yooj yim #if ["$ color_prompt" = yog]; tom qab ntawd # 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 # Yog tias qhov no yog xterm teeb lub npe rau tus neeg siv @ host: dir #case "$ TERM" hauv # xterm * | rxvt *) # PS1 = "\ [\ e] 0; $ {debian_chroot: + ($ debian_chroot)} \ u @ \ h : \ w \ a \] $ PS1 "# ;; # *) # ;; #esac # ua kom cov xim txhawb nqa ntawm ls thiab tseem ntxiv rau tus lej ntsej muag yog tias [-x / usr / bin / dircolors]; tom qab ntawv sim -r ~ / .dircolors && eval "$ (dircolors -b ~ / .dircolors)" || eval "$ (dircolors -b)" alias ls = 'ls --color = auto' #alias dir = 'dir - xim = pib' #alias vdir = 'vdir - xim = nws pib' cai grep = 'grep - -color = auto 'alias fgrep =' fgrep --color = auto 'alias egrep =' egrep --color = auto 'fi # kob GCC cov lus ceeb toom thiab qhov tsis raug #export GCC_COLORS =' yuam kev = 01; 31: ceeb toom = 01; 35 : faj seeb = 01; 36: caret = 01; 32: locus = 01: quote = 01 '# qee tus ntxiv ls siv yias ll =' ls -alF 'cai la =' l--A 'cai l =' ls -CF ' ## Alias ​​hloov kho cov txheej txheem ua haujlwm siv alias system-hloov tshiab = "sudo apt-tau hloov tshiab & & sudo apt-tau txawj tej yam ntxiv" # Ntxiv ib qho "ceeb toom" lub npe rau ntev khiav cov lus txib. Siv zoo li: # pw tsaug zog 10; alert alias alert = 'ceeb toom-xa - nrawm = qes -i "$ ([$?  = 0] && echo davhlau ya nyob twg || echo yuam kev) "" $ (keeb kwm | tw -n1 | sed -e '\' 's / ^ s s * [0-9] \ + \ s * //; s / [; & |] \ s * ceeb toom $ // '\' ') "" # Alias ​​cov ntsiab lus.
 # Koj tuaj yeem xav muab tag nrho koj cov lus ntxiv rau hauv ib daim ntawv cais xws li # ~ / .bash_aliases, tsis txhob ntxiv rau lawv ntawm no ncaj qha.
 # Saib / usr / share / doc / bash-doc / piv txwv hauv pob ntawv pob bash-doc.
 yog [-f ~ / .bash_aliases]; ntawd.  ~ / .bash_aliases fi #grep hais kom ua xim kom zoo GREP_OPTIONS = - xim # pab kom cov programmable tiav cov nta (koj tsis tas yuav pab kom qhov # no, yog tias nws tau qhib rau /etc/bash.bashrc thiab / thiab lwm yam / profile # qhov chaw / lwm yam / bash.bashrc).
 yog!  shopt -oq posix; ces yog [-f / usr / share / bash-tiav / bash_completion]; ntawd.  / usr / share / bash-tiav / bash_completion elif [-f / thiab / bash_completion]; ntawd.  / etc / bash_completion fi fi #Configuration powerline-plhaub-tswv muaj nuj nqi _update_ps1 () {PS1 = "$ ($ HOME / .powerline-shell-master / powerline-shell.py $?)? 

Qhov kawg ntawm kev teeb tsa, yog tias koj qhib lub davhlau ya nyob twg, nws yuav raug tso tawm raws li hauv qab no.

kawgPLS

Tseem ceeb yog tias koj xav tau koj qhov kev tshoov siab thaum koj nkag mus rau hauv hauv paus, nws tau tshwm zoo tib yam li hauv koj tus neeg siv koj yuav tsum xa .bashrc uas koj twb tau teeb tsa mus rau / hauv paus kev

Teem lub hauv paus sai

foundationsRootPLS

Yog tias koj nyeem ntawv ceeb toom thiab koj tau coj qhov tseem ceeb, cia peb mus tom ntej thiab teeb tsa lub hauv paus kev twv, qhov no yuav tsis siv sijhawm ntev, nws tsuas yog theej cov ntaub ntawv .bashrc yav tas los kho thiab xa nws mus rau txoj kev / hauv paus.

Nyob rau hauv txoj kev ntawm peb tus kheej daim nplaub tshev
$ sudo cp -f .bashrc /root/.bashrc [sudo] password rau (neeg siv):
Thaum kuv ua qhov no, peb tshawb xyuas tias /root/.bashrc ntawv muaj tib qho kev teeb tsa
$ sudo miv /root/.bashrc

Bash Qhia kev ceev kom haum

Ua tsaug rau koj saib cov lus qhia no, thiab yog tias koj yog ib tus ntawm muab tso rau hauv kev coj ua lub sijhawm zoo Kuv zoo siab tias nws yog li ntawd, vim hais tias phau ntawv lossis phau ntawv qhia no tau tsim nrog lub hom phiaj pab tau. Kuv paub tias rau ntau qhov no tsis yog qhov teeb meem no tab sis qee zaus nws yog qhov txaus siab ua haujlwm nrog lub davhlau ya nyob tsis zoo, hehe teeb meem ntawm saj.


Cov ntsiab lus ntawm tsab xov xwm ua raws li peb cov ntsiab cai ntawm kev tswj hwm kev ncaj nceesCov. Tshaj tawm ib qho yuam kev nyem no.

7 lus, tawm koj li

Tso koj saib

Koj email chaw nyob yuav tsis tsum luam tawm. Yuav tsum tau teb cov cim nrog *

*

*

  1. Lub luag haujlwm rau cov ntaub ntawv: Miguel Ángel Gatón
  2. Lub hom phiaj ntawm cov ntaub ntawv: Tswj SPAM, kev tswj xyuas tawm tswv yim.
  3. Sau raws cai: Koj kev tso cai
  4. Kev sib txuas lus ntawm cov ntaub ntawv: Cov ntaub ntawv yuav tsis raug xa mus rau lwm tus neeg thib peb tsuas yog los ntawm kev txiav txim siab raug cai.
  5. Cov ntaub ntawv khaws cia: Cov Ntaub Ntawv khaws tseg los ntawm Occentus Networks (EU)
  6. Txoj Cai: Txhua lub sijhawm koj tuaj yeem txwv, rov qab thiab tshem tawm koj cov ntaub ntawv.

  1.   Gerard said

    Nyob zoo !!

    Kuv nyiam koj cov ntawv tshaj tawm, Kuv tau sim nws hauv Mint 18.1 tshiab thiab thaum kev khawb cov txiaj ntsig tsis tau zoo ib yam ...

    Nws zoo nkaus li tias kuv tsis muaj cov qauv tsim nyog fonts los qhia cov lus sai nrog cov xub, txij li cov xim tau tso tawm kom raug.

    Kuv tsis paub yog tias muaj lwm tus yuav tshwm sim rau nws tab sis kuv xav paub yog tias muaj kev daws teeb meem, lossis ib nplooj ntawv rub tawm los ntawm cov khoom zoo los ua kom nws tshwm.

    Ua Tsaug !!

    1.    Nexcoyotl said

      Nyob zoo tus phooj ywg, ua tsaug rau kev tawm tswv yim, yog tias tseeb kuv tsis nco qab hais tias nws yuav tsum muaj txoj cai los txhim kho cov tsos. Cov fonts yog Powerline Fonts thiab koj tuaj yeem nrhiav tau lawv https://github.com/powerline/fonts

    2.    Yexus said

      Kuv yuav tsum tau hloov pauv nyob rau hauv qhov xaus cov kev xaiv, qhov kev xaiv ntawm 'Encodings' rau 'UTF-8 Unicode' thiab daws dhau.

      1.    Nexcoyotl said

        Yog tias qhov tseeb Kuv tseem ua haujlwm nrog qhov 'utf-8 unicode' encoding, ua tsaug rau saib 😀

  2.   9000 said

    Ohm, tsis yog nws saib zoo xwb yog tias nws tsis ua kom nyeem yooj yim dua, zoo Tuto.

  3.   paradox said

    Nyob zoo, zoo tshaj tawm ua tsaug, txawm hais tias nws tau tshwm sim rau kuv tias txhua qhov xim / ntu ntawm qhov bar tau tshwm sim hauv txho, thiab tus hais tawm ntawm lub hom x xxxx  ~  $  Kuv yuav tsum tau ua dab tsi los kho qhov ntawd? Ua tsaug ntau, pab txhawb, zoo siab txais tos koj

  4.   nco 9000 said

    Kuv tau sim thiab lub console ua haujlwm tab sis kuv tau khiav tawm tam sim ntawd, ua tsaug rau kev siab zoo nws tsis muaj dab tsi loj thiab kuv tuaj yeem kho nws.