You are not logged in.

#51 2006-04-05 21:48:56

codemac
Member
From: Cliche Tech Place
Registered: 2005-05-13
Posts: 794
Website

Re: pacman with colored -Ss

Your example isn't very solid.  We have -Ss search names and descriptions so you get more results that could possibly be what you are looking for.  You have to grep for "/" so you get all package names, and no descriptions.  If you really want, you could do

pacman -Sl | grep "something"

if you want less grepping.

Offline

#52 2006-04-06 00:27:28

sud_crow
Member
From: Argentina
Registered: 2003-06-30
Posts: 546
Website

Re: pacman with colored -Ss

Sorry Codemac, i just used that as an example, because it was in a previous post on the first page, I forgot to name that part of the discussion.


Leonardo Andrés Gallego
www.archlinux-es.org || Comunidad Hispana de Arch Linux

Offline

#53 2006-04-06 02:36:35

codemac
Member
From: Cliche Tech Place
Registered: 2005-05-13
Posts: 794
Website

Re: pacman with colored -Ss

Oh, and for your comments about the ordering of the output, pacman shows the order that the packages will be installed.  They are installed in a particular order so that dependencies are kept in check.  After that, it's the order of mirrors in your pacman.conf.  It's quite sensible.

Though the output when updating many packegs could be presented in a more readable fashion, not the thick block of text that's difficult to read.  I like to scan through my updates to see if I'm doing anything that I might want to wait on doing, but the big block is annoying.  Space saving, yes.  Readable, no.

Offline

#54 2006-04-12 08:59:04

n0gabor
Member
From: Hungary / Budapest
Registered: 2006-02-10
Posts: 95

Re: pacman with colored -Ss

i think its a great idea to have a colorizet output OPTION for pacman. i wanted to post this idea on the forums, but i found this topic.

when pacman -Ss ends in a long list, it coult ease the readablity of the output. (if the repo name would be light gray, and the others stay dark gray, that would fine for me (if someone dont like the colors))

so please implement this fearure if its not a big work

(srry for my english)

Offline

#55 2006-11-07 14:54:43

vredfreak
Member
Registered: 2004-11-20
Posts: 66

Re: pacman with colored -Ss

citral wrote:

The scripts posted above are nice, but they don't color repos that you don't predefine. This fixes that FWIW.

In my .bashrc I have:

alias pacs="pacsearch"
pacsearch () {
         echo -e "$(pacman -Ss $@ | sed 
        -e 's#current/.*#\033[0;31m&\033[0;37m#g' 
        -e 's#extra/.*#\033[0;32m&\033[0;37m#g' 
        -e 's#community/.*#\033[0;35m&\033[0;37m#g' 
        -e 's#^.*/.* .*#\033[0;36m&\033[0;37m#g' )"
}

I realize this is an old thread, but I just wanted to point out a small bug in this particular script since it's listed in the Wiki.  If you're using a terminal that you have set the foreground color to a specific color, this script will override that color even after the search is done.  For instance, in my mrxvtrc I have the foreground set to "blue", but after running "pacs whatever", my foreground is now a light grey.  The script by raskolnikov fixes this, maybe it should be the one in the Wiki.

Daniel


Hi.  I'm a sig.  What are you?

Offline

#56 2006-11-07 17:56:11

sebcactus
Member
From: Germany
Registered: 2005-01-27
Posts: 277

Re: pacman with colored -Ss

vredfreak wrote:

I realize this is an old thread, but I just wanted to point out a small bug in this particular script since it's listed in the Wiki.  If you're using a terminal that you have set the foreground color to a specific color, this script will override that color even after the search is done.  For instance, in my mrxvtrc I have the foreground set to "blue", but after running "pacs whatever", my foreground is now a light grey.  The script by raskolnikov fixes this, maybe it should be the one in the Wiki.

Daniel

You know you can edit the Wiki, because it's a wiki wink

Offline

#57 2006-11-07 18:09:26

vredfreak
Member
Registered: 2004-11-20
Posts: 66

Re: pacman with colored -Ss

You know you can edit the Wiki, because it's a wiki

Granted, but for all I know there's a very good reason why one is there and the other isn't.  Plus, if there's someone currently maintaining that particular section, it's best to let them handle it.

Besides, it's not like it's a life or death problem here, just pointing it out.  smile


Hi.  I'm a sig.  What are you?

Offline

#58 2006-11-07 21:27:41

F
Member
Registered: 2006-10-09
Posts: 322

Re: pacman with colored -Ss

After installing the new PKGBUILD I still don't get any colored output, what gives?

Installation went smoothly. I had to makepkg PKGBUILD, and then pacman -U pacman-blah.pkg.tar.gz.

Offline

#59 2006-11-14 14:22:09

citral
Member
Registered: 2005-05-07
Posts: 87

Re: pacman with colored -Ss

vredfreak wrote:
citral wrote:

The scripts posted above are nice, but they don't color repos that you don't predefine. This fixes that FWIW.

In my .bashrc I have:

alias pacs="pacsearch"
pacsearch () {
         echo -e "$(pacman -Ss $@ | sed 
        -e 's#current/.*#\033[0;31m&\033[0;37m#g' 
        -e 's#extra/.*#\033[0;32m&\033[0;37m#g' 
        -e 's#community/.*#\033[0;35m&\033[0;37m#g' 
        -e 's#^.*/.* .*#\033[0;36m&\033[0;37m#g' )"
}

I realize this is an old thread, but I just wanted to point out a small bug in this particular script since it's listed in the Wiki.  If you're using a terminal that you have set the foreground color to a specific color, this script will override that color even after the search is done.  For instance, in my mrxvtrc I have the foreground set to "blue", but after running "pacs whatever", my foreground is now a light grey.  The script by raskolnikov fixes this, maybe it should be the one in the Wiki.

Daniel

Hmm, then it seems that your terminal doesn't handle the bash color codes properly. You could add a blue color as the last code in the script, or simply use what works for you.

There are several options for colored pacman output, and the one you quoted is the most elegant one, because it only requires a bash alias. (Imo)


One of the main causes of the fall of the Roman Empire was that, lacking zero,
they had no way to indicate successful termination of their C programs.

Offline

#60 2006-11-14 16:32:06

vredfreak
Member
Registered: 2004-11-20
Posts: 66

Re: pacman with colored -Ss

Hmm, then it seems that your terminal doesn't handle the bash color codes properly. You could add a blue color as the last code in the script, or simply use what works for you.

There are several options for colored pacman output, and the one you quoted is the most elegant one, because it only requires a bash alias. (Imo)

Understood.  I just thought I'd point it out.  The only real difference between your script and the one by raskolnikov is that your lines end in "0;37m#g" where his is "0;0m,g".


Hi.  I'm a sig.  What are you?

Offline

#61 2006-11-14 17:04:09

SiD
Member
From: Germany
Registered: 2006-09-21
Posts: 729

Re: pacman with colored -Ss

I think a colored output is not neccessary, but an empty line bitween the packages would make it more comfortable to read the output...

$ pacman -Ss pacman
current/pacman 2.9.8-1
    A .tar.gz based package manager with dependency support

extra/namcap 1.5.4-1
    A Pacman package analyzer

extra/srcpac 0.4.1-1
    The pacman from-source wrapper

community/jacman 0.3.1-2
    Java-based GUI front-end for pacman

Offline

#62 2006-11-14 19:27:57

citral
Member
Registered: 2005-05-07
Posts: 87

Re: pacman with colored -Ss

vredfreak wrote:

Hmm, then it seems that your terminal doesn't handle the bash color codes properly. You could add a blue color as the last code in the script, or simply use what works for you.

There are several options for colored pacman output, and the one you quoted is the most elegant one, because it only requires a bash alias. (Imo)

Understood.  I just thought I'd point it out.  The only real difference between your script and the one by raskolnikov is that your lines end in "0;37m#g" where his is "0;0m,g".

Sorry my bad, I should've checked raskolnikov's script first. I think the 0;37 in my script should be 0;39, but I'm not near a terminal to check it.


One of the main causes of the fall of the Roman Empire was that, lacking zero,
they had no way to indicate successful termination of their C programs.

Offline

#63 2006-11-14 21:50:23

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: pacman with colored -Ss

SiD wrote:

I think a colored output is not neccessary, but an empty line bitween the packages would make it more comfortable to read the output...

very good point

Offline

#64 2006-11-14 22:08:35

Chman
Member
Registered: 2006-01-31
Posts: 169
Website

Re: pacman with colored -Ss

SiD wrote:

I think a colored output is not neccessary, but an empty line bitween the packages would make it more comfortable to read the output...

Hmmm... Nice idea, but that would make the result output longer for big searches. Maybe an empty line between repos ? Something like that :

$ pacman -Ss pacman
current/pacman 2.9.8-1
    A .tar.gz based package manager with dependency support

extra/namcap 1.5.4-1
    A Pacman package analyzer
extra/srcpac 0.4.1-1
    The pacman from-source wrapper

community/jacman 0.3.1-2
    Java-based GUI front-end for pacman

Add colors and it would be perfect (for me, at least) wink

edit: or maybe there should be a way to apply "themes" to pacman ? But I think that would make it more complicated and would not respect the KISS philosophy ?

Offline

#65 2006-11-14 23:11:35

lemon
Member
From: Norway
Registered: 2006-11-11
Posts: 50

Re: pacman with colored -Ss

Will pacman 3 have colored output?

Offline

#66 2006-11-17 20:23:48

noriko
Member
From: In My Mind
Registered: 2006-06-09
Posts: 535
Website

Re: pacman with colored -Ss

hmm.. i think what is needed is, some coloured output, with spaces / n, and to prevent long search going offscreen, etc.. tail the output...


The.Revolution.Is.Coming - - To fight, To hunger, To Resist!

Offline

#67 2006-11-18 11:27:03

Romashka
Forum Fellow
Registered: 2005-12-07
Posts: 1,054

Re: pacman with colored -Ss

lemon wrote:

Will pacman 3 have colored output?

IIRC no.


to live is to die

Offline

#68 2006-11-18 20:34:50

F
Member
Registered: 2006-10-09
Posts: 322

Re: pacman with colored -Ss

I run Z-Shell (zsh), also, I run xterm with -bg black -fg white.

the following:

alias pacs="pacsearch" 
pacsearch () { 
         echo -e "$(pacman -Ss $@ | sed  
        -e 's#current/.*#\033[0;31m&\033[0;37m#g'  
        -e 's#extra/.*#\033[0;32m&\033[0;37m#g'  
        -e 's#community/.*#\033[0;35m&\033[0;37m#g'  
        -e 's#^.*/.* .*#\033[0;36m&\033[0;37m#g' )" 
}

put in my .bashrc, and running bash and typing 'pacsearch opera' does not return colored output.

Putting the same code in my .zshrc, while using zsh, still won't give me colored output.

Has anyone gotten this to work?

edit: 
echo $TERM
xterm

I heard I need xterm-color; how can I get it?

Offline

#69 2006-11-18 20:38:24

vredfreak
Member
Registered: 2004-11-20
Posts: 66

Re: pacman with colored -Ss

EDIT: nevermind.  I missread the post.  sorry.


Hi.  I'm a sig.  What are you?

Offline

#70 2010-08-05 05:54:22

trusktr
Banned
From: .earth
Registered: 2010-02-18
Posts: 907
Website

Re: pacman with colored -Ss

Hey, can you post a screen shot? big_smile


joe@trusktr.io - joe at true skater dot io.

Offline

#71 2010-08-05 05:57:34

sand_man
Member
From: Australia
Registered: 2008-06-10
Posts: 2,164

Re: pacman with colored -Ss

trusktr wrote:

Hey, can you post a screen shot? big_smile

You are talking to someone 4 years into the past.


neutral

Offline

#72 2010-08-05 06:09:18

cesura
Package Maintainer (PM)
From: Tallinn, Estonia
Registered: 2010-01-23
Posts: 1,867

Re: pacman with colored -Ss

trusktr wrote:

Hey, can you post a screen shot? big_smile

I'm guessing you made a mistake, but nonetheless:
http://wiki.archlinux.org/index.php/For … Bumping.27

Offline

#73 2010-08-05 07:22:38

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: pacman with colored -Ss

trusktr - not the first time you've done this. PLEASE read the guidelines linked above, and check the date of the last entry in a thread before posting.

Closed.

Offline

Board footer

Powered by FluxBB