mirror of
				https://github.com/labwc/labwc.git
				synced 2025-11-03 09:01:51 -05: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
				
			
		| 
						 | 
				
			
			@ -26,7 +26,12 @@ action(struct server *server, const char *action, const char *command)
 | 
			
		|||
	if (!strcasecmp(action, "Debug")) {
 | 
			
		||||
		/* nothing */
 | 
			
		||||
	} else if (!strcasecmp(action, "Execute")) {
 | 
			
		||||
		spawn_async_no_shell(command);
 | 
			
		||||
		struct buf cmd;
 | 
			
		||||
		buf_init(&cmd);
 | 
			
		||||
		buf_add(&cmd, command);
 | 
			
		||||
		buf_expand_shell_variables(&cmd);
 | 
			
		||||
		spawn_async_no_shell(cmd.buf);
 | 
			
		||||
		free(cmd.buf);
 | 
			
		||||
	} else if (!strcasecmp(action, "Exit")) {
 | 
			
		||||
		wl_display_terminate(server->wl_display);
 | 
			
		||||
	} else if (!strcasecmp(action, "NextWindow")) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue