diff options
author | streetturtle <streetturtle@users.noreply.github.com> | 2020-12-07 15:33:55 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-07 15:33:55 -0500 |
commit | d4971690cec1e074999e730d87045e578d71e43c (patch) | |
tree | b0f05079840eba5467e14bdcd093ad3ed5362cf4 /run-shell-3 | |
parent | f078748e76eacae599cf0ad06120d9fff54f8fa5 (diff) | |
parent | ed2b256407291d8edadfcea9380029633cc7d9d8 (diff) |
Merge pull request #224 from streetturtle/comply-with-luacheck
Comply with luacheck
Diffstat (limited to 'run-shell-3')
-rw-r--r-- | run-shell-3/run-shell.lua | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/run-shell-3/run-shell.lua b/run-shell-3/run-shell.lua index 9bd575b..0015232 100644 --- a/run-shell-3/run-shell.lua +++ b/run-shell-3/run-shell.lua @@ -8,10 +8,6 @@ -- @copyright 2019 Pavel Makhov ------------------------------------------------- -local capi = { - screen = screen, - client = client, -} local awful = require("awful") local gfs = require("gears.filesystem") local wibox = require("wibox") @@ -26,8 +22,10 @@ local widget = {} function widget.new() local widget_instance = { _cached_wiboxes = {}, - _cmd_pixelate = [[bash -c 'ffmpeg -loglevel panic -f x11grab -video_size 1920x1060 -y -i :0.0+%s,20 -vf frei0r=pixeliz0r -vframes 1 /tmp/i3lock-%s.png ; echo done']], - _cmd_blur = [[bash -c 'ffmpeg -loglevel panic -f x11grab -video_size 1920x1060 -y -i :0.0+%s,20 -filter_complex "boxblur=9" -vframes 1 /tmp/i3lock-%s.png ; echo done']] + _cmd_pixelate = [[sh -c 'ffmpeg -loglevel panic -f x11grab -video_size 1920x1060 -y -i :0.0+%s,20 -vf ]] + .. [[frei0r=pixeliz0r -vframes 1 /tmp/i3lock-%s.png ; echo done']], + _cmd_blur = [[sh -c 'ffmpeg -loglevel panic -f x11grab -video_size 1920x1060 -y -i :0.0+%s,20 ]] + .. [[-filter_complex "boxblur=9" -vframes 1 /tmp/i3lock-%s.png ; echo done']] } function widget_instance:_create_wibox() @@ -74,22 +72,19 @@ function widget.new() return w end - function widget_instance:launch(s, c) - c = c or capi.client.focus - s = mouse.screen - -- naughty.notify { text = 'screen ' .. s.index } + function widget_instance:launch() + local s = mouse.screen if not self._cached_wiboxes[s] then self._cached_wiboxes[s] = {} - -- naughty.notify { text = 'nope' } end if not self._cached_wiboxes[s][1] then self._cached_wiboxes[s][1] = self:_create_wibox() - -- naughty.notify { text = 'nope' } end local w = self._cached_wiboxes[s][1] local rnd = math.random() - awful.spawn.with_line_callback(string.format(self._cmd_blur, tostring(awful.screen.focused().geometry.x), rnd), { - stdout = function(line) + awful.spawn.with_line_callback( + string.format(self._cmd_blur, tostring(awful.screen.focused().geometry.x), rnd), { + stdout = function() w.visible = true w.bgimage = '/tmp/i3lock-' .. rnd ..'.png' awful.placement.top(w, { margins = { top = 20 }, parent = awful.screen.focused() }) |