1
2
3
4
5
6
7
8
9
10
11
..
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
...
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
|
/* [ʞ] newtab.c
* ~ lexi hale <lexi@hale.su>
* $ cc -Ofast newtab.c -onewtab \
* [-D_default_qutebrowser_location=/...]
* $ ./newtab [example.net]
* © AGPLv3
* ? may god have mercy on my soul.
* i wrote this because qutebrowser, being a python
* abomination, takes an absurdly fucking long time
* to load, even when there's already an instance
* running and i just want a new goddamn tab. it
................................................................................
} ; {
/* fuck this fuck this fuck this fuck this */
char* end = stpncpy(srv.sun_path, run, sizeof srv.sun_path);
end = stpncpy(end, ssz("/qutebrowser/"));
DIR* qb = opendir(srv.sun_path);
if (!qb) return start_instance;
struct dirent* ent;
while (ent = readdir(qb)) {
if (ent == NULL) return start_instance;
if (strncmp(ent -> d_name, "ipc-", 4) == 0) break;
}
if (ent == NULL) return start_instance;
end = stpncpy(end, ent->d_name,
(sizeof srv.sun_path) - (end - srv.sun_path));
closedir(qb);
................................................................................
if (argc > 2) {
printf("\x1b[1musage:\x1b[m %s [uri]\n", argv[0]);
} else {
const char* uri = argc < 2 ? NULL : argv[1];
enum status st = transmit(uri);
if (st == start_instance) {
if (!fork()) {
execl(dupl(_default_qutebrowser_location), uri, NULL);
execl(dupl("/usr/local/bin/qutebrowser"), uri, NULL);
execlp(dupl("qutebrowser"), uri, NULL);
st = fail_find;
} else {
return start_instance;
}
}
if (errors[st] != NULL) printf("\x1b[1;31m(error)\x1b[m %s\n", errors[st]);
return st;
}
}
|
|
1
2
3
4
5
6
7
8
9
10
11
12
..
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
...
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
|
/* [ʞ] newtab.c
* ~ lexi hale <lexi@hale.su>
* $ cc -Ofast newtab.c -onewtab \
* [-D_default_qutebrowser_location=/...] \
* [-D_enable_vblank]
* $ ./newtab [example.net]
* © AGPLv3
* ? may god have mercy on my soul.
* i wrote this because qutebrowser, being a python
* abomination, takes an absurdly fucking long time
* to load, even when there's already an instance
* running and i just want a new goddamn tab. it
................................................................................
} ; {
/* fuck this fuck this fuck this fuck this */
char* end = stpncpy(srv.sun_path, run, sizeof srv.sun_path);
end = stpncpy(end, ssz("/qutebrowser/"));
DIR* qb = opendir(srv.sun_path);
if (!qb) return start_instance;
struct dirent* ent;
while ((ent = readdir(qb))) {
if (ent == NULL) return start_instance;
if (strncmp(ent -> d_name, "ipc-", 4) == 0) break;
}
if (ent == NULL) return start_instance;
end = stpncpy(end, ent->d_name,
(sizeof srv.sun_path) - (end - srv.sun_path));
closedir(qb);
................................................................................
if (argc > 2) {
printf("\x1b[1musage:\x1b[m %s [uri]\n", argv[0]);
} else {
const char* uri = argc < 2 ? NULL : argv[1];
enum status st = transmit(uri);
if (st == start_instance) {
if (!fork()) {
# ifndef _enable_vblank
setenv("vblank_mode","0",0);
# endif
execl(dupl(_default_qutebrowser_location), uri, NULL);
execl(dupl("/usr/local/bin/qutebrowser"), uri, NULL);
execlp(dupl("qutebrowser"), uri, NULL);
st = fail_find;
} else {
return start_instance;
}
}
if (errors[st] != NULL) printf("\x1b[1;31m(error)\x1b[m %s\n", errors[st]);
return st;
}
}
|