Last active
November 16, 2021 00:55
-
-
Save ak-seyam/1a44dd91861d82ec007114b88071956c to your computer and use it in GitHub Desktop.
Hello world awesome widget (A timer)
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
-- this can be considerd as a hello world that does somthing example for awesome wibar widgets | |
-- you can modify this slightly to make some useful widgets (i.e. pomodoro widget) | |
local textbox = require("wibox.widget.textbox") | |
local timer = require("gears.timer") | |
local counter = 10 | |
local w = textbox() | |
local function update_timer() | |
w.text = "⌚: " .. counter | |
if counter == 0 then | |
timer:connect_signal("timer::stop") | |
end | |
counter = counter - 1 | |
end | |
timer { | |
timeout = 1, | |
call_now = true, | |
autostart = true, | |
callback = update_timer | |
} | |
return w |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment