Skip to content

Instantly share code, notes, and snippets.

@pi3ch
Created January 13, 2013 13:26
Show Gist options
  • Save pi3ch/4524107 to your computer and use it in GitHub Desktop.
Save pi3ch/4524107 to your computer and use it in GitHub Desktop.
Textclock widget with tooltip for different cities/timezones in Awesome WM
-- 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