Re: [dev] dmc

2010-08-16 Thread Martin Kopta
I have read it many times. Am I missing something?

Dne 16.8.2010 1:24 "Jacob Todd"  napsal/a:

On Sun, Aug 15, 2010 at 08:15:41PM +0200, Martin Kopta wrote:
> does that thing actualy works?
Read the README.


Re: [dev] flo - a command line program for organizing events, to-dos, and deadlines

2010-08-16 Thread anonymous
On Sun, Aug 15, 2010 at 10:04:18PM +0200, Alexander Teinum wrote:
> I realize that there are ways to do this that are closer to the Unix
> way of thinking. Editor of choice for adding and editing. Instead of
> tagging items, one would should have one file for university and
> another one for work items. And 25 aliases and helper scripts to make
> it flo’.

Tagging is easy to do with grep: you can add tags right into items
description text (like "[work] [university]" or ":w:u:") and then use
grep like "flo | grep :u:".  So you don't need one file for each tag.




Re: [dev] dmc

2010-08-16 Thread pancake
dmc -e maybe?

On 16/08/2010, at 09:03, Martin Kopta  wrote:

> I have read it many times. Am I missing something?
> 
>> Dne 16.8.2010 1:24 "Jacob Todd"  napsal/a:
>> 
>> On Sun, Aug 15, 2010 at 08:15:41PM +0200, Martin Kopta wrote:
>> > does that thing actualy works?
>> 
>> Read the README.
> 


Re: [dev] dmc

2010-08-16 Thread Martin Kopta
Sorry, I didn't send the whole cmdlist but just the relevant part. Of course
I have run -e before. Just asking if it should work (dmc).

Dne 16.8.2010 9:41 "pancake"  napsal/a:

dmc -e maybe?



On 16/08/2010, at 09:03, Martin Kopta  wrote:

> I have read it many times. Am I missing something?
>>
>> Dne 16.8.2010 1:24 "Jacob Todd" 

Re: [dev] [vp] A media website video player/fetcher

2010-08-16 Thread Szabolcs Nagy
* Kris Maglione  [2010-08-15 05:18:55 -0400]:

> This is a cleaned up version of some of the scripts I've been using
> for a long time to play videos from sites like YouTube. I use a key

this is my solution:
http://repo.hu/projects/yget/

this only supports youtube, but knows a bit more
can handle playlists
can handle more url formats
yurl prints infos (title, tags, length, avail formats..)
yget downloads
yplay streams

uses sh and awk (+wget, +mplayer for yget and yplay)

> For now, the only sites supported are YouTube and Revision3, but I'm
i have one script for vimeo as well but i rarely use it so it's not
cleaned up




[dev] dmc

2010-08-16 Thread carmen
http://i.imgur.com/I2lJa.png


http://gitorious.org/element/element/blobs/master/ruby/W/mail.rb

i'm pretty happy with this - if you have feature suggestions or questions mail 
me offlist



Re: [dev] flo - a command line program for organizing events, to-dos, and deadlines

2010-08-16 Thread Alexander Teinum
> Tagging is easy to do with grep: you can add tags right into items
> description text (like "[work] [university]" or ":w:u:") and then use
> grep like "flo | grep :u:".  So you don't need one file for each tag.

You’re right! I’ve removed tag support. flo just got one millisecond faster!

It is harder now to add a tag to an untagged item, change an existing
tag to something else, and to remove a tag. It’s also more to type to
look up a tag. I might revert this change, but I’ll see if I can live
with it.

-- 
Best regards,

Alexander Teinum



Re: [dev] flo - a command line program for organizing events, to-dos, and deadlines

2010-08-16 Thread Alexander Teinum
alias fg='flo | grep '

# add tagged item

f :w meeting,d114-d11430

# list items of a tag

fg :w

# display today’s events

fg d0

# display tomorrow’s events

fg d1

Simplicity is so sweet.


Alexander



Re: [dev] flo - a command line program for organizing events, to-dos, and deadlines

2010-08-16 Thread Moritz Wilhelmy
In bourne-like shells, fg is absolutely necessary to manage job control.
How do you put your jobs back into foreground?



Re: [dev] flo - a command line program for organizing events, to-dos, and deadlines

2010-08-16 Thread Martin Kopta
\fg %jid ?

Dne 16.8.2010 12:43 "Moritz Wilhelmy"  napsal/a:

In bourne-like shells, fg is absolutely necessary to manage job control.
How do you put your jobs back into foreground?


Re: [dev] flo - a command line program for organizing events, to-dos, and deadlines

2010-08-16 Thread Alexander Teinum
> In bourne-like shells, fg is absolutely necessary to manage job control.
> How do you put your jobs back into foreground?

I haven’t used Ctrl+Z and fg, but I probably should! I usually have
lots of terminals in dwm that I alt+j/k between, and then I send the
active one to the left.

I would never override a bash function or a Unix command, so ff, flg,
or flog are better choices.

-- 
Best regards,

Alexander Teinum



Re: [dev] flo - a command line program for organizing events, to-dos, and deadlines

2010-08-16 Thread Alexander Teinum
Or fp as in [f]lo gre[p]. It’s two characters, one doesn’t have to
type the same character twice, and it alternates between the hands
when typing fp d0 for instance. At least for those that use qwerty. :)


Alexander



Re: [dev] [mkpkg] a suckless package manager

2010-08-16 Thread Jimmy Tang
On Sat, Aug 14, 2010 at 11:41:41AM +0200, pancake wrote:
> Your idea is simpler and closer to gnu package system or pkgsrc. But without 
> reusing code. Which means that you have to specify the full compilation rules 
> for every pkg, this is also an issue if you plan to use other tools like 
> wget/ftp/.. And imho keeping track of files and having support to remove 
> packages are some basic features of a package manager :)
> 
> In fact this week I have been working in slpm a lot. More to add features 
> than to keep code clean. So it's full of XXX and TODO atm :) but the result 
> is pretty good.
> 
> Now its about 500LOC and supports checksumming of files, dependencies, many 
> more packages, creation of chroot environments by detecting missing libs and 
> supports binary and src packages.
> 
> I also added 2 scripts:
> 
> genpkg: converts a installed pkg of debian/arch/gentoo into a slpm one.
> 
> genimg: generates an ext2 file with a bootable rootfs with the contents of 
> the slpm packages installed in _prefix.
> 
> I've used this to do some games with kernel and userland via qemu. And 
> resulted to be the simplest way for me to setup such environment.
> 
> Next weeks I'll probably be cleaning up the code in slpm and fixing some 
> bugs. I plan to use slpm to create "extensions" of the OS inside a directory 
> or a chroot. I find it useful for testing apps from hg/git/.. Without 
> trashing system and keeping track of files.
> 
> I use it in the n900 and my archlinux laptop. Next platforms for testing are 
> iOS and android.

I don't suppose slpm will support post/pre-install hooks as well? and
the capability with "doing things" like setting environment variables
according to the dependancies that are defined?

I'm interested in seeing the updated slpm code on your upcoming
releases, since I've recently forked cports (which is a forked version
of http://staff.e.kth.se/mpkg/) to package up scientific applications
which often don't come with sane build systems.

-- 
Jimmy Tang
Trinity Centre for High Performance Computing,
Lloyd Building, Trinity College Dublin, Dublin 2, Ireland.
http://www.tchpc.tcd.ie/


pgpN1Hqa0CChh.pgp
Description: PGP signature


[dev] [st] 256color info file?

2010-08-16 Thread Ramana Kumar
Is there a file st-256color.info missing from the st repo?
I just downloaded hg version 85 and tried to make it, and it failed
with "tic: Can't open st-256color.info".



[dev] [wmii] C configuration

2010-08-16 Thread Nikhilesh S

Any of you guys use a program in C with libixp for wmii configuration?

--
Nikhilesh S
http://nikki93.github.com/



Re: [dev] [st] 256color info file?

2010-08-16 Thread Nikhilesh S

On Tue, 17 Aug 2010, Ramana Kumar wrote:


Is there a file st-256color.info missing from the st repo?
I just downloaded hg version 85 and tried to make it, and it failed
with "tic: Can't open st-256color.info".


I had the same problem when I tried it. I did a 'touch st-256color.info'
hoping it didn't matter much, and it worked.



Re: [dev] [wmii] C configuration

2010-08-16 Thread Kris Maglione

On Tue, Aug 17, 2010 at 03:05:34AM +0300, Nikhilesh S wrote:

Any of you guys use a program in C with libixp for wmii configuration?


I have in the past, but not for my entire configuration, just 
for certain operations.


--
Kris Maglione

It is impossible to defeat an ignorant man in argument. 
	-William G. McAdoo





Re: [dev] [st] 256color info file?

2010-08-16 Thread Ramana Kumar
I just tried touching a st-256color.info, but it seems that my tic
goes into an infinite loop trying to process an empty file.

On Tue, Aug 17, 2010 at 10:24 AM, Nikhilesh S  wrote:
> On Tue, 17 Aug 2010, Ramana Kumar wrote:
>
>> Is there a file st-256color.info missing from the st repo?
>> I just downloaded hg version 85 and tried to make it, and it failed
>> with "tic: Can't open st-256color.info".
>
> I had the same problem when I tried it. I did a 'touch st-256color.info'
> hoping it didn't matter much, and it worked.
>



Re: [dev] [wmii] wimenu custom completion

2010-08-16 Thread LuX
Hello!

@Arian Kuschki: Thank you too, for the .inputrc trick.

On Sun, 15 Aug 2010 18:51:55 -0400, Kris Maglione wrote:
> Yes, I already fixed that problem when I made it into an example
> file for distribution. Attached. 

I have a few unessential remarks, if you allow me: 

- Although I don't understand this, it seems that the last 'tail -1' is
  no longer needed. 

- Since you replaced the call to dirname by a 'sub' command just after
  the comment '# Strip the trailing filename', it happens that when I
  type 'ls /' in the input area, it is the content of the $HOME
  directory instead of / which is displayed by wimenu. Here is a fix:

  # Strip the trailing filename
  if(match(str, "^/[^/]*$"))
  str = "/" str
  sub("(/|^)[^/]*$", "", str)

- I have read somewhere that /dev/shm was a good place to put files
  used by programs to discuss one with each others. This would apply
  to "fifo" in this case. I don't know if you have an opinion on this. 

- I liked more the previous behaviour, when the script ends by sending
  the input string to stdout (like wimenu does) so that it can can be
  processed by some independent script like for example this one:

cmd=$1
shift
args="$@"

noterm=$(grep Exec= /usr/share/applications/*.desktop 
/usr/local/share/applications/*.desktop | sed -e 's:.*Exec=\s*::' -e 's:^[^\ 
]*/::' | grep -E "^$cmd(\ |$)")

if [ "$args" != "${args% &}" -o "$noterm" != "" ]; then
exec $cmd $args &
elif [ "$cmd" != "" ]; then
Terminal -e "${SHELL:-sh} -c \"$cmd $args ; ${SHELL:-sh}\"" & 
fi



In addition I enjoyed adding another minor feature: when a list of
options has been declared in the script for the initial command of the
input line, every time a '-' is typed at the beginning of a new
argument in a line starting with that command, this list of options is
displayed instead of a list of files. I find it convenient for some
commands, like 'lp' or 'pdfnup' which accept many options, useful to
me but that I do not use to remember. 

In case other people would be interested I attach the code below with
my favourite options for lp, as an example. 

Note: It would be better to declare the 'opt' array outside this
script, in a sort of configuration file, but I don't know how to do
this. 

Regards, 
LuX. 


#!/bin/sh
# This script will launch wimenu and provide command
# completion for the first argument and filename completion
# for each following argument, and pass the result to stdout.
# Program name completion requires that a program list already
# exist in $(wmiir namespace)/.proglist

fifo="/dev/shm/wim_$USER"
mkfifo $fifo 2>/dev/null

script=$(cat <<'!'
BEGIN {
progs = "cat $(wmiir namespace)/.proglist"

# Favorite options for some programs
opt["lp"] = "-o media=a4\n-o landscape\n-o 
sides=two-sided-long-edge\nsides=two-sided-short-edge\n-o number-up=N\n"

# Print the first set of completions to wimenu’s fifo
print read(progs) >fifo
fflush(fifo)
}

# Process the input and provide the completions
{
# Skip the trailing part of the command.
# If there is none, this is the result.
if (!getline rest) {
print
exit
}

if (!match($0, /.*[ \t]/))
# First argument, provide the program list
update(0, progs)
else {
# Set the offset to the location of the last
# space, and save that part of the completion
offset = RLENGTH
str = substr($0, offset + 1)

# If we are completing a sub-directory, adjust
# the offset to the position of the last /
if (match(str, ".*/"))
offset += RLENGTH

# If the last component of the path begins with
# a ., include hidden files
arg = ""
if(match(str, "(^|/)\\.[^/]*$"))
arg = "-A"

# Substitute ~/ for $HOME/
sub("^~/", ENVIRON["HOME"] "/", str)

# Strip the trailing filename
if(match(str, "^/[^/]*$"))
str = "/" str
sub("(/|^)[^/]*$", "", str)

# If the last argument starts with a -, list 
# options declared in opt instead of files
lscmd = "ls " arg quote(str)
if(match($0, "\\ -[^\\ ]*$")) {
lsopt = opt[gensub(/\ .*/, "", 1)]
lscmd = "echo -n \"" lsopt "\""
}

update(offset, lscmd)
}
}

# Push out a new set of completions
function update(offset, cmd) {
# Only push out the completion if the offset or the
# ls command has changed. The behavior will be the
# same regardless, but this is a minor optimization
if (offset != loffset || cmd != lcmd) {
loffset = offset
lcmd = cmd

cmpl = read

Re: [dev] [wmii] wimenu custom completion

2010-08-16 Thread Kris Maglione

On Tue, Aug 17, 2010 at 02:15:13AM +0200, LuX wrote:

On Sun, 15 Aug 2010 18:51:55 -0400, Kris Maglione wrote:

Yes, I already fixed that problem when I made it into an example
file for distribution. Attached. 


I have a few unessential remarks, if you allow me: 


Of course.


- Although I don't understand this, it seems that the last 'tail -1' is
 no longer needed. 


Ah, you're right. I'd intended to remove that. Fortunately this 
changeset hasn't left my patch queue yet. :)



- Since you replaced the call to dirname by a 'sub' command just after
 the comment '# Strip the trailing filename', it happens that when I
 type 'ls /' in the input area, it is the content of the $HOME
 directory instead of / which is displayed by wimenu. Here is a fix:

 # Strip the trailing filename
 if(match(str, "^/[^/]*$"))
 str = "/" str
 sub("(/|^)[^/]*$", "", str)


This would be better:

sub("[^/]+$", "", str)

I'll update the script.


- I have read somewhere that /dev/shm was a good place to put files
 used by programs to discuss one with each others. This would apply
 to "fifo" in this case. I don't know if you have an opinion on this. 


That would not help in this case. For one thing, /dev/shm is 
very system specific. Only certain Linux distributions support 
it. For another, its value is in that it's a memory filesystem, 
so file contents are stored in RAM rather than on disk. But our 
file is a FIFO, anyway. Its contents never touch the disk. It 
would probably be better in ~/.wmii/menu_fifo or the like, 
though.



- I liked more the previous behaviour, when the script ends by sending
 the input string to stdout (like wimenu does) so that it can can be
 processed by some independent script like for example this one:


I think that you're right in principle. However, I'm going to 
leave the example as is because it illustrates the purpose of 
the script better and as it's fully self-contained, it works 
without modification.



In addition I enjoyed adding another minor feature: when a list of
options has been declared in the script for the initial command of the
input line, every time a '-' is typed at the beginning of a new
argument in a line starting with that command, this list of options is
displayed instead of a list of files. I find it convenient for some
commands, like 'lp' or 'pdfnup' which accept many options, useful to
me but that I do not use to remember. 


I think this is a good idea, and it was what my help file 
example was meant to suggest. I'd suggest some slight changes, 
though:


--- menu_thing  2010-08-16 20:32:26.0 -0400
+++ -   2010-08-16 20:49:19.051116173 -0400
@@ -5,18 +5,18 @@
 # Program name completion requires that a program list already
 # exist in $(wmiir namespace)/.proglist
 
-fifo="/dev/shm/wim_$USER"

+fifo=$HOME/.wmii/menu_fifo
 mkfifo $fifo 2>/dev/null
 
 script=$(cat <<'!'

 BEGIN {
-progs = "cat $(wmiir namespace)/.proglist"
+progs = read("cat $(wmiir namespace)/.proglist")
 
 # Favorite options for some programs

 opt["lp"] = "-o media=a4\n-o landscape\n-o 
sides=two-sided-long-edge\nsides=two-sided-short-edge\n-o number-up=N\n"
 
 # Print the first set of completions to wimenu’s fifo

-print read(progs) >fifo
+print progs >fifo
 fflush(fifo)
 }
 
@@ -25,13 +25,17 @@

 # Skip the trailing part of the command.
 # If there is none, this is the result.
 if (!getline rest) {
-print
-exit
+print
+exit
 }
 
 if (!match($0, /.*[ \t]/))

 # First argument, provide the program list
-update(0, progs)
+update(0, "", progs)
+else if($NF ~ /^-/)
+# If the last argument starts with a -, list 
+# options declared in opt instead of files

+update(RLENGTH, "", opt[$1])
 else {
 # Set the offset to the location of the last
 # space, and save that part of the completion
@@ -46,31 +50,21 @@
 # If the last component of the path begins with
 # a ., include hidden files
 arg = ""
-if(match(str, "(^|/)\\.[^/]*$"))
-arg = "-A"
+if(str ~ "(^|/)\\.[^/]*$")
+arg = "-A "
 
 # Substitute ~/ for $HOME/

 sub("^~/", ENVIRON["HOME"] "/", str)
 
 # Strip the trailing filename

-if(match(str, "^/[^/]*$"))
-str = "/" str
-sub("(/|^)[^/]*$", "", str)
-
-# If the last argument starts with a -, list 
-# options declared in opt instead of files

-lscmd = "ls " arg quote(str)
-if(match($0, "\\ -[^\\ ]*$")) {
-lsopt = opt[gensub(/\ .*/, "", 1)]
-lscmd = "echo -n \"" lsopt "\""
-}
+sub("[^/]+$", "", str)
 
-

Re: [dev] dmc

2010-08-16 Thread Andreas Wagner
I've packaged dmc for arch linux:
http://aur.archlinux.org/packages.php?ID=39955

This was before I tried it and could not send or recieve mail. Maybe I
packaged it too early?
I would also like to know if I'm missing something.

On Mon, Aug 16, 2010 at 3:43 AM, pancake  wrote:
> dmc -e maybe?
>
> On 16/08/2010, at 09:03, Martin Kopta  wrote:
>
> I have read it many times. Am I missing something?
>
> Dne 16.8.2010 1:24 "Jacob Todd"  napsal/a:
>
> On Sun, Aug 15, 2010 at 08:15:41PM +0200, Martin Kopta wrote:
>> does that thing actualy works?
>
> Read the README.
>



Re: [dev] flo - a command line program for organizing events, to-dos, and deadlines

2010-08-16 Thread David J Patrick

On 10-08-14 08:18 AM, Alexander Teinum wrote:

I have been working on a program that makes it easy to keep myself,
and perhaps others, in check. It’s inspired by suckless. I now
consider it stable enough to share it with you.


Sounds intriguing, and I'm going to check it out, but I have to admit to 
being the "Designer" of a competing bit of software at 
http://taskwarrior.org


Task may well "suck more" by some standards, but it is in roaring 
development, and getting (i.m.h.o.) very interesting.


djp



Re: [dev] flo - a command line program for organizing events, to-dos, and deadlines

2010-08-16 Thread Alexander Teinum
> Sounds intriguing, and I'm going to check it out, but I have to admit to
> being the "Designer" of a competing bit of software at
> http://taskwarrior.org

I don’t have time to try it out right now, but I see how an
interactive interface might be practical. Mine is more like a pure
command line application. Yesterday I added events for the university
semester this fall, and I did this using bash for-loops and another
small application that I’m working on that converts an ISO 6801 date
to a MMDD format.

The following line adds one event for the course IS-403 every week
between 35 and 35, and it places it on friday. The lab is between
08:15 and 16:00.

for i in {35..45}; do flo :u :is403 :h1024 :lab,`week $i 4`0815-`week
$i 4`1600; done

Then I use this alias to look up stuff:

alias fp='flo | grep'

fp :u
fp :lab

etc.

Now that I’ve got more than 100 items, I find this usable:

alias fh='flo | grep ^[^t] | head -n 25; flo | grep ^t'

I found that the standard of GNU grep sucked, and I recommend using
pcregrep instead (pcre.org).

> Should the word "id" appear in the "Change item" example of your Usage
> section of readme.md?

Yes. You just found a bug. Thank you!