Alopex

Check-in [ff2003de24]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:added error checking for image and status input file
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | master
Files: files | file ages | folders
SHA3-256: ff2003de243a5395058c0ea9847882a86dddf5455861674337562309e8fffb6a
User & Date: jesse@mccluresk9.com 2014-02-13 19:01:32
Context
2014-02-13
19:02
add back prebuilt man check-in: 1602adff53 user: jesse@mccluresk9.com tags: trunk, master
19:01
added error checking for image and status input file check-in: ff2003de24 user: jesse@mccluresk9.com tags: trunk, master
18:26
fixed dir permission check-in: 66f3c1ced3 user: jesse@mccluresk9.com tags: trunk, master
Changes

Deleted doc/alopex.1.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
'\" t
.\" Manual page created with latex2man on Thu Feb 13 13:24:00 EST 2014
.\" NOTE: This file is generated, DO NOT EDIT.
.de Vb
.ft CW
.nf
..
.de Ve
.ft R

.fi
..
.TH "ALOPEX" "1" "13 February 2014" "window manager " "window manager "
.SH NAME

.PP
Alopex
\- A Tabbed, Tiling Window Manager with Fur 
.PP
.SH SYNOPSIS

xinit alopex [\fItheme\fP]
.PP
.SH DESCRIPTION

.PP
Alopex
is a dynamic tiling window manager with a container 
concept inspired by i3 but implemented quite differently. Client 
windows are not statically assigned to a given container, instead, 
containers each have a configurable maximum number of clients, and 
clients fill each container in sequence. Within containers, multiple 
clients are displayed as tabs. 
.PP
There are three container layouts: rstack, bstack, and 
monocle. Stack modes divide the screen into two sections, the master 
region and the stack. Monocle uses the full area for one container. 
All layouts stack clients within containers displaying a tab for each 
client in the container\&'s title bar. These layouts are supplimented by 
per\-client floating and full\-screen modes. 
.PP
Alopex
uses a tag concept rather than the more common 
workspace/desktop metaphor. The default configuration, however, is 
optimized for a workspace\-like work flow. This can be modified as 
desired. 
.PP
.SH CONFIGURATION

.PP
Configuration is implemented via an X resources data base file which is 
read on startup. A well\-commented example configuration file is 
distributed with alopex
and can be found at 
/usr/share/alopex/config\&.
Further information on customizing and 
configuring alopex can be found on the github wiki. 
.PP
.SH STATUS INPUT

.PP
A child process specified in the configuration file can be launched to 
provide status input to be displayed along side the tabs in containers\&' 
bars. This child process should send text information to its standard 
output which will then be read in by alopex\&.
.PP
Each line must contain three ampersands which delineate four text 
segments. The first two segments are always displayed in the first 
container\&'s bar: the first before the tag indicators, the second 
immediately after the tag indicators. The third segment is displayed at 
the right side of the second container\&'s bar (or the right of the first 
container if there is only one visible). The fourth segment is 
displayed at the right side of the last visible container. 
.PP
Plain text is printed as is into the above\-specified status bar region. 
Text within curly\-braces is interpreted as a special indicator. These 
indicators can specify a foreground color, set a font, display an icon 
or paint the foreground color with an icon mask. Further documentation 
and examples can be found on the github wiki. 
.PP
.SH AUTHOR

Copyright (C)2012\-2014 Jesse McClure 
.br
License GPLv3: GNU GPL version 3 \fBhttp://gnu.org/licenses/gpl.html\fP
.br
This is free software: you are free to change and redistribute it. 
.br
There is NO WARRANTY, to the extent permitted by law. 
.PP
Submit bug reports via github: 
.br
\fBhttp://github/com/TrilbyWhite/alopex.git\fP
.PP
I would like your feedback. If you enjoy Alopex
see the bottom 
of the site below for detauls on submitting comments: 
.br
\fBhttp://mccluresk9.com/software.html\fP
.PP
Documentation added and edited collaboratively by Jesse McClure and Sam 
Stuewe. Any concerns or comments regarding documentation may be 
submitted to \fBhalosghost@archlinux.info\fP\&.
.PP
.SH SEE ALSO

The most up to date documentation can be found at 
\fBhttps://github.com/TrilbyWhite/alopex/wiki\fP
.PP
.\" NOTE: This file is generated, DO NOT EDIT.
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




























































































































































































































Changes to src/config.c.

182
183
184
185
186
187
188
189
190

191

192
193
194
195
196
197
198
		conf.tag_icon[i] = atoi(name);
		name = strtok(NULL," ");
	}
	if (conf.tag_count < i) conf.tag_count = i;
	conf.tag_icon = realloc(conf.tag_icon, (i+1) * sizeof(int));
	conf.tag_icon[i] = -1;
	/* status input */
	if (s[STR_StatIn]) {
		int fd[2];

		int flags;

		pipe(fd);
		if ( (pid=fork()) ) {
			close(fd[1]);
			flags = fcntl(fd[0], F_GETFL, 0);
			fcntl(fd[0], F_SETFL, flags | O_NONBLOCK);
			conf.statfd = fd[0];
			conf.stat = fdopen(fd[0],"r");







<
|
>
|
>







182
183
184
185
186
187
188

189
190
191
192
193
194
195
196
197
198
199
		conf.tag_icon[i] = atoi(name);
		name = strtok(NULL," ");
	}
	if (conf.tag_count < i) conf.tag_count = i;
	conf.tag_icon = realloc(conf.tag_icon, (i+1) * sizeof(int));
	conf.tag_icon[i] = -1;
	/* status input */

	int fd[2], flags;
	struct stat stbuf;
	if (s[STR_StatIn] && !stat(s[STR_StatIn],&stbuf) &&
			(stbuf.st_mode & S_IXUSR) ){
		pipe(fd);
		if ( (pid=fork()) ) {
			close(fd[1]);
			flags = fcntl(fd[0], F_GETFL, 0);
			fcntl(fd[0], F_SETFL, flags | O_NONBLOCK);
			conf.statfd = fd[0];
			conf.stat = fdopen(fd[0],"r");

Changes to src/draw.c.

101
102
103
104
105
106
107

108
109
110
111
112
113
114
...
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
...
152
153
154
155
156
157
158

159
160
161
162
163
164
165
	cairo_reset_clip(b->ctx);
}

int icons_init(const char *fname) {
	double iw, ih;
	int i, j, fs = conf.font_size;
	cairo_surface_t *img = cairo_image_surface_create_from_png(fname);

	icon_fmt = cairo_image_surface_get_format(img);
	iw = cairo_image_surface_get_width(img) / 10.0;
	ih = cairo_image_surface_get_height(img) / 10.0;
	cairo_t *ctx;
	for (j = 0; j < 10; j++) for (i = 0; i < 10; i++) {
		icon_img[j*10+i] = cairo_image_surface_create(icon_fmt, fs, fs);
		ctx = cairo_create(icon_img[j*10+i]);
................................................................................
	cairo_surface_destroy(img);
	return 0;
}

int icons_free() {
	int i;
	for (i = 0; i < 100; i++)
		cairo_surface_destroy(icon_img[i]);
	return 0;
}

int round_rect(Bar *b, int x, int y, int w, int h,
		int off, int bg, int brd, int txt) {
	const Theme *q = &conf.theme[off];
	if (b->opts & BAR_BOTTOM) {
................................................................................
	set_color(b->ctx, txt);
	return 0;
}

int sbar_icon(Bar *S, int n, Bool col) {
// TODO fix the "2"
	if ( (--n) < 0 || n > 99) return 1;

	cairo_save(S->ctx);
	if (col && icon_fmt != CAIRO_FORMAT_A1) {
		cairo_set_source_surface(S->ctx, icon_img[n], S->xoff, 2);
		cairo_paint(S->ctx);
	}
	else {
		cairo_mask_surface(S->ctx, icon_img[n], S->xoff, 2);







>







 







|







 







>







101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
...
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
...
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
	cairo_reset_clip(b->ctx);
}

int icons_init(const char *fname) {
	double iw, ih;
	int i, j, fs = conf.font_size;
	cairo_surface_t *img = cairo_image_surface_create_from_png(fname);
if (cairo_surface_status(img) != CAIRO_STATUS_SUCCESS) return 1;
	icon_fmt = cairo_image_surface_get_format(img);
	iw = cairo_image_surface_get_width(img) / 10.0;
	ih = cairo_image_surface_get_height(img) / 10.0;
	cairo_t *ctx;
	for (j = 0; j < 10; j++) for (i = 0; i < 10; i++) {
		icon_img[j*10+i] = cairo_image_surface_create(icon_fmt, fs, fs);
		ctx = cairo_create(icon_img[j*10+i]);
................................................................................
	cairo_surface_destroy(img);
	return 0;
}

int icons_free() {
	int i;
	for (i = 0; i < 100; i++)
		if (icon_img[i]) cairo_surface_destroy(icon_img[i]);
	return 0;
}

int round_rect(Bar *b, int x, int y, int w, int h,
		int off, int bg, int brd, int txt) {
	const Theme *q = &conf.theme[off];
	if (b->opts & BAR_BOTTOM) {
................................................................................
	set_color(b->ctx, txt);
	return 0;
}

int sbar_icon(Bar *S, int n, Bool col) {
// TODO fix the "2"
	if ( (--n) < 0 || n > 99) return 1;
	if (!icon_img[n]) return 1;
	cairo_save(S->ctx);
	if (col && icon_fmt != CAIRO_FORMAT_A1) {
		cairo_set_source_surface(S->ctx, icon_img[n], S->xoff, 2);
		cairo_paint(S->ctx);
	}
	else {
		cairo_mask_surface(S->ctx, icon_img[n], S->xoff, 2);

Changes to src/xlib.c.

100
101
102
103
104
105
106







107
108
109
110
111
112
113
		if (minY > mons[i].y) minY = mons[i].y;
		if (maxX < mons[i].x + mons[i].w) maxX = mons[i].x + mons[i].w;
		if (maxY < mons[i].y + mons[i].h) maxY = mons[i].y + mons[i].h;
	}
	/* create monitors and set background */
	cairo_surface_t *src, *dest;
	src = cairo_image_surface_create_from_png(bg);







	int imgw = cairo_image_surface_get_width(src);
	int imgh = cairo_image_surface_get_height(src);
	Pixmap pix = XCreatePixmap(dpy, root, maxX-minX, maxY-minY,
			DefaultDepth(dpy,scr));
	dest = cairo_xlib_surface_create(dpy, pix, DefaultVisual(dpy,scr),
			maxX-minX, maxY-minY);
	cairo_t *ctx, *rctx;







>
>
>
>
>
>
>







100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
		if (minY > mons[i].y) minY = mons[i].y;
		if (maxX < mons[i].x + mons[i].w) maxX = mons[i].x + mons[i].w;
		if (maxY < mons[i].y + mons[i].h) maxY = mons[i].y + mons[i].h;
	}
	/* create monitors and set background */
	cairo_surface_t *src, *dest;
	src = cairo_image_surface_create_from_png(bg);
if (cairo_surface_status(src) != CAIRO_STATUS_SUCCESS) {
	src = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, maxX, maxY);
	cairo_t *blank = cairo_create(src);
	cairo_set_source_rgba(blank, 0, 0, 0, 1);
	cairo_paint(blank);
	cairo_destroy(blank);
}
	int imgw = cairo_image_surface_get_width(src);
	int imgh = cairo_image_surface_get_height(src);
	Pixmap pix = XCreatePixmap(dpy, root, maxX-minX, maxY-minY,
			DefaultDepth(dpy,scr));
	dest = cairo_xlib_surface_create(dpy, pix, DefaultVisual(dpy,scr),
			maxX-minX, maxY-minY);
	cairo_t *ctx, *rctx;