简体   繁体   中英

awesome-wm gears.timer setup

I want to replace deprecated awful.timer with gears.timer in my awesome-wm . But I having trouble starting it. I took function from the example as a prototype and wrote simple test function. Here it is:

gears.timer {
    timeout   = 1,
    autostart = true,
    callback  = function()
        print("!!Timeout!!")
    end
}

I placed it in the end of the rc.lua file and ran awesome . From the look of the awesome-wm output it looks like function never runs. How do I setup gears.timer so it runs?

PS I use this command to see the output of the awesome-wm :

DISPLAY=:0; Xephyr :1 -screen 800x600 -ac -br -noreset & \
DISPLAY=:1.0; sleep 1; awesome -c ~/.config/awesome/rc.lua

Awesome 4.0 only supports the timeout argument for gears.timer . The autostart argument and the callback argument are new in awesome 4.1.

I was able to make gears.timer work as a signal emitter:

timer = gears.timer {
    timeout   = 1
}

timer:connect_signal("timeout", function()
        print("!!Timeout!!")
    end
)

timer:start()

However I'm still a bit puzzled about usege of autostart and callback attributes.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM