helpers.lua 679 B

12345678910111213141516171819202122232425262728293031323334
  1. -- {{{ License
  2. -- Awesome helpers
  3. -- 2012, Emmanuel Bouthenot <kolter@openics.org>
  4. --
  5. -- This file is distributed in the hope that it will be useful,
  6. -- but WITHOUT ANY WARRANTY
  7. --
  8. -- }}}
  9. -- {{{ Libraries
  10. -- Notification library
  11. require('naughty')
  12. -- User libraries
  13. require('utils')
  14. -- }}}
  15. -- {{{ Functions
  16. function whereis(program)
  17. local fh = io.popen('which ' .. program)
  18. path = string.trim(fh:read('*a'))
  19. fh:close()
  20. if path == "" then
  21. path = nil
  22. end
  23. return path
  24. end
  25. function debug(message)
  26. naughty.notify({ preset = naughty.config.presets.critical,
  27. title = "Debug message", text = message})
  28. end
  29. -- }}}
  30. -- vim: foldmethod=marker