|
|
@ -20,17 +20,13 @@ typedef struct {
|
|
|
|
Arg arg;
|
|
|
|
Arg arg;
|
|
|
|
} Key;
|
|
|
|
} Key;
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
const char *browse[] = { "firefox", NULL };
|
|
|
|
const char *browse[] = { "firefox", NULL };
|
|
|
|
const char *gimp[] = { "gimp", NULL };
|
|
|
|
const char *gimp[] = { "gimp", NULL };
|
|
|
|
*/
|
|
|
|
const char *term[] = {
|
|
|
|
const char *term[] = { "xterm", NULL };
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
"urxvtc", "-tr", "+sb", "-bg", "black", "-fg", "white", "-cr", "white",
|
|
|
|
"urxvtc", "-tr", "+sb", "-bg", "black", "-fg", "white", "-cr", "white",
|
|
|
|
"-fn", "-*-terminus-medium-*-*-*-13-*-*-*-*-*-iso10646-*", NULL
|
|
|
|
"-fn", "-*-terminus-medium-*-*-*-13-*-*-*-*-*-iso10646-*", NULL
|
|
|
|
};
|
|
|
|
};
|
|
|
|
coonst char *xlock[] = { "xlock", NULL };
|
|
|
|
const char *xlock[] = { "xlock", NULL };
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static Key key[] = {
|
|
|
|
static Key key[] = {
|
|
|
|
/* modifier key function arguments */
|
|
|
|
/* modifier key function arguments */
|
|
|
@ -56,13 +52,11 @@ static Key key[] = {
|
|
|
|
{ MODKEY|ShiftMask, XK_2, replacetag, { .i = Twww } },
|
|
|
|
{ MODKEY|ShiftMask, XK_2, replacetag, { .i = Twww } },
|
|
|
|
{ MODKEY|ShiftMask, XK_3, replacetag, { .i = Twork } },
|
|
|
|
{ MODKEY|ShiftMask, XK_3, replacetag, { .i = Twork } },
|
|
|
|
{ MODKEY|ShiftMask, XK_c, killclient, { 0 } },
|
|
|
|
{ MODKEY|ShiftMask, XK_c, killclient, { 0 } },
|
|
|
|
/*
|
|
|
|
|
|
|
|
{ MODKEY|ShiftMask, XK_g, spawn, { .argv = gimp } },
|
|
|
|
{ MODKEY|ShiftMask, XK_g, spawn, { .argv = gimp } },
|
|
|
|
{ MODKEY|ShiftMask, XK_l, spawn, { .argv = xlock } },
|
|
|
|
{ MODKEY|ShiftMask, XK_l, spawn, { .argv = xlock } },
|
|
|
|
*/
|
|
|
|
|
|
|
|
{ MODKEY|ShiftMask, XK_q, quit, { 0 } },
|
|
|
|
{ MODKEY|ShiftMask, XK_q, quit, { 0 } },
|
|
|
|
{ MODKEY|ShiftMask, XK_space, dofloat, { 0 } },
|
|
|
|
{ MODKEY|ShiftMask, XK_space, dofloat, { 0 } },
|
|
|
|
/*{ MODKEY|ShiftMask, XK_w, spawn, { .argv = browse } },*/
|
|
|
|
{ MODKEY|ShiftMask, XK_w, spawn, { .argv = browse } },
|
|
|
|
{ MODKEY|ShiftMask, XK_Return, spawn, { .argv = term } },
|
|
|
|
{ MODKEY|ShiftMask, XK_Return, spawn, { .argv = term } },
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
@ -71,10 +65,10 @@ static Key key[] = {
|
|
|
|
static void
|
|
|
|
static void
|
|
|
|
movemouse(Client *c)
|
|
|
|
movemouse(Client *c)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
XEvent ev;
|
|
|
|
|
|
|
|
int x1, y1, ocx, ocy, di;
|
|
|
|
int x1, y1, ocx, ocy, di;
|
|
|
|
unsigned int dui;
|
|
|
|
unsigned int dui;
|
|
|
|
Window dummy;
|
|
|
|
Window dummy;
|
|
|
|
|
|
|
|
XEvent ev;
|
|
|
|
|
|
|
|
|
|
|
|
ocx = c->x;
|
|
|
|
ocx = c->x;
|
|
|
|
ocy = c->y;
|
|
|
|
ocy = c->y;
|
|
|
@ -105,9 +99,9 @@ movemouse(Client *c)
|
|
|
|
static void
|
|
|
|
static void
|
|
|
|
resizemouse(Client *c)
|
|
|
|
resizemouse(Client *c)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
XEvent ev;
|
|
|
|
|
|
|
|
int ocx, ocy;
|
|
|
|
int ocx, ocy;
|
|
|
|
Corner sticky;
|
|
|
|
Corner sticky;
|
|
|
|
|
|
|
|
XEvent ev;
|
|
|
|
|
|
|
|
|
|
|
|
ocx = c->x;
|
|
|
|
ocx = c->x;
|
|
|
|
ocy = c->y;
|
|
|
|
ocy = c->y;
|
|
|
@ -146,8 +140,8 @@ buttonpress(XEvent *e)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
int x;
|
|
|
|
int x;
|
|
|
|
Arg a;
|
|
|
|
Arg a;
|
|
|
|
XButtonPressedEvent *ev = &e->xbutton;
|
|
|
|
|
|
|
|
Client *c;
|
|
|
|
Client *c;
|
|
|
|
|
|
|
|
XButtonPressedEvent *ev = &e->xbutton;
|
|
|
|
|
|
|
|
|
|
|
|
if(barwin == ev->window) {
|
|
|
|
if(barwin == ev->window) {
|
|
|
|
switch(ev->button) {
|
|
|
|
switch(ev->button) {
|
|
|
@ -201,9 +195,9 @@ buttonpress(XEvent *e)
|
|
|
|
static void
|
|
|
|
static void
|
|
|
|
configurerequest(XEvent *e)
|
|
|
|
configurerequest(XEvent *e)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
Client *c;
|
|
|
|
XConfigureRequestEvent *ev = &e->xconfigurerequest;
|
|
|
|
XConfigureRequestEvent *ev = &e->xconfigurerequest;
|
|
|
|
XWindowChanges wc;
|
|
|
|
XWindowChanges wc;
|
|
|
|
Client *c;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ev->value_mask &= ~CWSibling;
|
|
|
|
ev->value_mask &= ~CWSibling;
|
|
|
|
if((c = getclient(ev->window))) {
|
|
|
|
if((c = getclient(ev->window))) {
|
|
|
@ -248,8 +242,8 @@ destroynotify(XEvent *e)
|
|
|
|
static void
|
|
|
|
static void
|
|
|
|
enternotify(XEvent *e)
|
|
|
|
enternotify(XEvent *e)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
XCrossingEvent *ev = &e->xcrossing;
|
|
|
|
|
|
|
|
Client *c;
|
|
|
|
Client *c;
|
|
|
|
|
|
|
|
XCrossingEvent *ev = &e->xcrossing;
|
|
|
|
|
|
|
|
|
|
|
|
if(ev->mode != NotifyNormal || ev->detail == NotifyInferior)
|
|
|
|
if(ev->mode != NotifyNormal || ev->detail == NotifyInferior)
|
|
|
|
return;
|
|
|
|
return;
|
|
|
@ -263,8 +257,8 @@ enternotify(XEvent *e)
|
|
|
|
static void
|
|
|
|
static void
|
|
|
|
expose(XEvent *e)
|
|
|
|
expose(XEvent *e)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
XExposeEvent *ev = &e->xexpose;
|
|
|
|
|
|
|
|
Client *c;
|
|
|
|
Client *c;
|
|
|
|
|
|
|
|
XExposeEvent *ev = &e->xexpose;
|
|
|
|
|
|
|
|
|
|
|
|
if(ev->count == 0) {
|
|
|
|
if(ev->count == 0) {
|
|
|
|
if(barwin == ev->window)
|
|
|
|
if(barwin == ev->window)
|
|
|
@ -277,10 +271,10 @@ expose(XEvent *e)
|
|
|
|
static void
|
|
|
|
static void
|
|
|
|
keypress(XEvent *e)
|
|
|
|
keypress(XEvent *e)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
XKeyEvent *ev = &e->xkey;
|
|
|
|
|
|
|
|
static unsigned int len = key ? sizeof(key) / sizeof(key[0]) : 0;
|
|
|
|
static unsigned int len = key ? sizeof(key) / sizeof(key[0]) : 0;
|
|
|
|
unsigned int i;
|
|
|
|
unsigned int i;
|
|
|
|
KeySym keysym;
|
|
|
|
KeySym keysym;
|
|
|
|
|
|
|
|
XKeyEvent *ev = &e->xkey;
|
|
|
|
|
|
|
|
|
|
|
|
keysym = XKeycodeToKeysym(dpy, (KeyCode)ev->keycode, 0);
|
|
|
|
keysym = XKeycodeToKeysym(dpy, (KeyCode)ev->keycode, 0);
|
|
|
|
for(i = 0; i < len; i++)
|
|
|
|
for(i = 0; i < len; i++)
|
|
|
@ -303,8 +297,8 @@ leavenotify(XEvent *e)
|
|
|
|
static void
|
|
|
|
static void
|
|
|
|
maprequest(XEvent *e)
|
|
|
|
maprequest(XEvent *e)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
XMapRequestEvent *ev = &e->xmaprequest;
|
|
|
|
|
|
|
|
static XWindowAttributes wa;
|
|
|
|
static XWindowAttributes wa;
|
|
|
|
|
|
|
|
XMapRequestEvent *ev = &e->xmaprequest;
|
|
|
|
|
|
|
|
|
|
|
|
if(!XGetWindowAttributes(dpy, ev->window, &wa))
|
|
|
|
if(!XGetWindowAttributes(dpy, ev->window, &wa))
|
|
|
|
return;
|
|
|
|
return;
|
|
|
@ -322,9 +316,9 @@ maprequest(XEvent *e)
|
|
|
|
static void
|
|
|
|
static void
|
|
|
|
propertynotify(XEvent *e)
|
|
|
|
propertynotify(XEvent *e)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
XPropertyEvent *ev = &e->xproperty;
|
|
|
|
|
|
|
|
Window trans;
|
|
|
|
|
|
|
|
Client *c;
|
|
|
|
Client *c;
|
|
|
|
|
|
|
|
Window trans;
|
|
|
|
|
|
|
|
XPropertyEvent *ev = &e->xproperty;
|
|
|
|
|
|
|
|
|
|
|
|
if(ev->state == PropertyDelete)
|
|
|
|
if(ev->state == PropertyDelete)
|
|
|
|
return; /* ignore */
|
|
|
|
return; /* ignore */
|
|
|
|