mirror of
https://github.com/labwc/labwc.git
synced 2025-10-29 05:40:24 -04:00
action: expand shell variables before execvp()
Expanding shell variables, including tilde, enables the following type
of keybind:
<keyboard>
<keybind key="XF86AudioMute">
<action name="Execute">
<command>bash ~/mute-script.sh</command>
</action>
</keybind>
</keyboard>
Fixes issue #32
This commit is contained in:
parent
a1ae16c1cf
commit
afe666fd6e
3 changed files with 60 additions and 4 deletions
|
|
@ -17,17 +17,24 @@ struct buf {
|
|||
int len;
|
||||
};
|
||||
|
||||
/**
|
||||
* buf_expand_shell_variables - expand $foo and ~ in buffer
|
||||
* @s: buffer
|
||||
* Note: ${foo} and $$ are not handled
|
||||
*/
|
||||
void buf_expand_shell_variables(struct buf *s);
|
||||
|
||||
/**
|
||||
* buf_init - allocate NULL-terminated C string buffer
|
||||
* @s - buffer
|
||||
* @s: buffer
|
||||
* Note: use free(s->buf) to free it.
|
||||
*/
|
||||
void buf_init(struct buf *s);
|
||||
|
||||
/**
|
||||
* buf_add - add data to C string buffer
|
||||
* @s - buffer
|
||||
* @data - data to be added
|
||||
* @s: buffer
|
||||
* @data: data to be added
|
||||
*/
|
||||
void buf_add(struct buf *s, const char *data);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue