nikolavp / awesome-pomodoro Goto Github PK
View Code? Open in Web Editor NEWPomodoro time widget for the awesome window manager framework
Pomodoro time widget for the awesome window manager framework
t = os.date("%X", t-3600)
This is only valid for UTC+1. I'm at UTC+7 and to get valid result, i need to substract 25200 from t. Example:
> print(os.date("%X", 0))
07:00:00
As of lua wiki the format should be preceeded by an exclamation sign for the passed value to be treated as UTC:
> print(os.date("!%X", 0))
00:00:00
This should work for all time zones, no substraction required.
Hello,
It seems that the widget does not work with Awesome 4.0. It does not even allow me to load the widget with the require function.
Is it possible to have the widget working with Awesome >= 4.0?
Thank you.
The init function is called after we have done the customization to the global state. This is ok for now because we have few options but as the time passes it might be better to pass those parameters to the init function itself so we will get something like the following:
pomodoro = require('pomodoro').init{
pause_duration = 10
}
When I mouseover the widget I get the red notification "Oops, an error happened!", probably some missing library, I don't have time for debugging it yet, but I wanted to let you know about it.
awesome v3.5.5 (Kansas City Shuffle)
• Build: Apr 11 2014 09:36:33 for x86_64 by gcc version 4.8.2 (nobody@)
• Compiled against Lua 5.2.3 (running with Lua 5.2)
• D-Bus support: ✔
When I have more information, I'll update this issue.
Thanks and regards,
Germán.
I have a HiDPI display which results in the default tool tip font being too small. I tried customising it by setting theme.tooltip_font
in my custom them as the Beautiful documentation advises, to no effect. I am not very proficient in customising Awesome, and have run out of ideas. Any advice would be appreciated.
I am often restarting awesome for config changes, and then awesome-pomodoro will be reset.
It would be nice, if the current state could be kept across awesome restarts.
I am not sure how to achieve this best, but one way might be to use X resources. I have the following function, which keeps track of which programs have been autostarted already:
-- Source: http://awesome.naquadah.org/wiki/Autostart#The_X_Resources_way
xrun = function(cmd, late)
local xresources = awful.util.pread("xrdb -query")
local myxr = xresources:match("^awesome%.xrun:%s+.-\n")
or xresources:match("\nawesome%.xrun:%s+.-\n")
or "awesome.xrun:"
myxr = myxr:gsub("\n", "")
if not string.find(myxr, cmd, 1, true) then
-- use pread so that this runs synchronously
awful.util.pread("echo '" .. myxr .. " " .. cmd:gsub("'", "\\'") .. "'|xrdb -merge")
if late then
local stimer = timer { timeout = late }
local run = function()
stimer:stop()
awful.util.spawn(cmd, false)
end
stimer:connect_signal("timeout", run)
stimer:start()
else
awful.util.spawn(cmd, false)
end
end
end
The same mechanism might be used from awesome-pomodoro.
There's a new API to query/set X properties in awesome Git: awesomeWM/awesome@62e2dee - you could just use this, if it exists.
For some reason this only works on one of my displays. Not sure if I introduced it at some point or there was no support in the first place.
I think the code from the (mouse) button handlers could be improved, and call separate methods instead: https://github.com/nikolavp/awesome-pomodoro/blob/master/init.lua#L62
This way, it would be easier to bind the actions to keys.
The documentation could then include some examples how to bind them.
With 5c4db06 I am getting:
error while running function!
stack traceback:
/home/user/.config/awesome/pomodoro/init.lua:7: in main chunk
[C]: in function 'require'
/home/user/.config/awesome/rc.lua:688: in main chunk
error: /home/user/.config/awesome/pomodoro/init.lua:7: module 'impl' not found:
no field package.preload['impl']
no file './impl.lua'
no file '/usr/share/luajit-2.0.5/impl.lua'
no file '…/lua/5.1/impl.lua'
no file '…/lua/5.1/impl/init.lua'
no file '/usr/share/lua/5.1/impl.lua'
no file '/usr/share/lua/5.1/impl/init.lua'
no file '/home/user/.config/awesome/impl.lua'
no file '/home/user/.config/awesome/impl/init.lua'
no file '/etc/xdg/awesome/impl.lua'
no file '/etc/xdg/awesome/impl/init.lua'
no file '/usr/share/awesome/lib/impl.lua'
no file '/usr/share/awesome/lib/impl/init.lua'
no file './impl.so'
no file '/usr/local/lib/lua/5.1/impl.so'
no file '/usr/lib/lua/5.1/impl.so'
no file '/usr/local/lib/lua/5.1/loadall.so'
no file '/home/user/.config/awesome/impl.so'
no file '/etc/xdg/awesome/impl.so'
no file '/usr/share/awesome/lib/impl.so'
I am using just require("pomodoro")
.
require("pomodoro/init")
might be a workaround (mentioned in #34), but that should not be necessary.
The following patch fixes it:
diff --git i/init.lua w/init.lua
index 021d2d2..f8b9089 100644
--- i/init.lua
+++ w/init.lua
@@ -2,8 +2,8 @@ local wibox = require("wibox")
local awful = require("awful")
local naughty = require("naughty")
local beautiful = require("beautiful")
-local module_path = (...):match ("(.+/)[^/]+$") or ""
-local createPomodoro = require(module_path..'impl')
+local module_path = (...)
+local createPomodoro = require(module_path..'.impl')
local timer = (type(timer) == 'table' and timer or require("gears.timer"))
local awesome = awesome
But it should probably handle the case where people are using /init
(or .init
?!) at the end already.
Is this widget for Awesome 3.5 only? Currently running 3.4 (latest on Debian Jessie 8.4), and seeing this error.
There has been a request for a screenshot in a thread in /r/awesomewm.
I think it makes sense to see how it will look like. Especially now that the look has been beautified! :)
The remembering of the state does not appear to remember the running/paused state: if awesome restarts, the timer which was stopped before (at the beginning of a break) will start running.
It seems like not only the current time, but also the state(s) should get saved and restored.
Hi, I'm not sure if this is an issue with the widget or not, but irrespective of what durations I specify, my timer seems to always start from 30:00. It counts down and resets accordingly at the 30 minute mark, never going to 0:00. What could the possible issue be? I'm using Awesome 4.0 at the time of posting, and apart from this small issue your widget works perfectly! Thanks!
If we want to follow the technique closesy there should be a long break every 4 normal breaks. Sadly the original author from which this code came didn't include this at all. It is time to fix this - we can get some code from one of our forks which is sadly lagging behind https://github.com/aL3xa/awesome-pomodoro/commit/fc93226fac7eff9c7e456e7cd3868922cd5beffc
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.