You are not logged in.

#1 2011-07-18 09:10:18

schuay
Package Maintainer (PM)
From: Austria
Registered: 2008-08-19
Posts: 564

pcurses - a curses package management tool

pcurses features package browsing and management in a curses frontend written in C++

Features:

* regexp filtering and searching any package property
* customizable colorcoding
* customizable sorting
* external command execution with package list string replacements
* user defined macros and hotkeys

Package management is done through external command execution: for example, '!sudo pacman -S %p' will install all currently queued packages.
For more information, read the README file at github and take a look at some of the defined macros in /etc/pcurses.conf.

Default hotkey mappings:

1 - filter packages with updates available
2 - filter installed packages
5 - run pacman -Syu
6 - run pacman -S on the current contents of the queue
7 - run pacman -Rs on the current contents of the queue

These macros are entirely customizable and are defined in /etc/pcurses.conf.

The default view optimized for 80x24 terminals:
tOWl2dQ

And a 3 pane view for larger terminals:
tOWl2dw

Get it here: http://aur.archlinux.org/packages.php?ID=42685
Or, if you are using pacman-git: http://aur.archlinux.org/packages.php?ID=50804
Github: https://github.com/schuay/pcurses
Old thread from Nov 2010: https://bbs.archlinux.org/viewtopic.php?id=108585

For now, documentation is located mostly in the README file.
Keyboard commands are displayed by pressing the 'h' key in pcurses.

Last edited by schuay (2011-07-18 13:54:05)

Offline

#2 2011-07-18 09:11:11

schuay
Package Maintainer (PM)
From: Austria
Registered: 2008-08-19
Posts: 564

Re: pcurses - a curses package management tool

Reposting the full tutorial from the README file:

QUICK TUTORIAL
--------------

Navigation and queue management

The package list and queue can be navigated using the up/down arrows, page
up/down, and the home and end keys. The tab key switches focus between the
package and queue lists.

Adding packages to the queue is done by pressing the right arrow key while the
package list is focused. Left arrow removes the selected package from the
queue.

Filtering

Keybindings are displayed by pressing the 'h' (Help) key in pcurses.

Filtering takes the following syntax:

nd:game 1 23

1 is a list of field specifiers. These tell pcurses which fields to search.
Field specifiers are the highlighted characters in the field names in the info
pane.  In this example, this means that the Name and Description are searched
for the phrase 'game'.

2 the character ':' separates the field specifier list from the search phrase.
If this character is not present, the entire string is interpreted as the
search phrase.

3 is the actual search phrase. If it contains only alphanumeric characters, a
simple and quick string search is used. Otherwise, it is treated as a regular
expression (which is a bit slower). The search is case INSENSITIVE.

1 and 2 are OPTIONAL.

These searches can be chained. This means that a search for 'n:^a', followed by
'b:2010' will show all packages beginning with the letter 'a' and having a
build date in the year 2010.

Previous filters are cleared by pressing the 'c' key.

Pressing the up and down keys while in input mode will scroll through all
previous history.

Sorting and colorcoding

Colorcoding and sorting use the same syntax as filtering, but only accept a
single field specifier.

Command execution

Command execution can be entered by pressing the '!' key. The token '%p' will
be replaced by the current contents of the package queue. For example, with a
current package selection of pcurses and pacman,

!sudo pacman -S '%p'

will be expanded to

echo 'sudo pacman -S pcurses pacman'

A few useful commands could be

!pacman -Sy
!sudo pacman -S %p
!sudo pacman -Rs %p

Macros

Macros are defined in /etc/pcurses.conf using the syntax 'macroname=command'.
Macros can be chained by separating them with a comma. A few examples:

sortbyname=.n
colorbyrepo=;r
filterupdates=/d:update available

chainedmacro=@sortbyname,colorbyrepo,filterupdates

If defined, the macro named 'startup' will be executed on each application
start. Hotkeys can be defined by creating macros named '1', '2', [...], and are
triggered by pressing the corresponding key in pcurses.

All macros can be executed in pcurses by pressing the '@' key and entering the
macro name.

Last edited by schuay (2011-07-18 13:50:37)

Offline

#3 2011-07-19 14:05:57

linux-ka
Member
From: ADL
Registered: 2010-05-07
Posts: 232

Re: pcurses - a curses package management tool

looks great. I am writing a curses application in c++ too. maybe I can learn some tricks.

I was playe right now with it, but why does the color of those packages lsited on the left side change? Normally they are redish and blueish, but afeter trying '6' and aborting it the colros changed into greenish....that's normal?
anyway. Nice idea. I like every terminal application. avoiding GUIs makes the system more robust.

Offline

#4 2011-07-20 04:56:51

markbabc
Member
Registered: 2010-11-06
Posts: 157

Re: pcurses - a curses package management tool

do like! was thinking of making something like this in python but now this is here!

Offline

#5 2011-07-20 20:00:08

schuay
Package Maintainer (PM)
From: Austria
Registered: 2008-08-19
Posts: 564

Re: pcurses - a curses package management tool

@linux-ka: I fixed a couple of inconsistencies with colorcoding in https://github.com/schuay/pcurses/commi … fff65bd0b3, I believe I caught your case as well.

The next couple of commits change the way package loading is handled. It's now started manually instead of reloading the entire db after each external command execution. This gets rid of the hugely annoying wait times after running an external command, and allows us to preserve set filters, colorcodings, sort order and the package queue easily.

I'm currently hiking in Iceland, but I plan on pushing the next release by the end of July.

Offline

#6 2011-07-21 12:56:35

voidzero
Member
Registered: 2007-06-21
Posts: 109

Re: pcurses - a curses package management tool

Yes, I don't usually post "+1" on here, but this is a nice job, very well done! smile

Offline

#7 2011-07-27 15:24:02

schuay
Package Maintainer (PM)
From: Austria
Registered: 2008-08-19
Posts: 564

Re: pcurses - a curses package management tool

I just uploaded pcurses 1.1 containing the changes I mentioned in post #5:

* colorcoding consistency improvements
* after startup, the pacman db is only read on-demand by pressing 'r'

Let me know if you run into any issues. Enjoy! smile

Offline

#8 2011-08-04 08:07:06

schuay
Package Maintainer (PM)
From: Austria
Registered: 2008-08-19
Posts: 564

Re: pcurses - a curses package management tool

1.2 is out with two crash fixes:

* scrolling into an empty history
* entering an invalid regexp

Please feel free to post here if there are any features/improvements you'd like to see in pcurses.

Offline

#9 2011-11-28 18:11:31

ray040123
Member
Registered: 2011-11-15
Posts: 2

Re: pcurses - a curses package management tool

How about adding AUR support? I used to use aptitude in ubuntu. Now I feel nice to found pcurses in arch. I've used yaourt but it sometimes output a lot which make it not so convinient to use. If pcurses has AUR support, it will be great!

Offline

#10 2011-11-29 14:49:40

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: pcurses - a curses package management tool

ray040123 wrote:

How about adding AUR support? I used to use aptitude in ubuntu. Now I feel nice to found pcurses in arch. I've used yaourt but it sometimes output a lot which make it not so convinient to use. If pcurses has AUR support, it will be great!

pcurses is a frontend to libalpm http://www.archlinux.org/pacman/libalpm.3.html
I think adding AUR support is not trivial.

Have you tried other AUR helpers apart from yaourt?

Offline

#11 2011-11-29 20:38:17

schuay
Package Maintainer (PM)
From: Austria
Registered: 2008-08-19
Posts: 564

Re: pcurses - a curses package management tool

ray040123 wrote:

How about adding AUR support? I used to use aptitude in ubuntu. Now I feel nice to found pcurses in arch. I've used yaourt but it sometimes output a lot which make it not so convinient to use. If pcurses has AUR support, it will be great!

Sorry to disappoint you, but I currently have no plans of adding AUR support.
The entire AUR database would have to be pulled at each program start, and that's just not feasable in an acceptable timeframe AFAIK.

Personally, I'd recommend using cower to manage AUR packages.

Offline

#12 2011-11-29 20:40:58

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: pcurses - a curses package management tool

schuay wrote:

]The entire AUR database would have to be pulled at each program start, and that's just not feasable in an acceptable timeframe AFAIK.

http://aur3.org/ is updated daily so it should be sufficiently fresh for most purposes, but I agree that an AUR helper is the way to go.

Offline

Board footer

Powered by FluxBB