about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAnselm R. Garbe <arg@suckless.org>2007-01-14 22:32:26 +0100
committerAnselm R. Garbe <arg@suckless.org>2007-01-14 22:32:26 +0100
commitceea528eff5ccd1bbd11696209fdc60a5383cc41 (patch)
tree6997da5147c7b6e823f2e62cbd42a6080339cea5
parent6c5dc7017cff322b6402b3849c07529f5ab916fe (diff)
downloaddwm-ceea528eff5ccd1bbd11696209fdc60a5383cc41.tar.gz
removed mode label stuff
-rw-r--r--config.arg.h2
-rw-r--r--config.default.h2
-rw-r--r--draw.c2
-rw-r--r--dwm.h4
-rw-r--r--main.c4
-rw-r--r--view.c8
6 files changed, 6 insertions, 16 deletions
diff --git a/config.arg.h b/config.arg.h
index 180395a..92f01b7 100644
--- a/config.arg.h
+++ b/config.arg.h
@@ -7,7 +7,7 @@ const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9", NULL };
 
 #define DEFMODE			dotile		/* dofloat */
 #define FLOATSYMBOL		"><>"
-#define TILESYMBOL		"[%u]="		/* %u is replaced with nmaster */
+#define TILESYMBOL		"[]="
 
 #define FONT			"-*-terminus-medium-r-*-*-14-*-*-*-*-*-*-*"
 #define NORMBGCOLOR		"#222"
diff --git a/config.default.h b/config.default.h
index 73dc489..afd8e85 100644
--- a/config.default.h
+++ b/config.default.h
@@ -7,7 +7,7 @@ const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9", NULL };
 
 #define DEFMODE			dotile		/* dofloat */
 #define FLOATSYMBOL		"><>"
-#define TILESYMBOL		"[%u]="		/* %u is replaced with nmaster */
+#define TILESYMBOL		"[]="
 
 #define FONT			"-*-fixed-medium-r-normal-*-13-*-*-*-*-*-*-*"
 #define NORMBGCOLOR		"#333366"
diff --git a/draw.c b/draw.c
index 0ee362c..8e3962c 100644
--- a/draw.c
+++ b/draw.c
@@ -120,7 +120,7 @@ drawstatus(void) {
 		dc.x += dc.w;
 	}
 	dc.w = bmw;
-	drawtext(mtext, dc.status, False, False);
+	drawtext(arrange == dofloat ? FLOATSYMBOL : TILESYMBOL, dc.status, False, False);
 	x = dc.x + dc.w;
 	dc.w = textw(stext);
 	dc.x = bw - dc.w;
diff --git a/dwm.h b/dwm.h
index 0cdfad2..1a95078 100644
--- a/dwm.h
+++ b/dwm.h
@@ -90,8 +90,7 @@ struct Client {
 };
 
 extern const char *tags[];			/* all tags */
-extern char stext[1024];			/* status text */
-extern char mtext[32];				/* mode text */
+extern char stext[256];				/* status text */
 extern int bx, by, bw, bh, bmw;			/* bar geometry, bar mode label width */
 extern int screen, sx, sy, sw, sh;		/* screen geometry */
 extern int wax, way, wah, waw;			/* windowarea geometry */
@@ -163,6 +162,5 @@ extern void restack(void);			/* restores z layers of all clients */
 extern void togglefloat(Arg *arg);		/* toggles focusesd client between floating/non-floating state */
 extern void togglemode(Arg *arg);		/* toggles global arrange function (dotile/dofloat) */
 extern void toggleview(Arg *arg);		/* toggles the tag with arg's index (in)visible */
-extern void updatemodetext(void);		/* updates mtext */
 extern void view(Arg *arg);			/* views the tag with arg's index */
 extern void zoom(Arg *arg);			/* zooms the focused client to master area, arg is ignored */
diff --git a/main.c b/main.c
index 067f383..645b2e4 100644
--- a/main.c
+++ b/main.c
@@ -17,7 +17,7 @@
 
 /* extern */
 
-char stext[1024], mtext[32];
+char stext[256];
 Bool *seltag;
 int bx, by, bw, bh, bmw, masterd, screen, sx, sy, sw, sh, wax, way, waw, wah;
 unsigned int master, nmaster, ntags, numlockmask;
@@ -134,7 +134,7 @@ setup(void) {
 	sh = DisplayHeight(dpy, screen);
 	master = MASTER;
 	nmaster = NMASTER;
-	updatemodetext();
+	bmw = textw(TILESYMBOL) > textw(FLOATSYMBOL) ? textw(TILESYMBOL) : textw(FLOATSYMBOL);
 	/* bar */
 	bx = sx;
 	by = sy;
diff --git a/view.c b/view.c
index b8dd79a..935525f 100644
--- a/view.c
+++ b/view.c
@@ -152,7 +152,6 @@ incnmaster(Arg *arg) {
 	if((arrange == dofloat) || (nmaster + arg->i < 1) || (wah / (nmaster + arg->i) < bh))
 		return;
 	nmaster += arg->i;
-	updatemodetext();
 	if(sel)
 		arrange();
 	else
@@ -217,7 +216,6 @@ togglefloat(Arg *arg) {
 void
 togglemode(Arg *arg) {
 	arrange = (arrange == dofloat) ? dotile : dofloat;
-	updatemodetext();
 	if(sel)
 		arrange();
 	else
@@ -236,12 +234,6 @@ toggleview(Arg *arg) {
 }
 
 void
-updatemodetext() {
-	snprintf(mtext, sizeof mtext, arrange == dofloat ? FLOATSYMBOL : TILESYMBOL, nmaster);
-	bmw = textw(mtext);
-}
-
-void
 view(Arg *arg) {
 	unsigned int i;
 
54 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674