Skip to content

Commit

Permalink
i don't like the idea to sync configs all the time
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander "polachok" Polakov committed Mar 25, 2008
1 parent 9c4ebe2 commit a1a81ab
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 57 deletions.
2 changes: 1 addition & 1 deletion close.xbm
@@ -1,4 +1,4 @@
#define close_width 6
#define close_height 6
static unsigned char close_bits[] = {
0x21, 0x12, 0x0c, 0x0c, 0x12, 0x21 };
0x00, 0x11, 0x0a, 0x04, 0x0a, 0x11 };
2 changes: 1 addition & 1 deletion config.mk
@@ -1,5 +1,5 @@
# echinus wm version
VERSION = 0.2.2
VERSION = 0.2.3

# Customize below to fit your system

Expand Down
27 changes: 14 additions & 13 deletions echinus.c
Expand Up @@ -1337,21 +1337,20 @@ maprequest(XEvent *e) {

int
smartcheckarea(int x, int y, int w, int h){
/* this one is called for *every*(!) client */
Client *c;
int n = 0;
for(c = clients; c; c = c->next){
if(isvisible(c) && !c->isicon && c->isplaced){
if(c->y + c->h >= y && c->y + c->h <= y + h
/* A Kind Of Magic */
if((c->y + c->h >= y && c->y + c->h <= y + h
&& c->x+c->w >= x && c->x+c->w <= x+w)
n++;
else if(c->x >= x && c->x <= x+w
|| (c->x >= x && c->x <= x+w
&& c->y + c->h >= y && c->y + c->h <= y + h)
n++;
else if(c->x >= x && c->x <= x+w
&& c->y >= y && c->y <= y+h)
n++;
else if(c->x+c->w >= x && c->x+c->w <= x+w
|| (c->x >= x && c->x <= x+w
&& c->y >= y && c->y <= y+h)
|| (c->x+c->w >= x && c->x+c->w <= x+w
&& c->y >= y && c->y <= y+h))
n++;
}
}
Expand All @@ -1364,24 +1363,26 @@ ifloating(void){
int x = wax;
int y = way;
int f;
f = 0;
for(c = clients; c; c = c->next){
if(isvisible(c) && !c->isicon){
f = 0;
while(!c->isplaced){
while(!c->isplaced){
if(c->w > sw/2 && c->h > sw/2){
c->isplaced = True;
/* too big to deal with */
c->isplaced = True;
}
/* i dunno if c->h/4 & c->w/8 are optimal */
for(y = way; y+c->h <= wah && !c->isplaced ; y+=c->h/4){
for(x = wax; x+c->w <= waw && !c->isplaced; x+=c->w/8){
fprintf(stderr, "x = %d y = %d f = %d\n", x, y, f);
/* are you wondering about 0.9 & 0.8 ? */
if(smartcheckarea(x,y,0.9*c->w,0.8*c->h)<=f){
/* got it! a big chunk of "free" space */
resize(c, x+c->th*(rand()%3), y+c->th+c->th*(rand()%3), c->w, c->h, False);
c->isplaced = True;
}
}
}
f++;
f++; /* too many windows hanging around, try another time */
}
c->hastitle = c->hadtitle;
drawclient(c);
Expand Down
71 changes: 34 additions & 37 deletions echinusrc
@@ -1,42 +1,32 @@
// Colors
Echinus*selected.border: #0066ff
Echinus*normal.border: #cccccc
Echinus*selected.bg: #0066ff
Echinus*normal.bg: #cccccc
Echinus*selected.fg: #ffffff
Echinus*normal.fg: #000000
Echinus*selected.button: #ffffff
Echinus*normal.button: #000000
// border
Echinus*selected.border: #262626
Echinus*selected.button: #d3d7cf
Echinus*normal.border: #262626
Echinus*selected.bg: #262626
Echinus*normal.bg: #262626
Echinus*selected.fg: #d3d7cf
Echinus*normal.fg: #b0b4ac
Echinus*normal.button: #262626
Echinus*border: 1

// buttons
Echinus*button.left.pixmap: iconify.xbm
Echinus*button.center.pixmap: max.xbm
Echinus*button.right.pixmap: close.xbm
Echinus*opacity: 0.8

// opacity
Echinus*opacity: 0.9

// font
Echinus*font: fixed-9
Echinus*title: 12

// default terminal
Echinus*terminal: xterm

// free space
Echinus*space.top: 12
Echinus*space.top: 13
Echinus*space.bottom: 0

// tags
Echinus*tags.number: 3
Echinus*tags.number: 7
Echinus*tags.name0: main
Echinus*tags.name1: web
Echinus*tags.name2: gfx

Echinus*tags.name2: doc
Echinus*tags.name3: dev
Echinus*tags.name4: scr
Echinus*tags.name5: gfx
Echinus*tags.name6: misc

// hotkeys
Echinus*togglebar: A + b
Echinus*focusnext: A + j
Echinus*focusprev: A + k
Expand All @@ -47,30 +37,37 @@ Echinus*killclient: AS + c
Echinus*togglefloating: A + space
Echinus*iconify: A + i
Echinus*zoom: A + Return
Echinus*decmwfact: A + h = -0.05
Echinus*incmwfact: A + l = +0.05
Echinus*decnmaster: AS + j = -1
Echinus*incnmaster: AS + k = +1

Echinus*view0: A + F1
Echinus*view1: A + F2
Echinus*view2: A + F3
Echinus*view3: A + F4
Echinus*view4: A + F5
Echinus*view5: A + F6

Echinus*tag0: AS + 1
Echinus*tag1: AS + 2
Echinus*tag2: AS + 3
Echinus*tag3: AS + 4
Echinus*tag4: AS + 5
Echinus*tag5: AS + 6

Echinus*focusview6: A + s

// monocle
Echinus*setlayoutm: A + m
// floating
Echinus*setlayoutf: A + f
// ifloating
Echinus*setlayouti: A + i
// tiled
Echinus*setlayouti: A + a
Echinus*setlayoutt: A + r

// spawns
Echinus*spawn0: A + t = xterm

// rules
Echinus*decmwfact: A + h = -0.05
Echinus*incmwfact: A + l = +0.05
Echinus*decnmaster: AS + j = -1
Echinus*incnmaster: AS + k = +1

Echinus*terminal: xterm

Echinus*rule0: Firefox.* web 0 1
Echinus*rule4: Mplayer.* NULL 1 1
Echinus*rule5: Gimp.* gfx 1 1
2 changes: 1 addition & 1 deletion iconify.xbm
@@ -1,4 +1,4 @@
#define iconify_width 6
#define iconify_height 6
static unsigned char iconify_bits[] = {
0x00, 0x00, 0x00, 0x3f, 0x21, 0x3f };
0x00, 0x00, 0x22, 0x14, 0x08, 0x00 };
8 changes: 4 additions & 4 deletions max.xbm
@@ -1,4 +1,4 @@
#define maximize_width 6
#define maximize_height 6
static unsigned char maximize_bits[] = {
0x3f, 0x21, 0x3f, 0x21, 0x21, 0x3f };
#define max_width 6
#define max_height 6
static unsigned char max_bits[] = {
0x00, 0x00, 0x08, 0x14, 0x22, 0x00 };

0 comments on commit a1a81ab

Please sign in to comment.