Re: [dwm] dwm wish, a tidy-up function

2007-12-08 Thread Antoni Grzymala
Anselm R. Garbe dixit (2007-12-08, 20:16):

 Hi there,
 
 I implemented a reapply() function which is bound to Mod1-r by
 default in config.def.h. It unsets all tags of all clients and
 performs an applyrules() on each client in the global client
 list. Afterwards it calls arrange().
 
 Let me know if the functionality is what you had in mind,
 initially.

Yes, great, seems to work exactly as intended.

Thanks, arg!

-- 
[a]


signature.asc
Description: Podpis cyfrowy :: Digital signature


Re: [dwm] dwm wish, a tidy-up function

2007-12-06 Thread Anselm R. Garbe
Well, the only thing which is missing that dwm keeps state of
the currently selected tags. The idea is that dwm putenv's the
currently selected tags whenever they change and a newly spawned
dwm instance looks for that environment variable and pre-selects
those tags. Then a clean restart will behave like reapplying all
tagging rules beside persisting the selected tags.

What do you think about this proposal? I think of something
like:

DWMTAGS=1:2:www

You could as well define them in your X start script and dwm
will use those instead.

Regards,
Anselm

On Wed, Dec 05, 2007 at 09:15:41AM +0100, Anselm R. Garbe wrote:
 Hi,
 
 Let me think about this proposal. Restarting dwm should do the
 job, maybe it's a good idea to have a restart function in
 opposite to quit as well.
 
 Regards,
   Anselm
 
 
 On Wed, Dec 05, 2007 at 12:44:38AM +0100, Antoni Grzymala wrote:
  Hi,
  
  just came across another idea. How about implementing a function in dwm
  that would reapply all the predefined rules (float/non-float, tagging)
  to all clients in a dwm session.
  
  This could either be a function bindable to a keystroke, or dwm reacting
  to a signal (say, HUP), or what not.
  
  This way, when I do a total mess with tagging and floating my clients
  (sometimes it happens and I get lost) I could get my everyday dwm state
  with one keystroke or command.
  
  What do you think?
  
  I presume this could also be achieved by restarting dwm, but this
  doesn't seem too clean to me, and also would not integrate well with a
  login manager (from what it seems).
  
  If something like that is already there, excuse my infinite dumbness for
  not noticing.
  
  Best,
  
  -- 
  [a]
 
 
 
 -- 
  Anselm R. Garbe  http://www.suckless.org/  GPG key: 0D73F361
 

-- 
 Anselm R. Garbe  http://www.suckless.org/  GPG key: 0D73F361



Re: [dwm] dwm wish, a tidy-up function

2007-12-06 Thread Anselm R. Garbe
There comes my old idea into mind to implement a tiny command
language understood by the status text reader, e.g. to provide a
very basic configuration interface -- which would work similiar
to wmii's ctl files. One could do:

tag=2

status=foo bar baz

selcolor=#336677

etc.

Does that make sense?

Regards,
Anselm



On Thu, Dec 06, 2007 at 09:54:35AM +0100, Anselm R. Garbe wrote:
 Well, the only thing which is missing that dwm keeps state of
 the currently selected tags. The idea is that dwm putenv's the
 currently selected tags whenever they change and a newly spawned
 dwm instance looks for that environment variable and pre-selects
 those tags. Then a clean restart will behave like reapplying all
 tagging rules beside persisting the selected tags.
 
 What do you think about this proposal? I think of something
 like:
 
 DWMTAGS=1:2:www
 
 You could as well define them in your X start script and dwm
 will use those instead.
 
 Regards,
   Anselm
 
 On Wed, Dec 05, 2007 at 09:15:41AM +0100, Anselm R. Garbe wrote:
  Hi,
  
  Let me think about this proposal. Restarting dwm should do the
  job, maybe it's a good idea to have a restart function in
  opposite to quit as well.
  
  Regards,
  Anselm
  
  
  On Wed, Dec 05, 2007 at 12:44:38AM +0100, Antoni Grzymala wrote:
   Hi,
   
   just came across another idea. How about implementing a function in dwm
   that would reapply all the predefined rules (float/non-float, tagging)
   to all clients in a dwm session.
   
   This could either be a function bindable to a keystroke, or dwm reacting
   to a signal (say, HUP), or what not.
   
   This way, when I do a total mess with tagging and floating my clients
   (sometimes it happens and I get lost) I could get my everyday dwm state
   with one keystroke or command.
   
   What do you think?
   
   I presume this could also be achieved by restarting dwm, but this
   doesn't seem too clean to me, and also would not integrate well with a
   login manager (from what it seems).
   
   If something like that is already there, excuse my infinite dumbness for
   not noticing.
   
   Best,
   
   -- 
   [a]
  
  
  
  -- 
   Anselm R. Garbe  http://www.suckless.org/  GPG key: 0D73F361
  
 
 -- 
  Anselm R. Garbe  http://www.suckless.org/  GPG key: 0D73F361
 

-- 
 Anselm R. Garbe  http://www.suckless.org/  GPG key: 0D73F361



Re: [dwm] dwm wish, a tidy-up function

2007-12-06 Thread Sander van Dijk
On Dec 6, 2007 11:23 AM, Anselm R. Garbe [EMAIL PROTECTED] wrote:
 Ok, but the DWMTAGS idea is ok for everyone?

Would that work? If the new dwm is a child of the old one it would,
but when the dwm restart is controlled by a shell loop such as

while true
do
dwm
done

I believe this wouldn't work, right?

Gr. Sander.



Re: [dwm] dwm wish, a tidy-up function

2007-12-06 Thread Nagy Mate
 Ok, but the DWMTAGS idea is ok for everyone?
 it's ok. how about saving the state for viewprevtags, too, in a similar
manner?

Mate



Re: [dwm] dwm wish, a tidy-up function

2007-12-06 Thread Antoni Grzymala
Anselm R. Garbe dixit (2007-12-06, 09:54):

   This way, when I do a total mess with tagging and floating my clients
   (sometimes it happens and I get lost) I could get my everyday dwm state
   with one keystroke or command.

 Well, the only thing which is missing that dwm keeps state of
 the currently selected tags. The idea is that dwm putenv's the
 currently selected tags whenever they change and a newly spawned
 dwm instance looks for that environment variable and pre-selects
 those tags. Then a clean restart will behave like reapplying all
 tagging rules beside persisting the selected tags.

Hi,

this is possibly a cool idea, but it contradicts a little my
cleanup/tidyup idea, as described in the quoting above yours. I think
that a function (however implemented) brining back a pristine state of
dwm and the clients (rules reapplied, viewing only tag one, or some
other defafult (but default, not inherited)) is what I'd expect from a
tidyup function.

As to the minilanguage I also agree it should stay out.

What do you think?

Regards,

-- 
[a]


signature.asc
Description: Podpis cyfrowy :: Digital signature


Re: [dwm] dwm wish, a tidy-up function

2007-12-06 Thread Chris Webb
Sander van Dijk [EMAIL PROTECTED] writes:

 On Dec 6, 2007 11:23 AM, Anselm R. Garbe [EMAIL PROTECTED] wrote:
  Ok, but the DWMTAGS idea is ok for everyone?
 
 Would that work? If the new dwm is a child of the old one it would,
 but when the dwm restart is controlled by a shell loop such as
 
 while true
 do
 dwm
 done
 
 I believe this wouldn't work, right?

If dwm were to produce the list of selected tags on stdout on exit and
could accept a list of tags as arguments on startup, this would allow a
'restart by quit' without losing the selected tags and without requiring a
special 'quit and exec' function.

Also, if the point of a restart is just to retag windows according to the
rules, wouldn't it be cleaner to implement just that rather than a full
re-exec?

Best wishes,

Chris.



Re: [dwm] dwm wish, a tidy-up function

2007-12-06 Thread Ritesh Kumar
n Dec 6, 2007 5:23 AM, Anselm R. Garbe [EMAIL PROTECTED] wrote:

 On Thu, Dec 06, 2007 at 11:18:49AM +0100, Sander van Dijk wrote:
  On Dec 6, 2007 10:06 AM, Marc Andre Tanner [EMAIL PROTECTED] wrote:
   No. At least not in my opinion, please keep it simple  stupid.
   Thanks for the excellent work.
 
  I agree. If anything, I think I'd prefer a .dwmrc.

 Ok, but the DWMTAGS idea is ok for everyone?


I am wondering how will that work if we have two windows from the same
process. While keeping TAGS (and possibly floating state) in the environment
can eliminate the need for regex based client matching, I still would like
to segregate windows from the same process with different tags.
I was wondering if X11 supports some kind of window metadata atom which the
window manager could use to store some custom data? Dwm could just publish
the tags for a window there and use it on a restart.

Ritesh


 Regards,
 --
  Anselm R. Garbe  http://www.suckless.org/  GPG key: 0D73F361




Re: [dwm] dwm wish, a tidy-up function

2007-12-06 Thread Ritesh Kumar
On Dec 6, 2007 10:07 AM, Ritesh Kumar [EMAIL PROTECTED] wrote:

 n Dec 6, 2007 5:23 AM, Anselm R. Garbe [EMAIL PROTECTED] wrote:

  On Thu, Dec 06, 2007 at 11:18:49AM +0100, Sander van Dijk wrote:
   On Dec 6, 2007 10:06 AM, Marc Andre Tanner [EMAIL PROTECTED] wrote:
 
No. At least not in my opinion, please keep it simple  stupid.
Thanks for the excellent work.
  
   I agree. If anything, I think I'd prefer a .dwmrc.
 
  Ok, but the DWMTAGS idea is ok for everyone?
 

 I am wondering how will that work if we have two windows from the same
 process. While keeping TAGS (and possibly floating state) in the environment
 can eliminate the need for regex based client matching, I still would like
 to segregate windows from the same process with different tags.
 I was wondering if X11 supports some kind of window metadata atom which
 the window manager could use to store some custom data? Dwm could just
 publish the tags for a window there and use it on a restart.

 Ritesh


http://tronche.com/gui/x/xlib/window-information/properties-and-atoms.html

A little search on google brought me to this site...

Ritesh


Re: [dwm] dwm wish, a tidy-up function

2007-12-06 Thread Robert Figura
Anselm R. Garbe [EMAIL PROTECTED] wrote:

 There comes my old idea into mind to implement a tiny command
 language understood by the status text reader, e.g. to provide a
 very basic configuration interface -- which would work similiar
 to wmii's ctl files. One could do:
[...]

I'm planning to implement a regex based key-handler gateway in
dwm-rfigura but until now i havenn't written any line to implement
it.

It felt like it would disagree with dwm't philosophy so i never asked.

Alone it wouldn't make very much sense anyways (except maybe for the
killclient function which currently cannot be triggered by an external
menu program. At least i didn't grok how to do it with an external
command).

So the next interesting thing would be to implement the other way
around: Let dwm print events like focus change, window creation and
maybe some more on stdout.

It may be overkill but the wm seems to be the correct place to acquire
such information. Let's see if it is useful for completely managed
evironments (like a POI running X).

Regards
  - Robert Figura

-- 
http://spuerwerk.dyndns.org/~rfigura/dwm/




Re: [dwm] dwm wish, a tidy-up function

2007-12-06 Thread Anselm R. Garbe
On Thu, Dec 06, 2007 at 10:56:56AM +, Chris Webb wrote:
 Sander van Dijk [EMAIL PROTECTED] writes:
 
  On Dec 6, 2007 11:23 AM, Anselm R. Garbe [EMAIL PROTECTED] wrote:
   Ok, but the DWMTAGS idea is ok for everyone?
  
  Would that work? If the new dwm is a child of the old one it would,
  but when the dwm restart is controlled by a shell loop such as
  
  while true
  do
  dwm
  done
  
  I believe this wouldn't work, right?
 
 If dwm were to produce the list of selected tags on stdout on exit and
 could accept a list of tags as arguments on startup, this would allow a
 'restart by quit' without losing the selected tags and without requiring a
 special 'quit and exec' function.
 
 Also, if the point of a restart is just to retag windows according to the
 rules, wouldn't it be cleaner to implement just that rather than a full
 re-exec?

I agree on the idea to have a re-apply function, which applies
all tagging rules during runtime to all windows, without
restarting dwm. That seems to be the change which sucks less and
without any cornercases.

Regards,
-- 
 Anselm R. Garbe  http://www.suckless.org/  GPG key: 0D73F361



Re: [dwm] dwm wish, a tidy-up function

2007-12-06 Thread Anselm R. Garbe
On Thu, Dec 06, 2007 at 08:42:03PM +0100, Szabolcs Nagy wrote:
 On 12/6/07, Anselm R. Garbe [EMAIL PROTECTED] wrote:
  dwm is not intended being restarted that frequently which would
  justify tag persistence in an X property based way.
 
 what about a store_state function (can be user defined in config.h)
 that  stores tag information in some way in X (or in a .rc file) and a
 restore_state function?
 
 for restore_state some kind of startup event handler is needed in
 config.h (pressing keys for restoring is a bit uncomfortable)
 
 a startup event may have other uses as well
 so if there is a consistent way (with key bindings) to put it into
 config.h then i prefer this solution and let the user solve the
 problem
 (what to do when widows are closed and opened before restore or when
 tag names changed in dwm config, what info do we exactly want to
 store...)

Only as a patch, not as mainstream functionality ;)

Regards,
-- 
 Anselm R. Garbe  http://www.suckless.org/  GPG key: 0D73F361



Re: [dwm] dwm wish, a tidy-up function

2007-12-06 Thread Karl.
On Thu, Dec 06, 2007 at 05:32:58PM +, Robert Figura wrote:
 So the next interesting thing would be to implement the other way
 around: Let dwm print events like focus change, window creation and
 maybe some more on stdout.

I've always thought this would be fun, in order to implement tracking of 
what windows I spend my time in (and who I should be invoicing for my 
time) - sometimes (often) I wonder where my day has gone.  If dwm were 
outputting info about what has focus then I could log that and produce a 
nice summary.

I started to implement something once, but then there was a new hg tip 
which conflicted with my changes, and I never got back to it.  I also 
thought about having an external app looking at the state of the system 
at regular intervals, but it just makes more sense to me that the window 
manager provide the information that it has, when something happens.


Karl.
-- 
http://mowson.org/karl



Re: [dwm] dwm wish, a tidy-up function

2007-12-06 Thread Szabolcs Nagy
On 12/6/07, Anselm R. Garbe [EMAIL PROTECTED] wrote:
 On Thu, Dec 06, 2007 at 08:42:03PM +0100, Szabolcs Nagy wrote:
  for restore_state some kind of startup event handler is needed in
  config.h (pressing keys for restoring is a bit uncomfortable)

 Only as a patch, not as mainstream functionality ;)

well i wanted to say that if it is solvable in userland then i'd go that way

of course a mainstream solution won't mess (much) with config.h


the DWMTAGS env-var + re-apply rules is fairly simple, but it won't
help me much since i don't have rules for most of the programs i use

processing input as commands is interesting, but.. put a parser in dwm?
either a *very* simple parser or scripting comes to mind (libdwm +
your fav language  shell hackery + complex parser)



Re: [dwm] dwm wish, a tidy-up function

2007-12-05 Thread Anselm R. Garbe
Hi,

Let me think about this proposal. Restarting dwm should do the
job, maybe it's a good idea to have a restart function in
opposite to quit as well.

Regards,
Anselm


On Wed, Dec 05, 2007 at 12:44:38AM +0100, Antoni Grzymala wrote:
 Hi,
 
 just came across another idea. How about implementing a function in dwm
 that would reapply all the predefined rules (float/non-float, tagging)
 to all clients in a dwm session.
 
 This could either be a function bindable to a keystroke, or dwm reacting
 to a signal (say, HUP), or what not.
 
 This way, when I do a total mess with tagging and floating my clients
 (sometimes it happens and I get lost) I could get my everyday dwm state
 with one keystroke or command.
 
 What do you think?
 
 I presume this could also be achieved by restarting dwm, but this
 doesn't seem too clean to me, and also would not integrate well with a
 login manager (from what it seems).
 
 If something like that is already there, excuse my infinite dumbness for
 not noticing.
 
 Best,
 
 -- 
 [a]



-- 
 Anselm R. Garbe  http://www.suckless.org/  GPG key: 0D73F361



[dwm] dwm wish, a tidy-up function

2007-12-04 Thread Antoni Grzymala
Hi,

just came across another idea. How about implementing a function in dwm
that would reapply all the predefined rules (float/non-float, tagging)
to all clients in a dwm session.

This could either be a function bindable to a keystroke, or dwm reacting
to a signal (say, HUP), or what not.

This way, when I do a total mess with tagging and floating my clients
(sometimes it happens and I get lost) I could get my everyday dwm state
with one keystroke or command.

What do you think?

I presume this could also be achieved by restarting dwm, but this
doesn't seem too clean to me, and also would not integrate well with a
login manager (from what it seems).

If something like that is already there, excuse my infinite dumbness for
not noticing.

Best,

-- 
[a]


signature.asc
Description: Podpis cyfrowy :: Digital signature


Re: [dwm] dwm wish, a tidy-up function

2007-12-04 Thread Don Stewart
antoni:
 Hi,
 
 just came across another idea. How about implementing a function in dwm
 that would reapply all the predefined rules (float/non-float, tagging)
 to all clients in a dwm session.
 
 This could either be a function bindable to a keystroke, or dwm reacting
 to a signal (say, HUP), or what not.
 
 This way, when I do a total mess with tagging and floating my clients
 (sometimes it happens and I get lost) I could get my everyday dwm state
 with one keystroke or command.
 
 What do you think?
 
 I presume this could also be achieved by restarting dwm, but this
 doesn't seem too clean to me, and also would not integrate well with a
 login manager (from what it seems).
 
 If something like that is already there, excuse my infinite dumbness for
 not noticing.

We added mod-shift-space (rest workspace to default settings) recently
to xmonad -- it becomes particular useful once you start serialising
state, across restarts.

-- Don



Re: [dwm] dwm wish, a tidy-up function

2007-12-04 Thread Ritesh Kumar
On Dec 4, 2007 6:44 PM, Antoni Grzymala [EMAIL PROTECTED] wrote:

 Hi,

 just came across another idea. How about implementing a function in dwm
 that would reapply all the predefined rules (float/non-float, tagging)
 to all clients in a dwm session.

 This could either be a function bindable to a keystroke, or dwm reacting
 to a signal (say, HUP), or what not.

 This way, when I do a total mess with tagging and floating my clients
 (sometimes it happens and I get lost) I could get my everyday dwm state
 with one keystroke or command.

 What do you think?

 I presume this could also be achieved by restarting dwm, but this
 doesn't seem too clean to me, and also would not integrate well with a
 login manager (from what it seems).

 If something like that is already there, excuse my infinite dumbness for
 not noticing.

 Best,


I too get lost when I have floating and tiled windows in my view. I think a
shortcut to just tile everything  visible (without forgetting the tags) will
rescue me.
Infact what do you think about putting tags in the windows (associated
atoms?) themselves so that tags are preserved after a dwm restart?

Ritesh