Lokisa Bash Prompt ka Powerline-Shell-Master

Haeba u rata nna, u morati oa Bash mme ka mabaka a tloaelo kapa thato, ha o utloe ho rata zsh y oh zsh ho fana ka ntlafatso e kholo ho sesebelisoa sa hau. Ha e le hantle, ka nako e ntle, thuto ena e u bontša mokhoa oa ho hlophisa mohato ka mohato motlakase-shell-master le ho mo fa ponahalo e ntle potlako ho tloha ho hau bash shell. Ka bokhutšoanyane, thuto ena e tla u etsa setsebi sa Boemo ba Bash Prompt

Bash ke eng?

Bash (shell ea Bourne hape) ke lenaneo la k'homphieutha, leo mosebetsi oa lona e leng ho toloka litaelo, le puo ea lenaneo la console. E ipapisitse le khetla ea Unix mme e lumellana le POSIX.

Potlako ke eng?

Sebopeho kapa setlhaku sa litlhaku tse bontšitsoeng moleng oa taelo se bitsoa kapele ho bontša hore se emetse litaelo. Sena se ka fapana ho latela khetla mme hangata sea hlophiseha.

Ho khoasolla Powerline-Shell-Master

Powerline-Shell-Master ke projeke ea mahala ebile e ka fumanoa ho https://github.com/banga/powerline-shell

khalase ea motlakase ea github
Re ea tseleng ena ebe re e jarolla joalo ka ka sebopeho sa zip.

Khoasolla PLS

Re ka e etsa hape ho tsoa ho konsole ka taelo e latelang:

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

Ho hlophisa PowerLine-Shell-Master

Hang ha morero o jarollotsoe, rea o notlolla:

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

Re hlophisa faele ea phetolo tlhophiso.py.dist ho kenya sehlooho sa mantlha

$ nano config.py.dist
    Molaong oa ho qetela oa faele fetola mola THEME = 'default' ho
    SEHLOOHO = 'mantlha'
Tsoa 'me u boloke liphetoho

NanoEditPLS

Rea phethisa kenya.py Ho jarisa liphetoho tse ncha tsa tlhophiso:

$ python kenya.py
  E lokela ho khutlisa sephetho se latelang:
    O iketsetse config.py ea hau bakeng sa li-powerline-shell.py tsa hau tse bolokiloeng ka katleho
  Haeba polao e atlehile, re tla hlokomela lifaele tse ling tse tharo:
    config.pyc, config.py le powerline-shell.py

KenyaPLS

Hona joale re tlameha feela ho fumana foldara moo e lokelang ho ea teng kapa e lokela ho ba bonolo le tatellano, re tsamaisa foldara ho / home / user re e rehe lebitso la .power-line-shell-master, ntlha e tlang pele ho lebitso ke ho e pata.

Haeba re ntse re le kahare ho sistimi re khutlela morao:
$ cd .. $ mv motlakase-shell-master $ HOME / .powerline-shell-master

mvPLS

Ho theha Bash Prompt

Ho hlophisa ts'ebetso ea bash ho bonolo haholo hobane bukeng ea powerline-shell ho na le tlhophiso e nepahetseng ea bash, empa leha ho le joalo e na le moeli, ka hona ke tla u siela tlhophiso ea .bashrc hore o e manehe faeleng ea hau feela. bashrc joalo ka ha e le teng, e nkela sebaka sa phetolo e fetileng.

Haeba re ntse re le tseleng ea download re ea foldareng ea hau
$ cd ~
Re etsa kopi ea `` backup '' ea file ea rona ea .bashrc
$ cp .bashrc .bashrc_old
Re bula file ea .bashrc ka mohlophisi oa mongolo ho e hlophisa
$ nano .bashrc
Ha re se re butse, re hlakola litaba tsa eona ebe re e nkela tse latelang:
# ~ / .bashrc: e bolailoe ke bash (1) bakeng sa likhetla tse sa keneng.
 # bona / usr / share / doc / bash / mehlala / li-file-fono-fono (ka har'a sephutheloana sa bash-doc) # bakeng sa mehlala # Haeba e sa sebetse ka tšebelisano, u se ke oa etsa letho $ - ho * i *) ;; *) khutla ;; esac # se ke oa beha mela kapa mela e qalang ka sebaka nalaneng.
 # Bona bash (1) bakeng sa likhetho tse ling HISTCONTROL = hlokomoloha # tse kenyellelitsoeng faeleng ea nalane, u se ke oa e hatisa shopt -s histappend # bakeng sa ho beha bolelele ba nalane bona HISTSIZE le HISTFILESIZE ho bash (1) HISTSIZE = 1000 HISTFILESIZE = 2000 # cheke boholo ba fensetere kamora taelo e 'ngoe le e' ngoe, 'me ha ho hlokahala, # ntlafatsa boleng ba LINES le COLUMNS.
 shopt -s checkwinsize # Haeba e behiloe, paterone "**" e sebelisitsoeng tseleng ea ho holisa lebitso e tla # bapisa lifaele tsohle le zero kapa litsamaiso tse ling le li-subdirectories.
 #shopt -s globstar # etsa botsoalle bo fokolang bakeng sa lifaele tse sa kenyeng mongolo, bona pipe e nyane (1) [-x / usr / bin / lesspipe] && eval "$ (SHELL = / bin / sh lesspipe)" # set variable identifying chroot eo u sebetsang ho eona (e sebelisitsoeng kapele kapele ka tlase) haeba [-z "$ {debian_chroot: -}"] && [-r / etc / debian_chroot]; joale debian_chroot = $ (katse / jj / debian_chroot) fi # seta khothaletso e majabajaba (eseng mmala, ntle le haeba re tseba hore re "batla" mmala) "$ TERM" ka xterm-color | * -256color) color_prompt = yes ;; esac # uncomment bakeng sa 'mala o potlakileng, haeba sesebelisoa se na le bokhoni; e tima # ka boiketsetso hore e se ke ea sitisa mosebelisi: tsepamiso ea maikutlo fensetereng ea sesebelisoa # e lokela ho ba tlhahiso ea litaelo, eseng ho matla # force_color_prompt = ee haeba [-n "$ force_color_prompt"]; joale haeba [-x / usr / bin / tput] && tput setaf 1> & / dev / null; joale # Re na le ts'ehetso ea 'mala; nahana hore e lumellana le Ecma-48 # (ISO / IEC-6429).  (Ho haelloa ke ts'ehetso e joalo ke ntho e sa tloaelehang haholo, 'me joalo # joalo ho ka etsahala hore e tšehetse setf ho fapana le setaf.) Colour_prompt = yes else color_prompt = fi fi #config basic prompt #if ["$ color_prompt" = yes]; joale # 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 # Haeba sena ke xterm beha sehlooho ho user @ host: dir #case "$ TERM" ho # xterm * | rxvt *) # PS1 = "\ [\ e] 0; $ {debian_chroot: + ($ debian_chroot)} \ u @ \ h : \ w \ a \] $ PS1 "# ;; # *) # ;; #esac # nolofalletsa ts'ehetso ea mmala ea ls hape o kenye li-aliases tse sebetsang haeba [-x / usr / bin / dircolors]; ebe u leka -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 # litemoso le liphoso tsa GCC tse mebala #export GCC_COLORS =' phoso = 01; 31: temoso = 01; 35 : hlokomela = 01; 36: caret = 01; 32: locus = 01: quote = 01 '# tse ling tse ling tsa ls alias alias ll =' ls -alF 'alias la =' ls -A 'alias l =' ls -CF ' ' Sebelisa joalo: # robala 10; tlhokomeliso ea alias alert = 'notify-send --urgency = low -i "$ ([$?  = 0] && seteishene sa echo || echo phoso) "" $ (nalane | mohatla -n1 | sed -e '\' 's / ^ \ s * [0-9] \ + \ s * //; s / [; & |] \ s * tlhokomeliso $ // '\' ') "' # Tlhaloso ea likhetho.
 # U kanna ua batla ho kenya litlatsetso tsohle tsa hau ka faeleng e arohaneng joalo ka # ~ / .bash_aliases, ho fapana le ho li kenya mona ka kotloloho.
 # Bona / usr / share / doc / bash-doc / mehlala ho sephutheloana sa bash-doc.
 haeba [-f ~ / .bash_aliases]; joale.  ~ / .bash_aliases fi #grep command color color activation GREP_OPTIONS = - color # nolofalletsa likarolo tsa ho phethela tse hlophisitsoeng (ha ho hlokahale hore u li lumelle # sena, haeba se se se lumelletsoe ho /etc/bash.bashrc le / etc / profile # mehloli / jj / bash.bashrc).
 haeba!  shopt -oq posix; joale haeba [-f / usr / share / bash-completed / bash_completion]; joale.  / usr / share / bash-completed / bash_completion elif [-f / etc / bash_completion]; joale.  / etc / bash_completion fi fi #Configuration powerline-shell-master function _update_ps1 () {PS1 = "$ ($ HOME / .powerline-shell-master / powerline-shell.py $? 

Qetellong ea tlhophiso, haeba u bula sesebelisoa, se tla bontšoa ka tsela e latelang.

qetellongPLS

Ho bohlokoa haeba o batla potlako ea hau ha o kena e le motso, e bonts'oa ka mokhoa o ts'oanang le ho mosebelisi oa hau o tlameha ho romella .bashrc eo o seng o e hlophisitse ho / root path

Ho seta motso kapele

ponoRootPLS

Haeba u bala temoso mme u nka bohlokoa, ha re tsoeleng pele ho hlophisa motso oa propt, sena ha se nke nako e telele, ke ho kopitsa faele feela .bashrc e hlophisitsoeng pele mme o e romelle tseleng / motso.

Ka har'a tsela ea foldara ea rona
$ sudo cp -f .bashrc /root/.bashrc [sudo] phasewete bakeng sa (mosebelisi):
Hang ha ke etsa sena, re sheba hore file ea /root/.bashrc e na le tlhophiso e tšoanang
$ sudo katse / root/.bashrc

Boemo ba Bash Prompt

Kea le leboha ka ho shebella thupelo ena, 'me haeba ue mong oa ba e sebelisang ka nako e ntle ke thabile hore ebe ho joalo, hobane buka ena kapa thuto e entsoe ka sepheo sa ho ba molemo. Kea tseba hore ho ba bangata sena ha se khang empa ka linako tse ling hoa tena ho sebetsa le seteishene se sa rateheng, hehe taba ea tatso.


Litaba tsa sengoloa sena li latela melao-motheo ea rona ea melao ea boitšoaro ea bongoli. Ho tlaleha phoso tlanya mona.

Maikutlo a 7, siea ea hau

Siea maikutlo a hau

aterese ya hao ya imeile ke ke ho phatlalatswa. masimo a hlokahala a tšoailoe ka *

*

*

  1. E ikarabella bakeng sa data: Miguel Ángel Gatón
  2. Morero oa data: Laola SPAM, tsamaiso ea maikutlo.
  3. Molao: Tumello ea hau
  4. Puisano ea data: Lintlha li ke ke tsa tsebisoa batho ba boraro ntle le ka tlamo ea molao.
  5. Polokelo ea data: Database e hapiloeng ke Occentus Networks (EU)
  6. Litokelo: Nako efe kapa efe o ka fokotsa, oa hlaphoheloa mme oa hlakola tlhaiso-leseling ea hau.

  1.   Gerard a re

    Lumela!!

    Ke ratile poso ea hau haholo, ke e lekile ho Mint 18.1 e ncha mme ha ho cheka sephetho ha ho tšoane ...

    Ho bonahala eka ha ke na li-fonte tsa sistimi tse loketseng ho bonts'a se nepahetseng ka metsu, hobane mebala e bonts'itsoe hantle.

    Ha ke tsebe hore na ho na le motho e mong ea ka e hlahelang empa ke kopa ho tseba hore na ho na le tharollo, kapa leqephe la download ho tsoa mehloling e nepahetseng ho etsa hore le hlahe hantle.

    Kea leboha!

    1.    Moahlape a re

      Lumela motsoalle, kea leboha ka ho fana ka maikutlo, haeba kannete ke lebetse ho bolela hore ho hloka mehloli e nepahetseng ho ntlafatsa ponahalo. Mehala ena ke Mehala ea Powerline mme o ka e fumana ho https://github.com/powerline/fonts

    2.    Jesu a re

      Ke ile ka tlameha ho fetola likhethong tsa terminal, khetho ea 'Encodings' ho 'UTF-8 Unicode' mme e rarolloe hape.

      1.    Moahlape a re

        Haeba ehlile ke sebetsa le encoding ea 'utf-8 unicode', kea leboha ka maikutlo 😀

  2.   Kheta a re

    Ohm, ha e shebahale hantle feela haeba e sa etse hore ho bala ho be bonolo, Tuto e ntle.

  3.   Ho makatsa a re

    Kea leboha, ke leboha haholo poso, leha ho etsahetse ho nna hore mebala / likarolo tsohle tsa bareng li hlahile li le putsoa, ​​mme ts'isinyo ea mofuta ona xxxxxx   ~  $  ke tlameha ho etsa eng ho lokisa seo? Ke leboha haholo, monehelo o khabane, litumeliso

  4.   lenakoe9000 a re

    Ke lekile mme konteraka e ile ea sebetsa empa ka tsoa kapele, kea leboha hore e ne e se letho le tebileng mme nka e lokisa.