add option to enable/disable virtual switch notifications, remove diagnostic print statements from stick()

This commit is contained in:
Iris Lightshard 2021-02-11 00:37:25 -05:00
parent dd9e049a8c
commit f144036b01
Signed by: Iris Lightshard
GPG key ID: 3B7FBC22144E6398
2 changed files with 5 additions and 6 deletions

View file

@ -13,6 +13,7 @@
#define SMENUBGCOL 0x1f9b92
// #define SHOWSTICK
// #define VIRTNOTIFY
#define SHORTCUTMOD Mod4Mask
#define MODBITS (1<<6)

10
menu.c
View file

@ -362,15 +362,9 @@ unhidec(Client *c, int map)
void
stick(Client *c)
{
printf("BEFORE STICK:\n");
printf("virtual on client: %d\n", c->virt);
printf("virtual: %d\n", virt);
if (numvirtuals > 1 && c->virt >= 0 )
c->virt = -1;
else c->virt = virt;
printf("AFTER STICK:\n");
printf("virtual on client: %d\n", c->virt);
printf("virtual: %d\n", virt);
}
void
@ -436,7 +430,9 @@ switch_to_c(int n, Client *c)
void
switch_to(int n)
{
#ifdef VIRTNOTIFY
static char virtmsg[32];
#endif
if(n == virt)
return;
currents[virt] = current;
@ -457,8 +453,10 @@ switch_to(int n)
signal(SIGINT, SIG_DFL);
signal(SIGTERM, SIG_DFL);
signal(SIGHUP, SIG_DFL);
#ifdef VIRTNOTIFY
sprintf(virtmsg, "virtual: switched to %s", b2items[virt]);
execlp("notify-send", "notify-send", "-c", "virtual", virtmsg, (char*)0);
#endif
}
}