12345678910111213141516171819202122232425262728293031323334353637383940 |
- -- {{{ License
- -- Awesome helpers
- -- 2012, Emmanuel Bouthenot <kolter@openics.org>
- --
- -- This file is distributed in the hope that it will be useful,
- -- but WITHOUT ANY WARRANTY
- --
- -- }}}
- -- {{{ Libraries
- -- Notification library
- require('naughty')
- -- User libraries
- require('utils')
- -- }}}
- -- {{{ Functions
- function whereis(program)
- local fh = io.popen('which ' .. program)
- path = string.trim(fh:read('*a'))
- fh:close()
- if path == "" then
- path = nil
- end
- return path
- end
- function runonce(cmd, screen)
- if cmd then
- awful.util.spawn_with_shell("pgrep -f -u $USER -x '" .. cmd .. "' >/dev/null 2>&1 || (" .. cmd .. " ; echo Starting '" .. cmd .. "')", screen)
- end
- end
- function debug(message)
- naughty.notify({ preset = naughty.config.presets.critical,
- title = "Debug message", text = message})
- end
- -- }}}
- -- vim: foldmethod=marker
|