I have been adding keyboard macros expandsions in openbox with great success, but find that if I want a '~' in the arguments to a command Openbox expands that character when it should not do so.
For example in the openbox rc.xml I have...
<keybind key="W-F2">
<action name="Execute">
<startupnotify>
<enabled>true</enabled>
<name>Keyboard Macro: Web Page</name>
</startupnotify>
<command>xte 'usleep 500000' \
'str http://www.cit.gu.edu.au/~anthony/'</command>
</action>
</keybind>
When the user presses Super-F2 (and releases it) Openbox will
wait 1/2 (for user to release the modifiers) then output the string
"http://www.cit.gu.edu.au/~anthony/"
as if the user actually typed it into whatever the current input box is
THIS IS VERY USEFUL!
But openbox actually expands the '~' with "/home/anthony" which
means the above keyboard macro expands to
http://www.cit.gu.edu.au//home/anthony/"
That is WRONG!
A '~' character should only be expanded when....
* Not in quotes
* and has white space in front of it.
Any other '~' should not be expanded as it DOES NOT MAKE SENSE!
THIS IS A SERIOUS, if minor BUG.
I attempted to use the standard XML handling for ˜ or E; but these also do not work!
That could be regarded as another posible bug!
How can I get Openbox to give a command a '~' without expanding it!
(In reply to comment #0)
> I have been adding keyboard macros expandsions in openbox with great success,
> but find that if I want a '~' in the arguments to a command Openbox expands
> that character when it should not do so.
>
> For example in the openbox rc.xml I have...
>
> <keybind key="W-F2">
> <action name="Execute">
> <startupnotify>
> <enabled>true</enabled>
> <name>Keyboard Macro: Web Page</name>
> </startupnotify>
> <command>xte 'usleep 500000' \
> 'str http://www.cit.gu.edu.au/~anthony/'</command>
> </action>
> </keybind>
>
> When the user presses Super-F2 (and releases it) Openbox will
> wait 1/2 (for user to release the modifiers) then output the string
> "http://www.cit.gu.edu.au/~anthony/"
> as if the user actually typed it into whatever the current input box is
>
> THIS IS VERY USEFUL!
No need to shout :)
> But openbox actually expands the '~' with "/home/anthony" which
> means the above keyboard macro expands to
> http://www.cit.gu.edu.au//home/anthony/"
>
> That is WRONG!
>
> A '~' character should only be expanded when....
> * Not in quotes
> * and has white space in front of it.
or is at the start of a string
> Any other '~' should not be expanded as it DOES NOT MAKE SENSE!
>
> THIS IS A SERIOUS, if minor BUG.
These are mutually exclusive last i checked. :)
> I attempted to use the standard XML handling for ˜ or E; but
> these also do not work!
>
> That could be regarded as another posible bug!
No, openbox sees the strings after xml processing has been done, so this doesn't make any difference. Note also that your syntax is incorrect, to specify a hex unicode codepoint, you say ~, otherwise it is a decimal value, in which case E is an invalid character.
> How can I get Openbox to give a command a '~' without expanding it!
Questions end with "?", not "!".
I'll fix this for 3.4.8 so '~' is only expanded when the bullet points are true.
| > A '~' character should only be expanded when....
| > * Not in quotes
| > * and has white space in front of it.
| or is at the start of a string
| ...
| > Any other '~' should not be expanded
|
| I'll fix this for 3.4.8 so '~' is only expanded when the bullet points are
| true.
|
Thank you. can you tell me which version it will be in?
| > I attempted to use the standard XML handling for ˜ or E; but
| > these also do not work!
|
So I was later told from the mail list. My current workaround (until
the patch comes through)
<command>bash -c "xte 'usleep 500000' \\\
'str http://www.cit.gu.edu.au/'`printf '\176'`'anthony/'"
</command>
Which as you can see is not particularly nice.
Thanks again.
(In reply to comment #2)
> | I'll fix this for 3.4.8 so '~' is only expanded when the bullet points are
> | true.
> |
> Thank you. can you tell me which version it will be in?
If that didn't do the trick, I don't think I can. :)
I have been adding keyboard macros expandsions in openbox with great success, but find that if I want a '~' in the arguments to a command Openbox expands that character when it should not do so. For example in the openbox rc.xml I have... <keybind key="W-F2"> <action name="Execute"> <startupnotify> <enabled>true</enabled> <name>Keyboard Macro: Web Page</name> </startupnotify> <command>xte 'usleep 500000' \ 'str http://www.cit.gu.edu.au/~anthony/'</command> </action> </keybind> When the user presses Super-F2 (and releases it) Openbox will wait 1/2 (for user to release the modifiers) then output the string "http://www.cit.gu.edu.au/~anthony/" as if the user actually typed it into whatever the current input box is THIS IS VERY USEFUL! But openbox actually expands the '~' with "/home/anthony" which means the above keyboard macro expands to http://www.cit.gu.edu.au//home/anthony/" That is WRONG! A '~' character should only be expanded when.... * Not in quotes * and has white space in front of it. Any other '~' should not be expanded as it DOES NOT MAKE SENSE! THIS IS A SERIOUS, if minor BUG. I attempted to use the standard XML handling for ˜ or E; but these also do not work! That could be regarded as another posible bug! How can I get Openbox to give a command a '~' without expanding it!| > A '~' character should only be expanded when.... | > * Not in quotes | > * and has white space in front of it. | or is at the start of a string | ... | > Any other '~' should not be expanded | | I'll fix this for 3.4.8 so '~' is only expanded when the bullet points are | true. | Thank you. can you tell me which version it will be in? | > I attempted to use the standard XML handling for ˜ or E; but | > these also do not work! | So I was later told from the mail list. My current workaround (until the patch comes through) <command>bash -c "xte 'usleep 500000' \\\ 'str http://www.cit.gu.edu.au/'`printf '\176'`'anthony/'" </command> Which as you can see is not particularly nice. Thanks again.