You are not logged in.
I have two questions regarding ratpoison and ratpoisonrc:
1. How do i delete all default binds? They clutter up my help and it's not nice to have 100 lines of unbind =p
2. How do i pass several arguments through one bind? I cannot understand that google didn't yield one interesting result!
example,
bind a delete banish
or any syntax i can think of works
Last edited by hatten (2009-12-04 18:28:02)
Offline
try this:
bind a exec ratpoison -c "delete" -c "banish"
archlinux - please read this and this — twice — then ask questions.
--
http://rsontech.net | http://github.com/rson
Offline
rson's should work for the multiple bindings but as for the unbinding everything, I'm not sure. I think I had a long config file with "unbind". Maybe you can do it on the keymap level. http://www.nongnu.org/ratpoison/doc/Key-Maps.html
Offline
Would it be possible to go and delete/edit a ratpoison file somewhere in /usr and remove the binds?
rson, thanks, I'll try that tomorrow
Offline
Ratpoison doesn't seem to install much at all. I think the bindings are in the program itself. I've attempted to do an "unbind all" type script but haven't figured it out. The only way I know for sure is to edit the source before compiling. I believe it's in the "actions.c" file. So, if you're really adamant about not having any default bindings you may want to install ratpoison without ANY defaults at all, or edit your own in there. I would prefer with none at all, although I don't know the affects it would have on the rest of the program as it may try to find them and err' if it can't. I haven't tried this method but am looking at the file right now.
It comments about this being the "top-level map" so I'm still wondering about the keymaps. Anyway, it looks pretty straight forward as far as simply editing them out, as they all start with "add_keybinding". Starts at line 718 for version 1.4.5 .
718 /* Add the prefix key to the top-level map. */
719 add_keybinding (prefix_key.sym, prefix_key.state, "readkey " ROOT_KEYMAP, top);
720
721 add_keybinding (prefix_key.sym, prefix_key.state, "other", map);
722 add_keybinding (prefix_key.sym, 0, "meta", map);
723 add_keybinding (XK_g, RP_CONTROL_MASK, "abort", map);
724 add_keybinding (XK_0, 0, "select 0", map);
725 add_keybinding (XK_1, 0, "select 1", map);
726 add_keybinding (XK_2, 0, "select 2", map);
727 add_keybinding (XK_3, 0, "select 3", map);
728 add_keybinding (XK_4, 0, "select 4", map);
729 add_keybinding (XK_5, 0, "select 5", map);
730 add_keybinding (XK_6, 0, "select 6", map);
731 add_keybinding (XK_7, 0, "select 7", map);
732 add_keybinding (XK_8, 0, "select 8", map);
733 add_keybinding (XK_9, 0, "select 9", map);
734 add_keybinding (XK_minus, 0, "select -", map);
735 add_keybinding (XK_A, 0, "title", map);
736 add_keybinding (XK_A, RP_CONTROL_MASK, "title", map);
737 add_keybinding (XK_K, 0, "kill", map);
738 add_keybinding (XK_K, RP_CONTROL_MASK, "kill", map);
739 add_keybinding (XK_Return, 0, "next", map);
740 add_keybinding (XK_Return, RP_CONTROL_MASK, "next", map);
741 add_keybinding (XK_a, 0, "time", map);
742 add_keybinding (XK_a, RP_CONTROL_MASK, "time", map);
743 add_keybinding (XK_b, 0, "banish", map);
744 add_keybinding (XK_b, RP_CONTROL_MASK, "banish", map);
745 add_keybinding (XK_c, 0, "exec " TERM_PROG, map);
746 add_keybinding (XK_c, RP_CONTROL_MASK, "exec " TERM_PROG, map);
747 add_keybinding (XK_colon, 0, "colon", map);
748 add_keybinding (XK_exclam, 0, "exec", map);
749 add_keybinding (XK_exclam, RP_CONTROL_MASK, "colon exec " TERM_PROG " -e ", map);
750 add_keybinding (XK_i, 0, "info", map);
751 add_keybinding (XK_i, RP_CONTROL_MASK, "info", map);
752 add_keybinding (XK_k, 0, "delete", map);
753 add_keybinding (XK_k, RP_CONTROL_MASK, "delete", map);
754 add_keybinding (XK_l, 0, "redisplay", map);
755 add_keybinding (XK_l, RP_CONTROL_MASK, "redisplay", map);
756 add_keybinding (XK_m, 0, "lastmsg", map);
757 add_keybinding (XK_m, RP_CONTROL_MASK, "lastmsg", map);
758 add_keybinding (XK_n, 0, "next", map);
759 add_keybinding (XK_n, RP_CONTROL_MASK, "next", map);
760 add_keybinding (XK_p, 0, "prev", map);
761 add_keybinding (XK_p, RP_CONTROL_MASK, "prev", map);
762 add_keybinding (XK_quoteright, 0, "select", map);
763 add_keybinding (XK_quoteright, RP_CONTROL_MASK, "select", map);
764 add_keybinding (XK_space, 0, "next", map);
765 add_keybinding (XK_space, RP_CONTROL_MASK, "next", map);
766 add_keybinding (XK_v, 0, "version", map);
767 add_keybinding (XK_v, RP_CONTROL_MASK, "version", map);
768 add_keybinding (XK_V, 0, "license", map);
769 add_keybinding (XK_V, RP_CONTROL_MASK, "license", map);
770 add_keybinding (XK_w, 0, "windows", map);
771 add_keybinding (XK_w, RP_CONTROL_MASK, "windows", map);
772 add_keybinding (XK_s, 0, "split", map);
773 add_keybinding (XK_s, RP_CONTROL_MASK, "split", map);
774 add_keybinding (XK_S, 0, "hsplit", map);
775 add_keybinding (XK_S, RP_CONTROL_MASK, "hsplit", map);
776 add_keybinding (XK_Tab, 0, "focus", map);
777 add_keybinding (XK_Tab, RP_META_MASK, "focuslast", map);
778 add_keybinding (XK_Left, RP_CONTROL_MASK, "exchangeleft", map);
779 add_keybinding (XK_Right, RP_CONTROL_MASK, "exchangeright", map);
780 add_keybinding (XK_Up, RP_CONTROL_MASK, "exchangeup", map);
781 add_keybinding (XK_Down, RP_CONTROL_MASK, "exchangedown", map);
782 add_keybinding (XK_Left, 0, "focusleft", map);
783 add_keybinding (XK_Right, 0, "focusright", map);
784 add_keybinding (XK_Up, 0, "focusup", map);
785 add_keybinding (XK_Down, 0, "focusdown", map);
786 add_keybinding (XK_Q, 0, "only", map);
787 add_keybinding (XK_R, 0, "remove", map);
788 add_keybinding (XK_f, 0, "fselect", map);
789 add_keybinding (XK_f, RP_CONTROL_MASK, "fselect", map);
790 add_keybinding (XK_F, 0, "curframe", map);
791 add_keybinding (XK_r, 0, "resize", map);
792 add_keybinding (XK_r, RP_CONTROL_MASK, "resize", map);
793 add_keybinding (XK_question, 0, "help " ROOT_KEYMAP, map);
794 add_keybinding (XK_underscore, RP_CONTROL_MASK, "undo", map);
795 add_keybinding (XK_u, 0, "undo", map);
796 add_keybinding (XK_u, RP_CONTROL_MASK, "undo", map);
797 add_keybinding (XK_U, 0, "redo", map);
798 add_keybinding (XK_x, 0, "swap", map);
799 add_keybinding (XK_x, RP_CONTROL_MASK, "swap", map);
800 add_keybinding (XK_N, 0, "nextscreen", map);
801 add_keybinding (XK_P, 0, "prevscreen", map);
802
803 add_alias ("unbind", "undefinekey " ROOT_KEYMAP);
804 add_alias ("bind", "definekey " ROOT_KEYMAP);
805 add_alias ("split", "vsplit");
806 }
This may be overkill. Could be worth experimenting with though.
Offline
Ouch. For the moment i have a huge list of unbind, and it's really ugly. Is it possible to unbind more than one character per row maybe? Or can you have an external file with the unbinds that you import in the beginning of .ratpoisonrc?
Offline
Hey, hatten, I figured it out! It seems rather simple actually, I can't believe I didn't figure it out before. To unclutter your ~/.ratpoisonrc file with all those "unbinds" you can have a seperate file somewhere out of the way, like ~/.config/.rat/unbindings, and then have your ~/.ratpoisonrc source the file automatically or by command. Example:
#~/.config/.rat/unbindings
#source file for your unbindings and/or bindings
unbind a
unbind A
unbind C-a
unbind C-A
unbind b
...etc...
#this is the ugly file, unseen and out of the way.
And now you just have your regular bindings in the .ratpoisonrc file:
#~/.ratpoisonrc
#unbind all specified in your unbindings file automatically
exec ratpoison -c "source ~/.config/.rat/unbindings"
#now add your regular bindings
bind a exec ratpoison -c "only" -c "select -" (abort/panic/hide!, lol)
bind A abort
...etc...
And/or for a command-only option for unbinding:
#~/.ratpoisonrc
...
bind M-F1 exec ratpoison -c "source ~/.config/.rat/unbindings"
bind M-F2 exec ratpoison -c "source ~/.config/.rat/unbindings" -c "source ~/.config/.rat/alternative-bindings"
...etc...
Last edited by milomouse (2009-12-17 02:44:14)
Offline
Yay, thanks a lot. Here i come .ratpoisonrc!!
Offline
To unclutter your ~/.ratpoisonrc file with all those "unbinds" you can have a seperate file somewhere out of the way, like ~/.config/.rat/unbindings, and then have your ~/.ratpoisonrc source the file automatically or by command.
Ha! I actually did this a few weeks ago, but I had forgotten about this thread. I'm glad you remembered and posted that
archlinux - please read this and this — twice — then ask questions.
--
http://rsontech.net | http://github.com/rson
Offline