diff --git a/source/ubl-settings-services.c b/source/ubl-settings-services.c index b42e75d..8f905e9 100644 --- a/source/ubl-settings-services.c +++ b/source/ubl-settings-services.c @@ -1492,7 +1492,7 @@ void* yon_interface_update(main_window *widgets){ int active = !strcmp(parsed[2],"active"); enum YON_UNIT_TYPE type = yon_get_unit_type(names_parsed[j]); gtk_list_store_append(widgets->SystemList,&iter); - gtk_list_store_set(widgets->SystemList,&iter,3,enabled,4,active,5,names_parsed[j],6,parsed[4],7,type,8,active,9,loaded,11,_(parsed[3]),13,parsed[3],14,parsed[1],15,parsed[2],-1); + gtk_list_store_set(widgets->SystemList,&iter,3,enabled,4,active,5,names_parsed[j],6,parsed[4],7,type,8,active,9,loaded,11,_(parsed[3]),13,parsed[3],14,parsed[1],15,parsed[2],16,parsed[8],-1); } } yon_char_parsed_free(names_parsed,names_size); @@ -1524,7 +1524,7 @@ void* yon_interface_update(main_window *widgets){ int active = !strcmp(parsed[2],"active"); enum YON_UNIT_TYPE type = yon_get_unit_type(names_parsed[j]); gtk_list_store_append(widgets->UserList,&iter); - gtk_list_store_set(widgets->UserList,&iter,3,enabled,4,active,5,names_parsed[j],6,parsed[4],7,type,8,active,9,loaded,11,_(parsed[3]),13,parsed[3],14,parsed[1],15,parsed[2],-1); + gtk_list_store_set(widgets->UserList,&iter,3,enabled,4,active,5,names_parsed[j],6,parsed[4],7,type,8,active,9,loaded,11,_(parsed[3]),13,parsed[3],14,parsed[1],15,parsed[2],16,parsed[8],-1); } } yon_char_parsed_free(names_parsed,names_size); @@ -1797,9 +1797,9 @@ gboolean on_tooltip_show(GtkWidget*, gint x, gint y, gboolean, GtkTooltip* toolt if (gtk_tree_view_get_path_at_pos(GTK_TREE_VIEW(tree), tree_x, tree_y, &path, NULL, NULL, NULL)) { GtkTreeIter iter; if (gtk_tree_model_get_iter(model, &iter, path)) { - gchar *name, *description, *state, *name_target, *load_status, *active_status; + gchar *name, *description, *state, *name_target, *load_status, *active_status,*unit_path; int size; - gtk_tree_model_get(model, &iter, 5, &name, 6, &description, 11, &state, 14,&load_status,15,&active_status, -1); + gtk_tree_model_get(model, &iter, 5, &name, 6, &description, 11, &state, 14,&load_status,15,&active_status,16,&unit_path, -1); name_target = yon_char_new(name); if (name[0]=='-'){ name_target = yon_char_append("-- ",name_target); @@ -1813,10 +1813,10 @@ gboolean on_tooltip_show(GtkWidget*, gint x, gint y, gboolean, GtkTooltip* toolt yon_char_remove_last_symbol(target[1], '\n'); free(yon_char_divide_search(target[2], "=", -1)); yon_char_remove_last_symbol(target[2], '\n'); - gtk_label_set_text(GTK_LABEL(widgets->UnitLabel), target[0]); } + gtk_label_set_text(GTK_LABEL(widgets->UnitLabel), unit_path); gtk_label_set_text(GTK_LABEL(widgets->NameLabel), name); gtk_label_set_text(GTK_LABEL(widgets->DescriptionLabel), description); gtk_label_set_text(GTK_LABEL(widgets->StatusQueryLabel), state); diff --git a/source/ubl-settings-services.h b/source/ubl-settings-services.h index 0083191..9947e8d 100644 --- a/source/ubl-settings-services.h +++ b/source/ubl-settings-services.h @@ -37,7 +37,7 @@ #define systemd_config_path "resource:///com/ublinux/csv/systemd_conf.csv" #define load_services_command \ -"systemctl --property=Names,Description,LoadState,ActiveState,SubState,UnitFileState,ActiveEnterTimestampMonotonic,InactiveEnterTimestampMonotonic " \ +"systemctl --property=Names,Description,LoadState,ActiveState,SubState,UnitFileState,FragmentPath,ActiveEnterTimestampMonotonic,InactiveEnterTimestampMonotonic " \ "--no-pager --all --no-legend show -- $( { " \ "systemctl list-units --no-pager --all --plain --no-legend | sed -E 's/^([^ ]+).*/\\1/'; " \ "systemctl list-unit-files --no-pager --no-legend | sed -E 's/^([^ ]+).*/\\1/'; " \ @@ -46,11 +46,11 @@ "{ for (i=1; i<=NF; i++) { split($i, kv, \"=\"); val[kv[1]] = kv[2]; } " \ "print val[\"Names\"] \";\" val[\"LoadState\"] \";\" val[\"ActiveState\"] \";\" val[\"SubState\"] \";\" " \ "val[\"Description\"] \";\" val[\"UnitFileState\"] \";\" val[\"ActiveEnterTimestampMonotonic\"] \";\" " \ -"val[\"InactiveEnterTimestampMonotonic\"]; delete val }'" +"val[\"InactiveEnterTimestampMonotonic\"] \";\" val[\"FragmentPath\"]; delete val }'" #define load_system_units_command "systemctl list-unit-files --no-pager --all --plain --no-legend |sed -E 's/(\\S+)\\s+(\\S+)\\s+(\\S+)(.*)/\\1/'" #define load_user_units_command yon_char_unite(\ -"systemctl --property=Names,Description,LoadState,ActiveState,SubState,UnitFileState,ActiveEnterTimestampMonotonic,InactiveEnterTimestampMonotonic " \ +"systemctl --property=Names,Description,LoadState,ActiveState,SubState,UnitFileState,FragmentPath,ActiveEnterTimestampMonotonic,InactiveEnterTimestampMonotonic " \ "--no-pager --all --no-legend show -- $( { " \ "systemctl --user --machine=",yon_ubl_root_user_get(),"@ list-units --no-pager --all --plain --no-legend | sed -E 's/^([^ ]+).*/\\1/'; " \ "systemctl --user --machine=",yon_ubl_root_user_get(),"@ list-unit-files --no-pager --no-legend | sed -E 's/^([^ ]+).*/\\1/'; " \ @@ -59,7 +59,7 @@ "{ for (i=1; i<=NF; i++) { split($i, kv, \"=\"); val[kv[1]] = kv[2]; } " \ "print val[\"Names\"] \";\" val[\"LoadState\"] \";\" val[\"ActiveState\"] \";\" val[\"SubState\"] \";\" " \ "val[\"Description\"] \";\" val[\"UnitFileState\"] \";\" val[\"ActiveEnterTimestampMonotonic\"] \";\" " \ -"val[\"InactiveEnterTimestampMonotonic\"]; delete val }'",NULL) +"val[\"InactiveEnterTimestampMonotonic\"] \";\" val[\"FragmentPath\"]; delete val }'",NULL) #define load_user_services_command yon_char_unite("systemctl --user --machine=",yon_ubl_root_user_get(),"@ list-units --no-pager --all --plain --no-legend |sed -E 's/(\\S+)\\s+(\\S+)\\s+(\\S+)\\s+(\\S+)\\s+(.*)/\\1;\\2;\\3;\\4;\\5/'",NULL) #define load_system_services_command "systemctl --system list-units --no-pager --all |grep -E \"^ \" |grep -v \"UNIT\" |sed -e 's/ */;/g' -e 's/^;//g' |cut -f1 -d';'" #define load_enabled_command "systemctl list-unit-files --no-pager --state=enabled --all |sed -e 's/ */:/g' -e 's/ *: */:/g'|cut -f1 -d:" @@ -74,18 +74,18 @@ #define user_check_active_command(target) yon_char_unite("systemctl --user --machine=",yon_ubl_root_user_get(),"@ is-active ",target,NULL) #define user_check_enabled_command(target) yon_char_unite("systemctl --user --machine=",yon_ubl_root_user_get(),"@ is-enabled ",target,NULL) -#define load_system_service_single(target) yon_char_unite("systemctl --property=Names,Description,LoadState,ActiveState,SubState,UnitFileState,ActiveEnterTimestampMonotonic,InactiveEnterTimestampMonotonic --no-pager --all --no-legend show -- ",target,\ +#define load_system_service_single(target) yon_char_unite("systemctl --property=Names,Description,LoadState,ActiveState,SubState,UnitFileState,FragmentPath,ActiveEnterTimestampMonotonic,InactiveEnterTimestampMonotonic --no-pager --all --no-legend show -- ",target,\ "awk 'BEGIN { RS=\"\"; FS=\"\\n\" } " \ "{ for (i=1; i<=NF; i++) { split($i, kv, \"=\"); val[kv[1]] = kv[2]; } " \ "print val[\"Names\"] \";\" val[\"LoadState\"] \";\" val[\"ActiveState\"] \";\" val[\"SubState\"] \";\" " \ "val[\"Description\"] \";\" val[\"UnitFileState\"] \";\" val[\"ActiveEnterTimestampMonotonic\"] \";\" " \ -"val[\"InactiveEnterTimestampMonotonic\"]; delete val }'",NULL) -#define load_user_service_single(target) yon_char_unite("systemctl --user --machine=",yon_ubl_root_user_get(),"@ --property=Names,Description,LoadState,ActiveState,SubState,UnitFileState,ActiveEnterTimestampMonotonic,InactiveEnterTimestampMonotonic --no-pager --all --no-legend show -- ",target,\ +"val[\"InactiveEnterTimestampMonotonic\"] \";\" val[\"FragmentPath\"]; delete val }'",NULL) +#define load_user_service_single(target) yon_char_unite("systemctl --user --machine=",yon_ubl_root_user_get(),"@ --property=Names,Description,LoadState,ActiveState,SubState,UnitFileState,FragmentPath,ActiveEnterTimestampMonotonic,InactiveEnterTimestampMonotonic --no-pager --all --no-legend show -- ",target,\ "awk 'BEGIN { RS=\"\"; FS=\"\\n\" } " \ "{ for (i=1; i<=NF; i++) { split($i, kv, \"=\"); val[kv[1]] = kv[2]; } " \ "print val[\"Names\"] \";\" val[\"LoadState\"] \";\" val[\"ActiveState\"] \";\" val[\"SubState\"] \";\" " \ "val[\"Description\"] \";\" val[\"UnitFileState\"] \";\" val[\"ActiveEnterTimestampMonotonic\"] \";\" " \ -"val[\"InactiveEnterTimestampMonotonic\"]; delete val }'",NULL) +"val[\"InactiveEnterTimestampMonotonic\"] \";\" val[\"FragmentPath\"]; delete val }'",NULL) #define service_info_command(target) yon_char_append("systemctl status -l --no-pager ",target) #define get_log_command(target) yon_char_append("journalctl --all --no-pager --unit ",target) diff --git a/ubl-settings-services.glade b/ubl-settings-services.glade index 787a156..416e8a8 100644 --- a/ubl-settings-services.glade +++ b/ubl-settings-services.glade @@ -73,6 +73,8 @@ + + @@ -463,6 +465,8 @@ + +