spawn/execvp() is supposed to get each argument as a pointer, not all-in-one.
all the commands you are having trouble with also happen to have arguments.
On top of that, I don't think you have the right arguments for amixer...

Here's the relevent parts of my config for an example:

-----
static const char *sound_up[]   = { "/usr/bin/amixer", "-q", "set", "Master", 
"10+", NULL };
static const char *sound_down[] = { "/usr/bin/amixer", "-q", "set", "Master", 
"10-", NULL };
static const char *sound_mute[] = { "/usr/bin/amixer", "-q", "set", "Master", 
"toggle", NULL };

static Key keys[] = {
  { 0,         XF86XK_AudioRaiseVolume,      spawn,          {.v = sound_up } },
  { 0,         XF86XK_AudioLowerVolume,      spawn,          {.v = sound_down } 
},
  { 0,                XF86XK_AudioMute,      spawn,          {.v = sound_mute } 
},
};
-----

Jeremy

On Sat 14 Feb 2009 - 03:18PM, Jake Todd wrote:
> I've just switched from awesome to dwm, and in the process of migrating
> my config from lua to the c header file I've encountered some trouble.
> 
> The first problem is I can't get my multimedia keys to function (volume
> up/down/mute). I've searched through the mail archives and haven't
> found a fix that works for me. In my config.h I've tried to use
> XF86AudioRaiseVolume, XK_121 (that's the keycode), and the last thing I
> could think of to try was 0x1008ff13 (keysym); but none work.
> 
> The next problem I've encountered was the same problem with the print
> key. I've tried it's keycode, keysym, and XK_Print, but none of these
> work either. I've added #include <X11/keysym.h> to dwm.c, but this
> didn't help at all.
> 
> Has anyone else achived this sort of thing with just dwm without an
> external program like xbindkeys?
> 
> I've attached my current config.h also.
> 
> Thanks for any help.

> /* commands */
> static const char *termcmd[]  = { "xterm", NULL };
> static const char *scrot[]  = { "scrot '%Y-%m-%d-%T_$wx$h_scrot.png' -e 'mv 
> $f ~/media/pics/scrots/'", NULL };
> static const char *firefox[]  = { "firefox", NULL };
> static const char *pidgin[]  = { "pidgin", NULL };
> static const char *gpodder[]  = { "gpodder", NULL };
> static const char *vim[]  = { "xterm -name vim -e vim", NULL };
> static const char *pcmanfm[]  = { "pcmanfm", NULL };
> static const char *oowriter[]  = { "oowriter", NULL };
> static const char *gimp[]  = { "gimp", NULL };
> static const char *inkscape[]  = { "inkscape", NULL };
> static const char *ripperx[]  = { "ripperx", NULL };
> static const char *claws[]  = { "claws", NULL };
> static const char *volup[]  = { "amixer -q Master 2+ toggle", NULL };
> static const char *voldown[]  = { "amixer -q Master 2- toggle", NULL };
> static const char *volmute[]  = { "amixer -q Master toggle", NULL };

Reply via email to