[arch-general] script to reformat 'pacman -Ss' output into 2 readable columns (prevents blindness)
Guys, I developed a script to help me read the output of pacman -Ss in 2 nicely formatted columns. The output of 'pacman -Ss srchterm' drives me nuts trying to read down the package names and descriptions with all the tab indented and wrapped text -- so I fixed it. Download the script here: http://www.3111skyline.com/dl/Archlinux/scripts/srch2list.sh The script takes this: extra/ttf-khmer 5.0-2 TTFont collection for Khmer (Cambodia) extra/ttf-linux-libertine 4.4.1-3 Serif (Libertine) and Sans Serif (Biolinum) OpenType fonts with large Unicode coverage extra/ttf-mph-2b-damase 001.000.4.dfsg.2-2 Super-Unicode TTFont covering full Plane 1, and the following scripts: Armenian, Buginese, Cherokee, Cypriot Syllabary, Cyrillic, Deseret, Georgian, Asomtavruli, Nuskhuri but no Mkhedruli, Glagolitic, Gothic, Greek, Hanunoo, Hebrew, Latin, Limbu, Linear B, Old Italic, Old Persian cuneiform, Osmanya, Shavian, Syloti Nagri, Tai Le, Thaana, Tifinagh, Ugaritic, Vietnamese extra/ttf-ms-fonts 2.0-3 Core TTF Fonts from Microsoft and turn it into this: ttf-khmer TTFont collection for Khmer (Cambodia) ttf-linux-libertine Serif (Libertine) and Sans Serif (Biolinum) OpenType fonts with large Unicode coverage ttf-mph-2b-damase Super-Unicode TTFont covering full Plane 1, and the following scripts: Armenian, Buginese, Cherokee, Cypriot Syllabary, Cyrillic, Deseret, Georgian, Asomtavruli, Nuskhuri but no Mkhedruli, Glagolitic, Gothic, Greek, Hanunoo, Hebrew, Latin, Limbu, Linear B, Old Italic, Old Persian cuneiform, Osmanya, Shavian, Syloti Nagri, Tai Le, Thaana, Tifinagh, Ugaritic, Vietnamese ttf-ms-fonts Core TTF Fonts from Microsoft or with the '-d' option for semi-doublespace: ttf-khmer TTFont collection for Khmer (Cambodia) ttf-linux-libertine Serif (Libertine) and Sans Serif (Biolinum) OpenType fonts with large Unicode coverage ttf-mph-2b-damase Super-Unicode TTFont covering full Plane 1, and the following scripts: Armenian, Buginese, Cherokee, Cypriot Syllabary, Cyrillic, Deseret, Georgian, Asomtavruli, Nuskhuri but no Mkhedruli, Glagolitic, Gothic, Greek, Hanunoo, Hebrew, Latin, Limbu, Linear B, Old Italic, Old Persian cuneiform, Osmanya, Shavian, Syloti Nagri, Tai Le, Thaana, Tifinagh, Ugaritic, Vietnamese ttf-ms-fonts Core TTF Fonts from Microsoft The script needs 1 input. That is a filename 'srchfile' that contains the output from 'pacman -Ss srchterm > srchfile' There are 2 options, '-h or --help' gives a brief description and '-d' which causes the output to be essentially double-spaced. (each package description remains single spaced if it requires multiple lines, but a blank line is included between package descriptions) On the todo list is having the script take the input from stdin and eliminate the srchfile. NOTE: the '-d' option goes AFTER the filename. (I'll make the cli input position independent in the next version) The script does some pretty cool stuff and has some of my favorite funtions for the bash addicts out there. It reads 'srchfile' and formats the output in two columns 'pkgname' and 'description'. The pkgname column width is adjusted to the longest filename and the description column (in multiple lines, if necessary) spans the remainder of the xterm width leaving a one-char margin on the right. To make reading easier the description is parsed before being output so that descriptions that span multiple lines only break on spaces and not words while staying withing the column width. The column widths are dynamic based on the terminal window size. (via obtaining the terminal width and height from stty output). (for some reason, $COLUMNS and $LINES are not available in my scripts?? environment? exports?) The script was fun to write as it incorporated a good many of the finer points of bash. It is also well commented so if you are learning bash, or want to learn, this script can be a useful tool for some of the cooler things that can be done with arrays and strings using index manipulation and substring parsing/parameter substitution. The ultimate goal was to make the pacman search output readable, and I think this makes reading the search results *much* easier, at least for me. I guess what I should do for the next version is just incorporate the pacman -Ss call into the script itself and simply read the output of the search directly into the input array instead of reading the input file into an array. Simple enough, but I'll have to put that out as the next revision. Give this a whirl and see what you think. Let me know what works and what doesn't and also how I do things better/cleaner than I have currently done them. Who knows, maybe we will look at 'zenity --list' and provide a gui output next time :p Enjoy. -- David C. Rankin, J.D.,P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com
On Thu 05 Aug 2010 22:51 -0500, David C. Rankin wrote:
Guys,
You got a script for the gals too? :D
I developed a script to help me read the output of pacman -Ss in 2 nicely formatted columns. The output of 'pacman -Ss srchterm' drives me nuts trying to read down the package names and descriptions with all the tab indented and wrapped text -- so I fixed it. Download the script here:
http://www.3111skyline.com/dl/Archlinux/scripts/srch2list.sh
or with the '-d' option for semi-doublespace:
This should definitely be the default. Otherwise I may go walleyed.
The script needs 1 input. That is a filename 'srchfile' that contains the output from 'pacman -Ss srchterm > srchfile' There are 2 options, '-h or --help' gives a brief description and '-d' which causes the output to be essentially double-spaced. (each package description remains single spaced if it requires multiple lines, but a blank line is included between package descriptions) On the todo list is having the script take the input from stdin and eliminate the srchfile.
Cheers.
On 08/05/2010 11:19 PM, Loui Chang wrote:
or with the '-d' option for semi-doublespace: This should definitely be the default. Otherwise I may go walleyed.
You are correct sir! I guess the only reason it wasn't the default is that I did the script on my laptop so vertical space was at a premium :p I have to rework the options anyway to add an option to disable the zenity list so I'll redo the line spacing default as well. Right now I have the script testing for zenity with which and then displaying the zenity --list by default if zenity is installed. What's your vote? Should zenity be off by default and then enabled with an option?. It is light enough to work well even over ssh connections, so my thought was to just leave it enabled by default and add a flag to disable it if it wasn't wanted...... -- David C. Rankin, J.D.,P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com
Sweet script, it always bothered me the way pacman -Ss formatted its output. The check you do for zenity has a minor problem, though. Instead of "if which zenity > /dev/null..." it needs to be "if which zenity &> /dev/null...", the former doesn't redirect error output. Anyway, very well done, thanks for the script! Jason On Fri, Aug 6, 2010 at 12:48 AM, David C. Rankin < drankinatty@suddenlinkmail.com> wrote:
On 08/05/2010 11:19 PM, Loui Chang wrote:
or with the '-d' option for semi-doublespace:
This should definitely be the default. Otherwise I may go walleyed.
You are correct sir! I guess the only reason it wasn't the default is that I did the script on my laptop so vertical space was at a premium :p
I have to rework the options anyway to add an option to disable the zenity list so I'll redo the line spacing default as well.
Right now I have the script testing for zenity with which and then displaying the zenity --list by default if zenity is installed. What's your vote? Should zenity be off by default and then enabled with an option?. It is light enough to work well even over ssh connections, so my thought was to just leave it enabled by default and add a flag to disable it if it wasn't wanted......
-- David C. Rankin, J.D.,P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com
On 08/06/2010 12:09 AM, Jason Reardon wrote:
"if which zenity&> /dev/null...", the former doesn't redirect error output.
Thanks -> updated. -- David C. Rankin, J.D.,P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com
On 08/05/2010 10:51 PM, David C. Rankin wrote: <snip>
Give this a whirl and see what you think. Let me know what works and what doesn't and also how I do things better/cleaner than I have currently done them. Who knows, maybe we will look at 'zenity --list' and provide a gui output next time :p
OK, The zenity output was simpler than I thought. If you got the script before I added the zenity --list output, then download it again. The script is here: http://www.3111skyline.com/dl/Archlinux/scripts/srch2list.sh The zenity --list output looks like this: (82k) http://www.3111skyline.com/dl/Archlinux/scripts/srch2list-zenity.jpg Now I can read it :p -- David C. Rankin, J.D.,P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com
On Thu, Aug 05, 2010 at 10:51:45PM -0500, David C. Rankin wrote:
Guys,
I developed a script...
Hi. Let's see what we can do about cutting back a little on the verbosity, and upping the utility... ------------------------- #!/bin/bash pkg=() desc=() count=-1 WIDTH=${WIDTH:-50} while read line; do if [[ $line =~ ^(testing|core|extra|community|community-testing)/* ]]; then (( count++ )) pkg[count]="$line" continue fi desc[count]+="$line" done i=0 while (( i <= count )); do IFS=$'\n' read -r -d'\0' -a blockdesc < <(fmt -w$WIDTH <<< "${desc[i]}") paste -d' ' <(printf "%-49s" "${pkg[i]}") <(echo "${blockdesc[0]}") for line in "${blockdesc[@]:1}"; do printf "%-50s%s\n" "" "$line" done (( ++i )) [[ $1 == -d ]] && echo done ------------------------- It takes STDIN, and accepts a -d option to add a space after each package. Descriptions have a default width of 50 characters (meaning a total width of 100 characters). You can alter this by specifying WIDTH as an environment var, e.g. $ pacman -Ss | WIDTH=30 ./foofilter -d Personally I think pacman-color is a better solution that mangling the output like this, but to each their own. d
On 06/08/10 06:33, Dave Reisner wrote:
Hi.
Let's see what we can do about cutting back a little on the verbosity, and upping the utility...
-------------------------
#!/bin/bash
pkg=() desc=() count=-1 WIDTH=${WIDTH:-50}
while read line; do if [[ $line =~ ^(testing|core|extra|community|community-testing)/* ]]; then (( count++ )) pkg[count]="$line" continue fi
desc[count]+="$line" done
i=0 while (( i<= count )); do IFS=$'\n' read -r -d'\0' -a blockdesc< <(fmt -w$WIDTH<<< "${desc[i]}")
paste -d' '<(printf "%-49s" "${pkg[i]}")<(echo "${blockdesc[0]}")
for line in "${blockdesc[@]:1}"; do printf "%-50s%s\n" "" "$line" done
(( ++i )) [[ $1 == -d ]]&& echo done
-------------------------
It takes STDIN, and accepts a -d option to add a space after each package. Descriptions have a default width of 50 characters (meaning a total width of 100 characters). You can alter this by specifying WIDTH as an environment var, e.g.
$ pacman -Ss | WIDTH=30 ./foofilter -d
Personally I think pacman-color is a better solution that mangling the output like this, but to each their own.
d
--- Thanks for this one, I've messed around with it a little and it's a handy little function for searching.
On 06/08/10 19:40, Simon Stoakley wrote:
On 06/08/10 06:33, Dave Reisner wrote:
Hi.
Let's see what we can do about cutting back a little on the verbosity, and upping the utility...
-------------------------
#!/bin/bash
pkg=() desc=() count=-1
Snip.... ---- Been messing around with this a little, added pacman -Qs option, single space option (-d default) and some colours. Wrapped it in a function so can call it pacside [-qs] schstring. Thought I'd put it back up in case anyone's interested. pacside() { sidesch() { bldblu='\e[1;34m' # Blue bldwht='\e[1;37m' # White txtrst='\e[0m' # Text Reset pkg=() desc=() count=-1 WIDTH=${WIDTH:-70} while read line; do if [[ $line =~ ^(testing|core|extra|community|community-testing|local)/* ]]; then (( count++ )) line="$(echo $line | echo $line |cut -d "[" -f1 )" pkg[$count]="$line" continue fi desc[$count]+="$line" done i=0 while (( i <= $count )); do IFS=$'\n' read -r -d'\0' -a blockdesc < <(fmt -w$WIDTH <<< "${desc[i]}") paste -d' ' <(printf "${bldblu}\t%-60s" "${pkg[i]}") <(echo -e "${bldwht}${blockdesc[0]}${txtrst}") for line in "${blockdesc[@]:1}"; do printf "${bldwht}\t%-61s%s\n" "" "$line" done (( ++i )) [[ $1 != -s ]] && echo done } [[ -z $2 ]] && pacman -Ss $1 | sidesch [[ $1 == -s ]] && pacman -Ss $2 | sidesch -s [[ $1 == -q ]] && pacman -Qs $2 | sidesch [[ $1 == -sq ]] || [[ $1 == -qs ]] && pacman -Qs $2 | sidesch -s } --
On 08/07/2010 03:52 AM, Simon Stoakley wrote:
Been messing around with this a little, added pacman -Qs option, single space option (-d default) and some colours. Wrapped it in a function so can call it pacside [-qs] schstring. Thought I'd put it back up in case anyone's interested.
srchfName.' If you provide both a srchTerm and srchfName, the search will be
Excellent, thanks. As discussed earlier, I have re-written the input routine and add a number of new capabilities to the original script I did. The biggest change is the script now simply accepts a searchTerm and calls pacman -Ss from within the script. You can still pass the script a saved search file and it will parse it as it did originally. What is really cool (I think), is that you can specify the command line parameters "In Any Order" and NO flags are necessary to tell the script whether to call pacman or read a file for results. If the file exists, the script reads it, if no file matching the command line parameter exists, then it calls pacman. The new version is here: http://www.3111skyline.com/dl/Archlinux/scripts/srch2list.sh Just run it without options or with -h | --help to get the full usage information: Usage: srch2list.sh srchTerm [srchfName] [-d|--double] [-h|--help] [-z|--zenity] [-w|--write filename] srch2list.sh provides formatted output for 'pacman -Ss srchTerm'. The output is provided in two columns (package name)(description). The columns are dynamically sized so the package name column is wide enough for the longest package name returned, and the description fills the remaining space provided by the terminal while leaving a one character margin at the right-hand side. You can now read the search results without going blind. The script will also parse a previous pacman search saved with 'pacman -Ss performed and the srchfName ignored. The remaining options are as follows: Options: NOTE: options can be given in any order, flags must be separate: '-d -z' NOT '-dz' -d | --double option controls single/double spaced output. -h | --help display this help message. -w | --write filename write search results to 'filename'. -z | --zenity provide graphical output using 'zenity --list' (requires zenity) Two additional testing options (no effect on script): -v | --verbose dump select variables to the screen. -a | --array dump the array contents to the screen (requires -v option) Enjoy. -- David C. Rankin, J.D.,P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com
On 08/06/2010 12:33 AM, Dave Reisner wrote:
Hi.
Let's see what we can do about cutting back a little on the verbosity, and upping the utility...
Dave, Thanks. It will take me a bit to decipher it, but I'm all for cutting down on typing and upping the benefit received :p I have a question. I was trying to figure the script out by passing in one of my pacman -Ss save files as follows, but I keep getting an error: 16:36 alchemy:~/scr/arch> cat dev/font.pms | sh srchreisner.sh srchreisner.sh: line 20: syntax error near unexpected token `<' srchreisner.sh: line 20: ` IFS=$'\n' read -r -d'\0' -a blockdesc < <(fmt -w$WIDTH <<< "${desc[i]}")' Where in the black-magic or in my operation of it lies the problem? -- David C. Rankin, J.D.,P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com
On 08/06/2010 04:40 PM, David C. Rankin wrote:
On 08/06/2010 12:33 AM, Dave Reisner wrote:
Hi.
Let's see what we can do about cutting back a little on the verbosity, and upping the utility...
Dave,
Thanks. It will take me a bit to decipher it, but I'm all for cutting down on typing and upping the benefit received :p
I have a question. I was trying to figure the script out by passing in one of my pacman -Ss save files as follows, but I keep getting an error:
16:36 alchemy:~/scr/arch> cat dev/font.pms | sh srchreisner.sh srchreisner.sh: line 20: syntax error near unexpected token `<' srchreisner.sh: line 20: ` IFS=$'\n' read -r -d'\0' -a blockdesc < <(fmt -w$WIDTH <<< "${desc[i]}")'
Where in the black-magic or in my operation of it lies the problem?
Never mind, calling the script with sh was the issue (duh...) -- David C. Rankin, J.D.,P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com
On Thu, Aug 05, 2010 at 10:51:45PM -0500, David C. Rankin wrote:
Guys,
I developed a script to help me read the output of pacman -Ss in 2 nicely formatted columns. The output of 'pacman -Ss srchterm' drives me nuts trying to read down the package names and descriptions with all the tab indented and wrapped text -- so I fixed it. Download the script here:
http://www.3111skyline.com/dl/Archlinux/scripts/srch2list.sh
Hi, I'm new to Arch and to the list but wanted to say thanks for posting this up. I've found pacman a great tool for getting what I need installed, but browsing and looking around it was tricky - this script is really useful for that. Thanks, Nigel
On Fri, Aug 06, 2010 at 05:11:27PM +0100, nigel@greenlemur.com wrote:
On Thu, Aug 05, 2010 at 10:51:45PM -0500, David C. Rankin wrote:
http://www.3111skyline.com/dl/Archlinux/scripts/srch2list.sh
I'm new to Arch and to the list but wanted to say thanks for posting this up. I've found pacman a great tool for getting what I need installed, but browsing and looking around it was tricky - this script is really useful for that.
Nice. But why not read from stdin if no file is given, e.g. pacman -Ss ttf | srch2list.sh -- FA There are three of them, and Alleline.
On 08/06/2010 03:34 PM, fons@kokkinizita.net wrote:
On Fri, Aug 06, 2010 at 05:11:27PM +0100, nigel@greenlemur.com wrote:
On Thu, Aug 05, 2010 at 10:51:45PM -0500, David C. Rankin wrote:
http://www.3111skyline.com/dl/Archlinux/scripts/srch2list.sh
I'm new to Arch and to the list but wanted to say thanks for posting this up. I've found pacman a great tool for getting what I need installed, but browsing and looking around it was tricky - this script is really useful for that.
Nice. But why not read from stdin if no file is given, e.g.
pacman -Ss ttf | srch2list.sh
Actually I'm working on just passing the script the search term and calling pacman from within the script. The problem with piping the output into the script is it messed up my terminal size calcs (stty doesn't like the script taking input from stdin) and one of the primary goals I had for the script was for it to dynamically size the output based on (1) the longest filename returned (to set column 1 width) and (2) to size the description column using the remainder of the terminal width leaving the 1 char margin. So keeping the ability to grab the terminal size from stty was key. I'm working to learn the "why's" of stty seeing things as a file and not a tty when piping input from stdin, but I'm not there yet. I'll update the input routine for the script so it will be flexible enough to take a search term, a saved search file and/or have it prompt for the search term or filename using zenity or stdin. That will get the script to where I want it to be. But knowing my schedule (and distractions from 3 kids) I thought I would go ahead and post the reformatting part so some use could be made of it until I have an hour or two to work out the final input. -- David C. Rankin, J.D.,P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com
On 08/05/2010 10:51 PM, David C. Rankin wrote:
Guys,
I developed a script to help me read the output of pacman -Ss in 2 nicely formatted columns. The output of 'pacman -Ss srchterm' drives me nuts trying to read down the package names and descriptions with all the tab indented and wrapped text -- so I fixed it. Download the script here:
http://www.3111skyline.com/dl/Archlinux/scripts/srch2list.sh
<snip>
Enjoy.
I have played with the script a bit more so it provides the option to only show installed or uninstalled packages to minimize the stuff to look through. The current options to the script are: Options: NOTE: options can be given in any order, flags must be separate: '-d -z' NOT '-dz' -c | --color disable the use of an accent color for pkgnames. -d | --double option controls single/double spaced output. -h | --help display this help message. -i | --installed show only installed packages. -u | --uninstalled show only uninstalled packages. -w | --write filename write search results to 'filename'. -z | --zenity provide graphical output using 'zenity --list' (requires zenity) Two additional testing options (no effect on script): -v | --verbose dump select variables to the screen. -a | --array dump the array contents to the screen (requires -v option) -- David C. Rankin, J.D.,P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com
On 08/10/2010 03:46 PM, David C. Rankin wrote:
On 08/05/2010 10:51 PM, David C. Rankin wrote:
Guys,
I developed a script to help me read the output of pacman -Ss in 2 nicely formatted columns. The output of 'pacman -Ss srchterm' drives me nuts trying to read down the package names and descriptions with all the tab indented and wrapped text -- so I fixed it. Download the script here:
http://www.3111skyline.com/dl/Archlinux/scripts/srch2list.sh
<snip>
Enjoy.
I have played with the script a bit more so it provides the option to only show installed or uninstalled packages to minimize the stuff to look through. The current options to the script are:
Options:
NOTE: options can be given in any order, flags must be separate: '-d -z' NOT '-dz'
-c | --color disable the use of an accent color for pkgnames. -d | --double option controls single/double spaced output. -h | --help display this help message. -i | --installed show only installed packages. -u | --uninstalled show only uninstalled packages. -w | --write filename write search results to 'filename'. -z | --zenity provide graphical output using 'zenity --list' (requires zenity)
Two additional testing options (no effect on script):
-v | --verbose dump select variables to the screen. -a | --array dump the array contents to the screen (requires -v option)
Version 0.0.4 Changelog: - No functional changes - code clean up moving output routine to a function for readability. Todo: - Capture zenity package selection so selected packages can be automatically installed. (basically provide: pacman -Sy 'selected packages') -- David C. Rankin, J.D.,P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com
On 08/10/2010 05:29 PM, David C. Rankin wrote:
On 08/10/2010 03:46 PM, David C. Rankin wrote:
On 08/05/2010 10:51 PM, David C. Rankin wrote:
Guys,
I developed a script to help me read the output of pacman -Ss in 2 nicely formatted columns. The output of 'pacman -Ss srchterm' drives me nuts trying to read down the package names and descriptions with all the tab indented and wrapped text -- so I fixed it. Download the script here:
http://www.3111skyline.com/dl/Archlinux/scripts/srch2list.sh
<snip>
Whew - I have finally worked out the zenity install routine and I like it. I have also added the -n | --notext option that suppresses output of the list of search packages to the console. It is primarily for use with the -z | --zenity switch to allow the program to be run as a graphical program. Try it: srch2list.sh srchterm (or saved filename) -z -n and this will provide a graphical list with a checkbox for each package. You can select any number of packages you would like to install. Clicking 'Cancel' exits. Clicking 'OK' will bring up a confirmation dialog with the selected packages so the user can confirm the install --or-- modify the selection. Clicking 'Cancel' will again exit. Clicking 'OK' here will call pacman -Sy <list of packages> or will try 'sudo pacman' if run by other than root. The new option list is: Options: NOTE: options can be given in any order, flags must be separate: '-d -z' NOT '-dz' -c | --color disable the use of an accent color for pkgnames. -d | --double option controls single/double spaced output. -h | --help display this help message. -i | --installed show only installed packages. -n | --notext don't output list to console (use with -z). -u | --uninstalled show only uninstalled packages. -w | --write filename write search results to 'filename'. -z | --zenity provide graphical output using 'zenity --list' (requires zenity) Two additional testing options (no effect on script): -v | --verbose dump select variables to the screen. -a | --array dump the array contents to the screen (requires -v option) CHANGELOG: version 0.0.5 - Added to -n | --notext switch to suppress output of the list to the console - Added the ability to (1) select packages in the zenity list for install - Added confirm install dialog that allows modification and confirmation of packages to install with pacman -Sy TODO: - Perhaps add an initial searchterm or filename zenity dialog so this script can simply be run from a launcher on your desktop. Let me know if this is something that should be added to AUR or somewhere for people to find long after this email thread has died. Enjoy :p -- David C. Rankin, J.D.,P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com
On 08/10/2010 09:31 PM, David C. Rankin wrote:
On 08/10/2010 05:29 PM, David C. Rankin wrote:
On 08/10/2010 03:46 PM, David C. Rankin wrote:
On 08/05/2010 10:51 PM, David C. Rankin wrote:
Guys,
I developed a script to help me read the output of pacman -Ss in 2 nicely formatted columns. The output of 'pacman -Ss srchterm' drives me nuts trying to read down the package names and descriptions with all the tab indented and wrapped text -- so I fixed it. Download the script here:
http://www.3111skyline.com/dl/Archlinux/scripts/srch2list.sh
<snip>
Version 0.0.6 - bugfix - added the command line select of only installed/uninstalled to zenity --list output :p -- David C. Rankin, J.D.,P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com
On Tue, Aug 10, 2010 at 11:17 PM, David C. Rankin <drankinatty@suddenlinkmail.com> wrote:
On 08/10/2010 09:31 PM, David C. Rankin wrote:
On 08/10/2010 05:29 PM, David C. Rankin wrote:
On 08/10/2010 03:46 PM, David C. Rankin wrote:
On 08/05/2010 10:51 PM, David C. Rankin wrote:
Guys,
I developed a script to help me read the output of pacman -Ss in 2 nicely formatted columns. The output of 'pacman -Ss srchterm' drives me nuts trying to read down the package names and descriptions with all the tab indented and wrapped text -- so I fixed it. Download the script here:
http://www.3111skyline.com/dl/Archlinux/scripts/srch2list.sh
<snip>
Version 0.0.6
- bugfix - added the command line select of only installed/uninstalled to zenity --list output :p
could we xport this discussion to forums? else more productive for mailing list would be a proposal for inclusion into pacman. C Anthony
On 08/11/2010 02:31 AM, C Anthony Risinger wrote:
could we xport this discussion to forums? else more productive for mailing list would be a proposal for inclusion into pacman.
C Anthony
Thank you C Anthony, good point: With version 0.0.7, it now has the capability to run completely graphically. It will prompt the user for a searchfilename or searchTerm via the console or zenity --entry if the name or term is omitted from the cli. So now all the user needs to do to run this as a pure gui-app is create a launcher on the desktop pointing to: srch2list -z -n and a text entry dialog appears prompting for the filename or term and the results are then returned in a graphical list with checkboxes that allow the user to select which packages they would like to install and it then installs the selected packages with pacman. I don't know if this is something that can be cannibalized to make pacman -SS more readable or whether you guys would want it as an AUR standalone. That's up to you now. I'm done with what I wanted to do with it -- and the little guy turned out quite handy. Let me know what, if anything, you want to see done with it and I'll do it. P.S. As for forums -- no thank you, that's all I need -- more web pages to visit where you have no assurance of finding what you need or of getting a competent response. In the past I've found forums to be not much more than the blind-leading-the-blind. I'm sure Arch's is one of the best, but I dislike forums. I'll do private email long before a forum. They have just never worked for me. -- David C. Rankin, J.D.,P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com
On Wed, Aug 11, 2010 at 4:16 AM, David C. Rankin <drankinatty@suddenlinkmail.com> wrote:
On 08/11/2010 02:31 AM, C Anthony Risinger wrote:
could we xport this discussion to forums? else more productive for mailing list would be a proposal for inclusion into pacman.
C Anthony
Thank you C Anthony, good point:
With version 0.0.7, it now has the capability to run completely graphically. It will prompt the user for a searchfilename or searchTerm via the console or zenity --entry if the name or term is omitted from the cli. So now all the user needs to do to run this as a pure gui-app is create a launcher on the desktop pointing to:
srch2list -z -n
and a text entry dialog appears prompting for the filename or term and the results are then returned in a graphical list with checkboxes that allow the user to select which packages they would like to install and it then installs the selected packages with pacman.
I don't know if this is something that can be cannibalized to make pacman -SS more readable or whether you guys would want it as an AUR standalone. That's up to you now. I'm done with what I wanted to do with it -- and the little guy turned out quite handy.
Let me know what, if anything, you want to see done with it and I'll do it.
P.S. As for forums -- no thank you, that's all I need -- more web pages to visit where you have no assurance of finding what you need or of getting a competent response. In the past I've found forums to be not much more than the blind-leading-the-blind. I'm sure Arch's is one of the best, but I dislike forums. I'll do private email long before a forum. They have just never worked for me.
well that might be a little too general; i read/reply to forums, and there are many quality solutions and contributors. let me rephrase: i think the idea is good, it's just that the thread is 20+ replies already. the mailing lists are better suited for arch (official/specific) help/requests/proposals... the forums (or another avenue, like an off-topic mailing list) is more suited to discussion of loosely-related scripts like this. no offense intended whatsoever (like i said i think the idea is sound), but basically, i don't want to hear about it, unless it's being requested for inclusion into pacman mainline ;-) just my 2c. C Anthony
participants (8)
-
C Anthony Risinger
-
Dave Reisner
-
David C. Rankin
-
fons@kokkinizita.net
-
Jason Reardon
-
Loui Chang
-
nigel@greenlemur.com
-
Simon Stoakley