You are not logged in.
cope is a wrapper around various command-line programs that takes their output and adds colours - a sort of ornamental cope, if you will.
It's written in Perl, and requires version >= 5.10, so installation may be a bit complicated if you have to track down the dependencies. It installs several scripts in a directory, each one calling the program it's named after, only highlighting its output using regexes. Then you add this directory to your $PATH, and everything should (hopefully!) be seamless.
Currently it's in release candidate status - I've been using it personally for a few weeks and nothing catastrophic has happened so far, so there's little point me keeping it private.
Screenshots:
Main site: http://stuff.cytzol.org/cope/
GitHub: http://github.com/cytzol/cope
Offline
Judging by the screen shots, I like it.
Although I do have a small suggestion; show a small section in the site on how it's configured. I haven't downloaded yet, so you may as well explain the setup in comments or a man page, etc., but the configuration excerpt would tell me more about its features and how does it accomplish doing what it does before downloading it.
Offline
isn't coloring output of commands also what zsh does?
< Daenyth> and he works prolifically
4 8 15 16 23 42
Offline
I like the look of it a lot too, I'm going to download it and try it once I get the chance. Nice work Does it have a wrapper for pacman or do I still need to get around to installing pacman-color?
isn't coloring output of commands also what zsh does?
If it does, I would sure like to know. Just another reason to like zsh.
Edit: Just looked in the scripts directory, no pacman. And, is that a wrapper for ls? Can't ls do it's own colors?
Last edited by jac (2009-12-07 22:24:42)
Offline
the only other way to do this is to install cwrapper, Daisuke_Aramaki often shows colorized commands in most of his screenshot posts, and i believe this is how he does it.
calling existing binaries then colorizing their output is a much better approach IMO. i'm not sure how cwrapper does it, but i do know it's version of cmake wouldn't work for me so maybe something else is going on.
i assume all the standard redirects will hold with your method (i.e. you keep stdout and stderr intact post-coloring)?
i don't think zsh has anything like this built-in but i could be wrong.
//github/
Offline
I like the look of it a lot too, I'm going to download it and try it once I get the chance. Nice work Does it have a wrapper for pacman or do I still need to get around to installing pacman-color? And, is that a wrapper for ls? Can't ls do it's own colors?
Thanks! There's no script for pacman because pacman-color does the job already, so I just used that. Same with diff and colordiff.
cope provides extra colours when you use long output (ls -l); it doesn't touch dircolors's tweaking as it does this, so you can happily use them both.
isn't coloring output of commands also what zsh does?
I don't know! I've been using zsh for a while now, and haven't found anything in the way of highlighting. (Not to say that it can't do it, zsh sure can do a lot)
Judging by the screen shots, I like it. Although I do have a small suggestion; show a small section in the site on how it's configured.
Thanks. Good point; I'll add something to the site. There does exist documentation in the form of POD throughout the source files, but you need to download and install cope before you get to see it - the App::Cope documentation in particular shows how it can be configured. GitHub-coloured code doesn't exactly make pleasant reading, though.
Offline
the only other way to do this is to install cwrapper, Daisuke_Aramaki often shows colorized commands in most of his screenshot posts, and i believe this is how he does it.
calling existing binaries then colorizing their output is a much better approach IMO. i'm not sure how cwrapper does it, but i do know it's version of cmake wouldn't work for me so maybe something else is going on.
i assume all the standard redirects will hold with your method (i.e. you keep stdout and stderr intact post-coloring)?
cwrapper uses the same approach that cope does - you run programs that run actual programs of the same name. I've never used cmake, so I have no idea what could go wrong, sadly...
If you're redirecting stdout, it doesn't highlight it at all, as 1) this interferes badly with pipes, and 2) you might not end up seeing the final output anyway.
Offline
this is very cool, I just saw it on reddit. how would one go about making a pkgbuild for this?
check this out
http://www.myspace.com/banditsinthewoods
Offline
I briefly installed this to test it,,it had worked fine for most commands but it appeared to break things,,notably compilation with make, especially under AUR/yaourt,,maybe I did something wrong?
Offline
this is very cool, I just saw it on reddit. how would one go about making a pkgbuild for this?
Install abs and use the PKGBUILD-perl.proto template. Or just have a look at some official perl PKGBUILDs.
Offline
Can you post your $PS1? I like your fancy 2 line prompt.
How's my programming? Call 1-800-DEV-NULL
Offline
PKGBUILD
# Contributor: denton <e9203.00 gmail com>
pkgname=cope-git
pkgver=20091208
pkgrel=1
pkgdesc='A colourful wrapper for terminal programs'
arch=(any)
url=http://stuff.cytzol.org/cope/
license=('GPL' 'PerlArtistic')
depends=("perl>=5.10")
makedepends=(git)
provides=(cope)
conflicts=(cope)
install=$pkgname.install
_gitroot=git://github.com/cytzol/cope.git
_gitname=cope
build() {
cd $srcdir
# Git
msg 'Connecting to Git server...'
if [ -d $_gitname ] ; then
cd $_gitname && git pull origin || return 1
msg 'The local files are updated.'
else
git clone $_gitroot || return 1
fi
msg 'Git checkout done or server timeout.'
msg 'Starting make...'
rm -rf $srcdir/$_gitname-build
git clone $srcdir/$_gitname $srcdir/$_gitname-build || return 1
cd $srcdir/$_gitname-build
# Build
PERL_MM_USE_DEFAULT=1 perl Makefile.PL INSTALLDIRS=vendor || return 1
make || return 1
make install DESTDIR=$pkgdir || return 1
# Remove perllocal.pod and .packlist
find $pkgdir -name perllocal.pod -delete
find $pkgdir -name .packlist -delete
}
cope-git.install
post_install() {
echo 'Prepend /usr/share/perl5/vendor_perl/auto/share/dist/Cope/ to $PATH'
}
post_upgrade() {
post_install
}
First time making a perl package. It puts files that shouldn't be in */site:
/usr/bin/perlbin/site/envpath
/usr/lib/perl5/site_perl/5.10.1/IO/Pty.pm
/usr/lib/perl5/site_perl/5.10.1/IO/Tty.pm
/usr/lib/perl5/site_perl/5.10.1/IO/Tty/
/usr/lib/perl5/site_perl/5.10.1/IO/Tty/Constant.pm
/usr/lib/perl5/site_perl/5.10.1/List/MoreUtils.pm
/usr/lib/perl5/site_perl/5.10.1/Params/Util.pm
/usr/lib/perl5/site_perl/5.10.1/auto/IO/Tty/Tty.bs
/usr/lib/perl5/site_perl/5.10.1/auto/IO/Tty/Tty.so
/usr/lib/perl5/site_perl/5.10.1/auto/List/MoreUtils/MoreUtils.bs
/usr/lib/perl5/site_perl/5.10.1/auto/List/MoreUtils/MoreUtils.so
/usr/lib/perl5/site_perl/5.10.1/auto/Params/Util/Util.bs
/usr/lib/perl5/site_perl/5.10.1/auto/Params/Util/Util.so
/usr/share/perl5/site_perl/5.10.1/Class/Inspector.pm
/usr/share/perl5/site_perl/5.10.1/Class/Inspector/
/usr/share/perl5/site_perl/5.10.1/Class/Inspector/Functions.pm
/usr/share/perl5/site_perl/5.10.1/Env/Path.pm
/usr/share/perl5/site_perl/5.10.1/IO/Stty.pm
/usr/share/perl5/site_perl/5.10.1/IO/stty.pl
/usr/share/perl5/site_perl/5.10.1/Regexp/Common.pm
/usr/share/perl5/site_perl/5.10.1/Regexp/Common/CC.pm
/usr/share/perl5/site_perl/5.10.1/Regexp/Common/SEN.pm
/usr/share/perl5/site_perl/5.10.1/Regexp/Common/URI.pm
/usr/share/perl5/site_perl/5.10.1/Regexp/Common/URI/RFC1035.pm
/usr/share/perl5/site_perl/5.10.1/Regexp/Common/URI/RFC1738.pm
/usr/share/perl5/site_perl/5.10.1/Regexp/Common/URI/RFC1808.pm
/usr/share/perl5/site_perl/5.10.1/Regexp/Common/URI/RFC2384.pm
/usr/share/perl5/site_perl/5.10.1/Regexp/Common/URI/RFC2396.pm
/usr/share/perl5/site_perl/5.10.1/Regexp/Common/URI/RFC2806.pm
/usr/share/perl5/site_perl/5.10.1/Regexp/Common/URI/fax.pm
/usr/share/perl5/site_perl/5.10.1/Regexp/Common/URI/file.pm
/usr/share/perl5/site_perl/5.10.1/Regexp/Common/URI/ftp.pm
/usr/share/perl5/site_perl/5.10.1/Regexp/Common/URI/gopher.pm
/usr/share/perl5/site_perl/5.10.1/Regexp/Common/URI/http.pm
/usr/share/perl5/site_perl/5.10.1/Regexp/Common/URI/news.pm
/usr/share/perl5/site_perl/5.10.1/Regexp/Common/URI/pop.pm
/usr/share/perl5/site_perl/5.10.1/Regexp/Common/URI/prospero.pm
/usr/share/perl5/site_perl/5.10.1/Regexp/Common/URI/tel.pm
/usr/share/perl5/site_perl/5.10.1/Regexp/Common/URI/telnet.pm
/usr/share/perl5/site_perl/5.10.1/Regexp/Common/URI/tv.pm
/usr/share/perl5/site_perl/5.10.1/Regexp/Common/URI/wais.pm
/usr/share/perl5/site_perl/5.10.1/Regexp/Common/_support.pm
/usr/share/perl5/site_perl/5.10.1/Regexp/Common/balanced.pm
/usr/share/perl5/site_perl/5.10.1/Regexp/Common/comment.pm
/usr/share/perl5/site_perl/5.10.1/Regexp/Common/delimited.pm
/usr/share/perl5/site_perl/5.10.1/Regexp/Common/lingua.pm
/usr/share/perl5/site_perl/5.10.1/Regexp/Common/list.pm
/usr/share/perl5/site_perl/5.10.1/Regexp/Common/net.pm
/usr/share/perl5/site_perl/5.10.1/Regexp/Common/number.pm
/usr/share/perl5/site_perl/5.10.1/Regexp/Common/profanity.pm
/usr/share/perl5/site_perl/5.10.1/Regexp/Common/whitespace.pm
/usr/share/perl5/site_perl/5.10.1/Regexp/Common/zip.pm
And as shown by the previous list, I haven't fetched these binaries (are they in the repos?):
Env::Path
File::ShareDir
IO::Handle
IO::Pty
IO::Stty
List::MoreUtils
Regexp::Common
Term::ANSIColor
Everything works, except cope_path.pl.
Last edited by denton (2009-12-08 09:14:37)
Offline
I've tested this for some time now, and I'm not sure that it's that useful... yet. Though I must say that it is nice! Especially since it's perl, been digging through the code and that was even nicer...
Offline
Never mind, someone made a better package with all the modules: http://aur.archlinux.org/packages.php?ID=32514
Offline
So, I have a question that I wish I knew how to figure out: I have ccache setup by just prepending the /usr/lib/ccache/bin directory to my path so those binaries get run first, how does having cope installed affect that? To be honest, I just setup ccache and left it to figure out how to use it and what not till later, so I don't know how to check if it's being run or not. I tried looking at the scripts cope installs, but I don't know enough perl to make heads or tails of them. So, do I need to have the cope path and the ccache path in a certain order to have it still work OK? Thanks
Offline
Looking good!
So far only complain is that when a heavy ls -lh output is colored in the screen, the typing is slow.
Offline
Can you post your $PS1? I like your fancy 2 line prompt.
This is a great starting point:
http://bbs.archlinux.org/viewtopic.php?id=84386
Last edited by MkFly (2010-01-13 17:00:57)
Offline
jac wrote:I like the look of it a lot too, I'm going to download it and try it once I get the chance. Nice work Does it have a wrapper for pacman or do I still need to get around to installing pacman-color? And, is that a wrapper for ls? Can't ls do it's own colors?
Thanks! There's no script for pacman because pacman-color does the job already, so I just used that. Same with diff and colordiff.
There's also colorgcc. Why're you creating wrappers for gcc and stuff?
Offline
I am pretty noob. How to I add this directory to my path?
Last edited by gnomen (2010-01-27 23:52:31)
Offline
Open your .bashrc file with an editor and add this line
PATH=/usr/share/perl5/vendor_perl/auto/share/dist/Cope:$PATH
save and exit.
Last edited by Awake (2010-01-27 18:50:51)
Offline
Thanks! This is great!
Offline
Is there a way to customize the colors? Like have it read .dir_colors or something?
Offline
Sorry for the bump, but unfortunately it doesn't work for me.
I've installed cope via aur and and add "/usr/share/perl5/vendor_perl/auto/share/dist/Cope" to $PATH. I've confirmed that both the installation and the addition to the PATH went smoothly.
Any help?
Offline
Sorry for the bump, but unfortunately it doesn't work for me.
I've installed cope via aur and and add "/usr/share/perl5/vendor_perl/auto/share/dist/Cope" to $PATH. I've confirmed that both the installation and the addition to the PATH went smoothly.
Any help?
Make sure the path to cope is listed first, like so
PATH=/usr/share/perl5/vendor_perl/auto/share/dist/Cope:$PATH
Or, maybe you need to re-source the shell rc file.
Last edited by prasetyams (2010-02-06 18:46:25)
Where's my sig?
Offline