You are not logged in.
I don't like the list format of `pacman -Ss`. It's a pain to go through long search reslt lists because only every second line contains a package name and the package desctiption is on the next line. I'd prefer a format with one line per package, i.e. the name on the left and the description on the same line, not on the next line. That would make scanning through long lists much easier.
Is there a way to configure pacman like this?
Last edited by cryptkeeper (2012-02-19 13:50:56)
Offline
I'm not sure how to change pacman's behavior, but you can make a script or bash function to do this
pacman -Ss "$@" | while read line; do echo -n "$line"; read line; echo -e "\t$line"; doneI just made this up, so I'm sure it could be tweaked to look better, but this is the meat of it to do what you want.
Edit: better and easier to tweak:
pacman -Ss "$@" | while read package; do read description; echo -e "$package\t$description"; doneLast edited by Trilby (2012-02-19 13:09:59)
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Thanks for your fast answer, the command does just what I want. I already considered writing a short script for the task, but though I first ask if the output format could simply be changed in a config file. As this doesn't seem to be the case, I'll write a script based on your command refining the output a bit.
Edit: I made a short script. Basically it's just you're command, but I added the feature that lines that are too long to be displayed in the terminal window are cut off.
#!/bin/bash
#
# paclist - `pacman -Ss` wrapper
#
pacman -Ss "$@" | while read package
do
read description
line="$package - $description"
columns=`tput cols`
if [[ ${#line} -gt $((columns-3)) ]]
then
line="${line:0:$columns-3}..."
fi
echo -e "$line"
doneLast edited by cryptkeeper (2012-02-19 13:49:27)
Offline
Thanks for the tip, I'll keep expac in mind. For now though, I just stick to the script as a quick-and-dirty solution.
Offline