Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[OT] Com'e' il vosto prompt bash?
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

Goto page 1, 2, 3, 4, 5  Next  
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian) Forum di discussione italiano
View previous topic :: View next topic  
Author Message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 31641
Location: here

PostPosted: Wed Jul 07, 2004 6:11 pm    Post subject: [OT] Com'e' il vosto prompt bash? Reply with quote

Apro questo topic per sapere se avete modificato il vostro prompt bash. Io l'ho fatto e il risultato lo trovate qui. Il codice per fare questa cosa (messo in .bashrc) e' il seguente
Code:
normal='\[\033[0m\]'
white='\[\033[0;29m\]'
gray='\[\033[1;37m\]'
red='\[\033[1;31m\]'
green='\[\033[1;32m\]'
yellow='\[\033[0;33m\]'
blue='\[\033[0;34m\]'
magenta='\[\033[1;35m\]'
cyan='\[\033[0;36m\]'
purple='\[\033[1;0;35m\]'
lightgreen='\[\033[0;32m\]'
lightred='\[\033[0;31m\]'

MYL1="\033(0l\033(B"
MYL2="\033(0mq\033(B"
MYDATE="\$(/bin/date +'%d %B %Y - %H:%M')"
MYPTY="`tty | sed -e "s:/dev/::"`"
MYKERNEL="`uname -r`"


function mybattery {
  NO_AC_MESG="AC off"
  AC_MESG="AC on"

  APMD_RESPONSE=`apm`
  case $APMD_RESPONSE in
    *$AC_MESG*)
      ACstat="AC on"
      ;;
    *$NO_AC_MESG*)
      ACstat="AC off"
      ;;
  esac

  TOP="100%"
  BATT=`apm | tail -c 5`
  if [ $BATT = $TOP ]; then
    BATstat="top"
  else
    BATstat=`apm | tail -c 4`
  fi

  echo -n $ACstat, $BATstat
}

if [ `/usr/bin/whoami` = 'root' ]
then
    PS1="\n$gray$MYL1-($red\u $MYKERNEL$gray)-($yellow$MYDATE$gray)-($yellow\$(mybattery)$gray)-($yellow$MYPTY$gray)
$MYL2-($yellow\w$gray)->$normal "
else
    PS1="\n$gray$MYL1-($green\u $MYKERNEL$gray)-($yellow$MYDATE$gray)-($yellow\$(mybattery)$gray)-($yellow$MYPTY$gray)
$MYL2-($yellow\w$gray)->$normal "
fi


Le guide che ho seguito http://www.tldp.org/HOWTO/Bash-Prompt-HOWTO/ (in inglese) e http://it.tldp.org/HOWTO/Bash-Prompt-HOWTO.html#toc2 (in italiano), inoltre ho spulciato anche da https://forums.gentoo.org/viewtopic.php?t=5850
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
kaosone
Guru
Guru


Joined: 01 Feb 2004
Posts: 446

PostPosted: Wed Jul 07, 2004 6:28 pm    Post subject: Reply with quote

Code:
export PS1="\[\033[0;31m\]..::\[\033[1;31m\][\[\033[1;33m\]\u\[\033[0;31m\]@
\[\033[1;33m\]\h\[\033[1;31m\]][\[\033[1;33m\]\d\[\033[1;31m\]][\[\033
[1;33m\]\t\[\033[1;31m\]][\[\033[1;33m\]\w\[\033[1;31m\]]\[\033[0;31m\]
::..\n\[\033[1;31m\]$\[\033[0;0m\] "
 
:D
tutto su una riga ..
Back to top
View user's profile Send private message
Raffo
Veteran
Veteran


Joined: 23 Apr 2004
Posts: 1019
Location: Berlin

PostPosted: Wed Jul 07, 2004 6:30 pm    Post subject: Reply with quote

nn l'ho modificato e per ora credo che nn lo farò...forse un giorno mi verrà voglia, chissà....
Back to top
View user's profile Send private message
zUgLiO
l33t
l33t


Joined: 12 Aug 2003
Posts: 754
Location: Ferrara (Italy)

PostPosted: Wed Jul 07, 2004 6:32 pm    Post subject: Reply with quote

Io aspetto di copiarne subdolamente uno dei vostri! :)
_________________

voglio poi dire che il tempo mi avrà fatto abituare,

ma io non trovo nemmeno brutta la stiva buia di questa nave
Back to top
View user's profile Send private message
heXen
Guru
Guru


Joined: 21 Jun 2004
Posts: 320

PostPosted: Wed Jul 07, 2004 6:37 pm    Post subject: Reply with quote

user@host:cartella$
molto fantasioso :mrgreen:
è che non mi piacciono quelli lunghi
Back to top
View user's profile Send private message
croot
Apprentice
Apprentice


Joined: 07 Jul 2004
Posts: 240
Location: Massa (toscana)

PostPosted: Wed Jul 07, 2004 7:01 pm    Post subject: Reply with quote

x fedeliallalinea:

ho visto che il tuo sitto è interamente su ssl..
ma mi fallisce l'autenticazione del certificato è normale ?
altra domanda.. perchè l'hai messo tutto su ssl ? Ce n'era bisogno ?
Back to top
View user's profile Send private message
shev
Bodhisattva
Bodhisattva


Joined: 03 Feb 2003
Posts: 4084
Location: Italy

PostPosted: Wed Jul 07, 2004 7:12 pm    Post subject: Reply with quote

Code:
[ Wed Jul 07 - 21:08:49 | 92% | ~ ]
[ shev@kronos ] $


Ovviamente colorato è molto più figo :)

Rispettivamente riporto:

[data - ora | % carica batteria | directory in cui mi trovo]
[utente@nome-pc] $

Così ho sempre sott'occhio le info che più spesso mi servono, senza alzare gli occhi per cercarle nella varie barre/applet. Inoltre la disposizione dei vari elementi nel prompt è frutto di lunghi studi e consultazioni con vari esperti, in modo da ottimizzare lo spazio, evitare che gli elementi varino scombussolando l'allineamento del prompt o che sottraggano spazio ai comandi :lol:
_________________
Se per vivere ti dicono "siediti e stai zitto" tu alzati e muori combattendo
Back to top
View user's profile Send private message
Marculin
Guru
Guru


Joined: 24 Feb 2004
Posts: 376

PostPosted: Wed Jul 07, 2004 7:45 pm    Post subject: Reply with quote

sto lavorando a convertire la funzione batteria di fedeliallalinea per acpi ma ho un pò di problemi...se qualcuno riesce mi faccia sapere ;) grazie
ps:vi posterò presto a che punto sono
_________________
Non capisco perchè continuavo ad avere cosi paura della shell.....è cosi bella :)
Back to top
View user's profile Send private message
cromabianca
n00b
n00b


Joined: 05 Jun 2004
Posts: 13

PostPosted: Wed Jul 07, 2004 8:03 pm    Post subject: Reply with quote

E ogni volta che premi "invio" esce tutta quella roba? :roll:
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 31641
Location: here

PostPosted: Wed Jul 07, 2004 8:22 pm    Post subject: Reply with quote

Marculin wrote:
se qualcuno riesce mi faccia sapere

Domani dopo l'esame te lo faccio io :D
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 31641
Location: here

PostPosted: Wed Jul 07, 2004 8:23 pm    Post subject: Reply with quote

cromabianca wrote:
E ogni volta che premi "invio" esce tutta quella roba? :roll:

Si
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
randomaze
Bodhisattva
Bodhisattva


Joined: 21 Oct 2003
Posts: 9985

PostPosted: Wed Jul 07, 2004 8:26 pm    Post subject: Reply with quote

Mah, io avevo grabbato questo con l'idea di farlo anche a colori....

Code:
PS1="\w:\`if [ \$? = 0 ]; then echo :\\\); else echo :\\\(; fi\`\\\$ "


...ma é rimasto li perché preferisco il caro vecchio user@dir!
_________________
Ciao da me!
Back to top
View user's profile Send private message
silian87
Advocate
Advocate


Joined: 06 Oct 2003
Posts: 2318
Location: Treviso, Italy

PostPosted: Wed Jul 07, 2004 8:30 pm    Post subject: Reply with quote

Quote:
senza alzare gli occhi per cercarle nella varie barre/applet


Altro che pigrizia di alzarsi per prendere da bere o fare altre cose... qui i muscoli imlicati sono addiruttura quelli degli occhi! ahahaha :lol:
_________________
Musica che ascolto: http://www.last.fm/user/silian87/

Silian87 FAQs: http://marentax.homelinux.org/~silian87/silian87-faq.txt

GTalk: silian87@gmail.com
Back to top
View user's profile Send private message
Danilo
l33t
l33t


Joined: 05 Feb 2004
Posts: 747
Location: Italy

PostPosted: Wed Jul 07, 2004 9:35 pm    Post subject: Reply with quote

fedeliallalinea wrote:
cromabianca wrote:
E ogni volta che premi "invio" esce tutta quella roba? :roll:

Si

Io ho sempre la fisima che il buffer del terminale e' troppo breve per riempirlo con altre info.

Anche sulle macchine unix preferisco lasciare sempre
<user>@<hostname><$>
al limite sostituisco <$> con la directory corrente


Comunque un giorno o l'altro provero' i settaggi di Fedeliallalinea , non si sa mai che cambi abitudini ;-)
Back to top
View user's profile Send private message
koma
Advocate
Advocate


Joined: 06 Jun 2003
Posts: 2702
Location: Italy

PostPosted: Wed Jul 07, 2004 10:00 pm    Post subject: Reply with quote

kaosone wrote:
Code:
export PS1="\[\033[0;31m\]..::\[\033[1;31m\][\[\033[1;33m\]\u\[\033[0;31m\]@
\[\033[1;33m\]\h\[\033[1;31m\]][\[\033[1;33m\]\d\[\033[1;31m\]][\[\033
[1;33m\]\t\[\033[1;31m\]][\[\033[1;33m\]\w\[\033[1;31m\]]\[\033[0;31m\]
::..\n\[\033[1;31m\]$\[\033[0;0m\] "
 
:D
tutto su una riga ..
è opensource? perchè l'ho adattato al mio o meglio ci ho aggiunto un pezzetto e me lo sono spudoratamente copiato :mrgreen:
il risultato ve lo posto tra un attimo assieme a un mio vecchio tip che potrebbe interessare questo topic :)
_________________
http://www.youtube.com/watch?v=_yoJI-Tl94g GLORY GLORY HYPNOTOAD
Back to top
View user's profile Send private message
koma
Advocate
Advocate


Joined: 06 Jun 2003
Posts: 2702
Location: Italy

PostPosted: Wed Jul 07, 2004 10:07 pm    Post subject: Reply with quote

Qui il "mio" bash http://www.khb.altervista.org/bash.jpg .
é il risultato della 'volontaria' donazione di kaosone e dello scriptino che avevo fatto un po' di tempo fa su questo topic: https://forums.gentoo.org/viewtopic.php?t=178349
_________________
http://www.youtube.com/watch?v=_yoJI-Tl94g GLORY GLORY HYPNOTOAD
Back to top
View user's profile Send private message
federico
Advocate
Advocate


Joined: 18 Feb 2003
Posts: 3272
Location: Italy, Milano

PostPosted: Wed Jul 07, 2004 10:11 pm    Post subject: Reply with quote

Secondo me ci vuole qualcosa di compresso ma figo :)
Ovvero qualcosa che occupi poco spazio ma che metta dentro le informazioni + utili... Sto provando i vostri :)

Io ho mantenuto il PS1 di default di gentoo e ho messo un colore differente per ogni macchina sulla quale lavoro, in questo modo so sempre dove mi trovo...

Fede
_________________
Sideralis www.sideralis.org
Pic http://blackman.amicofigo.com/gallery
Arduino http://www.arduino.cc
Chi aveva potuto aveva spaccato
2000 pezzi buttati là
Molti saluti,qualche domanda
Semplice come musica punk
Back to top
View user's profile Send private message
kaosone
Guru
Guru


Joined: 01 Feb 2004
Posts: 446

PostPosted: Wed Jul 07, 2004 10:14 pm    Post subject: Reply with quote

koma wrote:
Qui il "mio" bash http://www.khb.altervista.org/bash.jpg .
é il risultato della 'volontaria' donazione di kaosone e dello scriptino che avevo fatto un po' di tempo fa su questo topic: https://forums.gentoo.org/viewtopic.php?t=178349

e' venuto un giallo un po' fiacco forse e' il jpg :?:
cmq anche io avevo pensato di mettere dentro il check delle email ma poi diventa un po troppo lungo e rischia di andare su tre righe :evil:
http://fedekaos.interfree.it/bash.png
Back to top
View user's profile Send private message
koma
Advocate
Advocate


Joined: 06 Jun 2003
Posts: 2702
Location: Italy

PostPosted: Wed Jul 07, 2004 10:19 pm    Post subject: Reply with quote

notare che il mio è in italiano ;)
http://khb.altervista.org/bash.png
l'ho fatto in png ora si dorvebbe leggere mejo :)
_________________
http://www.youtube.com/watch?v=_yoJI-Tl94g GLORY GLORY HYPNOTOAD
Back to top
View user's profile Send private message
federico
Advocate
Advocate


Joined: 18 Feb 2003
Posts: 3272
Location: Italy, Milano

PostPosted: Wed Jul 07, 2004 10:21 pm    Post subject: Reply with quote

Koma io non raggiungo il tuo link...
_________________
Sideralis www.sideralis.org
Pic http://blackman.amicofigo.com/gallery
Arduino http://www.arduino.cc
Chi aveva potuto aveva spaccato
2000 pezzi buttati là
Molti saluti,qualche domanda
Semplice come musica punk
Back to top
View user's profile Send private message
kaosone
Guru
Guru


Joined: 01 Feb 2004
Posts: 446

PostPosted: Wed Jul 07, 2004 10:25 pm    Post subject: Reply with quote

copiaincollalo in una nuova finestra :)
si cmq cosi' si vede decisamente meglio :wink:
meglio in inglese :D
Back to top
View user's profile Send private message
bld
l33t
l33t


Joined: 26 Mar 2003
Posts: 759
Location: Outter Space

PostPosted: Wed Jul 07, 2004 11:34 pm    Post subject: hmmm Reply with quote

Mi complimento per ancora una volta con uno dei grandi protagonisti di questo forum! (NO KOMA NON SEI TU!) hahaha

L'amico CCCP e' un grandissimo! Mi e' piaciuto TANTISSIMO questo prompt! Devo fare qualche tunning per perfezionarlo un attimino:

il prompt ora come ora e' cosi
Quote:

l-(bld
2.6.7-rc3-love2)-(08 July 2004 - 01:33)-(pts/21)
mq-(~)->


Io lo vorrei cosi:
Quote:

l-(bld )
|-(2.6.7-rc3-love2)-(08 July 2004 - 01:33)-(pts/21)
mq-(~)->


Se per fedeli e' facile .. io d'altra parte sto facendo solo danni! :P
per la bash sono proprio negato eheh
_________________
A happy GNU/Linux user!!
Back to top
View user's profile Send private message
Samos87
n00b
n00b


Joined: 15 Jul 2003
Posts: 73
Location: Rimini

PostPosted: Thu Jul 08, 2004 12:18 am    Post subject: Reply with quote

{andrea@Pbook} [andrea] *02:14:02* $

8)
Code:


   export PS1='\[\033[01;32m\]{\u@\h} \[\033[01;31m\][\W]\[\033[01;01;34m\] *\t*\[\033[0;31m\] \$ \[\033[00m\]'



:D
_________________
"Carpe Diem"
Back to top
View user's profile Send private message
bld
l33t
l33t


Joined: 26 Mar 2003
Posts: 759
Location: Outter Space

PostPosted: Thu Jul 08, 2004 12:27 am    Post subject: Reply with quote

ops okay fatto
avevo pigiato ... un "enter" di troppo :oops:

e' quello di fedeli senza la battery.. spacca!!!
_________________
A happy GNU/Linux user!!
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 31641
Location: here

PostPosted: Thu Jul 08, 2004 7:03 am    Post subject: Reply with quote

bld wrote:
ops okay fatto

Hai ancora bisogno?
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian) Forum di discussione italiano All times are GMT
Goto page 1, 2, 3, 4, 5  Next
Page 1 of 5

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum