change behaviour of uicb_setlayout: no arg now reset to first/default layout ; add bindings in default config

This commit is contained in:
Julien Danjou 2007-10-02 14:28:39 +02:00
parent 4c4fb83e81
commit d76902653a
2 changed files with 9 additions and 8 deletions

View File

@ -66,7 +66,8 @@ awesome:
# Keys binding # Keys binding
keys = ((("Mod4"), "Return", "spawn", "exec xterm"), keys = ((("Mod4"), "Return", "spawn", "exec xterm"),
(("Mod4"), "space", "setlayout"), (("Mod4"), "space", "setlayout", "+1"),
(("Mod4", "Shift"), "space", "setlayout", "-1"),
(("Mod4"), "b", "togglebar"), (("Mod4"), "b", "togglebar"),
(("Mod4"), "j", "focusnext"), (("Mod4"), "j", "focusnext"),
(("Mod4"), "k", "focusprev"), (("Mod4"), "k", "focusprev"),

View File

@ -166,14 +166,14 @@ uicb_setlayout(Display *disp,
int i; int i;
Client *c; Client *c;
for(i = 0; i < awesomeconf->nlayouts && &awesomeconf->layouts[i] != awesomeconf->current_layout; i++); if(arg)
{
if(!arg) for(i = 0; i < awesomeconf->nlayouts && &awesomeconf->layouts[i] != awesomeconf->current_layout; i++);
i++;
else
i = compute_new_value_from_arg(arg, (double) i); i = compute_new_value_from_arg(arg, (double) i);
if(i < 0 || i >= awesomeconf->nlayouts)
if(i < 0 || i >= awesomeconf->nlayouts) i = 0;
}
else
i = 0; i = 0;
awesomeconf->current_layout = &awesomeconf->layouts[i]; awesomeconf->current_layout = &awesomeconf->layouts[i];