summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--surf.c31
1 files changed, 19 insertions, 12 deletions
diff --git a/surf.c b/surf.c
index 94c6d23..c61620b 100644
--- a/surf.c
+++ b/surf.c
@@ -579,13 +579,31 @@ setcookie(char *name, char *val, char *dom, char *path, long exp) {
void
setup(void) {
- const gchar *home;
+ const gchar *home, *name;
+ SoupSession *s;
+ FILE *tmp;
+
dpy = GDK_DISPLAY();
session = webkit_get_default_session();
urlprop = XInternAtom(dpy, "_SURF_URL", False);
+
+ /* create dirs and files */
home = g_get_home_dir();
workdir = g_build_filename(home, ".surf", NULL);
+ g_mkdir_with_parents(workdir, 0755);
+ name = g_build_filename(workdir, "dl", NULL);
+ g_mkdir(name, 0755);
+ name = g_build_filename(workdir, "style.css", NULL);
+ if((tmp = g_fopen(name, "a")));
+ fclose(tmp);
+
+
+ /* cookie persistance */
+ s = webkit_get_default_session();
+ name = g_build_filename(workdir, "cookies.jar", NULL);
+ cookiejar = soup_cookie_jar_text_new(name, FALSE);
+ soup_session_add_feature(s, SOUP_SESSION_FEATURE(cookiejar));
}
void
@@ -679,10 +697,8 @@ zoom(Client *c, const Arg *arg) {
}
int main(int argc, char *argv[]) {
- SoupSession *s;
Client *c;
gint o;
- const gchar *filename;
Arg arg;
gtk_init(NULL, NULL);
@@ -718,15 +734,6 @@ int main(int argc, char *argv[]) {
if(!clients)
newclient();
- /* make dirs */
- filename = g_build_filename(workdir, "dl", NULL);
- g_mkdir_with_parents(filename, 0755);
-
- /* cookie persistance */
- s = webkit_get_default_session();
- filename = g_build_filename(workdir, "cookies.jar", NULL);
- cookiejar = soup_cookie_jar_text_new(filename, FALSE);
- soup_session_add_feature(s, SOUP_SESSION_FEATURE(cookiejar));
gtk_main();
cleanup();
011-10-26add paste from clipboardGravatar Connor Lane Smith 1-2/+4 2011-10-26add lots of commentsGravatar Connor Lane Smith 1-18/+33 2011-10-26input focus: calculate areas of intersectionGravatar Connor Lane Smith 1-12/+22 2011-10-17simplify dmenu_runGravatar Connor Lane Smith 1-1/+1 2011-10-17use ~/.dmenu_cache if no xdg cacheGravatar Connor Lane Smith 1-1/+4 2011-10-17lsx: detect read errorsGravatar Connor Lane Smith 1-7/+9 2011-10-17xim: check for corner casesGravatar Connor Lane Smith 1-4/+6 2011-10-16fix extra warningGravatar Connor Lane Smith 1-1/+1 2011-10-16lsx: return failure on errorGravatar Connor Lane Smith 1-2/+5 2011-10-16add xim supportGravatar Troels Henriksen 1-3/+15 2011-10-13limit lines to inputGravatar Connor Lane Smith 1-0/+1 2011-10-04input focus: fix for reparenting wmsGravatar Connor Lane Smith 1-1/+1 2011-09-30fix monitor select when no focusGravatar Connor Lane Smith 1-1/+1 2011-09-20tweak matchGravatar Connor Lane Smith 1-2/+2 2011-09-20update manpageGravatar Connor Lane Smith 1-9/+6 2011-09-19detect active monitor using input focusGravatar Connor Lane Smith 1-7/+12 2011-09-19add token matchingGravatar Connor Lane Smith 1-23/+34 2011-09-19change version to 'hg'Gravatar Connor Lane Smith 1-1/+1 2011-07-24dmenu_run: sh -cGravatar Connor Lane Smith 1-1/+1 2011-07-22fix loadfontGravatar Connor Lane Smith 1-12/+13 2011-07-19Added tag 4.4 for changeset 2b105eaae831Gravatar Connor Lane Smith 1-0/+1 2011-07-19add lsx.1 to distGravatar Connor Lane Smith 1-1/+1 2011-07-17tweaksGravatar Connor Lane Smith 2-2/+2 2011-07-14efficiency tweaksGravatar Connor Lane Smith 2-60/+44 2011-07-14fix extra warningGravatar Connor Lane Smith 1-1/+1 2011-07-06simpler vlineGravatar Connor Lane Smith 1-4/+2 2011-07-04rebind ^N ^PGravatar Connor Lane Smith 2-3/+3 2011-06-25include limits.hGravatar Connor Lane Smith 1-0/+1 2011-06-23make clean lsxGravatar Connor Lane Smith 1-1/+1 2011-06-23lsx: check snprintfGravatar Connor Lane Smith 1-4/+3 2011-06-18update draw.cGravatar Connor Lane Smith 2-14/+14 2011-06-18simpler lsxGravatar Connor Lane Smith 3-11/+6 2011-06-13new dmenu_runGravatar Connor Lane Smith 5-26/+15