Skip to content

Commit 0092025

Browse files
committed
Resolves 4 / 4.1
- resolves 4.1 (entirety of No. 4)
1 parent c7ebf23 commit 0092025

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

budgie-weathershow/src/desktop_weather/desktop_weather.vala

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,8 @@ public class DesktopWeather : Gtk.Window {
134134
this.set_visual(visual);
135135
this.draw.connect(on_draw);
136136
// monitored datafile
137-
string username = Environment.get_user_name();
138-
var tmp = Environment.get_tmp_dir() + "/";
139-
string src = tmp.concat(username, "_weatherdata");
137+
string tmpdir = Environment.get_variable("XDG_RUNTIME_DIR") ?? Environment.get_variable("HOME");
138+
string src = GLib.Path.build_path(GLib.Path.DIR_SEPARATOR_S, tmpdir, ".weatherdata");
140139
datasrc = File.new_for_path(src);
141140
// report
142141
maingrid = new Gtk.Grid();

budgie-weathershow/src/weathershow/WeatherShow.vala

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -348,9 +348,8 @@ namespace WeatherShowApplet {
348348
string result_current = weather_obj.get_current();
349349
// write to file only for desktop show
350350
if (show_ondesktop == true) {
351-
string username = Environment.get_user_name();
352-
var tmp = Environment.get_tmp_dir() + "/";
353-
string src = tmp.concat(username, "_weatherdata");
351+
string tmpdir = Environment.get_variable("XDG_RUNTIME_DIR") ?? Environment.get_variable("HOME");
352+
string src = GLib.Path.build_path(GLib.Path.DIR_SEPARATOR_S, tmpdir, ".weatherdata");
354353
WeatherShowFunctions.write_tofile(src, result_current);
355354
}
356355
}

0 commit comments

Comments
 (0)