Comments (10)
Thanks for your feedback!
It seems two modules involved: calendar.lua
and timelapsed.lua
. It's surely a bug in calendar.lua
, which I hope being fixed in 2ec0540.
As for timelapsed.lua
, I need more info to identify which part is broken. Would you please input those code in Hammerspoon terminal and see what it say?
for i in ipairs(timelapsed_canvas) do print(timelapsed_canvas[i]) end
from awesome-hammerspoon.
@biocyberman Yeah, locale
, misspelled …
Since @asmagill have opened a PR to fix this, so I guess I could close this issue now.
And please use the workaround above until the next hammerspoon release.
from awesome-hammerspoon.
Below is the output after updating to 2ec0540. The calendar looks correct now, but I still see the colourful box.
2017-06-10 12:35:12: -- Lazy extension loading enabled
2017-06-10 12:35:13: -- Loading ~/.hammerspoon/init.lua
2017-06-10 12:35:13: -- Loading extension: hotkey
2017-06-10 12:35:13: -- Loading extension: hints
2017-06-10 12:35:13: -- Loading extension: uielement
2017-06-10 12:35:13: -- Loading extension: window
2017-06-10 12:35:13: -- Loading extension: drawing
2017-06-10 12:35:13: -- Loading extension: fs
2017-06-10 12:35:13: 12:35:13 hotkey: Enabled hotkey ⌘⌃⇧R: Reload Configuration
2017-06-10 12:35:13: hotkey: Enabled hotkey ⌘⌃⇧L: Lock Screen
2017-06-10 12:35:13: hotkey: Enabled hotkey ⌘⌃⇧T: Show Digital Clock
2017-06-10 12:35:13: hotkey: Enabled hotkey ⌘⌃⇧SPACE: Toggle Hotkeys Cheatsheet
2017-06-10 12:35:13: hotkey: Enabled hotkey ⌘⌥LEFT: Lefthalf of Screen
2017-06-10 12:35:13: hotkey: Enabled hotkey ⌘⌥RIGHT: Righthalf of Screen
2017-06-10 12:35:13: hotkey: Enabled hotkey ⌘⌥UP: Fullscreen
2017-06-10 12:35:13: hotkey: Enabled hotkey ⌘⌥DOWN: Resize & Center
2017-06-10 12:35:13: hotkey: Enabled hotkey ⌘⌥RETURN: Center Window
2017-06-10 12:35:13: -- Loading extension: eventtap
2017-06-10 12:35:13: -- Loading extension: network
2017-06-10 12:35:13: -- Loading extension: osascript
2017-06-10 12:35:13: -- Loading extension: menubar
2017-06-10 12:35:13: -- Loading extension: timer
2017-06-10 12:35:13: -- Loading extension: screen
2017-06-10 12:35:13: -- Loading extension: geometry
2017-06-10 12:35:13: -- Loading extension: styledtext
2017-06-10 12:35:13: -- Loading extension: canvas
2017-06-10 12:35:13: -- Loading extension: image
2017-06-10 12:35:13: 12:35:13 ** Warning:hs.keycode: key '=' not found in active keymap; using ANSI-standard US keyboard layout as fallback, returning '24'
2017-06-10 12:35:13: 12:35:13 ** Warning:hs.keycode: key '`' not found in active keymap; using ANSI-standard US keyboard layout as fallback, returning '50'
2017-06-10 12:35:13: 12:35:13 ** Warning:hs.keycode: key '[' not found in active keymap; using ANSI-standard US keyboard layout as fallback, returning '33'
2017-06-10 12:35:13: 12:35:13 ** Warning:hs.keycode: key ']' not found in active keymap; using ANSI-standard US keyboard layout as fallback, returning '30'
2017-06-10 12:35:13: -- Loading extension: application
2017-06-10 12:35:14: 12:35:14 hotkey: Enabled hotkey ⌘⌃⇧Q: Toggle Modal Supervisor
2017-06-10 12:35:14: hotkey: Disabled hotkey ⌘⌃⇧Q: Toggle Modal Supervisor
2017-06-10 12:35:14: -- Done.
2017-06-10 12:35:14: ********
2017-06-10 12:35:14: 12:35:14 ERROR: LuaSkin: hs.canvas:invalid percentage string specified for field w of frame for element 6
2017-06-10 12:35:14: ********
2017-06-10 12:35:14: ********
2017-06-10 12:35:14: 12:35:14 ERROR: LuaSkin: hs.timer callback error: ...oon.app/Contents/Resources/extensions/hs/canvas/init.lua:525: bad argument #3 to 'elementAttribute' (invalid argument type for frame specified)
stack traceback:
[C]: in method 'elementAttribute'
...oon.app/Contents/Resources/extensions/hs/canvas/init.lua:525: in metamethod '__newindex'
/Users/user/.hammerspoon/widgets/timelapsed.lua:116: in function 'updateElapsedCanvas'
/Users/user/.hammerspoon/widgets/timelapsed.lua:122: in function </Users/user/.hammerspoon/widgets/timelapsed.lua:122>
2017-06-10 12:35:14: ********
2017-06-10 12:35:19: -- Loading extension: http
2017-06-10 12:35:19: -- Loading extension: json
2017-06-10 12:35:19: -- Loading extension: task
Lua code output:
> for i in ipairs(timelapsed_canvas) do print(timelapsed_canvas[i]) end
2017-06-10 12:37:30: {
action = "fill",
fillColor = {
__luaSkinType = "NSColor",
alpha = 0.2,
blue = 0.0,
green = 0.0,
red = 0.0,
},
frame = {
h = "100%",
w = "100%",
x = "0%",
y = "0%",
},
roundedRectRadii = {
xRadius = 5,
yRadius = 5,
},
type = "rectangle",
}
2017-06-10 12:37:30: {
frame = {
h = "100%",
w = "100%",
x = "0%",
y = "0%",
},
text = "Time Elapsed",
textColor = {
__luaSkinType = "NSColor",
alpha = 0.3,
blue = 1.0,
green = 1.0,
red = 1.0,
},
textSize = 14,
type = "text",
}
2017-06-10 12:37:30: {
frame = {
h = "100%",
w = "100%",
x = "0%",
y = "0%",
},
text = "161 days 12 hours 35 min 14 sec",
textAlignment = "center",
textColor = {
__luaSkinType = "NSColor",
alpha = 1.0,
blue = 0.76470588235294,
green = 0.66666666666667,
red = 0.65098039215686,
},
textSize = 17,
type = "text",
}
2017-06-10 12:37:30: {
frame = {
h = "100%",
w = "100%",
x = "0%",
y = "0%",
},
image = hs.image: (0x7fbb2a77af08),
imageAnimates = false,
type = "image",
}
2017-06-10 12:37:30: {
action = "fill",
fillColor = {
__luaSkinType = "NSColor",
alpha = 0.2,
blue = 1.0,
green = 1.0,
red = 1.0,
},
frame = {
h = "100%",
w = "100%",
x = "0%",
y = "0%",
},
type = "rectangle",
}
2017-06-10 12:37:30: {
action = "fill",
frame = {
h = "100%",
w = "100%",
x = "0%",
y = "0%",
},
type = "rectangle",
}
2017-06-10 12:37:30: {
action = "fill",
compositeRule = "sourceAtop",
fillGradient = "linear",
fillGradientColors = {
[1] = {
__luaSkinType = "NSColor",
alpha = 1.0,
blue = 0.96862745098039,
green = 0.62745098039216,
red = 0.0,
},
[2] = {
__luaSkinType = "NSColor",
alpha = 1.0,
blue = 0.89803921568627,
green = 0.82352941176471,
red = 0.57254901960784,
},
[3] = {
__luaSkinType = "NSColor",
alpha = 1.0,
blue = 0.50588235294118,
green = 0.89803921568627,
red = 0.29411764705882,
},
[4] = {
__luaSkinType = "NSColor",
alpha = 1.0,
blue = 0.36862745098039,
green = 0.94901960784314,
red = 0.91764705882353,
},
[5] = {
__luaSkinType = "NSColor",
alpha = 1.0,
blue = 0.33333333333333,
green = 0.7921568627451,
red = 0.95686274509804,
},
[6] = {
__luaSkinType = "NSColor",
alpha = 1.0,
blue = 0.30588235294118,
green = 0.30588235294118,
red = 0.87843137254902,
},
},
frame = {
h = "100%",
w = "100%",
x = "0%",
y = "0%",
},
type = "rectangle",
}
from awesome-hammerspoon.
That's very strange. All elements in canvas are created, but the frame percentage is not correct.
Are you running the latest Hammerspoon?
And also, could you please insert this script below line 113 of ~/.hammerspoon/widgets/timelapsed.lua
, reload the configuration to see what it say?
print("elapsed_percent",elapsed_percent)
from awesome-hammerspoon.
@ashfinal I installed hammerspoon like this: homebrew cask install hammerspoon
and its version is 0.9.54
Reloading output:
2017-06-11 11:49:48: -- Lazy extension loading enabled
2017-06-11 11:49:48: -- Loading ~/.hammerspoon/init.lua
2017-06-11 11:49:49: -- Loading extension: hotkey
2017-06-11 11:49:49: -- Loading extension: hints
2017-06-11 11:49:49: -- Loading extension: uielement
2017-06-11 11:49:49: -- Loading extension: window
2017-06-11 11:49:49: -- Loading extension: drawing
2017-06-11 11:49:49: -- Loading extension: fs
2017-06-11 11:49:49: 11:49:49 hotkey: Enabled hotkey ⌘⌃⇧R: Reload Configuration
2017-06-11 11:49:49: hotkey: Enabled hotkey ⌘⌃⇧L: Lock Screen
2017-06-11 11:49:49: hotkey: Enabled hotkey ⌘⌃⇧T: Show Digital Clock
2017-06-11 11:49:49: hotkey: Enabled hotkey ⌘⌃⇧SPACE: Toggle Hotkeys Cheatsheet
2017-06-11 11:49:49: hotkey: Enabled hotkey ⌘⌥LEFT: Lefthalf of Screen
2017-06-11 11:49:49: hotkey: Enabled hotkey ⌘⌥RIGHT: Righthalf of Screen
2017-06-11 11:49:49: hotkey: Enabled hotkey ⌘⌥UP: Fullscreen
2017-06-11 11:49:49: hotkey: Enabled hotkey ⌘⌥DOWN: Resize & Center
2017-06-11 11:49:49: hotkey: Enabled hotkey ⌘⌥RETURN: Center Window
2017-06-11 11:49:49: -- Loading extension: eventtap
2017-06-11 11:49:49: -- Loading extension: network
2017-06-11 11:49:49: -- Loading extension: osascript
2017-06-11 11:49:49: -- Loading extension: menubar
2017-06-11 11:49:49: -- Loading extension: timer
2017-06-11 11:49:49: -- Loading extension: screen
2017-06-11 11:49:49: -- Loading extension: geometry
2017-06-11 11:49:49: -- Loading extension: styledtext
2017-06-11 11:49:49: -- Loading extension: canvas
2017-06-11 11:49:49: -- Loading extension: image
2017-06-11 11:49:49: -- Loading extension: application
2017-06-11 11:49:49: hotkey: Enabled hotkey ⌘⌃⇧Q: Toggle Modal Supervisor
2017-06-11 11:49:49: hotkey: Disabled hotkey ⌘⌃⇧Q: Toggle Modal Supervisor
2017-06-11 11:49:49: -- Done.
2017-06-11 11:49:50: ********
2017-06-11 11:49:50: 11:49:50 ERROR: LuaSkin: hs.canvas:invalid percentage string specified for field w of frame for element 6
2017-06-11 11:49:50: ********
2017-06-11 11:49:50: ********
2017-06-11 11:49:50: 11:49:50 ERROR: LuaSkin: hs.timer callback error: ...oon.app/Contents/Resources/extensions/hs/canvas/init.lua:525: bad argument #3 to 'elementAttribute' (invalid argument type for frame specified)
stack traceback:
[C]: in method 'elementAttribute'
...oon.app/Contents/Resources/extensions/hs/canvas/init.lua:525: in metamethod '__newindex'
/Users/user/.hammerspoon/widgets/timelapsed.lua:116: in function 'updateElapsedCanvas'
/Users/user/.hammerspoon/widgets/timelapsed.lua:122: in function </Users/vql/.hammerspoon/widgets/timelapsed.lua:122>
2017-06-11 11:49:50: ********
2017-06-11 11:49:54: -- Loading extension: http
2017-06-11 11:49:54: -- Loading extension: json
2017-06-11 11:49:54: -- Loading extension: task
2017-06-11 12:52:26: -- Lazy extension loading enabled
2017-06-11 12:52:26: -- Loading ~/.hammerspoon/init.lua
2017-06-11 12:52:26: -- Loading extension: hotkey
2017-06-11 12:52:26: -- Loading extension: hints
2017-06-11 12:52:26: -- Loading extension: uielement
2017-06-11 12:52:26: -- Loading extension: window
2017-06-11 12:52:26: -- Loading extension: drawing
2017-06-11 12:52:26: -- Loading extension: fs
2017-06-11 12:52:26: 12:52:26 hotkey: Enabled hotkey ⌘⌃⇧R: Reload Configuration
2017-06-11 12:52:26: hotkey: Enabled hotkey ⌘⌃⇧L: Lock Screen
2017-06-11 12:52:26: hotkey: Enabled hotkey ⌘⌃⇧T: Show Digital Clock
2017-06-11 12:52:26: hotkey: Enabled hotkey ⌘⌃⇧SPACE: Toggle Hotkeys Cheatsheet
2017-06-11 12:52:26: hotkey: Enabled hotkey ⌘⌥LEFT: Lefthalf of Screen
2017-06-11 12:52:26: hotkey: Enabled hotkey ⌘⌥RIGHT: Righthalf of Screen
2017-06-11 12:52:26: hotkey: Enabled hotkey ⌘⌥UP: Fullscreen
2017-06-11 12:52:26: hotkey: Enabled hotkey ⌘⌥DOWN: Resize & Center
2017-06-11 12:52:26: hotkey: Enabled hotkey ⌘⌥RETURN: Center Window
2017-06-11 12:52:26: -- Loading extension: eventtap
2017-06-11 12:52:26: -- Loading extension: network
2017-06-11 12:52:26: -- Loading extension: osascript
2017-06-11 12:52:26: -- Loading extension: menubar
2017-06-11 12:52:27: -- Loading extension: timer
2017-06-11 12:52:27: -- Loading extension: screen
2017-06-11 12:52:27: -- Loading extension: geometry
2017-06-11 12:52:27: -- Loading extension: styledtext
2017-06-11 12:52:27: -- Loading extension: canvas
2017-06-11 12:52:27: -- Loading extension: image
2017-06-11 12:52:27: -- Loading extension: application
2017-06-11 12:52:27: 12:52:27 hotkey: Enabled hotkey ⌘⌃⇧Q: Toggle Modal Supervisor
2017-06-11 12:52:27: hotkey: Disabled hotkey ⌘⌃⇧Q: Toggle Modal Supervisor
2017-06-11 12:52:27: -- Done.
2017-06-11 12:52:28: elapsed_percent 0.44245142059868
2017-06-11 12:52:28: ********
2017-06-11 12:52:28: 12:52:28 ERROR: LuaSkin: hs.canvas:invalid percentage string specified for field w of frame for element 6
2017-06-11 12:52:28: ********
2017-06-11 12:52:28: ********
2017-06-11 12:52:28: 12:52:28 ERROR: LuaSkin: hs.timer callback error: ...oon.app/Contents/Resources/extensions/hs/canvas/init.lua:525: bad argument #3 to 'elementAttribute' (invalid argument type for frame specified)
stack traceback:
[C]: in method 'elementAttribute'
...oon.app/Contents/Resources/extensions/hs/canvas/init.lua:525: in metamethod '__newindex'
/Users/user/.hammerspoon/widgets/timelapsed.lua:117: in function 'updateElapsedCanvas'
/Users/user/.hammerspoon/widgets/timelapsed.lua:123: in function </Users/user/.hammerspoon/widgets/timelapsed.lua:123>
2017-06-11 12:52:28: ********
2017-06-11 12:52:32: -- Loading extension: http
2017-06-11 12:52:32: -- Loading extension: json
2017-06-11 12:52:32: -- Loading extension: task
from awesome-hammerspoon.
Yeah, you're using the latest Hammerspoon.
This may be a upstream bug, still need time to confirm.
For now, please disable this module timelapsed.lua
by adding these lines in ~/.hammerspoon/private/awesomeconfig.lua
, until this problem is resolved. Sorry for the trouble.
module_list = {
"widgets/netspeed",
"widgets/calendar",
"widgets/hcalendar",
"widgets/analogclock",
"widgets/aria2",
"modes/basicmode",
"modes/indicator",
"modes/clipshow",
"modes/cheatsheet",
"modes/hsearch",
"misc/bingdaily",
}
from awesome-hammerspoon.
@biocyberman The upstream maintainer said it may be related to your locate.
What's your locate? Have you tried to change it to en_US
for testing?
And please join this discussion here: Hammerspoon/hammerspoon#1458
from awesome-hammerspoon.
@ashfinal You mean locale
?
This is my locale:
.hammerspoon ➤ locale git:master*
LANG="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_CTYPE="UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_ALL=
But what's more relevant is the macos locale :) I changed region
like in the attached image and it works!
from awesome-hammerspoon.
Very happy that we found the root cause and the way around it. Thanks for sharing the indeed awesome HS config 🥇
from awesome-hammerspoon.
:)
from awesome-hammerspoon.
Related Issues (20)
- 当我关闭 shortcut 显示后,窗口模式下,如何让那个红点居中呢? HOT 8
- Add a shortcut to show/hide all widgets HOT 5
- Unable to disable window hints HOT 1
- Calendar date is not correct HOT 1
- CountDown spoon causes switching spaces to focus on Hammerspoon rather than currently visible application HOT 5
- interacting with workspaces? HOT 1
- A alternative window mover approach? HOT 5
- Can I only use left alt with hammerspoon? HOT 1
- How to disable the cheatsheet when I press "alt + A"
- Can window be set to two-thirds and one-third of the screen? HOT 1
- how to open Terminal? HOT 1
- WinWin Spoon is newer than this in Hammerspoon website
- Some Window Manipulations don't work
- git warning HOT 1
- BingDaily don't refresh every 3h
- 老哥,HCalendar被Dock栏遮挡如何解决 HOT 2
- WinWin doesn't split windows equal size
- Hsearch call chooser:hide() block me 3 seconds HOT 1
- Slow windows hints HOT 1
- 大佬,如果只想要cheatsheet和aria2c这两个功能的话,我应该怎么编辑配置文件呢
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from awesome-hammerspoon.