diff --git a/scripts/status.sh b/scripts/status.sh index 372a5bd..c55580e 100755 --- a/scripts/status.sh +++ b/scripts/status.sh @@ -8,4 +8,4 @@ statustext() wmfs -s "`date`" } -statustext +while true; do statustext; sleep 10; done diff --git a/src/config.c b/src/config.c index 1cd31bb..5542fe9 100644 --- a/src/config.c +++ b/src/config.c @@ -183,8 +183,6 @@ conf_misc_section(void) conf.focus_fmouse = fetch_opt_first(sec, "true", "focus_follow_mouse").boolean; conf.focus_fmov = fetch_opt_first(sec, "false", "focus_follow_movement").boolean; conf.focus_pclick = fetch_opt_first(sec, "true", "focus_pointer_click").boolean; - conf.status_timing = fetch_opt_first(sec, "1", "status_timing").num; - conf.status_path = fetch_opt_first(sec, "", "status_path").str; conf.autostart_path = fetch_opt_first(sec, "", "autostart_path").str; conf.autostart_command = fetch_opt_first(sec, "", "autostart_command").str; pad = fetch_opt_first(sec, "12", "pad").num; @@ -203,12 +201,6 @@ conf_misc_section(void) conf.pad = pad; - if(conf.status_timing < 0) - { - warnx("configuration : status_timing value (%d) incorrect.", conf.status_timing); - conf.status_timing = 1; - } - return; } diff --git a/src/event.c b/src/event.c index 1365d8a..f6053e9 100644 --- a/src/event.c +++ b/src/event.c @@ -281,10 +281,6 @@ clientmessageevent(XEvent *e) screen_get_sel(); } - /* Manage _WMFS_UPDATE_STATUS */ - if(mess_t == wmfs_update_status && estatus) - spawn(conf.status_path); - return; } diff --git a/src/ewmh.c b/src/ewmh.c index c10175b..ed58165 100644 --- a/src/ewmh.c +++ b/src/ewmh.c @@ -95,7 +95,6 @@ ewmh_init_hints(void) /* WMFS hints */ net_atom[wmfs_running] = ATOM("_WMFS_RUNNING"); net_atom[wmfs_update_hints] = ATOM("_WMFS_UPDATE_HINTS"); - net_atom[wmfs_update_status] = ATOM("_WMFS_UPDATE_STATUS"); net_atom[wmfs_set_screen] = ATOM("_WMFS_SET_SCREEN"); net_atom[wmfs_screen_count] = ATOM("_WMFS_SCREEN_COUNT"); net_atom[wmfs_current_tag] = ATOM("_WMFS_CURRENT_TAG"); diff --git a/src/init.c b/src/init.c index 349dde0..f91516b 100644 --- a/src/init.c +++ b/src/init.c @@ -196,43 +196,6 @@ init_root(void) return; } -/** Init statustext shell script - */ -static void -init_status(void) -{ - struct stat st; - char *home; - - conf.status_pid = -1; - estatus = False; - - if(!conf.status_path) - { - if(!(home = getenv("HOME"))) - { - warnx("HOME not set, can't launch status.sh"); - return; - } - - conf.status_path = zmalloc(strlen(home) + strlen(DEF_STATUS) + 2); - sprintf(conf.status_path, "%s/"DEF_STATUS, home); - } - - if (stat(patht(conf.status_path), &st) == -1) - { - warn("%s", patht(conf.status_path)); - return; - } - - if(st.st_size && st.st_mode & S_IXUSR) - estatus = True; - else - warnx("status file specified in configuratin (status_path) or present in wmfs directory can't be executed, try 'chmod +x %s'.", patht(conf.status_path)); - - return; -} - /** Init WMFS */ void @@ -250,7 +213,6 @@ init(void) event_make_array(); infobar_init(); systray_acquire(); - init_status(); ewmh_update_current_tag_prop(); grabkeys(); diff --git a/src/structs.h b/src/structs.h index 19ba931..6b722c6 100644 --- a/src/structs.h +++ b/src/structs.h @@ -158,7 +158,6 @@ enum /* WMFS HINTS */ wmfs_running, wmfs_update_hints, - wmfs_update_status, wmfs_current_tag, wmfs_current_screen, wmfs_current_layout, @@ -413,9 +412,6 @@ typedef struct bool tagnamecount; Tag default_tag; uint pad; - int status_timing; - char *status_path; - pid_t status_pid; char *autostart_path; char *autostart_command; struct diff --git a/src/wmfs.c b/src/wmfs.c index c09950d..9a31876 100644 --- a/src/wmfs.c +++ b/src/wmfs.c @@ -143,77 +143,18 @@ quit(void) free(event_handle); - /* kill status script */ - if (conf.status_pid != (pid_t)-1) - kill(conf.status_pid, SIGTERM); - return; } -static void -wait_childs_and_status(void) -{ - int pid; - - pthread_mutex_lock(&mtx); - if (sig_chld) { - while ((pid = waitpid(-1, NULL, WNOHANG)) > 0) - if (pid == conf.status_pid) - conf.status_pid = -1; - sig_chld = False; - } - pthread_mutex_unlock(&mtx); -} - -static void * -thread_status(void *arg) -{ - (void)arg; - int left = conf.status_timing; - - pthread_detach(pthread_self()); - - do - { - wait_childs_and_status(); - - pthread_mutex_lock(&mtx); - if (conf.status_pid == -1) - conf.status_pid = spawn(conf.status_path); - pthread_mutex_unlock(&mtx); - - while ((left = sleep(left)) > 0); - left = conf.status_timing; - - } while (!exiting); - - pthread_exit(NULL); -} - /** WMFS main loop. */ static void mainloop(void) { XEvent ev; - pthread_t th_status; - - if(estatus && !conf.status_timing) - conf.status_pid = spawn(conf.status_path); - else if(estatus && pthread_create(&th_status, NULL, thread_status, NULL) != 0) - { - warnx("pthread_create"); - estatus = False; - } while(!exiting && !XNextEvent(dpy, &ev)) - { HANDLE_EVENT(&ev); - wait_childs_and_status(); - } - - if(estatus) - pthread_join(th_status, NULL); return; } diff --git a/src/wmfs.h b/src/wmfs.h index 0a9d88c..3eb91a8 100644 --- a/src/wmfs.h +++ b/src/wmfs.h @@ -442,7 +442,6 @@ int selscreen; int prevselscreen; Conf conf; Key *keys; -bool estatus; Geo *sgeo; Geo *spgeo; Cursor cursor[CurLast]; diff --git a/wmfsrc b/wmfsrc index e207f2a..518cac2 100644 --- a/wmfsrc +++ b/wmfsrc @@ -18,8 +18,6 @@ # true -- default, set focus # false -- click go to client; including dockapps focus_pointer_click = true - status_timing = 1 #seconds - # status_path = "~/.config/wmfs/status.sh" [/misc] [bar]