diff --git a/src/installer.cr b/src/installer.cr index b23aaa3..28f3a83 100644 --- a/src/installer.cr +++ b/src/installer.cr @@ -97,7 +97,8 @@ city = gets puts "#{orange}#{bold}Config setup finished. Starting disp setup.#{reset}" -File.write("/home/#{sudo_user}/.local/share/Wfetch/config.toml", "api = \"#{api}\" +File.write("/home/#{sudo_user}/.local/share/Wfetch/config.toml", " +api = \"#{api}\" city = \"#{city}\"") puts "#{orange}#{bold}Would you like customary (1), metric (2), or both (3)?#{reset}" diff --git a/src/wfetch.cr b/src/wfetch.cr index 65de2a0..367415e 100644 --- a/src/wfetch.cr +++ b/src/wfetch.cr @@ -86,6 +86,25 @@ module Wfetch repeat = 1 + if Time.local.minute < 10 + time = (Time.local.hour.to_s + 0.to_s + Time.local.minute.to_s).to_i + + if time < 1200 + message = "#{bold}#{orange}Have a good morning!#{reset}" + elsif time >= 1200 + message = "#{bold}#{orange}Have a good afternoon!#{reset}" + end + + elsif Time.local.minute >= 10 + time = (Time.local.hour.to_s + Time.local.minute.to_s).to_i + if time < 1200 + message = "#{bold}#{orange}Have a good morning!#{reset}" + elsif time >= 1200 + message = "#{bold}#{orange}Have a good afternoon!#{reset}" + end + end + + vars = { "{temp_f}" => temp_f, "{temp_c}" => temp_c, @@ -104,7 +123,8 @@ module Wfetch "{orange}" => orange, "{bold}" => bold, "{reset}" => reset, - "{icon}" => nil + "{icon}" => nil, + "{goodbye}" => message } File.each_line("/home/koffeejava/.local/share/Wfetch/disp.toml") do |line|