From 4873f1e9b61dc61c537ec41c8d6e46d01649422a Mon Sep 17 00:00:00 2001 From: Ksaper Date: Tue, 7 Mar 2023 13:20:28 +0200 Subject: [PATCH] Use simpler commands --- widget/app_launcher/init.lua | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/widget/app_launcher/init.lua b/widget/app_launcher/init.lua index 9df9643..3d1e0bc 100644 --- a/widget/app_launcher/init.lua +++ b/widget/app_launcher/init.lua @@ -17,12 +17,8 @@ local helpers = require(tostring(path):match(".*bling") .. ".helpers") local app_launcher = { mt = {} } -local KILL_OLD_INOTIFY_SCRIPT = [[ ps x | grep "inotifywait -e modify /usr/share/applications" | grep -v grep | awk '{print $1}' | xargs kill ]] -local INOTIFY_SCRIPT = [[ bash -c "while (inotifywait -e modify /usr/share/applications -qq) do echo; done" ]] -local AWESOME_SENSIBLE_TERMINAL_SCRIPT_PATH = debug.getinfo(1).source:match("@?(.*/)") .. - "awesome-sensible-terminal" -local RUN_AS_ROOT_SCRIPT_PATH = debug.getinfo(1).source:match("@?(.*/)") .. - "run-as-root.sh" +local AWESOME_SENSIBLE_TERMINAL_SCRIPT_PATH = debug.getinfo(1).source:match("@?(.*/)") .. "awesome-sensible-terminal" +local RUN_AS_ROOT_SCRIPT_PATH = debug.getinfo(1).source:match("@?(.*/)") .. "run-as-root.sh" local function default_value(value, default) if value == nil then @@ -823,8 +819,8 @@ local function new(args) ) end - awful.spawn.easy_async_with_shell(KILL_OLD_INOTIFY_SCRIPT, function() - awful.spawn.with_line_callback(INOTIFY_SCRIPT, {stdout = function() + awful.spawn.easy_async_with_shell("pkill -f 'inotifywait -m /usr/share/applications -e modify'", function() + awful.spawn.with_line_callback("inotifywait -m /usr/share/applications -e modify", {stdout = function() generate_apps(ret) end}) end)