@ -240,8 +240,18 @@ void on_driver_selection_change(GtkWidget *self, widgets_dict *widgets){
GtkTreeSelection * selection = gtk_tree_view_get_selection ( GTK_TREE_VIEW ( widgets - > driversTreeView ) ) ;
if ( gtk_tree_selection_get_selected ( selection , & list_s , & iter ) ) {
int installed = 0 ;
gtk_tree_model_get ( gtk_tree_view_get_model ( GTK_TREE_VIEW ( widgets - > driversTreeView ) ) , & iter , 0 , & installed , - 1 ) ;
if ( installed = = 1 ) {
char * module , * package ;
gtk_tree_model_get ( gtk_tree_view_get_model ( GTK_TREE_VIEW ( widgets - > driversTreeView ) ) , & iter , 0 , & installed , 1 , & module , 2 , & package , - 1 ) ;
char * target ;
if ( strcmp ( module , " " ) )
target = module ;
else
target = package ;
if ( strcmp ( target , " xf86-video-intel " ) | | strcmp ( target , " lib32-vulkan-intel " ) | | strcmp ( target , " mesa " ) ) {
gtk_widget_set_sensitive ( widgets - > driversInstallButton , 0 ) ;
gtk_widget_set_sensitive ( widgets - > driversDeleteButton , 0 ) ;
}
else if ( installed = = 1 ) {
gtk_widget_set_sensitive ( widgets - > driversInstallButton , 0 ) ;
gtk_widget_set_sensitive ( widgets - > driversDeleteButton , 1 ) ;
} else {
@ -1093,9 +1103,6 @@ void yon_proprietary_local_get(){
if ( strcmp ( drivers [ dr_foun ] , ubm ) = = 0 ) {
yon_dictionary_add_or_create_if_exists_with_data ( videoconfig . proprietary , drivers [ dr_foun ] , rtn [ dr_desc ] ) ;
}
// else if (strcmp(pack,"")!=0&&!(yon_dictionary_get(!videoconfig.proprietary||&videoconfig.proprietary,pack))){
// yon_dictionary_add_or_create_if_exists_with_data(videoconfig.proprietary,pack,rtn[dr_desc]);
// }
}
}
@ -1115,25 +1122,54 @@ dictionary *yon_proprieary_get(){
int size = 0 ;
config_str drivers = NULL ;
config_str rtn = NULL ;
int adapter_size ;
char flag = 0 ;
config_str adapter = yon_config_load ( get_adapter_info , & adapter_size ) ;
for ( int i = 0 ; i < adapter_size ; i + + ) {
char * current_string = NULL ;
if ( strstr ( adapter [ i ] , " vendor= " ) ) {
if ( strstr ( adapter [ i ] , " Intel " ) )
flag | = ( 1 < < 0 ) ;
else if ( strstr ( adapter [ i ] , " AMD " ) )
flag | = ( 1 < < 1 ) ;
else if ( strstr ( adapter [ i ] , " NVIDIA " ) )
flag | = ( 1 < < 2 ) ;
}
}
rtn = yon_config_load ( get_proprietary_drivers_info_command , & size ) ;
if ( videoconfig . proprietary ) {
yon_gtk_list_store_fill_with_proprietaries ( videoconfig . list ) ;
videoconfig . proprietary = NULL ;
}
drivers = yon_config_load ( get_proprietary_drivers_command , & drivers_size ) ;
for ( int dr_desc = 0 ; dr_desc < size ; dr_desc + + ) {
for ( int dr_foun = 0 ; dr_foun < drivers_size ; dr_foun + + ) {
drivers [ dr_foun ] = yon_char_divide_search ( drivers [ dr_foun ] , " \n " , - 1 ) ;
char * pack = yon_char_new ( rtn [ dr_desc ] ) ;
char * ubm = yon_char_divide_search ( pack , " ; " , - 1 ) ;
pack = yon_char_divide_search ( pack , " ; " , - 1 ) ;
if ( strcmp ( drivers [ dr_foun ] , ubm ) = = 0 ) {
yon_dictionary_add_or_create_if_exists_with_data ( videoconfig . proprietary , drivers [ dr_foun ] , rtn [ dr_desc ] ) ;
for ( int i = 0 ; i < drivers_size ; i + + ) {
if ( drivers [ i ] [ strlen ( drivers [ i ] ) - 1 ] = = ' \n ' ) drivers [ i ] [ strlen ( drivers [ i ] ) - 1 ] = ' \0 ' ;
}
for ( int di = 1 ; di < size ; di + + ) {
int current_size ;
config_str current = yon_char_parse ( rtn [ di ] , & current_size , " ; " ) ;
if ( current_size > 2 ) {
if ( strcmp ( current [ 0 ] , " " ) ) {
if ( ! ! strstr ( current [ 0 ] , " nvidia " ) & & ( ( flag > > 2 ) & 1 ) | | ! ! strstr ( current [ 0 ] , " amdgpu " ) & & ( ( flag > > 1 ) & 1 ) | | ( ! strcmp ( current [ 0 ] , " xf86-video-intel " ) | | ! strcmp ( current [ 0 ] , " mesa " ) ) & & ( ( flag > > 1 ) & 1 ) | | ! ! strstr ( current [ 0 ] , " lib32-vulkan-intel " ) & & ( ( flag > > 0 ) & 1 ) ) {
int target = yon_char_parsed_check_exist ( drivers , drivers_size , current [ 0 ] ) ;
if ( target > - 1 ) {
yon_dictionary_add_or_create_if_exists_with_data ( videoconfig . proprietary , drivers [ target ] , rtn [ di ] ) ;
} else {
yon_dictionary_add_or_create_if_exists_with_data ( videoconfig . proprietary , current [ 0 ] , rtn [ di ] ) ;
}
}
} else if ( strcmp ( current [ 1 ] , " " ) ) {
if ( ! ! strstr ( current [ 1 ] , " nvidia " ) & & ( ( flag > > 2 ) & 1 ) | | ! ! strstr ( current [ 1 ] , " amdgpu " ) & & ( ( flag > > 1 ) & 1 ) | | ( ! strcmp ( current [ 1 ] , " xf86-video-intel " ) | | ! strcmp ( current [ 1 ] , " mesa " ) | | ! ! strstr ( current [ 1 ] , " lib32-vulkan-intel " ) ) & & ( ( flag > > 0 ) & 1 ) ) {
int target = yon_char_parsed_check_exist ( drivers , drivers_size , current [ 1 ] ) ;
if ( target > - 1 ) {
yon_dictionary_add_or_create_if_exists_with_data ( videoconfig . proprietary , drivers [ target ] , rtn [ di ] ) ;
} else {
yon_dictionary_add_or_create_if_exists_with_data ( videoconfig . proprietary , current [ 1 ] , rtn [ di ] ) ;
}
}
else if ( strcmp ( pack , " " ) ! = 0 & & ! yon_dictionary_get ( & videoconfig . proprietary , pack ) ) {
yon_dictionary_add_or_create_if_exists_with_data ( videoconfig . proprietary , pack , rtn [ dr_desc ] ) ;
}
}
yon_char_parsed_free ( current , current_size ) ;
}
if ( videoconfig . proprietary ) {
yon_gtk_list_store_fill_with_proprietaries ( videoconfig . list ) ;
@ -1191,7 +1227,7 @@ void yon_gtk_list_store_fill_with_proprietaries(GtkListStore *list){
else {
gtk_list_store_append ( videoconfig . list2 , & iter ) ;
gtk_list_store_set ( videoconfig . list2 , & iter , 1 , str [ 0 ] , 2 , str [ 1 ] , 3 , str [ 2 ] , 4 , _ ( str [ 3 ] ) , 5 , _ ( str [ 4 ] ) , - 1 ) ;
if ( yon_char_parsed_check_exist ( installed , inssize , str [ 1 ] ) ! = - 1 ) {
if ( yon_char_parsed_check_exist ( installed , inssize , str [ 1 ] ) ! = - 1 | | ! strcmp ( str [ 1 ] , " mesa " ) | | ! strcmp ( str [ 1 ] , " lib32-vulkan-intel " ) | | ! strcmp ( str [ 1 ] , " xf86-video-intel " ) ) {
gtk_list_store_set ( videoconfig . list2 , & iter , 0 , 1 , - 1 ) ;
}
}
@ -1353,8 +1389,6 @@ void yon_monitor_config_update(monitorconfig* monitor, char *port, char *config_
monitor - > enable = 1 ;
if ( yon_char_parsed_check_exist ( cnf , size , " disable " ) ! = - 1 )
monitor - > enable = 0 ;
// if (yon_char_parsed_check_exist(cnf,size,"ignore")==1)
// monitor->enable=0;
if ( yon_char_parsed_check_exist ( cnf , size , " LeftOf: " ) ! = - 1 )
monitor - > position = 1 ;
if ( yon_char_parsed_check_exist ( cnf , size , " lo: " ) ! = - 1 )