File tree Expand file tree Collapse file tree 2 files changed +4
-6
lines changed
Expand file tree Collapse file tree 2 files changed +4
-6
lines changed Original file line number Diff line number Diff 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 ();
Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments