-
Notifications
You must be signed in to change notification settings - Fork 210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Calendar: current date is not being highlighted. #300
Comments
Try this. |
It's already there. I've updated today morning. |
Why closing the issue ? It's still not working right ? |
@dummys it's another issue was closed. This one is not. |
Sorry, I mean try reverting to the previous code. |
@copycat-killer The previous code doesn't work either |
Is For instance, if you're using Ubuntu, it's EDIT: Or, maybe try setting |
I use ArchLinux so |
I'm on Arch too. This is what I use: lain.widgets.calendar {
cal = "/usr/bin/cal --color=always",
attach_to = { mytextclock }
} and it works (simple You can try adjusting the matching pattern in Lua: $ lua
> cal = io.popen("/usr/bin/cal --color=always"):read("*a")
> cal:gsub("%c%[%d+[m]?%d+%c%[%d+[m]?", "DID I PICK IT?") If you read the blurb, then it's working. Of course, I'll work on a solution myself, but in the meantime you can test. |
It's working in lua, but not in Awesome, the calendar doesn't have the highlighting. I just tried a default config(with default theme) with your snippet added. It's not working. |
Not working in my setup too. |
This is broken for me now too even after adding
I also had a problem with the icon not showing up because os.date was returning 01 instead of 1. I think it would probably be better to change the pattern so it matches the output of the cal command without the --color=always option. |
Sorry for misleading comment:
It's not being picked. |
code from the fix
does work in lua but highlighting is not appearing in Awesome's notification,
|
Fix calander widget not highlighting date #300
It might be the locale settings which leads into showing the day of month without the leading zero. Therefor we also make sure that the "today" variable exclude it with:
And then markup the right one:
The regex for the global substitution needs to be fixed ;-) |
@mbuelte You beat me on time. ;-) |
@copycat-killer, I'm afraid the regex still doensn't work (for me). Strangely enough that it match from the lua shell, but only if I append '--color=always' - it seems you've forgotten that in the latest commit.
The only way of getting it to work is to set this crappy gsub: Btw, this problem is independent from the current locale settings, I tried it with 'de_DE.UTF-8' and I got the same result. |
Doesn't for me either. |
And of course it's working only for me. Does pull #303 works for you? |
Unfortunately not |
How about such a solution? This may not be exactly nice, but it works for me:
Edit: This works even if |
Keep -ws = ws:gsub("%c%[+%d+[m]?%s?%d+%c%[+%d+[m]?", markup.bold(markup.color(bg, fg, today)))
+ws = ws:gsub("%c%[%d+[m]?" .. today .. "%c%[%d+[m]?", markup.bold(markup.color(bg, fg, today))) |
Sorry, same problem, the regex won't match here :( Edit: Hmm, probably there is another problem. Even this expression doesn't match: Finally I'm pretty sure, that the string doesn't contain these escape sequences at all. First I thought it has something todo with |
Since it worked for you in the shell, are you sure you don't have an environment problem? Try setting EDIT: You can use |
That's driving me nuts. I don't think there is an issue with the environment, everything looks similiar. I wonder, why the escape sequences doesn't came up in the output. Afterwards I wrote a little bash script that simulate the output of
And I see the escape sequences in the raw output, your regex matches and is highlighted as wished. |
I don't know. Did you try setting Try to understand why this works on your system. |
Yep, the only working variant is one you suggested.
You can use naughty.notify{text=ws, timeout=0} before ws:gsub(...) to print the pre-processing text. Actually I used this in helpers.lua inside the async function. It returns |
@sprnza That's the same I noticed here. When you try my bash script instead of I don't set awful.util.shell directly but it's pointing to |
@mbuelte Yep, your script is being processed just fine |
There's a problem with @mbuelte solution: it will highlight every Can you try setting |
What I've found that if I pipe cal to a file, then convert it to a scipt and call it. It's being displayed properly. So it's cal who is misbehaving. It doesn't return escape sequences under awesome env.
|
Even if I use
inside rc.lua (wich is working in lua shell) and then return the variable using awesome-client it doesn't have the escape sequences. |
|
Same here, even such things like @copycat-killer could this depend on a library version? Any changes in naughty.notify that ignores this kind of escape characters? Hm, forget the last one, this has nothing todo with naughty. Maybe we should try it with a vanilla awesome configuration. |
Works perfectly under Xephyr. |
Works perfectly if I start awesomewm using startx + xinitrc |
@sprnza What works perfectly? The standard How were you starting awesome before? |
The standard |
@mbuelte How do you start awesome? |
adding |
Great! I'll try it out soon. I start awesome by xdg, but using startx doesn't solved the issue. |
@sprnza Can you try with |
this one works. |
@copycat-killer sorry for had being disturbing you with this unrelated issue. And thank you! |
@mbuelte Let me know if it works for you too. I added a note in the wiki. |
@copycat-killer @sprnza Thanks a lot! |
cal = "/usr/bin/env TERM=linux /usr/bin/cal --color=always" This one works for me too ! |
No problems with the reverting. |
…path; weather: refresh widget when refreshing notification
No problem, thanks! |
I'll quietly add this here to help the next person. It might be connected to your issue, but if not, don't mind me. :) I encountered the issue of |
Hi there!
I can't remember exactly the update I've started facing this issue but calendar's stopped highlighting the current date.
I use this code to attach the widget:
In a terminal
cal
returns the date highlighted properly.Just tried a default awesom's config- it behaves the same way- no current date highlighting.
The text was updated successfully, but these errors were encountered: