mirror of https://github.com/0intro/wmii
Rearrange some things.
This commit is contained in:
parent
e5e4ff284d
commit
398533dfd1
|
@ -4,7 +4,8 @@ syntax: regexp
|
|||
\.([oa]|out|o_pic|so|pyc|pyo|diff)$
|
||||
\.(diff|orig|rej|bak)$
|
||||
\.(aux|idx|ilg|ind|log|toc)$
|
||||
^cmd/(stfo|osd|wiwarp|setfocus)(/|$)
|
||||
^cmd/osd(/|$)
|
||||
^cmd/x11/(stfo|wiclick)\.
|
||||
^(pkg|src)/
|
||||
^doxy
|
||||
/bak/
|
||||
|
|
|
@ -2,7 +2,7 @@ ROOT=..
|
|||
include $(ROOT)/mk/hdr.mk
|
||||
include $(ROOT)/mk/wmii.mk
|
||||
|
||||
BIN = $(ETC)/wmii$(CONFVERSION)
|
||||
BIN = $(GLOBALCONF)
|
||||
DIRS = python \
|
||||
plan9port \
|
||||
ruby
|
||||
|
|
|
@ -5,5 +5,5 @@ include $(ROOT)/mk/wmii.mk
|
|||
DOCS = README
|
||||
EXECS = wmiirc
|
||||
|
||||
DIR = $(ETC)/wmii$(CONFVERSION)/plan9port
|
||||
DIR = $(GLOBALCONF)/plan9port
|
||||
DOCDIR = $(DOC)/alternative_wmiircs/plan9port
|
||||
|
|
|
@ -8,7 +8,7 @@ TEXT = wmiirc.py
|
|||
DIRS = pygmi \
|
||||
pyxp
|
||||
|
||||
DIR = $(ETC)/wmii$(CONFVERSION)/python
|
||||
DIR = $(GLOBALCONF)/python
|
||||
DOCDIR = $(DOC)/alternative_wmiircs/python
|
||||
|
||||
include $(ROOT)/mk/dir.mk
|
||||
|
|
|
@ -9,4 +9,4 @@ BINARY = __init__.py \
|
|||
monitor.py \
|
||||
util.py
|
||||
|
||||
DIR = $(ETC)/wmii$(CONFVERSION)/python/pygmi
|
||||
DIR = $(GLOBALCONF)/python/pygmi
|
||||
|
|
|
@ -12,4 +12,4 @@ BINARY = __init__.py \
|
|||
mux.py \
|
||||
types.py
|
||||
|
||||
DIR = $(ETC)/wmii$(CONFVERSION)/python/pyxp
|
||||
DIR = $(GLOBALCONF)/python/pyxp
|
||||
|
|
|
@ -9,5 +9,5 @@ EXECS = wmiirc
|
|||
TEXT = config.rb \
|
||||
config.yaml
|
||||
|
||||
DIR = $(ETC)/wmii$(CONFVERSION)/ruby
|
||||
DIR = $(GLOBALCONF)/ruby
|
||||
DOCDIR = $(DOC)/alternative_wmiircs/ruby
|
||||
|
|
14
cmd/Makefile
14
cmd/Makefile
|
@ -4,24 +4,18 @@ include $(ROOT)/mk/wmii.mk
|
|||
|
||||
wmiir.c: $(ROOT)/mk/wmii.mk
|
||||
|
||||
DIRS = wmii \
|
||||
keyname \
|
||||
menu \
|
||||
DIRS = menu \
|
||||
strut \
|
||||
tray
|
||||
tray \
|
||||
wmii \
|
||||
x11
|
||||
TARG = wihack \
|
||||
wmii.rc \
|
||||
wmii.sh \
|
||||
wmii9menu \
|
||||
wmiir
|
||||
|
||||
LIBS += $(LIBS9) $(LIBIXP)
|
||||
CFLAGS += $(INCX11)
|
||||
|
||||
include $(ROOT)/mk/many.mk
|
||||
include $(ROOT)/mk/dir.mk
|
||||
|
||||
O9MENU=wmii9menu.o $(ROOT)/lib/libstuff.a $(LIBIXP)
|
||||
wmii9menu.out: $(O9MENU)
|
||||
$(LINK) $@ $(O9MENU) $$(pkg-config --libs $(X11PACKAGES)) -lXext
|
||||
|
||||
|
|
|
@ -1,18 +0,0 @@
|
|||
ROOT= ../..
|
||||
include $(ROOT)/mk/hdr.mk
|
||||
include $(ROOT)/mk/wmii.mk
|
||||
|
||||
main.c: $(ROOT)/mk/wmii.mk
|
||||
|
||||
TARG = click
|
||||
HFILES= dat.h fns.h
|
||||
|
||||
PACKAGES += $(X11PACKAGES) xext xrandr xrender xinerama
|
||||
|
||||
LIB = $(LIBIXP) $(LIBS9)
|
||||
LIBS += -lm -lXtst
|
||||
CFLAGS += -DIXP_NEEDAPI=86
|
||||
OBJ = main
|
||||
|
||||
include $(ROOT)/mk/one.mk
|
||||
|
|
@ -1,77 +0,0 @@
|
|||
/* Copyright ©2008-2010 Kris Maglione <maglione.k at Gmail>
|
||||
* See LICENSE file for license details.
|
||||
*/
|
||||
#include "dat.h"
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
#include "fns.h"
|
||||
|
||||
#define strbcmp(str, const) (strncmp((str), (const), sizeof(const)-1))
|
||||
static int
|
||||
getbase(const char **s, long *sign) {
|
||||
const char *p;
|
||||
int ret;
|
||||
|
||||
ret = 10;
|
||||
*sign = 1;
|
||||
if(**s == '-') {
|
||||
*sign = -1;
|
||||
*s += 1;
|
||||
}else if(**s == '+')
|
||||
*s += 1;
|
||||
|
||||
p = *s;
|
||||
if(!strbcmp(p, "0x")) {
|
||||
*s += 2;
|
||||
ret = 16;
|
||||
}
|
||||
else if(isdigit(p[0])) {
|
||||
if(p[1] == 'r') {
|
||||
*s += 2;
|
||||
ret = p[0] - '0';
|
||||
}
|
||||
else if(isdigit(p[1]) && p[2] == 'r') {
|
||||
*s += 3;
|
||||
ret = 10*(p[0]-'0') + (p[1]-'0');
|
||||
}
|
||||
}
|
||||
else if(p[0] == '0') {
|
||||
ret = 8;
|
||||
}
|
||||
if(ret != 10 && (**s == '-' || **s == '+'))
|
||||
*sign = 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool
|
||||
getlong(const char *s, long *ret) {
|
||||
const char *end;
|
||||
char *rend;
|
||||
int base;
|
||||
long sign;
|
||||
|
||||
end = s+strlen(s);
|
||||
base = getbase(&s, &sign);
|
||||
if(sign == 0)
|
||||
return false;
|
||||
|
||||
*ret = sign * strtol(s, &rend, base);
|
||||
return (end == rend);
|
||||
}
|
||||
|
||||
bool
|
||||
getulong(const char *s, ulong *ret) {
|
||||
const char *end;
|
||||
char *rend;
|
||||
int base;
|
||||
long sign;
|
||||
|
||||
end = s+strlen(s);
|
||||
base = getbase(&s, &sign);
|
||||
if(sign < 1)
|
||||
return false;
|
||||
|
||||
*ret = strtoul(s, &rend, base);
|
||||
return (end == rend);
|
||||
}
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
#include <fmt.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <stuff/x.h>
|
||||
#include <stuff/util.h>
|
||||
#include <ixp.h>
|
||||
|
||||
#define BLOCK(x) do { x; }while(0)
|
||||
|
||||
#ifndef EXTERN
|
||||
# define EXTERN extern
|
||||
#endif
|
||||
|
||||
EXTERN Window win;
|
||||
|
|
@ -1 +0,0 @@
|
|||
|
|
@ -1,60 +0,0 @@
|
|||
/* Copyright ©2006-2010 Kris Maglione <maglione.k at Gmail>
|
||||
* See LICENSE file for license details.
|
||||
*/
|
||||
#define EXTERN
|
||||
#include "dat.h"
|
||||
#include <X11/Xproto.h>
|
||||
#include <X11/extensions/XTest.h>
|
||||
#include <locale.h>
|
||||
#include <string.h>
|
||||
#include "fns.h"
|
||||
|
||||
static const char version[] = "click-"VERSION", "COPYRIGHT"\n";
|
||||
|
||||
static void
|
||||
usage(void) {
|
||||
fatal("usage: %s [window]\n", argv0);
|
||||
}
|
||||
|
||||
static void
|
||||
click(Window *w, Point p) {
|
||||
Rectangle r;
|
||||
Point rp;
|
||||
|
||||
r = getwinrect(w);
|
||||
rp = subpt(r.max, p);
|
||||
|
||||
XTestFakeMotionEvent(display, 0, rp.x, rp.y, 0);
|
||||
|
||||
XTestFakeButtonEvent(display, 1, true, 0);
|
||||
XTestFakeButtonEvent(display, 1, false, 0);
|
||||
|
||||
XTestFakeMotionEvent(display, 0, r.max.x, r.max.y, 0);
|
||||
}
|
||||
|
||||
int
|
||||
main(int argc, char *argv[]) {
|
||||
char *s;
|
||||
|
||||
ARGBEGIN{
|
||||
default:
|
||||
usage();
|
||||
}ARGEND;
|
||||
|
||||
initdisplay();
|
||||
|
||||
s = ARGF();
|
||||
if(s && !getulong(s, &win.xid))
|
||||
usage();
|
||||
if (!s)
|
||||
win.xid = getfocus();
|
||||
|
||||
if(argc)
|
||||
usage();
|
||||
|
||||
click(&win, Pt(1, 1));
|
||||
|
||||
XCloseDisplay(display);
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
ROOT= ../..
|
||||
include $(ROOT)/mk/hdr.mk
|
||||
include $(ROOT)/mk/wmii.mk
|
||||
|
||||
main.c: $(ROOT)/mk/wmii.mk
|
||||
|
||||
TARG = wikeyname
|
||||
|
||||
PACKAGES += $(X11PACKAGES)
|
||||
|
||||
LIB = $(LIBS9)
|
||||
OBJ = main
|
||||
|
||||
include $(ROOT)/mk/one.mk
|
||||
|
|
@ -15,28 +15,6 @@ struct Key {
|
|||
|
||||
static Key* bindings;
|
||||
|
||||
static void
|
||||
init_numlock(void) {
|
||||
static int masks[] = {
|
||||
ShiftMask, LockMask, ControlMask, Mod1Mask,
|
||||
Mod2Mask, Mod3Mask, Mod4Mask, Mod5Mask
|
||||
};
|
||||
XModifierKeymap *modmap;
|
||||
KeyCode kcode;
|
||||
int i, max;
|
||||
|
||||
modmap = XGetModifierMapping(display);
|
||||
kcode = keycode("Num_Lock");
|
||||
if(kcode)
|
||||
if(modmap && modmap->max_keypermod > 0) {
|
||||
max = nelem(masks) * modmap->max_keypermod;
|
||||
for(i = 0; i < max; i++)
|
||||
if(modmap->modifiermap[i] == kcode)
|
||||
numlock = masks[i / modmap->max_keypermod];
|
||||
}
|
||||
XFreeModifiermap(modmap);
|
||||
}
|
||||
|
||||
/*
|
||||
* To do: Find my red black tree implementation.
|
||||
*/
|
||||
|
@ -50,7 +28,7 @@ parse_keys(char *spec) {
|
|||
int i, nlines, nwords;
|
||||
|
||||
if(!numlock)
|
||||
init_numlock();
|
||||
numlock = numlockmask();
|
||||
|
||||
nlines = tokenize(lines, nelem(lines), spec, '\n');
|
||||
for(i=0; i < nlines; i++) {
|
||||
|
|
|
@ -6,30 +6,6 @@
|
|||
#include <X11/keysym.h>
|
||||
#include "fns.h"
|
||||
|
||||
void
|
||||
init_lock_keys(void) {
|
||||
static int masks[] = {
|
||||
ShiftMask, LockMask, ControlMask, Mod1Mask, Mod2Mask,
|
||||
Mod3Mask, Mod4Mask, Mod5Mask
|
||||
};
|
||||
XModifierKeymap *modmap;
|
||||
KeyCode numlock;
|
||||
int i, max;
|
||||
|
||||
numlock_mask = 0;
|
||||
modmap = XGetModifierMapping(display);
|
||||
numlock = keycode("Num_Lock");
|
||||
if(numlock)
|
||||
if(modmap && modmap->max_keypermod > 0) {
|
||||
max = nelem(masks) * modmap->max_keypermod;
|
||||
for(i = 0; i < max; i++)
|
||||
if(modmap->modifiermap[i] == numlock)
|
||||
numlock_mask = masks[i / modmap->max_keypermod];
|
||||
}
|
||||
XFreeModifiermap(modmap);
|
||||
valid_mask = 255 & ~(numlock_mask | LockMask);
|
||||
}
|
||||
|
||||
static void
|
||||
freekey(Key *k) {
|
||||
Key *n;
|
||||
|
@ -43,7 +19,7 @@ freekey(Key *k) {
|
|||
static void
|
||||
_grab(XWindow w, int keycode, uint mod) {
|
||||
XGrabKey(display, keycode, mod, w,
|
||||
true, GrabModeAsync, GrabModeAsync);
|
||||
true, GrabModeAsync, GrabModeAsync);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -66,12 +42,12 @@ ungrabkey(Key *k) {
|
|||
}
|
||||
}
|
||||
|
||||
static Key *
|
||||
static Key*
|
||||
name2key(const char *name) {
|
||||
Key *k;
|
||||
|
||||
for(k=key; k; k=k->lnext)
|
||||
if(!strncmp(k->name, name, sizeof k->name))
|
||||
if(!strcmp(k->name, name))
|
||||
return k;
|
||||
return nil;
|
||||
}
|
||||
|
@ -218,22 +194,21 @@ update_keys(void) {
|
|||
Key *k;
|
||||
char *l, *p;
|
||||
|
||||
init_lock_keys();
|
||||
numlock_mask = numlockmask();
|
||||
valid_mask = 0xff & ~(numlock_mask | LockMask);
|
||||
while((k = key)) {
|
||||
key = key->lnext;
|
||||
ungrabkey(k);
|
||||
freekey(k);
|
||||
}
|
||||
for(l = p = def.keys; p && *p;) {
|
||||
for(l = p = def.keys; p && *p; p++) {
|
||||
if(*p == '\n') {
|
||||
*p = 0;
|
||||
if((k = getkey(l)))
|
||||
grabkey(k);
|
||||
*p = '\n';
|
||||
l = ++p;
|
||||
l = p + 1;
|
||||
}
|
||||
else
|
||||
p++;
|
||||
}
|
||||
if(l < p && strlen(l)) {
|
||||
if((k = getkey(l)))
|
||||
|
|
|
@ -92,9 +92,9 @@ init_environment(void) {
|
|||
setenv("WMII_ADDRESS", address, true);
|
||||
else
|
||||
address = smprint("unix!%s/wmii", ns_path);
|
||||
setenv("WMII_CONFPATH", sxprint("%s/.wmii%s:%s/wmii%s",
|
||||
getenv("HOME"), CONFVERSION,
|
||||
CONFPREFIX, CONFVERSION), true);
|
||||
setenv("WMII_CONFPATH",
|
||||
sxprint("%s/.%s:%s", getenv("HOME"), CONFDIR, GLOBALCONF),
|
||||
true);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -398,7 +398,7 @@ main(int argc, char *argv[]) {
|
|||
|
||||
init_traps();
|
||||
init_cursors();
|
||||
init_lock_keys();
|
||||
update_keys();
|
||||
ewmh_init();
|
||||
xext_init();
|
||||
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
ROOT= ../..
|
||||
include $(ROOT)/mk/hdr.mk
|
||||
include $(ROOT)/mk/wmii.mk
|
||||
|
||||
TARG = wikeyname \
|
||||
wmii9menu
|
||||
|
||||
PACKAGES += $(X11PACKAGES)
|
||||
|
||||
LIB = $(LIBS9) $(LIBIXP)
|
||||
LIBS += $(LIB)
|
||||
CFLAGS += $(INCX11)
|
||||
|
||||
wiclick.out: wiclick.o
|
||||
$(LINK) $@ $< -lXtst
|
||||
|
||||
include $(ROOT)/mk/many.mk
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
/* Copyight 2008 Kris Maglione <maglione.k at Gmail>
|
||||
* See LICENSE file for license details.
|
||||
*/
|
||||
#include <ctype.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdbool.h>
|
||||
#include <string.h>
|
||||
#include <stuff/x.h>
|
||||
#include <stuff/util.h>
|
||||
#include <fmt.h>
|
||||
|
||||
int
|
||||
main(int argc, char *argv[]) {
|
||||
XWindow w;
|
||||
|
||||
ARGBEGIN{
|
||||
}ARGEND;
|
||||
|
||||
initdisplay();
|
||||
|
||||
if(!getulong(EARGF(exit(1)), &w))
|
||||
exit(1);
|
||||
|
||||
XSetInputFocus(display, w, RevertToParent, CurrentTime);
|
||||
XCloseDisplay(display);
|
||||
}
|
||||
|
|
@ -30,6 +30,7 @@ main(int argc, char *argv[]) {
|
|||
if(argc)
|
||||
usage();
|
||||
|
||||
fmtinstall('K', fmtkey);
|
||||
initdisplay();
|
||||
|
||||
selectinput(&scr.root, KeyPressMask|KeyReleaseMask);
|
||||
|
@ -46,25 +47,11 @@ main(int argc, char *argv[]) {
|
|||
|
||||
static bool
|
||||
kdown_event(Window *w, void *aux, XKeyEvent *ev) {
|
||||
Fmt f;
|
||||
char buf[32];
|
||||
char *key;
|
||||
KeySym ksym;
|
||||
int num;
|
||||
|
||||
USED(aux);
|
||||
USED(w, aux);
|
||||
nkeys++;
|
||||
num = XLookupString(ev, buf, sizeof buf, &ksym, 0);
|
||||
key = XKeysymToString(ksym);
|
||||
|
||||
fmtstrinit(&f);
|
||||
unmask(&f, ev->state, modkey_names, '-');
|
||||
if(f.nfmt)
|
||||
fmtrune(&f, '-');
|
||||
fmtstrcpy(&f, key);
|
||||
|
||||
free(keyname);
|
||||
keyname = fmtstrflush(&f);
|
||||
keyname = smprint("%K", ev);
|
||||
return false;
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
/* Copyight 2008 Kris Maglione <maglione.k at Gmail>
|
||||
* See LICENSE file for license details.
|
||||
*/
|
||||
#include <ctype.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdbool.h>
|
||||
#include <string.h>
|
||||
#include <stuff/x.h>
|
||||
#include <stuff/util.h>
|
||||
#include <fmt.h>
|
||||
|
||||
int
|
||||
main(int argc, char *argv[]) {
|
||||
Point pt;
|
||||
|
||||
ARGBEGIN{
|
||||
}ARGEND;
|
||||
|
||||
initdisplay();
|
||||
|
||||
if(argc) {
|
||||
if(!getint(EARGF(exit(1)), &pt.x))
|
||||
exit(1);
|
||||
if(!getint(EARGF(exit(1)), &pt.y))
|
||||
exit(1);
|
||||
}else {
|
||||
pt = querypointer(&scr.root);
|
||||
lprint(1, "%d %d\n", pt.x, pt.y);
|
||||
}
|
||||
|
||||
warppointer(pt);
|
||||
XCloseDisplay(display);
|
||||
}
|
||||
|
|
@ -18,6 +18,8 @@ extern void init_screens(void);
|
|||
/* printevent.c */
|
||||
int fmtevent(Fmt*);
|
||||
|
||||
int fmtkey(Fmt*);
|
||||
|
||||
/* xext.c */
|
||||
void randr_event(XEvent*);
|
||||
bool render_argb_p(Visual*);
|
||||
|
|
|
@ -236,10 +236,10 @@ void changeprop_string(Window*, const char*, const char*);
|
|||
void changeprop_textlist(Window*, const char*, const char*, char*[]);
|
||||
void changeprop_ulong(Window*, const char*, const char*, ulong[], int);
|
||||
void changeproperty(Window*, const char*, const char*, int width, const uchar*, int);
|
||||
void cleanupwindow(Window*);
|
||||
void clientmessage(Window*, const char*, long, int, ClientMessageData);
|
||||
void copyimage(Image*, Rectangle, Image*, Point);
|
||||
Window* createwindow(Window*, Rectangle, int depth, uint class, WinAttr*, int valuemask);
|
||||
void cleanupwindow(Window*);
|
||||
Window* createwindow_visual(Window*, Rectangle, int depth, Visual*, uint class, WinAttr*, int);
|
||||
void delproperty(Window*, const char*);
|
||||
void destroywindow(Window*);
|
||||
|
@ -272,6 +272,7 @@ Font* loadfont(const char*);
|
|||
void lowerwin(Window*);
|
||||
int mapwin(Window*);
|
||||
void movewin(Window*, Point);
|
||||
int numlockmask(void);
|
||||
bool parsecolor(const char *name, Color*);
|
||||
bool parsekey(char*, int*, char**);
|
||||
ulong pixelvalue(Color);
|
||||
|
|
|
@ -1,21 +0,0 @@
|
|||
#include "fmtdef.h"
|
||||
|
||||
void
|
||||
vseprint(Fmt *f, char *buf, char *e) {
|
||||
Fmt f;
|
||||
|
||||
if(e <= buf)
|
||||
return nil;
|
||||
f.runes = 0;
|
||||
f.start = buf;
|
||||
f.to = buf;
|
||||
f.stop = e - 1;
|
||||
f.flush = 0;
|
||||
f.farg = nil;
|
||||
f.nfmt = 0;
|
||||
va_copy(f.args,args);
|
||||
dofmt(&f, fmt);
|
||||
va_end(f.args);
|
||||
*(char*)f.to = '\0';
|
||||
return (char*)f.to;
|
||||
}
|
|
@ -38,5 +38,4 @@ traperrors(bool enable) {
|
|||
if (enable)
|
||||
nerrors = 0;
|
||||
return nerrors;
|
||||
|
||||
}
|
||||
|
|
|
@ -3,8 +3,6 @@
|
|||
*/
|
||||
#include "../x11.h"
|
||||
|
||||
typedef struct KMask KMask;
|
||||
|
||||
char *modkey_names[] = {
|
||||
"Shift",
|
||||
"",
|
||||
|
@ -41,3 +39,43 @@ parsekey(char *str, int *mask, char **key) {
|
|||
else
|
||||
return i == nkeys;
|
||||
}
|
||||
|
||||
int
|
||||
numlockmask(void) {
|
||||
static int masks[] = {
|
||||
ShiftMask, LockMask, ControlMask, Mod1Mask,
|
||||
Mod2Mask, Mod3Mask, Mod4Mask, Mod5Mask
|
||||
};
|
||||
XModifierKeymap *modmap;
|
||||
KeyCode kcode;
|
||||
int i, max, numlock;
|
||||
|
||||
numlock = 0;
|
||||
modmap = XGetModifierMapping(display);
|
||||
kcode = keycode("Num_Lock");
|
||||
if(kcode && modmap && modmap->max_keypermod > 0) {
|
||||
max = nelem(masks) * modmap->max_keypermod;
|
||||
for(i = 0; i < max && !numlock; i++)
|
||||
if(modmap->modifiermap[i] == kcode)
|
||||
numlock = masks[i / modmap->max_keypermod];
|
||||
}
|
||||
XFreeModifiermap(modmap);
|
||||
return numlock;
|
||||
}
|
||||
|
||||
int
|
||||
fmtkey(Fmt *f) {
|
||||
XKeyEvent *ev;
|
||||
char *key;
|
||||
int nfmt;
|
||||
|
||||
ev = va_arg(f->args, XKeyEvent*);
|
||||
key = XKeysymToString(XKeycodeToKeysym(display, ev->keycode, 0));
|
||||
|
||||
nfmt = f->nfmt;
|
||||
unmask(f, ev->state, modkey_names, '-');
|
||||
if(f->nfmt > nfmt)
|
||||
fmtrune(f, '-');
|
||||
return fmtstrcpy(f, key);
|
||||
}
|
||||
|
||||
|
|
15
man/wmii.1
15
man/wmii.1
|
@ -51,7 +51,6 @@ connections. The address takes the form
|
|||
unix!/tmp/ns.\fB$USER\fR.\fB${DISPLAY\fR%.0\fB}\fR/wmii
|
||||
.fi
|
||||
|
||||
|
||||
which opens a unix socket per Plan 9 Port conventions. To
|
||||
open a TCP socket, listening at port 4332 on the loopback
|
||||
interface, use:
|
||||
|
@ -60,7 +59,6 @@ interface, use:
|
|||
tcp!localhost!4332
|
||||
.fi
|
||||
|
||||
|
||||
\fB$WMII_NAMESPACE\fR is automatically set to this value.
|
||||
|
||||
.TP
|
||||
|
@ -265,14 +263,12 @@ Rules have the form:
|
|||
/\fI<regex>\fR/ -> \fI<width>\fR\fI[+\fI<width>\fR]\fR*
|
||||
.fi
|
||||
|
||||
|
||||
Where,
|
||||
|
||||
.nf
|
||||
\fI<width>\fR := \fI<percent of screen>\fR | \fI<pixels>\fRpx
|
||||
.fi
|
||||
|
||||
|
||||
When a new column, \fI<n>\fR, is created on a view whose name
|
||||
matches \fI<regex>\fR, it is given the \fI<n>\fRth supplied \fI<width>\fR.
|
||||
If there is no \fI<n>\fRth width, it is given 1/\fI<ncol>\fRth of the
|
||||
|
@ -290,7 +286,6 @@ specified as:
|
|||
/\fI<regex>\fR/ \fI<key>\fR=\fI<value>\fR ...
|
||||
.fi
|
||||
|
||||
|
||||
where each \fI<key>\fR represents a command in the clients \fIctl\fR
|
||||
file, and each \fI<value>\fR represents the value to assign to it.
|
||||
The rules are applied when the client is first started and
|
||||
|
@ -405,7 +400,9 @@ attached to a new view. Ordinarilly, the value
|
|||
changes automatically whenever the window is
|
||||
moved between the floating and managed layers.
|
||||
However, setting a value of \fIalways\fR or \fInever\fR
|
||||
overrides this behavior.
|
||||
overrides this behavior. Additionally, dialogs,
|
||||
menus, docks, and splash screens will always
|
||||
float unless this value is set to \fInever\fR.
|
||||
.TP
|
||||
fullscreen \fI<on | off | toggle>\fR
|
||||
Sets the client's fullscreen state.
|
||||
|
@ -519,7 +516,6 @@ Selects a column or the floating area.
|
|||
area ::= \fI<area_spec>\fR | \fI<screen_spec>\fR:\fI<area_spec>\fR
|
||||
.fi
|
||||
|
||||
|
||||
When \fI<screen_spec>\fR is omitted and \fI<area_spec>\fR is not "sel",
|
||||
0 is assumed. "sel" by itself represents the selected client no
|
||||
matter which screen it is on.
|
||||
|
@ -528,7 +524,6 @@ matter which screen it is on.
|
|||
area_spec ::= "~" | \fI<number>\fR | "sel"
|
||||
.fi
|
||||
|
||||
|
||||
Where "~" represents the floating area and \fI<number>\fR represents a column
|
||||
index, starting at one.
|
||||
|
||||
|
@ -536,7 +531,6 @@ index, starting at one.
|
|||
screen_spec ::= \fI<number>\fR
|
||||
.fi
|
||||
|
||||
|
||||
Where \fI<number>\fR representes the 0\-based Xinerama screen number.
|
||||
|
||||
.TP
|
||||
|
@ -547,7 +541,6 @@ Selects a client window.
|
|||
frame ::= \fI<area>\fR \fI<index>\fR | \fI<area>\fR sel | client \fI<window-id>\fR
|
||||
.fi
|
||||
|
||||
|
||||
Where \fI<index>\fR represents the nth frame of \fI<area>\fR or \fI<window\-id>\fR is
|
||||
the X11 window id of the given client.
|
||||
|
||||
|
@ -559,7 +552,6 @@ The amount to grow or nudge something.
|
|||
amount ::= \fI<number>\fR | \fI<number>\fRpx
|
||||
.fi
|
||||
|
||||
|
||||
If "px" is given, \fI<number>\fR is interperated as an exact pixel count.
|
||||
Otherwise, it's interperated as a "reasonable" amount, which is
|
||||
usually either the height of a window's title bar, or its sizing
|
||||
|
@ -624,6 +616,7 @@ The namespace directory to use if no address is provided.
|
|||
wimenu(1), wmii9menu(1), witray(1), wmiir(1), wihack(1)
|
||||
.P
|
||||
@DOCDIR@/wmii.pdf
|
||||
@DOCDIR@/FAQ
|
||||
|
||||
.P
|
||||
\fI[1]\fR http://www.suckless.org/wiki/wmii/tips/9p_tips
|
||||
|
|
|
@ -50,13 +50,11 @@ of the core window manager.
|
|||
`<protocol>!<address>`. The default is of the form:
|
||||
|
||||
``` unix!/tmp/ns.$USER.${DISPLAY%.0}/wmii
|
||||
|
||||
which opens a unix socket per Plan 9 Port conventions. To
|
||||
open a TCP socket, listening at port 4332 on the loopback
|
||||
interface, use:
|
||||
|
||||
``` tcp!localhost!4332
|
||||
|
||||
$WMII_NAMESPACE is automatically set to this value.
|
||||
|
||||
: -r <wmiirc>
|
||||
|
@ -232,11 +230,9 @@ follows.
|
|||
Rules have the form:
|
||||
|
||||
``` /<regex>/ -> <width>[+<width>]*
|
||||
|
||||
Where,
|
||||
|
||||
``` <width> := <percent of screen> | <pixels>px
|
||||
|
||||
When a new column, <n>, is created on a view whose name
|
||||
matches <regex>, it is given the <n>th supplied <width>.
|
||||
If there is no <n>th width, it is given 1/<ncol>th of the
|
||||
|
@ -250,7 +246,6 @@ follows.
|
|||
specified as:
|
||||
|
||||
``` /<regex>/ <key>=<value> ...
|
||||
|
||||
where each <key> represents a command in the clients _ctl_
|
||||
file, and each <value> represents the value to assign to it.
|
||||
The rules are applied when the client is first started and
|
||||
|
@ -351,7 +346,9 @@ represents the currently selected client.
|
|||
changes automatically whenever the window is
|
||||
moved between the floating and managed layers.
|
||||
However, setting a value of _always_ or _never_
|
||||
overrides this behavior.
|
||||
overrides this behavior. Additionally, dialogs,
|
||||
menus, docks, and splash screens will always
|
||||
float unless this value is set to _never_.
|
||||
: fullscreen <on | off | toggle>
|
||||
Sets the client's fullscreen state.
|
||||
: group <group id>
|
||||
|
@ -435,25 +432,21 @@ all of the clients with the given tag applied. The special
|
|||
Selects a column or the floating area.
|
||||
|
||||
``` area ::= <area_spec> | <screen_spec>:<area_spec>
|
||||
|
||||
When <screen_spec> is omitted and <area_spec> is not "sel",
|
||||
0 is assumed. "sel" by itself represents the selected client no
|
||||
matter which screen it is on.
|
||||
|
||||
``` area_spec ::= "~" | <number> | "sel"
|
||||
|
||||
Where "~" represents the floating area and <number> represents a column
|
||||
index, starting at one.
|
||||
|
||||
``` screen_spec ::= <number>
|
||||
|
||||
Where <number> representes the 0-based Xinerama screen number.
|
||||
|
||||
: frame
|
||||
Selects a client window.
|
||||
|
||||
``` frame ::= <area> <index> | <area> sel | client <window-id>
|
||||
|
||||
Where <index> represents the nth frame of <area> or <window-id> is
|
||||
the X11 window id of the given client.
|
||||
|
||||
|
@ -461,7 +454,6 @@ all of the clients with the given tag applied. The special
|
|||
The amount to grow or nudge something.
|
||||
|
||||
``` amount ::= <number> | <number>px
|
||||
|
||||
If "px" is given, <number> is interperated as an exact pixel count.
|
||||
Otherwise, it's interperated as a "reasonable" amount, which is
|
||||
usually either the height of a window's title bar, or its sizing
|
||||
|
@ -517,6 +509,7 @@ thus can be used in actions:
|
|||
= SEE ALSO =
|
||||
wimenu(1), wmii9menu(1), witray(1), wmiir(1), wihack(1) +
|
||||
@DOCDIR@/wmii.pdf
|
||||
@DOCDIR@/FAQ
|
||||
|
||||
[1] http://www.suckless.org/wiki/wmii/tips/9p_tips +
|
||||
[2] @DOCDIR@/wmii.pdf
|
||||
|
|
17
mk/wmii.mk
17
mk/wmii.mk
|
@ -1,26 +1,31 @@
|
|||
|
||||
VERS = hg$$(hg identify -n)
|
||||
VERS = $$(test -n "$$WMII_HGVERSION" && echo $$WMII_HGVERSION || \
|
||||
hg log -r $$(hg id 2>/dev/null | awk -F'[+ ]' '{print $$1}') --template 'hg{rev}' 2>/dev/null)
|
||||
echo -n "hg$$(hg id -n 2>/dev/null)")
|
||||
|
||||
WMII_HGVERSION = $(VERS)
|
||||
WMII_HGVERSION := $(shell echo $(VERS))
|
||||
WMII_HGVERSION != echo $(VERS)
|
||||
VERSION = $(WMII_HGVERSION)
|
||||
CONFVERSION = -hg
|
||||
COPYRIGHT = ©2010 Kris Maglione
|
||||
|
||||
CONFDIR = wmii-hg
|
||||
LOCALCONF = ~/.$(CONFDIR)
|
||||
GLOBALCONF = $(ETC)/$(CONFDIR)
|
||||
|
||||
.MAKE.EXPORTED += WMII_HGVERSION
|
||||
SUBMAKE_EXPORT = WMII_HGVERSION=$(WMII_HGVERSION)
|
||||
|
||||
LIBS9 = $(ROOT)/lib/libstuff.a $(ROOT)/lib/libregexp9.a $(ROOT)/lib/libbio.a $(ROOT)/lib/libfmt.a $(ROOT)/lib/libutf.a
|
||||
|
||||
CFLAGS += '-DVERSION=\"$(VERSION)\"' '-DCOPYRIGHT=\"$(COPYRIGHT)\"' \
|
||||
'-DCONFVERSION=\"$(CONFVERSION)\"' '-DCONFPREFIX=\"$(ETC)\"'
|
||||
'-DCONFDIR=\"$(CONFDIR)\"' '-DCONFPREFIX=\"$(ETC)\"' \
|
||||
'-DLOCALCONF=\"$(LOCALCONF)\"' '-DGLOBALCONF=\"$(GLOBALCONF)\"'
|
||||
|
||||
FILTER = sed "s|@CONFPREFIX@|$(ETC)|g; \
|
||||
s|@GLOBALCONF@|$(ETC)/wmii$(CONFVERSION)|g; \
|
||||
s|@LOCALCONF@|~/.wmii$(CONFVERSION)|g; \
|
||||
s|@CONFVERSION@|$(CONFVERSION)|g; \
|
||||
s|@GLOBALCONF@|$(GLOBALCONF)|g; \
|
||||
s|@LOCALCONF@|$(LOCALCONF)|g; \
|
||||
s|@CONFDIR@|$(CONFDIR)|g; \
|
||||
s|@DOCDIR@|$(DOC)|g; \
|
||||
s|@ALTDOC@|$(DOC)/alternative_wmiircs|g; \
|
||||
s|@EXAMPLES@|$(DOC)/examples|g; \
|
||||
|
|
|
@ -2,7 +2,7 @@ ROOT=..
|
|||
include $(ROOT)/mk/hdr.mk
|
||||
include $(ROOT)/mk/wmii.mk
|
||||
|
||||
BIN = $(ETC)/wmii$(CONFVERSION)
|
||||
BIN = $(GLOBALCONF)
|
||||
TARG = wmiirc \
|
||||
welcome
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ echo LD "$($bin/cleanname ${BASE}$outfile)"
|
|||
[ -n "$noisycc" ] && echo $LD -o $outfile $ofiles $LDFLAGS $args
|
||||
$LD -o $outfile $ofiles $LDFLAGS $args >$xtmp 2>&1
|
||||
status=$?
|
||||
[ $? -eq 0 ] || $LD -o $outfile $ofiles $LDFLAGS $args >&2
|
||||
[ $status -eq 0 ] || $LD -o $outfile $ofiles $LDFLAGS $args >&2
|
||||
|
||||
sed 's/.*: In function `[^:]*: *//' $xtmp | egrep . |
|
||||
egrep -v 'is almost always misused|is dangerous, better use|in statically linked applications requires at runtime'
|
||||
|
|
Loading…
Reference in New Issue