Added VNC switching

pull/100/head
parent cb340c80a6
commit ed30b86beb
No known key found for this signature in database
GPG Key ID: FF1D842BF4DDE92B

@ -3,6 +3,13 @@
config main_config;
// //functions
void on_vnc_toggled(GtkWidget *self, main_window *){
if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(self))){
yon_launch(enable_vnc_command);
} else {
yon_launch(disable_vnc_command);
}
}
void on_pacman_software_all_toggled(GtkWidget *, char *path, main_window *widgets){
GtkTreeIter iter;
@ -381,6 +388,7 @@ main_window *yon_main_window_complete(){
widgets->Notebook = yon_gtk_builder_get_widget(builder,"Notebook");
widgets->MainSpinner=yon_gtk_builder_get_widget(builder,"MainSpinner");
widgets->EnableVNCMenuItem = yon_gtk_builder_get_widget(builder,"EnableVNCMenuItem");
widgets->DocumentationMenuItem = yon_ubl_menu_item_documentation_new(DOCUMENTATION_LABEL);
widgets->AboutMenuItem = yon_ubl_menu_item_about_new(ABOUT_LABEL);
@ -630,11 +638,13 @@ main_window *yon_main_window_complete(){
gtk_style_context_remove_class(gtk_widget_get_style_context(widgets->DocumentationMenuItem),"menuitemtop");
gtk_menu_shell_append(GTK_MENU_SHELL(menu),widgets->DocumentationMenuItem);
gtk_menu_shell_append(GTK_MENU_SHELL(menu),widgets->AboutMenuItem);
g_signal_connect(G_OBJECT(widgets->LoadGlobalConfigurationMenuItem),"activate",G_CALLBACK(on_config_global_load),widgets);
g_signal_connect(G_OBJECT(widgets->LoadLocalConfigurationMenuItem),"activate",G_CALLBACK(on_config_local_load),widgets);
g_signal_connect(G_OBJECT(widgets->LoadExternalConfigurationMenuItem),"activate",G_CALLBACK(on_config_custom_load),widgets);
g_signal_connect(G_OBJECT(widgets->EnableVNCMenuItem),"activate",G_CALLBACK(on_vnc_toggled),widgets);
// g_signal_connect(G_OBJECT(widgets->SaveGlobalLocalConfigurationMenuItem),"activate",G_CALLBACK(on_config_global_local_save),widgets);
// g_signal_connect(G_OBJECT(widgets->SaveGlobalConfigurationMenuItem),"activate",G_CALLBACK(on_config_global_save),widgets);
// g_signal_connect(G_OBJECT(widgets->SaveLocalConfigurationMenuItem),"activate",G_CALLBACK(on_config_local_save),widgets);

@ -123,6 +123,10 @@ layout && /description:/ {\
}\
\" | sort -u\
"
#define enable_vnc_command "ubconfig --target system set [desktop] X11VNC=ublinux"
#define disable_vnc_command "ubconfig --target system remove [desktop] X11VNC=ublinux"
#define get_layouts_local_command(layout) yon_char_unite("xkbcli list --load-exotic | awk -v layout=\"",layout,"\" \"BEGIN {layout_pattern = sprintf(\\\"^ *- *layout: *'%s'\\\",layout);matched=0} matched && /variant:/ {match(\\$0, /: *'([^']+)'/, matches);variant = matches[1]} matched && /description:/ {match(\\$0, /: *(.+)/, matches);description = matches[1]} matched && /^ *-/{matched=0; if (variant) printf \\\"%s|%s\\n\\\",variant,description} \\$0 ~ layout_pattern {matched=1;variant=\\\"\\\";description=\\\"\\\";next}\" | sort -u",NULL)
#define get_devices_command "lsblk --noheadings --nodeps -Jo PATH,SIZE,MODEL,VENDOR,SERIAL --exclude 7"
#define get_parts_and_devices_command "lsblk --noheadings --bytes -o TYPE,PATH,SIZE,FSTYPE,LABEL,PARTLABEL,MOUNTPOINT,FSUSED,FSUSE% --exclude 7 |awk '{print ($1\";\"$2\";\"$3\";\"$4\";\"$5\";\"$6\";\"$7\";\"$8\";\"$9)}'"
@ -515,6 +519,7 @@ typedef struct {
GtkWidget *ConfigurationModeMenuItem;
GtkWidget *EnableVNCMenuItem;
GtkWidget *AboutMenuItem;
GtkWidget *DocumentationMenuItem;
@ -1113,4 +1118,5 @@ void yon_source_update(source_window *window);
void yon_source_element_add(char *key,void*,source_window *window);
source_element *yon_source_element_new();
void on_system_setup_pass(GtkWidget *, main_window *widgets);
void yon_resize_images_update(main_window *widgets);
void yon_resize_images_update(main_window *widgets);
void on_vnc_toggled(GtkWidget *self, main_window *widgets);
Loading…
Cancel
Save