2

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

hertkof
  • 23
  • 1
  • 4

3 Answers3

4

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),
Chunliang Lyu
  • 1,750
  • 1
  • 20
  • 34
laite
  • 178
  • 1
  • 5
  • Thanks, yes i use awesome 3.4.13 and ubuntu 12.10. Unfortunately it - just like another answer - does not work > awful.key({ modkey, "Control" }, "o", function () awful.util.spawn("sh /home/hertkof/layout-ir.sh") end), – hertkof Jan 11 '13 at 11:54
  • 1
    try without the `sh` preceeding `/home/hertkof...`. Good luck to all. – shellter Jan 11 '13 at 14:55
2

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),
Chunliang Lyu
  • 1,750
  • 1
  • 20
  • 34
2

try:

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

milarepa
  • 759
  • 9
  • 28