Introduction
Introduction Statistics Contact Development Disclaimer Help
treplaced togglelayout with setlayout - dwm - [fork] customized build of dwm, t…
git clone git://src.adamsgaard.dk/dwm
Log
Files
Refs
README
LICENSE
---
commit 879241c05cbf959304a2dc4f2fabcdcecaea5092
parent 3794c6294535518fdcdf2ceb434875584189aa1e
Author: Anselm R. Garbe <[email protected]>
Date: Mon, 19 Feb 2007 18:33:15 +0100
replaced togglelayout with setlayout
Diffstat:
M config.arg.h | 2 +-
M config.default.h | 6 +++---
M dwm.h | 2 +-
M event.c | 3 ++-
M screen.c | 37 ++++++++++++++++++-----------…
5 files changed, 29 insertions(+), 21 deletions(-)
---
diff --git a/config.arg.h b/config.arg.h
t@@ -63,7 +63,7 @@ static Key key[] = { \
{ MODKEY|ControlMask|ShiftMask, XK_8, toggletag,…
{ MODKEY|ControlMask|ShiftMask, XK_9, toggletag,…
{ MODKEY|ShiftMask, XK_c, killclient, …
- { MODKEY, XK_space, togglelayout, …
+ { MODKEY, XK_space, setlayout, { …
{ MODKEY|ShiftMask, XK_space, toggleversatile,{ …
{ MODKEY, XK_0, view, …
{ MODKEY, XK_1, view, …
diff --git a/config.default.h b/config.default.h
t@@ -58,8 +58,8 @@ static Key key[] = { \
{ MODKEY|ControlMask|ShiftMask, XK_8, toggletag,…
{ MODKEY|ControlMask|ShiftMask, XK_9, toggletag,…
{ MODKEY|ShiftMask, XK_c, killclient, …
- { MODKEY, XK_space, togglelayout, …
- { MODKEY|ShiftMask, XK_space, toggleversatile …
+ { MODKEY, XK_space, setlayout, { …
+ { MODKEY|ShiftMask, XK_space, toggleversatile,{ …
{ MODKEY, XK_0, view, …
{ MODKEY, XK_1, view, …
{ MODKEY, XK_2, view, …
t@@ -86,7 +86,7 @@ static Key key[] = { \
* xprop | awk -F '"' '/^WM_CLASS/ { printf("%s:%s:",$4,$2) }; /^WM_NAME/ { pr…
#define RULES \
static Rule rule[] = { \
- /* class:instance:title regex tags regex versatile */ \
+ /* class:instance:title regex tags regex isversatile */ \
{ "Gimp", NULL, True }, \
{ "MPlayer", NULL, True }, \
{ "Acroread", NULL, True }, \
diff --git a/dwm.h b/dwm.h
t@@ -134,10 +134,10 @@ extern void initlayouts(void); /*…
extern Bool isvisible(Client *c); /* returns True if client is …
extern void resizemaster(Arg *arg); /* resizes the master perce…
extern void restack(void); /* restores z layers of all …
+extern void setlayout(Arg *arg); /* sets layout, -1 toggles */
extern void settags(Client *c, Client *trans); /* sets tags of c */
extern void tag(Arg *arg); /* tags c with arg's index */
extern void toggleversatile(Arg *arg); /* toggles focusesd clie…
-extern void togglelayout(Arg *arg); /* toggles layout */
extern void toggletag(Arg *arg); /* toggles c tags with arg's i…
extern void toggleview(Arg *arg); /* toggles the tag with arg's…
extern void versatile(void); /* arranges all windows ve…
diff --git a/event.c b/event.c
t@@ -140,7 +140,8 @@ buttonpress(XEvent *e) {
if(ev->x < x + blw)
switch(ev->button) {
case Button1:
- togglelayout(NULL);
+ a.i = -1;
+ setlayout(&a);
break;
case Button4:
a.i = 1;
diff --git a/screen.c b/screen.c
t@@ -191,6 +191,28 @@ restack(void) {
}
void
+setlayout(Arg *arg) {
+ unsigned int i;
+
+ if(arg->i == -1) {
+ for(i = 0; i < nlayouts && lt != &layout[i]; i++);
+ if(i == nlayouts - 1)
+ lt = &layout[0];
+ else
+ lt = &layout[++i];
+ }
+ else {
+ if(arg->i < 0 || arg->i >= nlayouts)
+ return;
+ lt = &layout[arg->i];
+ }
+ if(sel)
+ lt->arrange();
+ else
+ drawstatus();
+}
+
+void
settags(Client *c, Client *trans) {
char prop[512];
unsigned int i, j;
t@@ -253,21 +275,6 @@ toggletag(Arg *arg) {
}
void
-togglelayout(Arg *arg) {
- unsigned int i;
-
- for(i = 0; i < nlayouts && lt != &layout[i]; i++);
- if(i == nlayouts - 1)
- lt = &layout[0];
- else
- lt = &layout[++i];
- if(sel)
- lt->arrange();
- else
- drawstatus();
-}
-
-void
toggleversatile(Arg *arg) {
if(!sel || lt->arrange == versatile)
return;
You are viewing proxied material from mx1.adamsgaard.dk. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.