Question

I'm new in Awesome WM and try to add a custom shortcut to run a bash file but it does not work.

awful.key({ modkey, "Control", "Shift" }, function () awful.util.spawn(./layout-ir.sh) end),

I add this behind of "Standard Program".

Thank you

Was it helpful?

Solution

First of all, I assume that you are using awesome 3.4.something since you tagged this as . Then: You don't specify key for your shortcut, only modifiers. And lastly: you should use full path for command you want to run and put it in double quotations.

See example for binding Shift-e to run script from user home folder:

awful.key({ modkey,   "Shift" }, "e", function () awful.util.spawn("sh /home/USERNAME/myscript.sh") end),

OTHER TIPS

You need to provide full path to awful.util.spawn, say awful.util.spawn("~/.bin/layout-ir.sh").

Another mistake is you need to provide the key as second parameter for awful.key. So if you want to bind Win+Control+Shift+k as your shortcut, you need the following line:

awful.key({ modkey, "Control", "Shift" }, "k", function () awful.util.spawn("~/.bin/layout-ir.sh") end),

try:

awful.util.spawn_with_shell("./layout-ir.sh")

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top