Re: How to put windows into groups by application type.

tomm smith <[email protected]>
Newsgroups gmane.comp.window-managers.ratpoison.devel
Message-ID <[email protected]>
I believe I have created a patch for this desired hook. Only had to
change a few lines, basically define the hook and add a hook call to
new_window(). I am a newborn in the C world so if any of this is
hackery that does not comply with GNU coding standards I do apologize.
I have attached the patch to this email. I tested out the code very
shortly I plan to test it more, but initial test showed everything was
working smoothly.

On 3/13/10, Shawn Betts <[email protected]> wrote:
>> So, is there anyway that I could have ratpoison detect when a new
>> window was created and place it in an appropriate group?
>
> There is a hook system in place to call user commands at specific
> events, but there is currently no new window hook to hang your code
> off. If anyone is interested coding such a patch, I'll commit it.
>
> -Shawn
>
>
> _______________________________________________
> Ratpoison-devel mailing list
> [email protected]
> http://lists.nongnu.org/mailman/listinfo/ratpoison-devel
>

_______________________________________________
Ratpoison-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/ratpoison-devel
createwin_hook.diff (text/x-diff, 1.7 KB)
Only in .: config.h
Only in .: config.h.in
Only in .: createwin_hook.diff
Only in .: .deps
diff -crB ./events.c ratpoison/src/events.c
*** ./events.c	2010-03-13 21:46:01.000000000 -0500
--- ratpoison/src/events.c	2010-03-13 21:43:43.000000000 -0500
***************
*** 103,111 ****
        win = add_to_window_list (s, e->window);
        update_window_information (win);
      }
- 	
- 	// created new win so call our hook
- 	hook_run (&rp_new_window_hook);
  }
  
  static void
--- 103,108 ----
diff -crB ./globals.c ratpoison/src/globals.c
*** ./globals.c	2010-03-13 21:46:29.000000000 -0500
--- ratpoison/src/globals.c	2010-03-13 21:43:43.000000000 -0500
***************
*** 231,237 ****
  LIST_HEAD (rp_quit_hook);
  LIST_HEAD (rp_restart_hook);
  LIST_HEAD (rp_delete_window_hook);
- LIST_HEAD (rp_new_window_hook);
  
  struct rp_hook_db_entry rp_hook_db[]=
    {{"key",              &rp_key_hook},
--- 231,236 ----
***************
*** 242,248 ****
     {"deletewindow",     &rp_delete_window_hook},
     {"quit",             &rp_quit_hook},
     {"restart",          &rp_restart_hook},
- 	 {"createwin",				&rp_new_window_hook},
     {NULL, NULL}};
  
  void
--- 241,246 ----
diff -crB ./globals.h ratpoison/src/globals.h
*** ./globals.h	2010-03-13 21:46:42.000000000 -0500
--- ratpoison/src/globals.h	2010-03-13 21:43:43.000000000 -0500
***************
*** 181,187 ****
  extern struct list_head rp_delete_window_hook;
  extern struct list_head rp_quit_hook;
  extern struct list_head rp_restart_hook;
- extern struct list_head rp_new_window_hook;
  
  extern struct rp_hook_db_entry rp_hook_db[];
  
--- 181,186 ----
Only in .: Makefile
Only in .: Makefile.in
Only in .: ratpoison
Only in .: stamp-h1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.