From aedf4ef0ec9712789310b5b6d7d06af90f4f6261 Mon Sep 17 00:00:00 2001 From: xero Date: Sat, 8 Mar 2014 22:14:34 -0500 Subject: add awesome wm config files and v0.1.0 of ghost theme. --- .../lain/widgets/yawn/icons/BlowingSnow.png | Bin 0 -> 11454 bytes .config/awesome/lain/widgets/yawn/icons/Cloudy.png | Bin 0 -> 7469 bytes .../awesome/lain/widgets/yawn/icons/DayClear.png | Bin 0 -> 6147 bytes .../awesome/lain/widgets/yawn/icons/DayFair.png | 1 + .../lain/widgets/yawn/icons/DayMostlyCloudy.png | Bin 0 -> 8016 bytes .../lain/widgets/yawn/icons/DayPartlyCloudy.png | Bin 0 -> 7478 bytes .../awesome/lain/widgets/yawn/icons/Drizzle.png | 1 + .config/awesome/lain/widgets/yawn/icons/Fog.png | 1 + .config/awesome/lain/widgets/yawn/icons/Foggy.png | Bin 0 -> 7325 bytes .../lain/widgets/yawn/icons/FreezingDrizzle.png | Bin 0 -> 13166 bytes .../lain/widgets/yawn/icons/FreezingRain.png | Bin 0 -> 13979 bytes .config/awesome/lain/widgets/yawn/icons/Hail.png | Bin 0 -> 7325 bytes .config/awesome/lain/widgets/yawn/icons/Haze.png | 1 + .../awesome/lain/widgets/yawn/icons/HeavyRain.png | 1 + .../awesome/lain/widgets/yawn/icons/HeavySnow.png | Bin 0 -> 12733 bytes .../awesome/lain/widgets/yawn/icons/LightRain.png | 1 + .../awesome/lain/widgets/yawn/icons/LightSnow.png | 1 + .../lain/widgets/yawn/icons/LightSnowShowers.png | Bin 0 -> 8779 bytes .config/awesome/lain/widgets/yawn/icons/Mist.png | 1 + .../lain/widgets/yawn/icons/MixedRainAndHail.png | Bin 0 -> 9060 bytes .../lain/widgets/yawn/icons/MixedRainAndSleet.png | Bin 0 -> 10978 bytes .../lain/widgets/yawn/icons/MixedRainAndSnow.png | Bin 0 -> 10808 bytes .../awesome/lain/widgets/yawn/icons/NightClear.png | Bin 0 -> 5198 bytes .../awesome/lain/widgets/yawn/icons/NightFair.png | 1 + .../lain/widgets/yawn/icons/NightMostlyCloudy.png | Bin 0 -> 7058 bytes .../lain/widgets/yawn/icons/NightPartlyCloudy.png | Bin 0 -> 6583 bytes .config/awesome/lain/widgets/yawn/icons/README.md | 6 + .config/awesome/lain/widgets/yawn/icons/Rain.png | Bin 0 -> 8052 bytes .../lain/widgets/yawn/icons/RainThunder.png | Bin 0 -> 9879 bytes .../awesome/lain/widgets/yawn/icons/Showers.png | Bin 0 -> 9694 bytes .config/awesome/lain/widgets/yawn/icons/Sleet.png | 1 + .config/awesome/lain/widgets/yawn/icons/Snow.png | 1 + .../lain/widgets/yawn/icons/SnowFlurries.png | 1 + .../lain/widgets/yawn/icons/SnowShowers.png | Bin 0 -> 9961 bytes .config/awesome/lain/widgets/yawn/icons/Sunny.png | Bin 0 -> 14018 bytes .../widgets/yawn/icons/ThunderintheVicinity.png | 1 + .config/awesome/lain/widgets/yawn/icons/Wind.png | Bin 0 -> 8726 bytes .config/awesome/lain/widgets/yawn/icons/na.png | Bin 0 -> 11160 bytes .config/awesome/lain/widgets/yawn/init.lua | 200 +++++++++++++++++++++ .../awesome/lain/widgets/yawn/localizations/it_IT | 60 +++++++ .../yawn/localizations/localization_template | 60 +++++++ 41 files changed, 339 insertions(+) create mode 100755 .config/awesome/lain/widgets/yawn/icons/BlowingSnow.png create mode 100755 .config/awesome/lain/widgets/yawn/icons/Cloudy.png create mode 100755 .config/awesome/lain/widgets/yawn/icons/DayClear.png create mode 120000 .config/awesome/lain/widgets/yawn/icons/DayFair.png create mode 100755 .config/awesome/lain/widgets/yawn/icons/DayMostlyCloudy.png create mode 100755 .config/awesome/lain/widgets/yawn/icons/DayPartlyCloudy.png create mode 120000 .config/awesome/lain/widgets/yawn/icons/Drizzle.png create mode 120000 .config/awesome/lain/widgets/yawn/icons/Fog.png create mode 100755 .config/awesome/lain/widgets/yawn/icons/Foggy.png create mode 100755 .config/awesome/lain/widgets/yawn/icons/FreezingDrizzle.png create mode 100755 .config/awesome/lain/widgets/yawn/icons/FreezingRain.png create mode 100755 .config/awesome/lain/widgets/yawn/icons/Hail.png create mode 120000 .config/awesome/lain/widgets/yawn/icons/Haze.png create mode 120000 .config/awesome/lain/widgets/yawn/icons/HeavyRain.png create mode 100755 .config/awesome/lain/widgets/yawn/icons/HeavySnow.png create mode 120000 .config/awesome/lain/widgets/yawn/icons/LightRain.png create mode 120000 .config/awesome/lain/widgets/yawn/icons/LightSnow.png create mode 100755 .config/awesome/lain/widgets/yawn/icons/LightSnowShowers.png create mode 120000 .config/awesome/lain/widgets/yawn/icons/Mist.png create mode 100755 .config/awesome/lain/widgets/yawn/icons/MixedRainAndHail.png create mode 100755 .config/awesome/lain/widgets/yawn/icons/MixedRainAndSleet.png create mode 100755 .config/awesome/lain/widgets/yawn/icons/MixedRainAndSnow.png create mode 100755 .config/awesome/lain/widgets/yawn/icons/NightClear.png create mode 120000 .config/awesome/lain/widgets/yawn/icons/NightFair.png create mode 100755 .config/awesome/lain/widgets/yawn/icons/NightMostlyCloudy.png create mode 100755 .config/awesome/lain/widgets/yawn/icons/NightPartlyCloudy.png create mode 100644 .config/awesome/lain/widgets/yawn/icons/README.md create mode 100755 .config/awesome/lain/widgets/yawn/icons/Rain.png create mode 100755 .config/awesome/lain/widgets/yawn/icons/RainThunder.png create mode 100755 .config/awesome/lain/widgets/yawn/icons/Showers.png create mode 120000 .config/awesome/lain/widgets/yawn/icons/Sleet.png create mode 120000 .config/awesome/lain/widgets/yawn/icons/Snow.png create mode 120000 .config/awesome/lain/widgets/yawn/icons/SnowFlurries.png create mode 100755 .config/awesome/lain/widgets/yawn/icons/SnowShowers.png create mode 100755 .config/awesome/lain/widgets/yawn/icons/Sunny.png create mode 120000 .config/awesome/lain/widgets/yawn/icons/ThunderintheVicinity.png create mode 100755 .config/awesome/lain/widgets/yawn/icons/Wind.png create mode 100755 .config/awesome/lain/widgets/yawn/icons/na.png create mode 100644 .config/awesome/lain/widgets/yawn/init.lua create mode 100644 .config/awesome/lain/widgets/yawn/localizations/it_IT create mode 100644 .config/awesome/lain/widgets/yawn/localizations/localization_template (limited to '.config/awesome/lain/widgets/yawn') diff --git a/.config/awesome/lain/widgets/yawn/icons/BlowingSnow.png b/.config/awesome/lain/widgets/yawn/icons/BlowingSnow.png new file mode 100755 index 0000000..6223f8f Binary files /dev/null and b/.config/awesome/lain/widgets/yawn/icons/BlowingSnow.png differ diff --git a/.config/awesome/lain/widgets/yawn/icons/Cloudy.png b/.config/awesome/lain/widgets/yawn/icons/Cloudy.png new file mode 100755 index 0000000..bac1e7e Binary files /dev/null and b/.config/awesome/lain/widgets/yawn/icons/Cloudy.png differ diff --git a/.config/awesome/lain/widgets/yawn/icons/DayClear.png b/.config/awesome/lain/widgets/yawn/icons/DayClear.png new file mode 100755 index 0000000..d9e2745 Binary files /dev/null and b/.config/awesome/lain/widgets/yawn/icons/DayClear.png differ diff --git a/.config/awesome/lain/widgets/yawn/icons/DayFair.png b/.config/awesome/lain/widgets/yawn/icons/DayFair.png new file mode 120000 index 0000000..8ee94d1 --- /dev/null +++ b/.config/awesome/lain/widgets/yawn/icons/DayFair.png @@ -0,0 +1 @@ +DayClear.png \ No newline at end of file diff --git a/.config/awesome/lain/widgets/yawn/icons/DayMostlyCloudy.png b/.config/awesome/lain/widgets/yawn/icons/DayMostlyCloudy.png new file mode 100755 index 0000000..22b929c Binary files /dev/null and b/.config/awesome/lain/widgets/yawn/icons/DayMostlyCloudy.png differ diff --git a/.config/awesome/lain/widgets/yawn/icons/DayPartlyCloudy.png b/.config/awesome/lain/widgets/yawn/icons/DayPartlyCloudy.png new file mode 100755 index 0000000..8fd0a5b Binary files /dev/null and b/.config/awesome/lain/widgets/yawn/icons/DayPartlyCloudy.png differ diff --git a/.config/awesome/lain/widgets/yawn/icons/Drizzle.png b/.config/awesome/lain/widgets/yawn/icons/Drizzle.png new file mode 120000 index 0000000..df34463 --- /dev/null +++ b/.config/awesome/lain/widgets/yawn/icons/Drizzle.png @@ -0,0 +1 @@ +Rain.png \ No newline at end of file diff --git a/.config/awesome/lain/widgets/yawn/icons/Fog.png b/.config/awesome/lain/widgets/yawn/icons/Fog.png new file mode 120000 index 0000000..b615645 --- /dev/null +++ b/.config/awesome/lain/widgets/yawn/icons/Fog.png @@ -0,0 +1 @@ +Foggy.png \ No newline at end of file diff --git a/.config/awesome/lain/widgets/yawn/icons/Foggy.png b/.config/awesome/lain/widgets/yawn/icons/Foggy.png new file mode 100755 index 0000000..009039f Binary files /dev/null and b/.config/awesome/lain/widgets/yawn/icons/Foggy.png differ diff --git a/.config/awesome/lain/widgets/yawn/icons/FreezingDrizzle.png b/.config/awesome/lain/widgets/yawn/icons/FreezingDrizzle.png new file mode 100755 index 0000000..6a66140 Binary files /dev/null and b/.config/awesome/lain/widgets/yawn/icons/FreezingDrizzle.png differ diff --git a/.config/awesome/lain/widgets/yawn/icons/FreezingRain.png b/.config/awesome/lain/widgets/yawn/icons/FreezingRain.png new file mode 100755 index 0000000..c924fac Binary files /dev/null and b/.config/awesome/lain/widgets/yawn/icons/FreezingRain.png differ diff --git a/.config/awesome/lain/widgets/yawn/icons/Hail.png b/.config/awesome/lain/widgets/yawn/icons/Hail.png new file mode 100755 index 0000000..009039f Binary files /dev/null and b/.config/awesome/lain/widgets/yawn/icons/Hail.png differ diff --git a/.config/awesome/lain/widgets/yawn/icons/Haze.png b/.config/awesome/lain/widgets/yawn/icons/Haze.png new file mode 120000 index 0000000..0874a83 --- /dev/null +++ b/.config/awesome/lain/widgets/yawn/icons/Haze.png @@ -0,0 +1 @@ +Hail.png \ No newline at end of file diff --git a/.config/awesome/lain/widgets/yawn/icons/HeavyRain.png b/.config/awesome/lain/widgets/yawn/icons/HeavyRain.png new file mode 120000 index 0000000..ace2a94 --- /dev/null +++ b/.config/awesome/lain/widgets/yawn/icons/HeavyRain.png @@ -0,0 +1 @@ +Showers.png \ No newline at end of file diff --git a/.config/awesome/lain/widgets/yawn/icons/HeavySnow.png b/.config/awesome/lain/widgets/yawn/icons/HeavySnow.png new file mode 100755 index 0000000..ddcb8f3 Binary files /dev/null and b/.config/awesome/lain/widgets/yawn/icons/HeavySnow.png differ diff --git a/.config/awesome/lain/widgets/yawn/icons/LightRain.png b/.config/awesome/lain/widgets/yawn/icons/LightRain.png new file mode 120000 index 0000000..df34463 --- /dev/null +++ b/.config/awesome/lain/widgets/yawn/icons/LightRain.png @@ -0,0 +1 @@ +Rain.png \ No newline at end of file diff --git a/.config/awesome/lain/widgets/yawn/icons/LightSnow.png b/.config/awesome/lain/widgets/yawn/icons/LightSnow.png new file mode 120000 index 0000000..aa8b28e --- /dev/null +++ b/.config/awesome/lain/widgets/yawn/icons/LightSnow.png @@ -0,0 +1 @@ +LightSnowShowers.png \ No newline at end of file diff --git a/.config/awesome/lain/widgets/yawn/icons/LightSnowShowers.png b/.config/awesome/lain/widgets/yawn/icons/LightSnowShowers.png new file mode 100755 index 0000000..d797ee9 Binary files /dev/null and b/.config/awesome/lain/widgets/yawn/icons/LightSnowShowers.png differ diff --git a/.config/awesome/lain/widgets/yawn/icons/Mist.png b/.config/awesome/lain/widgets/yawn/icons/Mist.png new file mode 120000 index 0000000..b615645 --- /dev/null +++ b/.config/awesome/lain/widgets/yawn/icons/Mist.png @@ -0,0 +1 @@ +Foggy.png \ No newline at end of file diff --git a/.config/awesome/lain/widgets/yawn/icons/MixedRainAndHail.png b/.config/awesome/lain/widgets/yawn/icons/MixedRainAndHail.png new file mode 100755 index 0000000..758b01e Binary files /dev/null and b/.config/awesome/lain/widgets/yawn/icons/MixedRainAndHail.png differ diff --git a/.config/awesome/lain/widgets/yawn/icons/MixedRainAndSleet.png b/.config/awesome/lain/widgets/yawn/icons/MixedRainAndSleet.png new file mode 100755 index 0000000..7f0d252 Binary files /dev/null and b/.config/awesome/lain/widgets/yawn/icons/MixedRainAndSleet.png differ diff --git a/.config/awesome/lain/widgets/yawn/icons/MixedRainAndSnow.png b/.config/awesome/lain/widgets/yawn/icons/MixedRainAndSnow.png new file mode 100755 index 0000000..0a07b7b Binary files /dev/null and b/.config/awesome/lain/widgets/yawn/icons/MixedRainAndSnow.png differ diff --git a/.config/awesome/lain/widgets/yawn/icons/NightClear.png b/.config/awesome/lain/widgets/yawn/icons/NightClear.png new file mode 100755 index 0000000..84ea140 Binary files /dev/null and b/.config/awesome/lain/widgets/yawn/icons/NightClear.png differ diff --git a/.config/awesome/lain/widgets/yawn/icons/NightFair.png b/.config/awesome/lain/widgets/yawn/icons/NightFair.png new file mode 120000 index 0000000..23df45a --- /dev/null +++ b/.config/awesome/lain/widgets/yawn/icons/NightFair.png @@ -0,0 +1 @@ +NightClear.png \ No newline at end of file diff --git a/.config/awesome/lain/widgets/yawn/icons/NightMostlyCloudy.png b/.config/awesome/lain/widgets/yawn/icons/NightMostlyCloudy.png new file mode 100755 index 0000000..d8b3673 Binary files /dev/null and b/.config/awesome/lain/widgets/yawn/icons/NightMostlyCloudy.png differ diff --git a/.config/awesome/lain/widgets/yawn/icons/NightPartlyCloudy.png b/.config/awesome/lain/widgets/yawn/icons/NightPartlyCloudy.png new file mode 100755 index 0000000..9e4404d Binary files /dev/null and b/.config/awesome/lain/widgets/yawn/icons/NightPartlyCloudy.png differ diff --git a/.config/awesome/lain/widgets/yawn/icons/README.md b/.config/awesome/lain/widgets/yawn/icons/README.md new file mode 100644 index 0000000..e4dc111 --- /dev/null +++ b/.config/awesome/lain/widgets/yawn/icons/README.md @@ -0,0 +1,6 @@ +Yawn icons +========== + +These are [Plain Weather Icons](http://merlinthered.deviantart.com/art/plain-weather-icons-157162192), created by [MerlinTheRed](http://merlinthered.deviantart.com/). + + diff --git a/.config/awesome/lain/widgets/yawn/icons/Rain.png b/.config/awesome/lain/widgets/yawn/icons/Rain.png new file mode 100755 index 0000000..d00552a Binary files /dev/null and b/.config/awesome/lain/widgets/yawn/icons/Rain.png differ diff --git a/.config/awesome/lain/widgets/yawn/icons/RainThunder.png b/.config/awesome/lain/widgets/yawn/icons/RainThunder.png new file mode 100755 index 0000000..d30e120 Binary files /dev/null and b/.config/awesome/lain/widgets/yawn/icons/RainThunder.png differ diff --git a/.config/awesome/lain/widgets/yawn/icons/Showers.png b/.config/awesome/lain/widgets/yawn/icons/Showers.png new file mode 100755 index 0000000..3cc6665 Binary files /dev/null and b/.config/awesome/lain/widgets/yawn/icons/Showers.png differ diff --git a/.config/awesome/lain/widgets/yawn/icons/Sleet.png b/.config/awesome/lain/widgets/yawn/icons/Sleet.png new file mode 120000 index 0000000..f8f9693 --- /dev/null +++ b/.config/awesome/lain/widgets/yawn/icons/Sleet.png @@ -0,0 +1 @@ +SnowShowers.png \ No newline at end of file diff --git a/.config/awesome/lain/widgets/yawn/icons/Snow.png b/.config/awesome/lain/widgets/yawn/icons/Snow.png new file mode 120000 index 0000000..f8f9693 --- /dev/null +++ b/.config/awesome/lain/widgets/yawn/icons/Snow.png @@ -0,0 +1 @@ +SnowShowers.png \ No newline at end of file diff --git a/.config/awesome/lain/widgets/yawn/icons/SnowFlurries.png b/.config/awesome/lain/widgets/yawn/icons/SnowFlurries.png new file mode 120000 index 0000000..2e090cd --- /dev/null +++ b/.config/awesome/lain/widgets/yawn/icons/SnowFlurries.png @@ -0,0 +1 @@ +BlowingSnow.png \ No newline at end of file diff --git a/.config/awesome/lain/widgets/yawn/icons/SnowShowers.png b/.config/awesome/lain/widgets/yawn/icons/SnowShowers.png new file mode 100755 index 0000000..30534a2 Binary files /dev/null and b/.config/awesome/lain/widgets/yawn/icons/SnowShowers.png differ diff --git a/.config/awesome/lain/widgets/yawn/icons/Sunny.png b/.config/awesome/lain/widgets/yawn/icons/Sunny.png new file mode 100755 index 0000000..cf08c5c Binary files /dev/null and b/.config/awesome/lain/widgets/yawn/icons/Sunny.png differ diff --git a/.config/awesome/lain/widgets/yawn/icons/ThunderintheVicinity.png b/.config/awesome/lain/widgets/yawn/icons/ThunderintheVicinity.png new file mode 120000 index 0000000..1fb3b9c --- /dev/null +++ b/.config/awesome/lain/widgets/yawn/icons/ThunderintheVicinity.png @@ -0,0 +1 @@ +Cloudy.png \ No newline at end of file diff --git a/.config/awesome/lain/widgets/yawn/icons/Wind.png b/.config/awesome/lain/widgets/yawn/icons/Wind.png new file mode 100755 index 0000000..5dc1356 Binary files /dev/null and b/.config/awesome/lain/widgets/yawn/icons/Wind.png differ diff --git a/.config/awesome/lain/widgets/yawn/icons/na.png b/.config/awesome/lain/widgets/yawn/icons/na.png new file mode 100755 index 0000000..62a5350 Binary files /dev/null and b/.config/awesome/lain/widgets/yawn/icons/na.png differ diff --git a/.config/awesome/lain/widgets/yawn/init.lua b/.config/awesome/lain/widgets/yawn/init.lua new file mode 100644 index 0000000..3f08cd5 --- /dev/null +++ b/.config/awesome/lain/widgets/yawn/init.lua @@ -0,0 +1,200 @@ + +--[[ + + Licensed under GNU General Public License v2 + * (c) 2013, Luke Bonham + +--]] + +local newtimer = require("lain.helpers").newtimer + +local naughty = require("naughty") +local wibox = require("wibox") + +local debug = { getinfo = debug.getinfo } +local io = io +local os = { date = os.date, + getenv = os.getenv } +local string = { find = string.find, + match = string.match, + gsub = string.gsub, + sub = string.sub } +local tonumber = tonumber + +local setmetatable = setmetatable + +-- YAhoo! Weather Notification +-- lain.widgets.yawn +local yawn = +{ + icon = wibox.widget.imagebox(), + widget = wibox.widget.textbox('') +} + +local project_path = debug.getinfo(1, 'S').source:match[[^@(.*/).*$]] +local localizations_path = project_path .. 'localizations/' +local icon_path = project_path .. 'icons/' +local api_url = 'http://weather.yahooapis.com/forecastrss' +local units_set = '?u=c&w=' -- Default is Celsius +local language = string.match(os.getenv("LANG"), "(%S*$*)[.]") +local weather_data = nil +local notification = nil +local city_id = nil +local sky = nil +local settings = function() end + +yawn_notification_preset = {} + +local function fetch_weather() + local url = api_url .. units_set .. city_id + local f = io.popen("curl --connect-timeout 1 -fsm 3 '" .. url .. "'" ) + local text = f:read("*all") + f:close() + + -- In case of no connection or invalid city ID + -- widgets won't display + if text == "" or text:match("City not found") + then + yawn.icon:set_image(icon_path .. "na.png") + if text == "" then + weather_data = "Service not available at the moment." + yawn.widget:set_text(" N/A ") + else + weather_data = "City not found!\n" .. + "Are you sure " .. city_id .. + " is your Yahoo city ID?" + yawn.widget:set_text(" ? ") + end + return + end + + -- Processing raw data + weather_data = text:gsub("<.->", "") + weather_data = weather_data:match("Current Conditions:.-Full") or "" + + -- may still happens in case of bad connectivity + if weather_data == "" then + yawn.icon:set_image(icon_path .. "na.png") + yawn.widget:set_text(" ? ") + return + end + + weather_data = weather_data:gsub("Current Conditions:.-\n", "Now: ") + weather_data = weather_data:gsub("Forecast:.-\n", "") + weather_data = weather_data:gsub("\nFull", "") + weather_data = weather_data:gsub("[\n]$", "") + weather_data = weather_data:gsub(" [-] " , ": ") + weather_data = weather_data:gsub("[.]", ",") + weather_data = weather_data:gsub("High: ", "") + weather_data = weather_data:gsub(" Low: ", " - ") + + -- Getting info for text widget + local now = weather_data:sub(weather_data:find("Now:")+5, + weather_data:find("\n")-1) + forecast = now:sub(1, now:find(",")-1) + units = now:sub(now:find(",")+2, -2) + + -- Day/Night icon change + local hour = tonumber(os.date("%H")) + sky = icon_path + + if forecast == "Clear" or + forecast == "Fair" or + forecast == "Partly Cloudy" or + forecast == "Mostly Cloudy" + then + if hour >= 6 and hour <= 18 + then + sky = sky .. "Day" + else + sky = sky .. "Night" + end + end + + sky = sky .. forecast:gsub(" ", ""):gsub("/", "") .. ".png" + + -- In case there's no defined icon for current forecast + if io.open(sky) == nil then + sky = icon_path .. "na.png" + end + + -- Localization + local f = io.open(localizations_path .. language, "r") + if language:find("en_") == nil and f ~= nil + then + f:close() + for line in io.lines(localizations_path .. language) + do + word = string.sub(line, 1, line:find("|")-1) + translation = string.sub(line, line:find("|")+1) + weather_data = string.gsub(weather_data, word, translation) + end + end + + -- Finally setting infos + yawn.icon:set_image(sky) + widget = yawn.widget + + forecast = weather_data:match(": %S.-,"):gsub(": ", ""):gsub(",", "") + units = units:gsub(" ", "") + + settings() +end + +function yawn.hide() + if notification ~= nil then + naughty.destroy(notification) + notification = nil + end +end + +function yawn.show(t_out) + if yawn.widget._layout.text:match("?") + then + fetch_weather(settings) + end + + yawn.hide() + + notification = naughty.notify({ + preset = yawn_notification_preset, + text = weather_data, + icon = sky, + timeout = t_out + }) +end + +function yawn.register(id, args) + local args = args or {} + local timeout = args.timeout or 600 + settings = args.settings or function() end + + if args.u == "f" then units_set = '?u=f&w=' end + + city_id = id + + newtimer("yawn", timeout, fetch_weather) + + yawn.icon:connect_signal("mouse::enter", function() + yawn.show(0) + end) + yawn.icon:connect_signal("mouse::leave", function() + yawn.hide() + end) + + return yawn +end + +function yawn.attach(widget, id, args) + yawn.register(id, args) + + widget:connect_signal("mouse::enter", function() + yawn.show(0) + end) + + widget:connect_signal("mouse::leave", function() + yawn.hide() + end) +end + +return setmetatable(yawn, { __call = function(_, ...) return yawn.register(...) end }) diff --git a/.config/awesome/lain/widgets/yawn/localizations/it_IT b/.config/awesome/lain/widgets/yawn/localizations/it_IT new file mode 100644 index 0000000..70b0eef --- /dev/null +++ b/.config/awesome/lain/widgets/yawn/localizations/it_IT @@ -0,0 +1,60 @@ +Now:|Ora: +Sun:|Dom: +Mon:|Lun: +Tue:|Mar: +Wed:|Mer: +Thu:|Gio: +Fri:|Ven: +Sat:|Sab: +Mostly Sunny|Abbastanza Soleggiato +Sunny|Soleggiato +Sun|Soleggiato +Rain/Thunder|Temporali +Isolated Thunderstorms|Temporali Isolati +Scattered Thunderstorms|Temporali Sparsi +Thundershowers|Rovesci Temporaleschi +Thunderstorms|Temporali +Thunder in the Vicinity|Tuoni in prossimità +Thunder|Temporale +AM|In Mattinata +PM|Nel Pomeriggio +Early|In Mattinata +Late|In Serata +Few|Sporadiche +Severe|Forti +Clear|Sereno +Fair|Sereno +Partly|Parzialmente +Mostly|Molto +Cloudy|Nuvoloso +Clouds|Nuvoloso +Scattered Showers|Temporali Sparsi +Light Snow Showers|Nevicate Leggere +Snow Showers|Nevicate +aeavy Snow|Forti Nevicate +Scattered Snow Showers|Nevicate Sparse +Mixed Rain And Snow|Pioggia E Neve +Mixed Rain And Sleet|Pioggia E Nevischio +Mixed Snow And Sleet|Neve E Nevischio +Mixed Rain And Hail|Pioggia E Grandine +Snow Flurries|Folate Di Neve +Blowing Snow|Neve Battente +Blowing Rain|Pioggia Battente +Heavy Rain|Forti Piogge +Freezing Rain|Pioggia Congelantesi +Showers|Piogge +Light Rain|Pioggia Leggera +Heavy|Forti +Rain|Piovoso +Windy|Ventoso +Wind|Ventoso +Snow|Neve +Sleet|Nevischio +Light Drizzle|Pioggia Leggera +Drizzle|Pioggia Leggera +Freezing Drizzle|Pioggerella Congelantesi +Hail|Grandine +Fog|Nebbia +Foggy|Nebbioso +Haze|Nebbia +Light|Leggere diff --git a/.config/awesome/lain/widgets/yawn/localizations/localization_template b/.config/awesome/lain/widgets/yawn/localizations/localization_template new file mode 100644 index 0000000..453807e --- /dev/null +++ b/.config/awesome/lain/widgets/yawn/localizations/localization_template @@ -0,0 +1,60 @@ +Now:| +Sun:| +Mon:| +Tue:| +Wed:| +Thu:| +Fri:| +Sat:| +Mostly Sunny| +Sunny| +Sun| +Rain/Thunder| +Isolated Thunderstorms| +Scattered Thunderstorms| +Thundershowers| +Thunderstorms| +Thunder in the Vicinity| +Thunder| +AM| +PM| +Early| +Late| +Few| +Severe| +Clear| +Fair| +Partly| +Mostly| +Cloudy| +Clouds| +Scattered Showers| +Light Snow Showers| +Snow Showers| +Heavy Snow| +Scattered Snow Showers| +Mixed Rain And Snow| +Mixed Rain And Sleet| +Mixed Snow And Sleet| +Mixed Rain And Hail| +Snow Flurries| +Blowing Snow| +Blowing Rain| +Heavy Rain| +Freezing Rain| +Showers| +Light Rain| +Heavy| +Rain| +Windy| +Wind| +Snow| +Sleet| +Freezing Drizzle| +Light Drizzle| +Drizzle| +Hail| +Fog| +Foggy| +Haze| +Light| -- cgit v1.2.1