diff options
| -rw-r--r-- | sb.c | 15 | 
1 files changed, 9 insertions, 6 deletions
| @@ -13,7 +13,7 @@  	static struct {	GtkWidget *win;	GtkWidget *bar;	GtkWidget *search; GtkWidget *vbox; GtkWidget *notebook; GtkWidget *status; } w;  	#define  get_tab(x, page_idx ) (struct tab*)g_object_get_qdata(G_OBJECT( gtk_notebook_get_nth_page( (GtkNotebook*)w.notebook, page_idx ) ), term_data_id);  	static GQuark term_data_id = 0; -	static char *defaultdownload = "xterm -bg black -fg white -e wget "; +	static char *defaultdownload = "xterm -bg black -fg white -e wget -P ";  	static char *defaultsearchengine = "http://www.google.com/search?q=";  	static void activate_uri_entry_cb(GtkWidget* entry, gpointer data);  	static void link_hover(WebKitWebView* page, const gchar* title, const gchar* link, gpointer data); @@ -56,7 +56,7 @@  			}  	static void download(WebKitWebView *web_view, GObject *d, gpointer user_data) {  		const gchar *c = webkit_download_get_uri(WEBKIT_DOWNLOAD(d)); -		gchar *command = g_strconcat(defaultdownload, g_strdup(c), NULL); +		gchar *command = g_strconcat(defaultdownload, g_get_home_dir(), "/ ", g_strdup(c), NULL);  		puts(command);  		g_spawn_command_line_async(command, NULL);  		g_free(command); @@ -78,7 +78,7 @@  		gtk_entry_set_text (GTK_ENTRY (w.bar), uri);  		FILE *history  = fopen(g_strconcat(g_get_home_dir(), "/.history", NULL), "a+"); -		fprintf(history, "%s", uri); +		fprintf(history, "%s \n", uri);  		fclose(history);  	} @@ -177,7 +177,10 @@  		webkit_web_view_set_settings (WEBKIT_WEB_VIEW(t->view), t->settings);  		gtk_widget_show_all(w.win);  		gtk_notebook_set_current_page(GTK_NOTEBOOK(w.notebook), index); -		gtk_widget_grab_focus(w.bar); +		//gtk_widget_grab_focus(w.bar); +		//gchar *url;		 +		//g_spawn_command_line_sync("sh -c 'sort /home/calvin/.history | dmenu -l 15'", &url, NULL, NULL, NULL); +		//load_uri(url);  	}  	static void tab_focus(GtkNotebook *notebook, GtkNotebookPage *page, guint page_num, gpointer user_data)   { @@ -236,8 +239,8 @@  	gboolean key_press_cb (GtkWidget *widget, GdkEventKey *event) {  		guint(g) = event->keyval; - -	if (event->state == GDK_CONTROL_MASK) { +	 +		if ( (event->state & GDK_CONTROL_MASK)== GDK_CONTROL_MASK) {  		if(g == GDK_l) {gtk_widget_grab_focus(GTK_WIDGET(w.bar)); return TRUE; }  		if (g == GDK_j) {  go_cb(FALSE); return TRUE; }  		if (g == GDK_k) {	go_cb(TRUE); return TRUE;	} | 
