From c53da4c7f0899c8a44c462a7a6f99a4baa307f7b Mon Sep 17 00:00:00 2001 From: Luca CPZ Date: Fri, 3 Aug 2018 11:29:32 +0200 Subject: [PATCH] fixed awful.spawn/os.execute calls --- rc.lua.template | 22 +++++++++++----------- themes/copland/theme.lua | 20 ++++++++++---------- themes/holo/theme.lua | 8 ++++---- themes/powerarrow-dark/theme.lua | 6 +++--- themes/powerarrow/theme.lua | 8 ++++---- themes/rainbow/theme.lua | 10 +++++----- themes/vertex/theme.lua | 10 +++++----- 7 files changed, 42 insertions(+), 42 deletions(-) diff --git a/rc.lua.template b/rc.lua.template index fd83779..57a231c 100644 --- a/rc.lua.template +++ b/rc.lua.template @@ -398,9 +398,9 @@ globalkeys = my_table.join( {description = "show weather", group = "widgets"}), -- Brightness - awful.key({ }, "XF86MonBrightnessUp", function () awful.util.spawn("xbacklight -inc 10") end, + awful.key({ }, "XF86MonBrightnessUp", function () os.execute("xbacklight -inc 10") end, {description = "+10%", group = "hotkeys"}), - awful.key({ }, "XF86MonBrightnessDown", function () awful.util.spawn("xbacklight -dec 10") end, + awful.key({ }, "XF86MonBrightnessDown", function () os.execute("xbacklight -dec 10") end, {description = "-10%", group = "hotkeys"}), -- ALSA volume control @@ -438,25 +438,25 @@ globalkeys = my_table.join( -- MPD control awful.key({ altkey, "Control" }, "Up", function () - awful.spawn.with_shell("mpc toggle") + os.execute("mpc toggle") beautiful.mpd.update() end, {description = "mpc toggle", group = "widgets"}), awful.key({ altkey, "Control" }, "Down", function () - awful.spawn.with_shell("mpc stop") + os.execute("mpc stop") beautiful.mpd.update() end, {description = "mpc stop", group = "widgets"}), awful.key({ altkey, "Control" }, "Left", function () - awful.spawn.with_shell("mpc prev") + os.execute("mpc prev") beautiful.mpd.update() end, {description = "mpc prev", group = "widgets"}), awful.key({ altkey, "Control" }, "Right", function () - awful.spawn.with_shell("mpc next") + os.execute("mpc next") beautiful.mpd.update() end, {description = "mpc next", group = "widgets"}), @@ -475,10 +475,10 @@ globalkeys = my_table.join( {description = "mpc on/off", group = "widgets"}), -- Copy primary to clipboard (terminals to gtk) - awful.key({ modkey }, "c", function () awful.spawn("xsel | xsel -i -b") end, + awful.key({ modkey }, "c", function () awful.spawn.with_shell("xsel | xsel -i -b") end, {description = "copy terminal to gtk", group = "hotkeys"}), -- Copy clipboard to primary (gtk to terminals) - awful.key({ modkey }, "v", function () awful.spawn("xsel -b | xsel") end, + awful.key({ modkey }, "v", function () awful.spawn.with_shell("xsel -b | xsel") end, {description = "copy gtk to terminal", group = "hotkeys"}), -- User programs @@ -494,9 +494,9 @@ globalkeys = my_table.join( --]] --[[ dmenu awful.key({ modkey }, "x", function () - awful.spawn(string.format("dmenu_run -i -fn 'Monospace' -nb '%s' -nf '%s' -sb '%s' -sf '%s'", - beautiful.bg_normal, beautiful.fg_normal, beautiful.bg_focus, beautiful.fg_focus)) - end, + os.execute(string.format("dmenu_run -i -fn 'Monospace' -nb '%s' -nf '%s' -sb '%s' -sf '%s'", + beautiful.bg_normal, beautiful.fg_normal, beautiful.bg_focus, beautiful.fg_focus)) + end, {description = "show dmenu", group = "launcher"}) --]] -- Prompt diff --git a/themes/copland/theme.lua b/themes/copland/theme.lua index bb1e0d4..f11ac4b 100644 --- a/themes/copland/theme.lua +++ b/themes/copland/theme.lua @@ -10,7 +10,7 @@ local lain = require("lain") local awful = require("awful") local wibox = require("wibox") -local os = { getenv = os.getenv, setlocale = os.setlocale } +local os = { execute = os.execute, getenv = os.getenv, setlocale = os.setlocale } local awesome, client = awesome, client local my_table = awful.util.table or gears.table -- 4.{0,1} compatibility @@ -214,7 +214,7 @@ local fsbar = wibox.widget { ticks_size = 6, widget = wibox.widget.progressbar, } -theme.fs = lain.widget.fs({ +theme.fs = lain.widget.fs { notification_preset = { fg = theme.fg_normal, bg = theme.bg_normal, font = "Tamzen 10.5" }, settings = function() if fs_now["/home"].percentage < 90 then @@ -224,13 +224,13 @@ theme.fs = lain.widget.fs({ end fsbar:set_value(fs_now["/home"].percentage / 100) end -}) +} local fsbg = wibox.container.background(fsbar, "#474747", gears.shape.rectangle) local fswidget = wibox.container.margin(fsbg, 2, 7, 4, 4) -- ALSA volume bar local volicon = wibox.widget.imagebox(theme.vol) -theme.volume = lain.widget.alsabar({ +theme.volume = lain.widget.alsabar { width = 59, border_width = 0, ticks = true, ticks_size = 6, notification_preset = { font = theme.font }, --togglechannel = "IEC958,3", @@ -250,26 +250,26 @@ theme.volume = lain.widget.alsabar({ mute = red, unmute = theme.fg_normal } -}) +} theme.volume.tooltip.wibox.fg = theme.fg_focus theme.volume.bar:buttons(my_table.join ( awful.button({}, 1, function() - awful.spawn.with_shell(string.format("%s -e alsamixer", awful.util.terminal)) + awful.spawn(string.format("%s -e alsamixer", awful.util.terminal)) end), awful.button({}, 2, function() - awful.spawn(string.format("%s set %s 100%%", theme.volume.cmd, theme.volume.channel)) + os.execute(string.format("%s set %s 100%%", theme.volume.cmd, theme.volume.channel)) theme.volume.update() end), awful.button({}, 3, function() - awful.spawn(string.format("%s set %s toggle", theme.volume.cmd, theme.volume.togglechannel or theme.volume.channel)) + os.execute(string.format("%s set %s toggle", theme.volume.cmd, theme.volume.togglechannel or theme.volume.channel)) theme.volume.update() end), awful.button({}, 4, function() - awful.spawn(string.format("%s set %s 1%%+", theme.volume.cmd, theme.volume.channel)) + os.execute(string.format("%s set %s 1%%+", theme.volume.cmd, theme.volume.channel)) theme.volume.update() end), awful.button({}, 5, function() - awful.spawn(string.format("%s set %s 1%%-", theme.volume.cmd, theme.volume.channel)) + os.execute(string.format("%s set %s 1%%-", theme.volume.cmd, theme.volume.channel)) theme.volume.update() end) )) diff --git a/themes/holo/theme.lua b/themes/holo/theme.lua index 55a2a84..aafb1be 100644 --- a/themes/holo/theme.lua +++ b/themes/holo/theme.lua @@ -180,23 +180,23 @@ musicwidget:buttons(my_table.join(awful.button({ }, 1, function () awful.spawn(theme.musicplr) end))) prev_icon:buttons(my_table.join(awful.button({}, 1, function () - awful.spawn.with_shell("mpc prev") + os.execute("mpc prev") theme.mpd.update() end))) next_icon:buttons(my_table.join(awful.button({}, 1, function () - awful.spawn.with_shell("mpc next") + os.execute("mpc next") theme.mpd.update() end))) stop_icon:buttons(my_table.join(awful.button({}, 1, function () play_pause_icon:set_image(theme.play) - awful.spawn.with_shell("mpc stop") + os.execute("mpc stop") theme.mpd.update() end))) play_pause_icon:buttons(my_table.join(awful.button({}, 1, function () - awful.spawn.with_shell("mpc toggle") + os.execute("mpc toggle") theme.mpd.update() end))) diff --git a/themes/powerarrow-dark/theme.lua b/themes/powerarrow-dark/theme.lua index e5b4c9e..e4dfa40 100644 --- a/themes/powerarrow-dark/theme.lua +++ b/themes/powerarrow-dark/theme.lua @@ -136,15 +136,15 @@ local mpdicon = wibox.widget.imagebox(theme.widget_music) mpdicon:buttons(my_table.join( awful.button({ modkey }, 1, function () awful.spawn.with_shell(musicplr) end), awful.button({ }, 1, function () - awful.spawn.with_shell("mpc prev") + os.execute("mpc prev") theme.mpd.update() end), awful.button({ }, 2, function () - awful.spawn.with_shell("mpc toggle") + os.execute("mpc toggle") theme.mpd.update() end), awful.button({ }, 3, function () - awful.spawn.with_shell("mpc next") + os.execute("mpc next") theme.mpd.update() end))) theme.mpd = lain.widget.mpd({ diff --git a/themes/powerarrow/theme.lua b/themes/powerarrow/theme.lua index f68e11a..f9982bb 100644 --- a/themes/powerarrow/theme.lua +++ b/themes/powerarrow/theme.lua @@ -128,7 +128,7 @@ task:buttons(my_table.join(awful.button({}, 1, lain.widget.contrib.task.prompt)) -- Scissors (xsel copy and paste) local scissors = wibox.widget.imagebox(theme.widget_scissors) -scissors:buttons(my_table.join(awful.button({}, 1, function() awful.spawn("xsel | xsel -i -b") end))) +scissors:buttons(my_table.join(awful.button({}, 1, function() awful.spawn.with_shell("xsel | xsel -i -b") end))) -- Mail IMAP check local mailicon = wibox.widget.imagebox(theme.widget_mail) @@ -163,15 +163,15 @@ local mpdicon = wibox.widget.imagebox(theme.widget_music) mpdicon:buttons(my_table.join( awful.button({ modkey }, 1, function () awful.spawn.with_shell(musicplr) end), awful.button({ }, 1, function () - awful.spawn.with_shell("mpc prev") + os.execute("mpc prev") theme.mpd.update() end), awful.button({ }, 2, function () - awful.spawn.with_shell("mpc toggle") + os.execute("mpc toggle") theme.mpd.update() end), awful.button({ }, 3, function () - awful.spawn.with_shell("mpc next") + os.execute("mpc next") theme.mpd.update() end))) theme.mpd = lain.widget.mpd({ diff --git a/themes/rainbow/theme.lua b/themes/rainbow/theme.lua index 55243ba..03f8be5 100644 --- a/themes/rainbow/theme.lua +++ b/themes/rainbow/theme.lua @@ -168,22 +168,22 @@ theme.volume.tooltip.wibox.fg = theme.fg_focus theme.volume.tooltip.wibox.font = theme.font theme.volume.bar:buttons(my_table.join ( awful.button({}, 1, function() - awful.spawn.with_shell(string.format("%s -e alsamixer", terminal)) + awful.spawn(string.format("%s -e alsamixer", terminal)) end), awful.button({}, 2, function() - awful.spawn(string.format("%s set %s 100%%", theme.volume.cmd, theme.volume.channel)) + os.execute(string.format("%s set %s 100%%", theme.volume.cmd, theme.volume.channel)) theme.volume.update() end), awful.button({}, 3, function() - awful.spawn(string.format("%s set %s toggle", theme.volume.cmd, theme.volume.togglechannel or theme.volume.channel)) + os.execute(string.format("%s set %s toggle", theme.volume.cmd, theme.volume.togglechannel or theme.volume.channel)) theme.volume.update() end), awful.button({}, 4, function() - awful.spawn(string.format("%s set %s 1%%+", theme.volume.cmd, theme.volume.channel)) + os.execute(string.format("%s set %s 1%%+", theme.volume.cmd, theme.volume.channel)) theme.volume.update() end), awful.button({}, 5, function() - awful.spawn(string.format("%s set %s 1%%-", theme.volume.cmd, theme.volume.channel)) + os.execute(string.format("%s set %s 1%%-", theme.volume.cmd, theme.volume.channel)) theme.volume.update() end) )) diff --git a/themes/vertex/theme.lua b/themes/vertex/theme.lua index e33dcca..38b3c46 100644 --- a/themes/vertex/theme.lua +++ b/themes/vertex/theme.lua @@ -209,22 +209,22 @@ theme.volume = lain.widget.alsabar({ }) volicon:buttons(my_table.join ( awful.button({}, 1, function() - awful.spawn.with_shell(string.format("%s -e alsamixer", awful.util.terminal)) + awful.spawn(string.format("%s -e alsamixer", awful.util.terminal)) end), awful.button({}, 2, function() - awful.spawn(string.format("%s set %s 100%%", theme.volume.cmd, theme.volume.channel)) + os.execute(string.format("%s set %s 100%%", theme.volume.cmd, theme.volume.channel)) theme.volume.notify() end), awful.button({}, 3, function() - awful.spawn(string.format("%s set %s toggle", theme.volume.cmd, theme.volume.togglechannel or theme.volume.channel)) + os.execute(string.format("%s set %s toggle", theme.volume.cmd, theme.volume.togglechannel or theme.volume.channel)) theme.volume.notify() end), awful.button({}, 4, function() - awful.spawn(string.format("%s set %s 1%%+", theme.volume.cmd, theme.volume.channel)) + os.execute(string.format("%s set %s 1%%+", theme.volume.cmd, theme.volume.channel)) theme.volume.notify() end), awful.button({}, 5, function() - awful.spawn(string.format("%s set %s 1%%-", theme.volume.cmd, theme.volume.channel)) + os.execute(string.format("%s set %s 1%%-", theme.volume.cmd, theme.volume.channel)) theme.volume.notify() end) ))