new output system for all driver actions implemented

pull/9/head^2
parent a30135ef12
commit c42bb965a4

@ -125,8 +125,6 @@ void yon_terminal_start(widgets_dict *widgets, char *usr_command){
widgets->TerminalInfoLabel = yon_gtk_builder_get_widget(builder, "TerminalInfoLabel");
GtkWidget *terminal = yon_gtk_builder_get_widget(builder, "TerminalTerminal");
// gtk_size_group_add_widget(GTK_SIZE_GROUP(gtk_builder_get_object(builder,"sgroup")),yon_gtk_builder_get_widget(builder,"TerminalFrame"));
// gtk_size_group_add_widget(GTK_SIZE_GROUP(gtk_builder_get_object(builder,"sgroup")),widgets->TerminalOverlay);
vte_terminal_set_size(VTE_TERMINAL(terminal),10,15);
gtk_widget_set_app_paintable(terminal,1);
gtk_style_context_add_class(gtk_widget_get_style_context(terminal),"opacited");
@ -139,7 +137,7 @@ void yon_terminal_start(widgets_dict *widgets, char *usr_command){
gtk_revealer_set_reveal_child(GTK_REVEALER(widgets->TerminalRevealer),1);
VtePty *pty = vte_pty_new_sync(VTE_PTY_DEFAULT,NULL,NULL);
vte_terminal_set_pty(VTE_TERMINAL(terminal),pty);
char *install_command=yon_char_unite(usr_command," ;exit 0","\n",NULL);
char *install_command=yon_char_unite("tput cup 0 0 && tput ed; ",usr_command," ; sleep 5;exit 0","\n",NULL);
vte_terminal_spawn_async(VTE_TERMINAL(terminal),
VTE_PTY_DEFAULT,
NULL,
@ -176,7 +174,7 @@ void on_driver_pack_install(GtkWidget *self,widgets_dict *widgets){
GtkTreeSelection *selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->proprietaryTreeView));
gtk_tree_selection_get_selected(selection,&list_s,&iter);
gtk_tree_model_get(list_s,&iter,1,&name,-1);
yon_terminal_start(widgets,yon_char_get_augumented(install_proprietary_command,"virtualbox"));
yon_terminal_start(widgets,yon_char_get_augumented(install_proprietary_command,name));
}
@ -189,50 +187,7 @@ void on_driver_install(GtkWidget *self,widgets_dict *widgets){
GtkTreeSelection *selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->driversTreeView));
gtk_tree_selection_get_selected(selection,&list_s,&iter);
gtk_tree_model_get(list_s,&iter,1,&name,-1);
pthread_t tid;
char **command=new_arr(char*,2);
gchar **envp = g_get_environ();
command[0]=(gchar *)g_strdup(g_environ_getenv(envp, "SHELL"));
command[1]=NULL;
char **env=new_arr(char*,2);
env[0]="";
env[1]=NULL;
GtkWidget *terminal = vte_terminal_new();
gtk_box_pack_start(GTK_BOX(widgets->TerminalBox),terminal,1,1,0);
VtePty *pty = vte_pty_new_sync(VTE_PTY_DEFAULT,NULL,NULL);
// VtePty *pty = vte_terminal_pty_new_sync(VTE_TERMINAL(terminal),VTE_PTY_DEFAULT,NULL,NULL);
vte_terminal_set_pty(VTE_TERMINAL(terminal),pty);
char *install_command=yon_char_unite(install_proprietary_command,name,"\n",NULL);
vte_terminal_spawn_async(VTE_TERMINAL(terminal),
VTE_PTY_DEFAULT,
NULL, /* working directory */
command, /* command */
NULL, /* environment */
0, /* spawn flags */
NULL, NULL, /* child setup */
NULL, /* child pid */
-1, /* timeout */
NULL, /* cancellable */
child_ready, /* callback */
install_command); /* user_data */
vte_pty_spawn_async(pty,
NULL, /* working directory */
command, /* command */
NULL, /* environment */
0, /* spawn flags */
NULL, NULL, /* child setup */
NULL, /* child pid */
-1, /* timeout */
NULL, /* cancellable */
NULL, /* callback */
NULL); /* user_data */
vte_terminal_set_scroll_on_output(VTE_TERMINAL(terminal), FALSE);
vte_terminal_set_scroll_on_keystroke(VTE_TERMINAL(terminal), FALSE);
vte_terminal_set_scrollback_lines(VTE_TERMINAL(terminal),100);
gtk_widget_show_all(widgets->TerminalRevealer);
// pthread_create(&tid,NULL,(void*)yon_launch_with_output,(void*)yon_char_get_augumented(install_proprietary_command,name));
yon_terminal_start(widgets,yon_char_get_augumented(install_proprietary_command,name));
}
void on_driver_pack_delete(GtkWidget *self,widgets_dict *widgets){
@ -258,36 +213,7 @@ void on_driver_pack_delete(GtkWidget *self,widgets_dict *widgets){
VtePty *pty = vte_pty_new_sync(VTE_PTY_DEFAULT,NULL,NULL);
// VtePty *pty = vte_terminal_pty_new_sync(VTE_TERMINAL(terminal),VTE_PTY_DEFAULT,NULL,NULL);
vte_terminal_set_pty(VTE_TERMINAL(terminal),pty);
char *install_command=yon_char_unite(delete_proprietary_command,name,"\n",NULL);
vte_terminal_spawn_async(VTE_TERMINAL(terminal),
VTE_PTY_DEFAULT,
NULL, /* working directory */
command, /* command */
NULL, /* environment */
0, /* spawn flags */
NULL, NULL, /* child setup */
NULL, /* child pid */
-1, /* timeout */
NULL, /* cancellable */
child_ready, /* callback */
install_command); /* user_data */
vte_pty_spawn_async(pty,
NULL, /* working directory */
command, /* command */
NULL, /* environment */
0, /* spawn flags */
NULL, NULL, /* child setup */
NULL, /* child pid */
-1, /* timeout */
NULL, /* cancellable */
NULL, /* callback */
NULL); /* user_data */
vte_terminal_set_scrollback_lines(VTE_TERMINAL(terminal), 0);
vte_terminal_set_scroll_on_output(VTE_TERMINAL(terminal), FALSE);
vte_terminal_set_scroll_on_keystroke(VTE_TERMINAL(terminal), TRUE);
gtk_widget_show_all(widgets->TerminalRevealer);
// pthread_create(&tid,NULL,(void*)yon_launch_with_output,(void*)yon_char_get_augumented(delete_proprietary_command,name));
yon_terminal_start(widgets,yon_char_get_augumented(delete_proprietary_command,name));
}
void on_driver_delete(GtkWidget *self,widgets_dict *widgets){
@ -298,51 +224,7 @@ void on_driver_delete(GtkWidget *self,widgets_dict *widgets){
GtkTreeSelection *selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->driversTreeView));
gtk_tree_selection_get_selected(selection,&list_s,&iter);
gtk_tree_model_get(list_s,&iter,1,&name,-1);
pthread_t tid;
char **command=new_arr(char*,2);
gchar **envp = g_get_environ();
command[0]=(gchar *)g_strdup(g_environ_getenv(envp, "SHELL"));
command[1]=NULL;
char **env=new_arr(char*,2);
env[0]="";
env[1]=NULL;
GtkWidget *terminal = vte_terminal_new();
// vte_terminal_set_size(VTE_TERMINAL(terminal),50,100);
gtk_box_pack_start(GTK_BOX(widgets->TerminalBox),terminal,1,1,0);
VtePty *pty = vte_pty_new_sync(VTE_PTY_DEFAULT,NULL,NULL);
// VtePty *pty = vte_terminal_pty_new_sync(VTE_TERMINAL(terminal),VTE_PTY_DEFAULT,NULL,NULL);
vte_terminal_set_pty(VTE_TERMINAL(terminal),pty);
char *install_command=yon_char_unite(delete_proprietary_command,name,"\n",NULL);
vte_terminal_spawn_async(VTE_TERMINAL(terminal),
VTE_PTY_DEFAULT,
NULL, /* working directory */
command, /* command */
NULL, /* environment */
0, /* spawn flags */
NULL, NULL, /* child setup */
NULL, /* child pid */
-1, /* timeout */
NULL, /* cancellable */
child_ready, /* callback */
install_command); /* user_data */
vte_pty_spawn_async(pty,
NULL, /* working directory */
command, /* command */
NULL, /* environment */
0, /* spawn flags */
NULL, NULL, /* child setup */
NULL, /* child pid */
-1, /* timeout */
NULL, /* cancellable */
NULL, /* callback */
NULL); /* user_data */
vte_terminal_set_scrollback_lines(VTE_TERMINAL(terminal), 0);
vte_terminal_set_scroll_on_output(VTE_TERMINAL(terminal), FALSE);
vte_terminal_set_scroll_on_keystroke(VTE_TERMINAL(terminal), TRUE);
gtk_widget_show_all(widgets->TerminalRevealer);
// pthread_create(&tid,NULL,(void*)yon_launch_with_output,(void*)yon_char_get_augumented(delete_proprietary_command,name));
yon_terminal_start(widgets,yon_char_get_augumented(delete_proprietary_command,name));
}
void on_driver_pack_info(GtkWidget *self, widgets_dict *widgets){

@ -53,7 +53,7 @@
#define remove_drivers_local_command "/usr/bin/ubconfig --target global remove video "
#define install_proprietary_command "tput cup 0 0 && tput ed; pkexec pacman -Sy "
#define install_proprietary_command "pkexec pacman --quiet --needed --noconfirm -S "
#define delete_proprietary_command "pkexec pacman -R --noconfirm "

Loading…
Cancel
Save