diff --git a/source/ubl-settings-logging.c b/source/ubl-settings-logging.c index a1f9451..b612b4e 100644 --- a/source/ubl-settings-logging.c +++ b/source/ubl-settings-logging.c @@ -1591,6 +1591,7 @@ logrotate_configure_window *yon_logrotate_window_new(char *paths, logrotate_wind } config_str logsize = yon_config_load(logrotate_size_command(temp_paths),&sz); for (int i=0;iLogSizeLabel),logsize[0]); } gtk_window_set_title(GTK_WINDOW(window->MainWindow),TITLE_LABEL); @@ -2598,10 +2600,35 @@ void on_log_edit(GtkWidget *self,main_window *widgets){ int sz; config_str logsize = yon_config_load(journald_size_command,&sz); if (logsize) + if (logsize[0][strlen(logsize[0])-1]=='\n') logsize[0][strlen(logsize[0])-1]='\0'; gtk_label_set_text(GTK_LABEL(window->LogSizeLabel),logsize[0]); - g_signal_connect(G_OBJECT(window->JournaldButton),"clicked", G_CALLBACK(on_journald_open),widgets); + g_signal_connect(G_OBJECT(window->JournaldButton),"clicked", G_CALLBACK(on_journald_open),widgets); } else { gtk_widget_hide(window->JournaldButton); + if (paths){ + int sz; + float finalsize=0.0; + char *temp_paths = yon_char_new(paths); + config_str parsed_paths = yon_char_parse(temp_paths,&sz,"\n"); + free(temp_paths); + temp_paths=NULL; + for (int i=0;iLogSizeLabel),yon_char_append(fin,yon_size_get_letter_from_int(sizenumber))); + gtk_widget_show(window->StatisticsFrame); + } + } dictionary *dict = NULL; yon_dictionary_add_or_create_if_exists_with_data(dict,"widgets",widgets); yon_dictionary_add_or_create_if_exists_with_data(dict,"window",window); diff --git a/source/ubl-settings-logging.h b/source/ubl-settings-logging.h index 2e0494e..2a20f0a 100644 --- a/source/ubl-settings-logging.h +++ b/source/ubl-settings-logging.h @@ -39,6 +39,7 @@ #define config_path yon_char_unite(yon_ubl_user_get_home_directory(),"/.config/",LocaleName,"/",LocaleName,".conf",NULL) #define journals_list_path "/usr/share/ubl-settings-logging/csv/journals_list.csv" #define services_list_path "/usr/share/ubl-settings-logging/csv/logging_services.csv" + #define logrotate_config_command "ls /etc/logrotate.d/ |sed -e 's/ */\\n/g'" #define journald_size_command "journalctl --disk-usage | grep -oE \"[0-9]{1,}.[0-9]{1,}[A-Z]\"" #define logrotate_size_command(paths) yon_char_unite("du ",paths," |grep -oE '^[0-9]{1,}'",NULL) @@ -51,14 +52,14 @@ #define JOURNALD(key) yon_char_unite("JOURNALD[",key,"]",NULL) #define LOGROTATE(key) yon_char_unite("LOGROTATE[",key,"]",NULL) -#define get_journal_output_command "clear;SYSTEMD_COLORS=false journalctl --no-pager" -#define get_journal_output_since_boot_command "clear;SYSTEMD_COLORS=false journalctl --no-pager -b" -#define get_journal_output_followed_command "clear;SYSTEMD_COLORS=false journalctl --no-pager -f" -#define get_journal_output_kernel_command "clear;SYSTEMD_COLORS=false journalctl --no-pager -k" -#define get_journal_output_prioritied_command "clear;SYSTEMD_COLORS=false journalctl --no-pager -p err..alert" -#define get_journal_all_boots_command "clear;SYSTEMD_COLORS=false journalctl --no-pager --list-boots" -#define get_journal_all_units_command "clear;SYSTEMD_COLORS=false systemd-analyze blame --no-pager" -#define get_journal_init_tree_command "clear;SYSTEMD_COLORS=false systemd-analyze critical-chain --no-pager" +#define get_journal_output_command "clear;journalctl --no-pager" +#define get_journal_output_since_boot_command "clear;journalctl --no-pager -b" +#define get_journal_output_followed_command "clear;journalctl --no-pager -f" +#define get_journal_output_kernel_command "clear;journalctl --no-pager -k" +#define get_journal_output_prioritied_command "clear;journalctl --no-pager -p err..alert" +#define get_journal_all_boots_command "clear;journalctl --no-pager --list-boots" +#define get_journal_all_units_command "clear;systemd-analyze blame --no-pager" +#define get_journal_init_tree_command "clear;systemd-analyze critical-chain --no-pager" #define group_list_path "/etc/group"