get rid of script usage
This commit is contained in:
parent
9012468e8f
commit
627a6888a2
|
@ -25,9 +25,10 @@ local widget = {}
|
||||||
function widget.new()
|
function widget.new()
|
||||||
local widget_instance = {
|
local widget_instance = {
|
||||||
_cached_wiboxes = {},
|
_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']]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function widget_instance:_create_wibox()
|
function widget_instance:_create_wibox()
|
||||||
local w = wibox {
|
local w = wibox {
|
||||||
visible = false,
|
visible = false,
|
||||||
|
@ -41,8 +42,7 @@ function widget.new()
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
text = 'a',
|
markup = '<span font="awesomewm-font 14" color="#ffffff">a</span>',
|
||||||
font = 'awesomewm-font 13',
|
|
||||||
widget = wibox.widget.textbox,
|
widget = wibox.widget.textbox,
|
||||||
},
|
},
|
||||||
id = 'icon',
|
id = 'icon',
|
||||||
|
@ -75,21 +75,22 @@ function widget.new()
|
||||||
|
|
||||||
function widget_instance:launch(s, c)
|
function widget_instance:launch(s, c)
|
||||||
c = c or capi.client.focus
|
c = c or capi.client.focus
|
||||||
s = s or (c and c.screen or awful.screen.focused())
|
s = s or (c and c.screen or mouse.screen)
|
||||||
naughty.notify{text = 'screen ' .. s.index}
|
naughty.notify { text = 'screen ' .. s.index }
|
||||||
if not self._cached_wiboxes[s] then
|
if not self._cached_wiboxes[s] then
|
||||||
self._cached_wiboxes[s] = {}
|
self._cached_wiboxes[s] = {}
|
||||||
naughty.notify{text = 'nope'}
|
naughty.notify { text = 'nope' }
|
||||||
end
|
end
|
||||||
if not self._cached_wiboxes[s][1] then
|
if not self._cached_wiboxes[s][1] then
|
||||||
self._cached_wiboxes[s][1] = self:_create_wibox()
|
self._cached_wiboxes[s][1] = self:_create_wibox()
|
||||||
naughty.notify{text = 'nope'}
|
naughty.notify { text = 'nope' }
|
||||||
end
|
end
|
||||||
local w = self._cached_wiboxes[s][1]
|
local w = self._cached_wiboxes[s][1]
|
||||||
awful.spawn.with_line_callback(os.getenv("HOME") .. "/.config/awesome/awesome-wm-widgets/run-shell/scratch_6.sh " .. tostring(awful.screen.focused().geometry.x), {
|
local rnd = math.random()
|
||||||
|
awful.spawn.with_line_callback(string.format(self._cmd_pixelate, tostring(awful.screen.focused().geometry.x), rnd), {
|
||||||
stdout = function(line)
|
stdout = function(line)
|
||||||
w.visible = true
|
w.visible = true
|
||||||
w.bgimage = '/tmp/i3lock-' .. line .. '.png'
|
w.bgimage = '/tmp/i3lock-' .. rnd ..'.png'
|
||||||
awful.placement.top(w, { margins = { top = 20 }, parent = awful.screen.focused() })
|
awful.placement.top(w, { margins = { top = 20 }, parent = awful.screen.focused() })
|
||||||
awful.prompt.run {
|
awful.prompt.run {
|
||||||
prompt = 'Run: ',
|
prompt = 'Run: ',
|
||||||
|
@ -115,7 +116,7 @@ function widget.new()
|
||||||
end
|
end
|
||||||
|
|
||||||
return widget_instance
|
return widget_instance
|
||||||
end
|
end
|
||||||
|
|
||||||
local function get_default_widget()
|
local function get_default_widget()
|
||||||
if not widget.default_widget then
|
if not widget.default_widget then
|
||||||
|
@ -128,5 +129,4 @@ function widget.launch(...)
|
||||||
return get_default_widget():launch(...)
|
return get_default_widget():launch(...)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
return widget
|
return widget
|
||||||
|
|
Loading…
Reference in New Issue