summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--run-shell/run-shell.lua53
1 files changed, 16 insertions, 37 deletions
diff --git a/run-shell/run-shell.lua b/run-shell/run-shell.lua
index f661e53..b00bfe4 100644
--- a/run-shell/run-shell.lua
+++ b/run-shell/run-shell.lua
@@ -15,7 +15,6 @@ local awful = require("awful")
local gfs = require("gears.filesystem")
local wibox = require("wibox")
local gears = require("gears")
-local naughty = require("naughty")
local completion = require("awful.completion")
local run_shell = awful.widget.prompt()
@@ -24,9 +23,7 @@ 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']]
+ _cached_wiboxes = {}
}
function widget_instance:_create_wibox()
@@ -34,7 +31,7 @@ function widget.new()
visible = false,
ontop = true,
height = 1060,
- width = 1920
+ width = 1920,
}
w:setup {
@@ -73,46 +70,28 @@ 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)
- w.visible = true
- w.bgimage = '/tmp/i3lock-' .. rnd ..'.png'
- awful.placement.top(w, { margins = { top = 20 }, parent = awful.screen.focused() })
- awful.prompt.run {
- prompt = 'Run: ',
- bg_cursor = '#74aeab',
- textbox = run_shell.widget,
- completion_callback = completion.shell,
- exe_callback = function(...)
- run_shell:spawn_and_handle_error(...)
- end,
- history_path = gfs.get_cache_dir() .. "/history",
- done_callback = function()
- w.visible = false
- w.bgimage = ''
- awful.spawn([[bash -c 'rm -f /tmp/i3lock*']])
- end
- }
+ w.visible = true
+ awful.placement.top(w, { margins = { top = 20 }, parent = awful.screen.focused() })
+ awful.prompt.run {
+ prompt = 'Run: ',
+ bg_cursor = '#74aeab',
+ textbox = run_shell.widget,
+ completion_callback = completion.shell,
+ exe_callback = function(...)
+ run_shell:spawn_and_handle_error(...)
end,
- stderr = function(line)
- naughty.notify { text = "ERR:" .. line }
- end,
- })
-
+ history_path = gfs.get_cache_dir() .. "/history",
+ done_callback = function() w.visible = false end
+ }
end
return widget_instance