How to make key-binds to execute shell scripts in DWM
I want to make DWM execute a shell script when I press a series of keys. Like this would do in I3 "bindsym $mod+p exec ~/Tests/shell/mpc-play.sh" Thank you!
|
Guessing you would have to modify the config.h (?) and recompile. Been a while since I have used DWM. You can add your own bindings I think - probably just figure out the key codes and add them in the appropriate spot. I have modified key bindings but not added my own.
|
Quote:
In config.h, define an array of character pointers (strings) to hold the script name, and any arguments it may take, and it must end with NULL. Code:
static const char *mpcplay[] = { "/absolute/path/to/mpc-play.sh", "ARGUMENTS", NULL }; Code:
{ MODKEY, p, spawn, {.v = mpcplay} }, |
thanks for the solution, I'm a total newb to all this and wanted to ask you if there is some documentation page that you could guide me to that has all such basic stuff, and also, I wanted to know how to set variables and use them, for eg.
I use brave as my browser. I downloaded Luke Smith's build of DWM and it has "$BROWSER" all over the config.h file, and there is a key bind to for executing $BROWSER but i believe the value of $BROWSER is not set to brave, how do i fix that? thanks :) |
All times are GMT -5. The time now is 08:42 PM. |