Skip to content
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

Allow multiple lines of output #53

Closed
protist opened this issue May 22, 2015 · 13 comments
Closed

Allow multiple lines of output #53

protist opened this issue May 22, 2015 · 13 comments
Assignees
Milestone

Comments

@protist
Copy link

protist commented May 22, 2015

I'd love to have my todo.sh list on the dashboard, but Awesome Widgets doesn't appear to process newlines correctly. It'd be great if we could have multi-line output.

(Also, interpreting ANSI colour codes would be very cool; I'm happy to open up a new issue for this if you like.)

@arcan1s
Copy link
Owner

arcan1s commented May 22, 2015

As far as I remember my tests, only <br> is recognizable as new line separator.

The general idea is to support on text configuration HTML only. In this context I may suggest you two cases which may be implemented on my side:

  1. For configuration create "Replace \n to <br>" checkbox.
  2. For custom commands create a special filters which should be selected from interface. For your example they are may be:
    1. Replace \n to <br>
    2. Convert shell colours to html

@arcan1s arcan1s added this to the Release 2.3.0 milestone May 22, 2015
@arcan1s arcan1s self-assigned this May 22, 2015
arcan1s pushed a commit that referenced this issue May 22, 2015
implement initial support of filters (dep #53)
@arcan1s
Copy link
Owner

arcan1s commented May 23, 2015

jfyi i've implemented both of them but didn't test yet. Do you have any suggestion about filters which may be applied for the custom scripts?

@arcan1s
Copy link
Owner

arcan1s commented May 23, 2015

hmm, I've improved the filters so except for standard filters (color, \n and \t, spaces) it may apply any other custom filter by using json configuration /usr/share/awesomewidgets/scripts/awesomewidgets-extscripts-filters.json

@arcan1s
Copy link
Owner

arcan1s commented May 23, 2015

will be released on this week if all will be ok

@protist
Copy link
Author

protist commented May 26, 2015

Apologies for the delay in response. In terms of where to place settings, I'm a little conflicted. It'd be useful to select interpretation of '\n' and colour for the widget as a whole, so that users could insert newlines between their non-custom commands. However, making the option specific to individual custom commands gives more control to users. I guess I tend towards the former, but very slightly.

In terms of filters, I think you have them all covered. I had a quick read but the only other possibility might be \r. Obviously it's fairly rare, and probably not even worth considering for *nix users. Thanks for the quick response.

@arcan1s
Copy link
Owner

arcan1s commented May 26, 2015

ok thanks for the feedback, will implement \r to the filter list

@arcan1s
Copy link
Owner

arcan1s commented May 31, 2015

implemented. As far as there is no any plan for the future release, the new version will be released on Monday.

@arcan1s arcan1s closed this as completed May 31, 2015
@protist
Copy link
Author

protist commented Jun 1, 2015

I just tested and it's working great! However, I'm finding a really strange bug; it's not printing v's! For example, the following desktop file.

[Desktop%20Entry]
Comment=Print todo list
Encoding=UTF-8
Exec=\"echo A caravan of travellers.\"
Name=todo.desktop
X-AW-Active=true
X-AW-ApiVersion=3
X-AW-Filters="color,newline"
X-AW-Interval=60
X-AW-Number=3
X-AW-Output=true
X-AW-Prefix=bash -c
X-AW-Redirect=nothing

@arcan1s
Copy link
Owner

arcan1s commented Jun 1, 2015

hm, please remove line 25 at /usr/share/awesomewidgets/scripts/awesomewidgets-extscripts-filters.json and comma at the end of line 24. Probably it is caused by the fact that usually unused \v (vertical tab) parsed from json as v

@protist
Copy link
Author

protist commented Jun 1, 2015

Perfect! I can confirm that v's now work perfectly.

arcan1s pushed a commit that referenced this issue Jun 1, 2015
@protist
Copy link
Author

protist commented Jun 1, 2015

Also, related to multiple lines, having left justification as an option instead of centred would be excellent. I'm happy to open up a new issue if you like.

@arcan1s
Copy link
Owner

arcan1s commented Jun 1, 2015

it should be supported by html tags. Smth like <p align="left">$custom</p>
scr8

@protist
Copy link
Author

protist commented Jun 2, 2015

Oh brilliant! Thanks for that!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants