From d99ce8fdba3d86c7837a1ee60c398fa477365eab Mon Sep 17 00:00:00 2001 From: Luca CPZ Date: Tue, 19 Dec 2017 17:20:59 +0100 Subject: [PATCH] helpers: async_with_shell added --- README.rst | 4 ++-- helpers.lua | 12 ++++++++++-- lain-git.rockspec | 2 +- wiki | 2 +- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/README.rst b/README.rst index 84cdc8b..098f6bc 100644 --- a/README.rst +++ b/README.rst @@ -5,7 +5,7 @@ Lain Layouts, widgets and utilities for Awesome WM 4.x ------------------------------------------------- -:Author: Luca CPZ +:Author: Luca CPZ :Version: git :License: GNU-GPL2_ :Source: https://github.com/lcpz/lain @@ -13,7 +13,7 @@ Layouts, widgets and utilities for Awesome WM 4.x Description ----------- -Successor of awesome-vain_, this module provides alternative layouts, asynchronous widgets and utility functions for Awesome_ WM. Read the wiki_ for all the info. +Successor of awesome-vain_, this module provides alternative layouts, asynchronous widgets and utility functions for Awesome_. Read the wiki_ for all the info. Contributions ------------- diff --git a/helpers.lua b/helpers.lua index 7fa8564..ab87f76 100644 --- a/helpers.lua +++ b/helpers.lua @@ -5,7 +5,7 @@ --]] -local easy_async = require("awful.spawn").easy_async +local spawn = require("awful.spawn") local timer = require("gears.timer") local debug = require("debug") local io = { lines = io.lines, @@ -110,7 +110,15 @@ end -- @param callback function to execute on cmd output -- @return cmd PID function helpers.async(cmd, callback) - return easy_async(cmd, + return spawn.easy_async(cmd, + function (stdout, stderr, reason, exit_code) + callback(stdout) + end) +end + +-- like above, but call spawn.easy_async with a shell +function helpers.async_with_shell(cmd, callback) + return spawn.easy_async_with_shell(cmd, function (stdout, stderr, reason, exit_code) callback(stdout) end) diff --git a/lain-git.rockspec b/lain-git.rockspec index acb1967..13b2db7 100644 --- a/lain-git.rockspec +++ b/lain-git.rockspec @@ -12,7 +12,7 @@ description = { Optional dependency: curl (for IMAP, MPD and weather widgets). ]], homepage = "https://github.com/lcpz/lain", - license = "GPL v2" + license = "GPL-2.0" } dependencies = { "lua >= 5.1", diff --git a/wiki b/wiki index d902970..f395683 160000 --- a/wiki +++ b/wiki @@ -1 +1 @@ -Subproject commit d9029707520bf9ce8e3f695659d8ceea4fef0f01 +Subproject commit f395683e491fabd539fa0b5d596dbb5cc451e68e -- 2.39.5