|
Post by rikky on Jul 16, 2016 15:21:24 GMT 1
Hmm, The "!" problem is not a cairo problem nor bash. bcm -c "#fafafafa" -b "#0f0f0ffa" -g r:t -t "Hello!" -d 0 Works like a sharm. as soon as I add some style bcm -c "#fafafafa" -b "#0f0f0ffa" -g r:t -t "<span font='Sans Bold 45' color='white'>Hello!</span>" -d 0 It goes kaput. remove the !,; bcm -c "#fafafafa" -b "#0f0f0ffa" -g r:t -t "<span font='Sans Bold 45' color='white'>Hello</span>" -d 0 then everything is ok. Rik.
|
|
|
Post by rikky on Jul 16, 2016 15:27:12 GMT 1
Oh ja, Adding a "\" before the ! does not work here. That is, the error disappears, but now it prints : " hallo\! " on the screen, in stead of " hallo! " Rik.
|
|
|
Post by alexfish on Jul 16, 2016 16:21:13 GMT 1
Hi rikky
did you the mod the code of bcm , below line 136 line 137 add 'msg_text$ = REPLACE$(msg_text$, CHR$(92), "")'
msg_text$ = CHOP$(ARGUMENT$) msg_text$ = REPLACE$(msg_text$, "&", "&") msg_text$ = REPLACE$(msg_text$, CHR$(92), "")
recompile then
code to test
./bcm -c "#fafafafa" -b "#0f0f0ffa" -g r:t -t "<span font='Sans Bold 45' color='white'>Hello\!</span>" -d 0
BR Alex
|
|
|
Post by alexfish on Jul 16, 2016 16:36:27 GMT 1
Dear Alex, Good that you discovered the shell problem with certain chars. What about this thing? simple terminalI will look at it now. With kind regards, vovchik Well No. but have just tested an old , well not so old friend of mine , best read what it does . On The Tin . + basica , No I am not related to Axel fishshell.com/it should be in most repos... code to test ./bcm -c "#fafafafa" -b "#0f0f0ffa" -g r:t -t "<span font='Sans Bold 45' color='white'>Hello!</span>" -d 0 Will be Interesting to see how Simple will Compare. BR Alex
|
|
|
Post by basica on Jul 16, 2016 17:52:44 GMT 1
Well No. but have just tested an old , well not so old friend of mine , best read what it does . On The Tin . + basica , No I am not related to Axel fishshell.com/it should be in most repos... BR Alex Alex, I've just finished reading the fishshell site. It's really intriguing with helpful features. And be prepared to give up a lot of standardization, as apparently it doesn't recognize backtics and works quite differently for many other commands. Not for one minute, did I suspect more programming nepotism going on, Axel Great stuff and your friends are always fascinating, basica
|
|
|
Post by vovchik on Jul 16, 2016 18:16:05 GMT 1
Dear Alex,
Yep, it works with a paste of the string in fish and does show the "!"
All very puzzling.
With kind regards, vovchik
|
|
|
Post by rikky on Jul 16, 2016 18:53:27 GMT 1
Ah ja, alexfish , I've now done the mods, and now it works with the "\" And yes indeed, its a Bash bug. Probably not even a bug. You can make a 'script' #!/bin/sh echo $@ Now you can say ./Script "!u" Wich gives : ./Script "urxvt " urxvt Its a command I gave earlier, wich seems to be remembered. Nice feature, when you are typing in a terminal, but it is very unhandy when passed as an argument. Hmm, Well ,ll give the Fish a try. Rik.
|
|
|
Post by vovchik on Jul 16, 2016 18:58:52 GMT 1
Dear guys, Problem solved, I think. Type this in the terminal: set +H and then run the command. The "!" shows, as does "&"! bash expansionWith kind regards, vovchik
|
|
|
Post by alexfish on Jul 16, 2016 19:23:46 GMT 1
Hmm, The "!" problem is not a cairo problem nor bash. bcm -c "#fafafafa" -b "#0f0f0ffa" -g r:t -t "Hello!" -d 0 Works like a sharm. Hi rikky on the Rasberry pi lx term I get the same fail. pi@raspberrypi ~ $ bcm -c "#fafafafa" -b "#0f0f0ffa" -g r:t -t "Hello!" -d 0 bash: !": event not found BR Alex
|
|
|
Post by alexfish on Jul 16, 2016 20:19:56 GMT 1
Hi Vovchik
Managed to get a result by changing the Quotes ..
the the opt parse
CASE "t" msg_text$ = CHOP$(ARGUMENT$) msg_text$ = REPLACE$(msg_text$, "&", "&") msg_text$ = REPLACE$(msg_text$, "'", (CHR$34))
The test code ./bcm -c "#fafafafa" -b "#0f0f0ffa" -g r:t -t '<span font="Sans Bold 45" color="white">Hello!</span>' -d 5
BR Alex
|
|
|
Post by rikky on Jul 16, 2016 22:19:42 GMT 1
set +H Works perfect. So a little wrapper, will do. #!/bin/bash set +H bcm $@
Thanks. Rik.
|
|
|
Post by rikky on Jul 17, 2016 17:48:37 GMT 1
So I already had a sort of myXprint program, but I liked this one better,
Guess what.
In the notify_svg program the "|" is used as an "enter"
And I had a lot of, you can say, help print balloons, in wich the "|" is used as a kind of "or", as in English.
That doesnt look so well.
So I changed, I believe, line 180 :
msg_text$ = REPLACE$(msg_text$, CHR$(10), "") to :
msg_text$ = REPLACE$(msg_text$, CHR$(10), CHR$(13) ) and kicked out line 181 :
msg_text$ = CHOP$(REPLACE$(msg_text$, "|", CHR$(13))) So far it seems to work Just leaving the CHR$(10) as it is doesn't however, for some strange reason.
Now my text is just as you write it, with the enters in the text. You should be able to feed a file to it, probably.
example:
set +H; notify_svg -s -d 0 -w 50 -g c:c -c white -b yellow -t "notify_svg [options] --- -g (geometry xx(int):xx(int) | t:l t:c t:r, c:l c:c c:r, b:r b:c b:l) -f (fade in and out) -d (duration in seconds for autoclose) -s (use rounded svg bounding box for message) -c (first color for grad in svg rectangle) -b (second color for grad in svg rectangle) -t (text - use markup if you want) -j (justify 0-3: 0 = left 1 = right 2 = centre 3 = fill - default = 2) -a (angle of text - floating point value) -w (wrap text 0 or 1 - no/yes - default = 0)
Example: notify_svg -f -c ghostwhite -b dimgray -g r:t -t \"<span font='Sans Bold 45' color='white'>Hello!</span>\" -s -d 5 --- Oops. Your screen does not support alpha channels! Bye-bye..." Just copy and paste the above in a terminal.
Groetjes Rik.
|
|
|
Post by rikky on Jul 17, 2016 18:38:57 GMT 1
And I immediately found the next 'bug', Maybe caused because of the meddling with the CHR$(10) I wrote the above in a Script. #!/bin/sh set +H; notify_svg -j 2 -s -d 0 -w 50 -g c:c -c white -b yellow -t "notify_svg [options] --- -g (geometry xx(int):xx(int) | t:l t:c t:r, c:l c:c c:r, b:r b:c b:l) -f (fade in and out) -d (duration in seconds for autoclose) -s (use rounded svg bounding box for message) -c (first color for grad in svg rectangle) -b (second color for grad in svg rectangle) -t (text - use markup if you want) -j (justify 0-3: 0 = left 1 = right 2 = centre 3 = fill - default = 2) -a (angle of text - floating point value) -w (wrap text 0 or 1 - no/yes - default = 0)
Example: notify_svg -f -c ghostwhite -b dimgray -g r:t -t \"<span font='Sans Bold 45' color='white'>Hello!</span>\" -s -d 5 --- Oops. Your screen does not support alpha channels! Bye-bye..."
executed it, and unbelevably got the "HELLO" from the example in the example in the box as well. Groeten Rik.
|
|
|
Post by rikky on Jul 17, 2016 18:52:04 GMT 1
Ah ja, now I see. The Hello is not over it, but in it. So the bash in my script is differently configured, and doesnt take the backslash, so notify interprets the markup language. I am really sorrie to have bothered you with this nonsense. Rik.
|
|
|
Post by vovchik on Jul 17, 2016 21:35:48 GMT 1
Dear Rik, Thanks in any case. I am glad we have figured out the peculiarities of bash and the swallowing of "!" and "&". And any bug sqaushes are always welcome! With kind regards, vovchik
|
|