Created
January 13, 2013 13:26
-
-
Save pi3ch/4524107 to your computer and use it in GitHub Desktop.
Textclock widget with tooltip for different cities/timezones in Awesome WM
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Add to your rc.lua, | |
-- Create a textclock widget | |
mytextclock = awful.widget.textclock({ align = "right" }) | |
mytestclock_tooltip = awful.tooltip({ | |
objects = { mytextclock }, | |
timer_function = function() | |
local now = os.time() | |
local utcdate = os.date("!*t", now) | |
local tehran_t = os.time(utcdate) + (3.5*3600) | |
local ljubljana_t = os.time(utcdate) + (1*3600) | |
local sydney_t = os.time(utcdate) + (10*3600) | |
local timez = os.date("Tehran: %d %b %Y, %I:%M%P\n", tehran_t) | |
.. os.date("Ljubljana: %d %b %Y, %I:%M%P\n", ljubljana_t) | |
.. os.date("Sydney: %d %b %Y, %I:%M%P", sydney_t) | |
return timez | |
end, | |
}) | |
-- happy fast coding! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment