xfce add, lumina-desktop move lumina directory

This commit is contained in:
Erkan IŞIK
2020-11-09 13:00:20 +03:00
parent 8d50b0df35
commit ae7c06a3dd
196 changed files with 266026 additions and 250034 deletions
@@ -0,0 +1,71 @@
--- a/panel-plugin/weather-summary.c 2020-02-23 03:39:53.000000000 +0300
+++ b/panel-plugin/weather-summary.c 2020-10-04 17:44:45.597555175 +0300
@@ -282,6 +282,55 @@
}
+static gboolean
+text_view_key_pressed_cb (GtkWidget *widget,
+ GdkEventKey *event,
+ gpointer user_data)
+{
+ GtkScrolledWindow *scrolled = GTK_SCROLLED_WINDOW (user_data);
+ GtkAdjustment *adjustment = gtk_scrolled_window_get_vadjustment (scrolled);
+ gdouble current = gtk_adjustment_get_value (adjustment);
+ gdouble min = gtk_adjustment_get_lower (adjustment);
+ gdouble max = gtk_adjustment_get_upper (adjustment);
+ gdouble step_size = 0;
+
+ switch (event->keyval) {
+ case GDK_KEY_Up:
+ case GDK_KEY_uparrow:
+ step_size = -1 * gtk_adjustment_get_step_increment (adjustment);
+ break;
+ case GDK_KEY_Down:
+ case GDK_KEY_downarrow:
+ step_size = gtk_adjustment_get_step_increment (adjustment);
+ break;
+ case GDK_KEY_Page_Up:
+ step_size = -1 * gtk_adjustment_get_page_size (adjustment);
+ break;
+ case GDK_KEY_Page_Down:
+ case GDK_KEY_space:
+ step_size = gtk_adjustment_get_page_size (adjustment);
+ break;
+ case GDK_KEY_Home:
+ step_size = -1 * current;
+ break;
+ case GDK_KEY_End:
+ step_size = max;
+ break;
+ }
+
+ if (step_size != 0) {
+ current = current + step_size;
+ if (current < min) current = min;
+ if (current > max) current = max;
+
+ gtk_adjustment_set_value (adjustment, current);
+
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
static GtkWidget *
create_summary_tab(plugin_data *data)
{
@@ -311,9 +360,12 @@
gtk_text_view_set_top_margin (GTK_TEXT_VIEW(view), 12);
gtk_text_view_set_right_margin (GTK_TEXT_VIEW(view), 12);
gtk_text_view_set_bottom_margin (GTK_TEXT_VIEW(view), 12);
+
frame = gtk_frame_new(NULL);
scrolled = gtk_scrolled_window_new(NULL, NULL);
+ g_signal_connect(GTK_WIDGET(view), "key-press-event", G_CALLBACK(text_view_key_pressed_cb), scrolled);
+
overlay = gtk_overlay_new ();
gtk_container_add (GTK_CONTAINER (overlay), view);
@@ -0,0 +1,187 @@
From f98836ef80afd511b9debc5d24cc570cd0f6ad20 Mon Sep 17 00:00:00 2001
From: Mikhail Efremov <sem@altlinux.org>
Date: Fri, 22 Nov 2019 18:11:26 +0300
Subject: Fix day/night calculation (bug #16091)
Time in the astronomical date given in local time, so parse it as
local. Otherwise the day/night calculation is broken, we can't
compare local and UTC time properly.
This fixes commit 701da805ecf273f376dbae5003607746fad9d316.
Signed-off-by: Sean Davis <smd.seandavis@gmail.com>
---
panel-plugin/weather-parsers.c | 8 ++++----
panel-plugin/weather-summary.c | 16 ++++++++--------
panel-plugin/weather.c | 20 ++++++++++----------
3 files changed, 22 insertions(+), 22 deletions(-)
diff --git a/panel-plugin/weather-parsers.c b/panel-plugin/weather-parsers.c
index 109d726..786abf7 100644
--- a/panel-plugin/weather-parsers.c
+++ b/panel-plugin/weather-parsers.c
@@ -445,28 +445,28 @@ parse_astro_time(xmlNode *cur_node)
if (child_node->type == XML_ELEMENT_NODE) {
if (NODE_IS_TYPE(child_node, "sunrise")) {
sunrise = remove_timezone_offset(PROP(child_node, "time"));
- astro->sunrise = parse_timestring(sunrise, NULL, FALSE);
+ astro->sunrise = parse_timestring(sunrise, NULL, TRUE);
xmlFree(sunrise);
sun_rises = TRUE;
}
if (NODE_IS_TYPE(child_node, "moonset")) {
moonset = remove_timezone_offset(PROP(child_node, "time"));
- astro->moonset = parse_timestring(moonset, NULL, FALSE);
+ astro->moonset = parse_timestring(moonset, NULL, TRUE);
xmlFree(moonset);
moon_sets = TRUE;
}
if (NODE_IS_TYPE(child_node, "sunset")) {
sunset = remove_timezone_offset(PROP(child_node, "time"));
- astro->sunset = parse_timestring(sunset, NULL, FALSE);
+ astro->sunset = parse_timestring(sunset, NULL, TRUE);
xmlFree(sunset);
sun_sets = TRUE;
}
if (NODE_IS_TYPE(child_node, "moonrise")) {
moonrise = remove_timezone_offset(PROP(child_node, "time"));
- astro->moonrise = parse_timestring(moonrise, NULL, FALSE);
+ astro->moonrise = parse_timestring(moonrise, NULL, TRUE);
xmlFree(moonrise);
moon_rises = TRUE;
}
diff --git a/panel-plugin/weather-summary.c b/panel-plugin/weather-summary.c
index dbe3014..da12a5b 100644
--- a/panel-plugin/weather-summary.c
+++ b/panel-plugin/weather-summary.c
@@ -417,12 +417,12 @@ create_summary_tab(plugin_data *data)
value = g_strdup(_("\tSunset:\t\tThe sun never sets today.\n"));
APPEND_TEXT_ITEM_REAL(value);
} else {
- sunrise = format_date(data->current_astro->sunrise, NULL, FALSE);
+ sunrise = format_date(data->current_astro->sunrise, NULL, TRUE);
value = g_strdup_printf(_("\tSunrise:\t\t%s\n"), sunrise);
g_free(sunrise);
APPEND_TEXT_ITEM_REAL(value);
- sunset = format_date(data->current_astro->sunset, NULL, FALSE);
+ sunset = format_date(data->current_astro->sunset, NULL, TRUE);
value = g_strdup_printf(_("\tSunset:\t\t%s\n\n"), sunset);
g_free(sunset);
APPEND_TEXT_ITEM_REAL(value);
@@ -445,12 +445,12 @@ create_summary_tab(plugin_data *data)
g_strdup(_("\tMoonset:\tThe moon never sets today.\n"));
APPEND_TEXT_ITEM_REAL(value);
} else {
- moonrise = format_date(data->current_astro->moonrise, NULL, FALSE);
+ moonrise = format_date(data->current_astro->moonrise, NULL, TRUE);
value = g_strdup_printf(_("\tMoonrise:\t%s\n"), moonrise);
g_free(moonrise);
APPEND_TEXT_ITEM_REAL(value);
- moonset = format_date(data->current_astro->moonset, NULL, FALSE);
+ moonset = format_date(data->current_astro->moonset, NULL, TRUE);
value = g_strdup_printf(_("\tMoonset:\t%s\n"), moonset);
g_free(moonset);
APPEND_TEXT_ITEM_REAL(value);
@@ -699,13 +699,13 @@ forecast_day_header_tooltip_text(xml_astro *astro)
"Sunset: The sun never sets this day."
"</small></tt>\n"));
else {
- sunrise = format_date(astro->sunrise, NULL, FALSE);
+ sunrise = format_date(astro->sunrise, NULL, TRUE);
g_string_append_printf(text, _("<tt><small>"
"Sunrise: %s"
"</small></tt>\n"), sunrise);
g_free(sunrise);
- sunset = format_date(astro->sunset, NULL, FALSE);
+ sunset = format_date(astro->sunset, NULL, TRUE);
g_string_append_printf(text, _("<tt><small>"
"Sunset: %s"
"</small></tt>\n\n"), sunset);
@@ -732,13 +732,13 @@ forecast_day_header_tooltip_text(xml_astro *astro)
"Moonset: The moon never sets this day."
"</small></tt>\n"));
else {
- moonrise = format_date(astro->moonrise, NULL, FALSE);
+ moonrise = format_date(astro->moonrise, NULL, TRUE);
g_string_append_printf(text, _("<tt><small>"
"Moonrise: %s"
"</small></tt>\n"), moonrise);
g_free(moonrise);
- moonset = format_date(astro->moonset, NULL, FALSE);
+ moonset = format_date(astro->moonset, NULL, TRUE);
g_string_append_printf(text, _("<tt><small>"
"Moonset: %s"
"</small></tt>"), moonset);
diff --git a/panel-plugin/weather.c b/panel-plugin/weather.c
index 7d79566..11f6f6f 100644
--- a/panel-plugin/weather.c
+++ b/panel-plugin/weather.c
@@ -1115,8 +1115,8 @@ write_cache_file(plugin_data *data)
if (G_UNLIKELY(astro == NULL))
continue;
value = format_date(astro->day, "%Y-%m-%d", TRUE);
- start = format_date(astro->sunrise, date_format, FALSE);
- end = format_date(astro->sunset, date_format, FALSE);
+ start = format_date(astro->sunrise, date_format, TRUE);
+ end = format_date(astro->sunset, date_format, TRUE);
g_string_append_printf(out, "[astrodata%d]\n", i);
CACHE_APPEND("day=%s\n", value);
CACHE_APPEND("sunrise=%s\n", start);
@@ -1129,8 +1129,8 @@ write_cache_file(plugin_data *data)
g_free(start);
g_free(end);
- start = format_date(astro->moonrise, date_format, FALSE);
- end = format_date(astro->moonset, date_format, FALSE);
+ start = format_date(astro->moonrise, date_format, TRUE);
+ end = format_date(astro->moonset, date_format, TRUE);
CACHE_APPEND("moonrise=%s\n", start);
CACHE_APPEND("moonset=%s\n", end);
CACHE_APPEND("moon_never_rises=%s\n",
@@ -1303,10 +1303,10 @@ read_cache_file(plugin_data *data)
astro->day = parse_timestring(timestring, "%Y-%m-%d", TRUE);
g_free(timestring);
CACHE_READ_STRING(timestring, "sunrise");
- astro->sunrise = parse_timestring(timestring, NULL, FALSE);
+ astro->sunrise = parse_timestring(timestring, NULL, TRUE);
g_free(timestring);
CACHE_READ_STRING(timestring, "sunset");
- astro->sunset = parse_timestring(timestring, NULL, FALSE);
+ astro->sunset = parse_timestring(timestring, NULL, TRUE);
g_free(timestring);
astro->sun_never_rises =
g_key_file_get_boolean(keyfile, group, "sun_never_rises", NULL);
@@ -1314,10 +1314,10 @@ read_cache_file(plugin_data *data)
g_key_file_get_boolean(keyfile, group, "sun_never_sets", NULL);
CACHE_READ_STRING(timestring, "moonrise");
- astro->moonrise = parse_timestring(timestring, NULL, FALSE);
+ astro->moonrise = parse_timestring(timestring, NULL, TRUE);
g_free(timestring);
CACHE_READ_STRING(timestring, "moonset");
- astro->moonset = parse_timestring(timestring, NULL, FALSE);
+ astro->moonset = parse_timestring(timestring, NULL, TRUE);
g_free(timestring);
CACHE_READ_STRING(astro->moon_phase, "moon_phase");
astro->moon_never_rises =
@@ -1731,9 +1731,9 @@ weather_get_tooltip_text(const plugin_data *data)
sunval = g_strdup(_("The sun never sets today."));
} else {
sunrise = format_date(data->current_astro->sunrise,
- "%H:%M:%S", FALSE);
+ "%H:%M:%S", TRUE);
sunset = format_date(data->current_astro->sunset,
- "%H:%M:%S", FALSE);
+ "%H:%M:%S", TRUE);
sunval =
g_strdup_printf(_("The sun rises at %s and sets at %s."),
sunrise, sunset);
--
cgit v1.2.3
@@ -0,0 +1,135 @@
From 72c34872bad6ff11cc6e74245ab5db805132c4bd Mon Sep 17 00:00:00 2001
From: Goran <tiny.lasagna@protonmail.com>
Date: Sat, 29 Feb 2020 23:50:00 -0500
Subject: Support solarnoon and solarmidnight (bug #15771)
---
panel-plugin/weather-data.c | 15 ++++++++-------
panel-plugin/weather-parsers.c | 10 ++++++++++
panel-plugin/weather-parsers.h | 2 ++
panel-plugin/weather.c | 29 +++++++++++++++++++++++++----
4 files changed, 45 insertions(+), 11 deletions(-)
diff --git a/panel-plugin/weather-data.c b/panel-plugin/weather-data.c
index 008a60c..fa6a4bd 100644
--- a/panel-plugin/weather-data.c
+++ b/panel-plugin/weather-data.c
@@ -552,13 +552,14 @@ is_night_time(const xml_astro *astro)
time(&now_t);
if (G_LIKELY(astro)) {
- /* Polar night */
- if (astro->sun_never_rises)
- return TRUE;
-
- /* Polar day */
- if (astro->sun_never_sets)
- return FALSE;
+ if (astro->sun_never_rises || astro->sun_never_sets){
+ /* Polar night */
+ if (astro->solarnoon_elevation <= 0)
+ return TRUE;
+ /* Polar day */
+ if (astro->solarmidnight_elevation > 0)
+ return FALSE;
+ }
/* Sunrise and sunset are known */
if (difftime(astro->sunrise, now_t) > 0)
diff --git a/panel-plugin/weather-parsers.c b/panel-plugin/weather-parsers.c
index 786abf7..baa0250 100644
--- a/panel-plugin/weather-parsers.c
+++ b/panel-plugin/weather-parsers.c
@@ -478,6 +478,14 @@ parse_astro_time(xmlNode *cur_node)
}
astro->moon_phase = g_strdup(parse_moonposition(moonposition));
}
+
+ if (NODE_IS_TYPE(child_node, "solarnoon")) {
+ astro->solarnoon_elevation = extract_double(PROP(child_node, "elevation"));
+ }
+
+ if (NODE_IS_TYPE(child_node, "solarmidnight")) {
+ astro->solarmidnight_elevation = extract_double(PROP(child_node, "elevation"));
+ }
}
}
@@ -737,6 +745,8 @@ xml_astro_copy(const xml_astro *src)
dst->moon_never_rises = src->moon_never_rises;
dst->moon_never_sets = src->moon_never_sets;
dst->moon_phase = g_strdup(src->moon_phase);
+ dst->solarnoon_elevation = src->solarnoon_elevation;
+ dst->solarmidnight_elevation = src->solarmidnight_elevation;
return dst;
}
diff --git a/panel-plugin/weather-parsers.h b/panel-plugin/weather-parsers.h
index 2b98d2f..f0697a7 100644
--- a/panel-plugin/weather-parsers.h
+++ b/panel-plugin/weather-parsers.h
@@ -86,6 +86,8 @@ typedef struct {
time_t sunset;
gboolean sun_never_rises;
gboolean sun_never_sets;
+ gdouble solarnoon_elevation;
+ gdouble solarmidnight_elevation;
time_t moonrise;
time_t moonset;
diff --git a/panel-plugin/weather.c b/panel-plugin/weather.c
index 11f6f6f..8780c0e 100644
--- a/panel-plugin/weather.c
+++ b/panel-plugin/weather.c
@@ -1125,6 +1125,8 @@ write_cache_file(plugin_data *data)
astro->sun_never_rises ? "true" : "false");
CACHE_APPEND("sun_never_sets=%s\n",
astro->sun_never_sets ? "true" : "false");
+ CACHE_APPEND("solarnoon_elevation=%e\n", astro->solarnoon_elevation);
+ CACHE_APPEND("solarmidnight_elevation=%e\n", astro->solarmidnight_elevation);
g_free(value);
g_free(start);
g_free(end);
@@ -1312,6 +1314,10 @@ read_cache_file(plugin_data *data)
g_key_file_get_boolean(keyfile, group, "sun_never_rises", NULL);
astro->sun_never_sets =
g_key_file_get_boolean(keyfile, group, "sun_never_sets", NULL);
+ astro->solarnoon_elevation =
+ g_key_file_get_double(keyfile, group, "solarnoon_elevation", NULL);
+ astro->solarmidnight_elevation =
+ g_key_file_get_double(keyfile, group, "solarmidnight_elevation", NULL);
CACHE_READ_STRING(timestring, "moonrise");
astro->moonrise = parse_timestring(timestring, NULL, TRUE);
@@ -1725,10 +1731,25 @@ weather_get_tooltip_text(const plugin_data *data)
/* use sunrise and sunset times if available */
if (data->current_astro)
- if (data->current_astro->sun_never_rises) {
- sunval = g_strdup(_("The sun never rises today."));
- } else if (data->current_astro->sun_never_sets) {
- sunval = g_strdup(_("The sun never sets today."));
+ if (data->current_astro->sun_never_rises && data->current_astro->sun_never_sets) {
+ if (data->current_astro->solarmidnight_elevation > 0)
+ sunval = g_strdup(_("The sun never sets today."));
+ else if (data->current_astro->solarnoon_elevation <= 0)
+ sunval = g_strdup(_("The sun never rises today."));
+ }
+ else if (data->current_astro->sun_never_rises){
+ sunset = format_date(data->current_astro->sunset,
+ "%H:%M:%S", FALSE);
+ sunval =
+ g_strdup_printf(_("The sun never rises and sets at %s."),
+ sunset);
+ }
+ else if (data->current_astro->sun_never_sets){
+ sunrise = format_date(data->current_astro->sunrise,
+ "%H:%M:%S", FALSE);
+ sunval =
+ g_strdup_printf(_("The sun rises at %s and never sets."),
+ sunset);
} else {
sunrise = format_date(data->current_astro->sunrise,
"%H:%M:%S", TRUE);
--
cgit v1.2.3