From ac2ff7f7a783caee4d9af25881013d135f45aa42 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Sun, 1 Aug 2010 16:00:03 +0200 Subject: [PATCH] prompt: Only show error messages Ever since awesome.spawn() also returns the pid of the started process, the prompt accidentally displayed the pid of processes that it started. Signed-off-by: Uli Schlachter --- lib/awful/widget/prompt.lua.in | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/awful/widget/prompt.lua.in b/lib/awful/widget/prompt.lua.in index 2ae7eb60..9a0ff2f7 100644 --- a/lib/awful/widget/prompt.lua.in +++ b/lib/awful/widget/prompt.lua.in @@ -11,6 +11,7 @@ local completion = require("awful.completion") local util = require("awful.util") local prompt = require("awful.prompt") local layout = require("awful.widget.layout") +local type = type module("awful.widget.prompt") @@ -19,7 +20,12 @@ module("awful.widget.prompt") local function run(promptbox) return prompt.run({ prompt = promptbox.prompt }, promptbox.widget, - function (...) promptbox.widget.text = util.spawn(...) end, + function (...) + local result = util.spawn(...) + if type(result) == "string" then + promptbox.widget.text = result + end + end, completion.shell, util.getdir("cache") .. "/history") end