Re: [Sawfish] Print rep data in shell

[ Thread Index | Date Index | More lists.tuxfamily.org/sawfish Archives ]


On Sun, Feb 26, 2012 at 05:42:46PM +0000, Deric Bytes wrote:
> I have a selection of rep scripts, that I wish to also call from bash. With
> the addition of extra formatting when called from bash
> 
> An example rep script that I call is below.
> 
> ------------------------------------------
> ;; file: list-names-of-managed-windows.jl
> (setq windows (mapcar (lambda (win) (window-name win)) (managed-windows)))
> -------------------------------------------

At least in what you are showing you are using only a side-effect of
'setq windows' assignment.  Is that really needed?  Also 'cat' is
actually a "dead cat" as "$(cat some_file)" and "$(<some_file)" will
have the same effect.

> When called from bash ....

If you are using bash then 'sed' happens to be unessential too.

show_my_args () { while [ "$1" ]; do echo $1; shift; done }
eval list=$(sawfish-client -e \
 '(mapcar (lambda (win) (window-name win)) (managed-windows))')
show_my_args "${list[@]}"

> Is there a better way?

For a some value of "better" ....

   Michal

-- 
--
Sawfish ML


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/