pulsebar: corrected colors typo; closes #251
This commit is contained in:
parent
1bd178f687
commit
bcd37ae4ae
14 changed files with 113 additions and 172 deletions
|
@ -211,13 +211,7 @@ end
|
||||||
|
|
||||||
-- On the fly useless gaps change
|
-- On the fly useless gaps change
|
||||||
function util.useless_gaps_resize(thatmuch)
|
function util.useless_gaps_resize(thatmuch)
|
||||||
beautiful.useless_gap_width = tonumber(beautiful.useless_gap_width) + thatmuch
|
beautiful.useless_gap = tonumber(beautiful.useless_gap) + thatmuch
|
||||||
awful.layout.arrange(mouse.screen)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- On the fly global border change
|
|
||||||
function util.global_border_resize(thatmuch)
|
|
||||||
beautiful.global_border_width = tonumber(beautiful.global_border_width) + thatmuch
|
|
||||||
awful.layout.arrange(mouse.screen)
|
awful.layout.arrange(mouse.screen)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -6,15 +6,14 @@
|
||||||
|
|
||||||
--]]
|
--]]
|
||||||
|
|
||||||
local awful = require("awful")
|
local awful = require("awful")
|
||||||
local capi = { client = client,
|
local capi = { client = client,
|
||||||
mouse = mouse,
|
timer = require("gears.timer") }
|
||||||
screen = screen,
|
local math = { floor = math.floor }
|
||||||
timer = timer or require("gears.timer") }
|
local string = string
|
||||||
local math = { floor = math.floor }
|
|
||||||
local string = string
|
|
||||||
|
|
||||||
local pairs = pairs
|
local pairs = pairs
|
||||||
|
local screen = screen
|
||||||
local setmetatable = setmetatable
|
local setmetatable = setmetatable
|
||||||
local tostring = tostring
|
local tostring = tostring
|
||||||
|
|
||||||
|
@ -65,21 +64,22 @@ function quake:display()
|
||||||
client.border_width = self.border
|
client.border_width = self.border
|
||||||
client.size_hints_honor = false
|
client.size_hints_honor = false
|
||||||
if self.notexist then
|
if self.notexist then
|
||||||
|
self:compute_size()
|
||||||
client:geometry(self.geometry)
|
client:geometry(self.geometry)
|
||||||
self.notexist = false
|
self.notexist = false
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Not sticky and on top
|
-- Not sticky and on top
|
||||||
|
client.sticky = false
|
||||||
client.ontop = true
|
client.ontop = true
|
||||||
client.above = true
|
client.above = true
|
||||||
client.skip_taskbar = true
|
client.skip_taskbar = true
|
||||||
client.sticky = false
|
|
||||||
|
|
||||||
-- Toggle display
|
-- Toggle display
|
||||||
if self.visible then
|
if self.visible then
|
||||||
client.hidden = false
|
client.hidden = false
|
||||||
client:raise()
|
client:raise()
|
||||||
self.last_tag = tostring(awful.tag.selected(self.screen))
|
self.last_tag = awful.tag.selected(self.screen)
|
||||||
client:tags({awful.tag.selected(self.screen)})
|
client:tags({awful.tag.selected(self.screen)})
|
||||||
capi.client.focus = client
|
capi.client.focus = client
|
||||||
else
|
else
|
||||||
|
@ -94,36 +94,38 @@ function quake:display()
|
||||||
return client
|
return client
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function quake:compute_size()
|
||||||
|
local geom = screen[self.screen].workarea
|
||||||
|
local width, height
|
||||||
|
if self.width <= 1 then width = math.floor(geom.width * self.width) end
|
||||||
|
if self.height <= 1 then height = math.floor(geom.height * self.height) end
|
||||||
|
local x, y
|
||||||
|
if self.horiz == "left" then x = geom.x
|
||||||
|
elseif self.horiz == "right" then x = geom.width + geom.x - self.width
|
||||||
|
else x = geom.x + (geom.width - self.width)/2 end
|
||||||
|
if self.vert == "top" then y = geom.y
|
||||||
|
elseif self.vert == "bottom" then y = geom.height + geom.y - self.height
|
||||||
|
else y = geom.y + (geom.height - self.height)/2 end
|
||||||
|
self.geometry = { x = x, y = y, width = width, height = height }
|
||||||
|
end
|
||||||
|
|
||||||
function quake:new(config)
|
function quake:new(config)
|
||||||
local conf = config or {}
|
local conf = config or {}
|
||||||
|
|
||||||
conf.app = conf.app or "xterm" -- application to spawn
|
conf.app = conf.app or "xterm" -- application to spawn
|
||||||
conf.name = conf.name or "QuakeDD" -- window name
|
conf.name = conf.name or "QuakeDD" -- window name
|
||||||
conf.argname = conf.argname or "-name %s" -- how to specify window name
|
conf.argname = conf.argname or "-name %s" -- how to specify window name
|
||||||
conf.extra = conf.extra or "" -- extra arguments
|
conf.extra = conf.extra or "" -- extra arguments
|
||||||
conf.visible = conf.visible or false -- initially not visible
|
conf.visible = conf.visible or false -- initially not visible
|
||||||
conf.screen = conf.screen or capi.mouse.screen
|
conf.border = conf.border or 1 -- client border width
|
||||||
conf.border = conf.border or 1
|
conf.followtag = conf.followtag or false -- spawn on currently focused screen
|
||||||
|
conf.screen = conf.screen or awful.screen.focused()
|
||||||
|
|
||||||
-- If width or height <= 1 this is a proportion of the workspace
|
-- If width or height <= 1 this is a proportion of the workspace
|
||||||
wibox_height = conf.wibox_height or 18 -- statusbar weight
|
conf.height = conf.height or 0.25 -- height
|
||||||
height = conf.height or 0.25 -- height
|
conf.width = conf.width or 1 -- width
|
||||||
width = conf.width or 1 -- width
|
conf.vert = conf.vert or "top" -- top, bottom or center
|
||||||
vert = conf.vert or "top" -- top, bottom or center
|
conf.horiz = conf.horiz or "center" -- left, right or center
|
||||||
horiz = conf.horiz or "center" -- left, right or center
|
|
||||||
|
|
||||||
-- Compute size
|
|
||||||
local geom = capi.screen[conf.screen].workarea
|
|
||||||
if width <= 1 then width = math.floor(geom.width * width) end
|
|
||||||
if height <= 1 then height = math.floor(geom.height * height) end
|
|
||||||
local x, y
|
|
||||||
if horiz == "left" then x = geom.x
|
|
||||||
elseif horiz == "right" then x = geom.width + geom.x - width
|
|
||||||
else x = geom.x + (geom.width - width)/2 end
|
|
||||||
if vert == "top" then y = geom.y
|
|
||||||
elseif vert == "bottom" then y = geom.height + geom.y - height
|
|
||||||
else y = geom.y + (geom.height - height)/2 end
|
|
||||||
conf.geometry = { x = x, y = y + wibox_height, width = width, height = height }
|
|
||||||
|
|
||||||
local console = setmetatable(conf, { __index = quake })
|
local console = setmetatable(conf, { __index = quake })
|
||||||
capi.client.connect_signal("manage", function(c)
|
capi.client.connect_signal("manage", function(c)
|
||||||
|
@ -140,6 +142,9 @@ function quake:new(config)
|
||||||
-- "Reattach" currently running quake application. This is in case awesome is restarted.
|
-- "Reattach" currently running quake application. This is in case awesome is restarted.
|
||||||
local reattach = capi.timer { timeout = 0 }
|
local reattach = capi.timer { timeout = 0 }
|
||||||
reattach:connect_signal("timeout", function()
|
reattach:connect_signal("timeout", function()
|
||||||
|
if self.followtag then
|
||||||
|
self.screen = awful.screen.focused()
|
||||||
|
end
|
||||||
reattach:stop()
|
reattach:stop()
|
||||||
console:display()
|
console:display()
|
||||||
end)
|
end)
|
||||||
|
@ -149,8 +154,11 @@ function quake:new(config)
|
||||||
end
|
end
|
||||||
|
|
||||||
function quake:toggle()
|
function quake:toggle()
|
||||||
current_tag = awful.tag.selected(self.screen)
|
if self.followtag then
|
||||||
if self.last_tag ~= tostring(current_tag) and self.visible then
|
self.screen = awful.screen.focused()
|
||||||
|
end
|
||||||
|
local current_tag = awful.tag.selected(self.screen)
|
||||||
|
if self.last_tag ~= current_tag and self.visible then
|
||||||
awful.client.movetotag(current_tag, self:display())
|
awful.client.movetotag(current_tag, self:display())
|
||||||
else
|
else
|
||||||
self.visible = not self.visible
|
self.visible = not self.visible
|
||||||
|
|
|
@ -15,7 +15,7 @@ local gears = require("gears")
|
||||||
-- lain.util.separators
|
-- lain.util.separators
|
||||||
local separators = {}
|
local separators = {}
|
||||||
|
|
||||||
local height = beautiful.awful_widget_height or 0
|
local height = beautiful.separators_height or 0
|
||||||
local width = beautiful.separators_width or 9
|
local width = beautiful.separators_width or 9
|
||||||
|
|
||||||
-- [[ Arrow
|
-- [[ Arrow
|
||||||
|
|
|
@ -16,7 +16,6 @@ local naughty = require("naughty")
|
||||||
local wibox = require("wibox")
|
local wibox = require("wibox")
|
||||||
|
|
||||||
local math = { modf = math.modf }
|
local math = { modf = math.modf }
|
||||||
local mouse = mouse
|
|
||||||
local string = { format = string.format,
|
local string = { format = string.format,
|
||||||
match = string.match,
|
match = string.match,
|
||||||
rep = string.rep }
|
rep = string.rep }
|
||||||
|
@ -43,7 +42,6 @@ local alsabar = {
|
||||||
font = beautiful.font:sub(beautiful.font:find(""), beautiful.font:find(" ")),
|
font = beautiful.font:sub(beautiful.font:find(""), beautiful.font:find(" ")),
|
||||||
font_size = "11",
|
font_size = "11",
|
||||||
color = beautiful.fg_normal,
|
color = beautiful.fg_normal,
|
||||||
bar_size = 18,
|
|
||||||
screen = 1
|
screen = 1
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -71,12 +69,12 @@ function alsabar.notify()
|
||||||
preset.title = string.format("%s - %s%%", alsabar.channel, alsabar._current_level)
|
preset.title = string.format("%s - %s%%", alsabar.channel, alsabar._current_level)
|
||||||
end
|
end
|
||||||
|
|
||||||
int = math.modf((alsabar._current_level / 100) * alsabar.notifications.bar_size)
|
int = math.modf((alsabar._current_level / 100) * awful.screen.focused().mywibox.height)
|
||||||
preset.text = string.format("[%s%s]", string.rep("|", int),
|
preset.text = string.format("[%s%s]", string.rep("|", int),
|
||||||
string.rep(" ", alsabar.notifications.bar_size - int))
|
string.rep(" ", awful.screen.focused().mywibox.height - int))
|
||||||
|
|
||||||
if alsabar.followmouse then
|
if alsabar.followtag then
|
||||||
preset.screen = mouse.screen
|
preset.screen = awful.screen.focused()
|
||||||
end
|
end
|
||||||
|
|
||||||
if alsabar._notify ~= nil then
|
if alsabar._notify ~= nil then
|
||||||
|
@ -107,7 +105,7 @@ local function worker(args)
|
||||||
alsabar.step = args.step or alsabar.step
|
alsabar.step = args.step or alsabar.step
|
||||||
alsabar.colors = args.colors or alsabar.colors
|
alsabar.colors = args.colors or alsabar.colors
|
||||||
alsabar.notifications = args.notifications or alsabar.notifications
|
alsabar.notifications = args.notifications or alsabar.notifications
|
||||||
alsabar.followmouse = args.followmouse or false
|
alsabar.followtag = args.followtag or false
|
||||||
|
|
||||||
alsabar.bar = wibox.widget {
|
alsabar.bar = wibox.widget {
|
||||||
forced_height = height,
|
forced_height = height,
|
||||||
|
|
|
@ -1,58 +0,0 @@
|
||||||
|
|
||||||
--[[
|
|
||||||
|
|
||||||
Licensed under GNU General Public License v2
|
|
||||||
* (c) 2013, Luke Bonham
|
|
||||||
* (c) 2010-2012, Peter Hofmann
|
|
||||||
|
|
||||||
--]]
|
|
||||||
|
|
||||||
local wibox = require("awful.wibox")
|
|
||||||
local setmetatable = setmetatable
|
|
||||||
|
|
||||||
-- Creates a thin wibox at a position relative to another wibox
|
|
||||||
-- lain.widgets.borderbox
|
|
||||||
local borderbox = {}
|
|
||||||
|
|
||||||
local function worker(relbox, s, args)
|
|
||||||
local where = args.position or 'top'
|
|
||||||
local color = args.color or '#FFFFFF'
|
|
||||||
local size = args.size or 1
|
|
||||||
local box = nil
|
|
||||||
local wiboxarg = { position = nil, bg = color }
|
|
||||||
|
|
||||||
if where == 'top'
|
|
||||||
then
|
|
||||||
wiboxarg.width = relbox.width
|
|
||||||
wiboxarg.height = size
|
|
||||||
box = wibox(wiboxarg)
|
|
||||||
box.x = relbox.x
|
|
||||||
box.y = relbox.y - size
|
|
||||||
elseif where == 'bottom'
|
|
||||||
then
|
|
||||||
wiboxarg.width = relbox.width
|
|
||||||
wiboxarg.height = size
|
|
||||||
box = wibox(wiboxarg)
|
|
||||||
box.x = relbox.x
|
|
||||||
box.y = relbox.y + relbox.height
|
|
||||||
elseif where == 'left'
|
|
||||||
then
|
|
||||||
wiboxarg.width = size
|
|
||||||
wiboxarg.height = relbox.height
|
|
||||||
box = wibox(wiboxarg)
|
|
||||||
box.x = relbox.x - size
|
|
||||||
box.y = relbox.y
|
|
||||||
elseif where == 'right'
|
|
||||||
then
|
|
||||||
wiboxarg.width = size
|
|
||||||
wiboxarg.height = relbox.height
|
|
||||||
box = wibox(wiboxarg)
|
|
||||||
box.x = relbox.x + relbox.width
|
|
||||||
box.y = relbox.y
|
|
||||||
end
|
|
||||||
|
|
||||||
box.screen = s
|
|
||||||
return box
|
|
||||||
end
|
|
||||||
|
|
||||||
return setmetatable(borderbox, { __call = function(_, ...) return worker(...) end })
|
|
|
@ -14,7 +14,6 @@ local naughty = require("naughty")
|
||||||
|
|
||||||
local io = { popen = io.popen }
|
local io = { popen = io.popen }
|
||||||
local os = { date = os.date }
|
local os = { date = os.date }
|
||||||
local mouse = mouse
|
|
||||||
local string = { format = string.format,
|
local string = { format = string.format,
|
||||||
sub = string.sub,
|
sub = string.sub,
|
||||||
gsub = string.gsub }
|
gsub = string.gsub }
|
||||||
|
@ -47,13 +46,13 @@ function calendar.show(t_out, inc_offset, scr)
|
||||||
if offs == 0 or calendar.offset == 0
|
if offs == 0 or calendar.offset == 0
|
||||||
then -- current month showing, today highlighted
|
then -- current month showing, today highlighted
|
||||||
calendar.offset = 0
|
calendar.offset = 0
|
||||||
calendar.notify_icon = calendar.icons .. today .. ".png"
|
calendar.notify_icon = string.format("%s%s.png", calendar.icons, today)
|
||||||
|
|
||||||
-- bg and fg inverted to highlight today
|
-- bg and fg inverted to highlight today
|
||||||
f = io.popen(calendar.cal_format(today))
|
f = io.popen(calendar.cal_format(today))
|
||||||
else -- no current month showing, no day to highlight
|
else -- no current month showing, no day to highlight
|
||||||
local month = tonumber(os.date('%m'))
|
local month = tonumber(os.date('%m'))
|
||||||
local year = tonumber(os.date('%Y'))
|
local year = tonumber(os.date('%Y'))
|
||||||
|
|
||||||
month = month + calendar.offset
|
month = month + calendar.offset
|
||||||
|
|
||||||
|
@ -79,8 +78,8 @@ function calendar.show(t_out, inc_offset, scr)
|
||||||
.. "</span></tt>"
|
.. "</span></tt>"
|
||||||
f:close()
|
f:close()
|
||||||
|
|
||||||
if calendar.followmouse then
|
if calendar.followtag then
|
||||||
scrp = mouse.screen
|
scrp = awful.screen.focused()
|
||||||
else
|
else
|
||||||
scrp = scr or calendar.scr_pos
|
scrp = scr or calendar.scr_pos
|
||||||
end
|
end
|
||||||
|
@ -111,7 +110,7 @@ function calendar.attach(widget, args)
|
||||||
calendar.bg = args.bg or beautiful.bg_normal or "#000000"
|
calendar.bg = args.bg or beautiful.bg_normal or "#000000"
|
||||||
calendar.position = args.position or "top_right"
|
calendar.position = args.position or "top_right"
|
||||||
calendar.scr_pos = args.scr_pos or 1
|
calendar.scr_pos = args.scr_pos or 1
|
||||||
calendar.followmouse = args.followmouse or false
|
calendar.followtag = args.followtag or false
|
||||||
|
|
||||||
calendar.offset = 0
|
calendar.offset = 0
|
||||||
calendar.notify_icon = nil
|
calendar.notify_icon = nil
|
||||||
|
|
|
@ -6,15 +6,18 @@
|
||||||
|
|
||||||
--]]
|
--]]
|
||||||
|
|
||||||
local helpers = require("lain.helpers")
|
local helpers = require("lain.helpers")
|
||||||
local json = require("lain.util.dkjson")
|
local json = require("lain.util.dkjson")
|
||||||
local pread = require("awful.util").pread
|
|
||||||
local naughty = require("naughty")
|
|
||||||
local wibox = require("wibox")
|
|
||||||
local mouse = mouse
|
|
||||||
local os = { getenv = os.getenv }
|
|
||||||
|
|
||||||
|
local focused = require("awful.screen").focused
|
||||||
|
local pread = require("awful.util").pread
|
||||||
|
local naughty = require("naughty")
|
||||||
|
local wibox = require("wibox")
|
||||||
|
|
||||||
|
local next = next
|
||||||
|
local os = { getenv = os.getenv }
|
||||||
local setmetatable = setmetatable
|
local setmetatable = setmetatable
|
||||||
|
local table = table
|
||||||
|
|
||||||
-- Google Play Music Desktop infos
|
-- Google Play Music Desktop infos
|
||||||
-- lain.widget.contrib.gpmdp
|
-- lain.widget.contrib.gpmdp
|
||||||
|
@ -24,7 +27,7 @@ local function worker(args)
|
||||||
local args = args or {}
|
local args = args or {}
|
||||||
local timeout = args.timeout or 2
|
local timeout = args.timeout or 2
|
||||||
local notify = args.notify or "off"
|
local notify = args.notify or "off"
|
||||||
local followmouse = args.followmouse or false
|
local followtag = args.followtag or false
|
||||||
local file_location = args.file_location or
|
local file_location = args.file_location or
|
||||||
os.getenv("HOME") .. "/.config/Google Play Music Desktop Player/json_store/playback.json"
|
os.getenv("HOME") .. "/.config/Google Play Music Desktop Player/json_store/playback.json"
|
||||||
local settings = args.settings or function() end
|
local settings = args.settings or function() end
|
||||||
|
@ -39,14 +42,14 @@ local function worker(args)
|
||||||
helpers.set_map("gpmdp_current", nil)
|
helpers.set_map("gpmdp_current", nil)
|
||||||
|
|
||||||
function gpmdp.update()
|
function gpmdp.update()
|
||||||
file, err = io.open(file_location, "r")
|
local filelines = helpers.lines_from(file_location)
|
||||||
if not file
|
|
||||||
|
if not next(filelines)
|
||||||
then
|
then
|
||||||
gpm_now = { running = false, playing = false }
|
local gpm_now = { running = false, playing = false }
|
||||||
else
|
else
|
||||||
dict, pos, err = json.decode(file:read "*a", 1, nil)
|
dict, pos, err = json.decode(table.concat(filelines), 1, nil)
|
||||||
file:close()
|
local gpm_now = {}
|
||||||
gpm_now = {}
|
|
||||||
gpm_now.artist = dict.song.artist
|
gpm_now.artist = dict.song.artist
|
||||||
gpm_now.album = dict.song.album
|
gpm_now.album = dict.song.album
|
||||||
gpm_now.title = dict.song.title
|
gpm_now.title = dict.song.title
|
||||||
|
@ -54,7 +57,7 @@ local function worker(args)
|
||||||
gpm_now.playing = dict.playing
|
gpm_now.playing = dict.playing
|
||||||
end
|
end
|
||||||
|
|
||||||
if (pread("pidof 'Google Play Music Desktop Player'") ~= '') then
|
if pread("pidof 'Google Play Music Desktop Player'") ~= '' then
|
||||||
gpm_now.running = true
|
gpm_now.running = true
|
||||||
else
|
else
|
||||||
gpm_now.running = false
|
gpm_now.running = false
|
||||||
|
@ -69,10 +72,10 @@ local function worker(args)
|
||||||
if notify == "on" and gpm_now.title ~= helpers.get_map("gpmdp_current")
|
if notify == "on" and gpm_now.title ~= helpers.get_map("gpmdp_current")
|
||||||
then
|
then
|
||||||
helpers.set_map("gpmdp_current", gpm_now.title)
|
helpers.set_map("gpmdp_current", gpm_now.title)
|
||||||
os.execute("curl " .. gpm_now.cover_url .. " -o /tmp/gpmcover.png")
|
os.execute(string.format("curl %d -o /tmp/gpmcover.png", gpm_now.cover_url))
|
||||||
|
|
||||||
if followmouse then
|
if followtag then
|
||||||
gpmdp_notification_preset.screen = mouse.screen
|
gpmdp_notification_preset.screen = focused()
|
||||||
end
|
end
|
||||||
|
|
||||||
gpmdp.id = naughty.notify({
|
gpmdp.id = naughty.notify({
|
||||||
|
|
|
@ -6,18 +6,19 @@
|
||||||
|
|
||||||
--]]
|
--]]
|
||||||
|
|
||||||
local helpers = require("lain.helpers")
|
local helpers = require("lain.helpers")
|
||||||
local async = require("lain.asyncshell")
|
local async = require("lain.asyncshell")
|
||||||
|
|
||||||
|
local focused = require("awful.screen").focused
|
||||||
local escape_f = require("awful.util").escape
|
local escape_f = require("awful.util").escape
|
||||||
local naughty = require("naughty")
|
local naughty = require("naughty")
|
||||||
local wibox = require("wibox")
|
local wibox = require("wibox")
|
||||||
|
|
||||||
local io = { popen = io.popen }
|
local io = { popen = io.popen }
|
||||||
local os = { execute = os.execute,
|
local os = { execute = os.execute,
|
||||||
getenv = os.getenv }
|
getenv = os.getenv }
|
||||||
local string = { format = string.format,
|
local string = { format = string.format,
|
||||||
gmatch = string.gmatch }
|
gmatch = string.gmatch }
|
||||||
|
|
||||||
local setmetatable = setmetatable
|
local setmetatable = setmetatable
|
||||||
|
|
||||||
|
@ -31,7 +32,7 @@ local function worker(args)
|
||||||
local music_dir = args.music_dir or os.getenv("HOME") .. "/Music"
|
local music_dir = args.music_dir or os.getenv("HOME") .. "/Music"
|
||||||
local cover_size = args.cover_size or 100
|
local cover_size = args.cover_size or 100
|
||||||
local default_art = args.default_art or ""
|
local default_art = args.default_art or ""
|
||||||
local followmouse = args.followmouse or false
|
local followtag = args.followtag or false
|
||||||
local settings = args.settings or function() end
|
local settings = args.settings or function() end
|
||||||
|
|
||||||
local mpdcover = helpers.scripts_dir .. "mpdcover"
|
local mpdcover = helpers.scripts_dir .. "mpdcover"
|
||||||
|
@ -85,8 +86,8 @@ local function worker(args)
|
||||||
os.execute(string.format("%s %q %q %d %q", mpdcover, "",
|
os.execute(string.format("%s %q %q %d %q", mpdcover, "",
|
||||||
moc_now.file, cover_size, default_art))
|
moc_now.file, cover_size, default_art))
|
||||||
|
|
||||||
if followmouse then
|
if followtag then
|
||||||
moc_notification_preset.screen = mouse.screen
|
moc_notification_preset.screen = focused()
|
||||||
end
|
end
|
||||||
|
|
||||||
moc.id = naughty.notify({
|
moc.id = naughty.notify({
|
||||||
|
|
|
@ -42,8 +42,8 @@ function task.show(scr_pos)
|
||||||
|
|
||||||
local f, c_text, scrp
|
local f, c_text, scrp
|
||||||
|
|
||||||
if task.followmouse then
|
if task.followtag then
|
||||||
scrp = mouse.screen
|
scrp = awful.screen.focused()
|
||||||
else
|
else
|
||||||
scrp = scr_pos or task.scr_pos
|
scrp = scr_pos or task.scr_pos
|
||||||
end
|
end
|
||||||
|
@ -69,7 +69,7 @@ end
|
||||||
|
|
||||||
function task.prompt_add()
|
function task.prompt_add()
|
||||||
awful.prompt.run({ prompt = "Add task: " },
|
awful.prompt.run({ prompt = "Add task: " },
|
||||||
mypromptbox[mouse.screen].widget,
|
mypromptbox[awful.screen.focused()].widget,
|
||||||
function (...)
|
function (...)
|
||||||
local f = io.popen("task add " .. ...)
|
local f = io.popen("task add " .. ...)
|
||||||
c_text = "\n<span font='"
|
c_text = "\n<span font='"
|
||||||
|
@ -94,7 +94,7 @@ end
|
||||||
|
|
||||||
function task.prompt_search()
|
function task.prompt_search()
|
||||||
awful.prompt.run({ prompt = "Search task: " },
|
awful.prompt.run({ prompt = "Search task: " },
|
||||||
mypromptbox[mouse.screen].widget,
|
mypromptbox[awful.screen.focused()].widget,
|
||||||
function (...)
|
function (...)
|
||||||
local f = io.popen("task " .. ...)
|
local f = io.popen("task " .. ...)
|
||||||
c_text = f:read("*all"):gsub(" \n*$", "")
|
c_text = f:read("*all"):gsub(" \n*$", "")
|
||||||
|
@ -119,7 +119,7 @@ function task.prompt_search()
|
||||||
fg = task.fg,
|
fg = task.fg,
|
||||||
bg = task.bg,
|
bg = task.bg,
|
||||||
timeout = task.timeout,
|
timeout = task.timeout,
|
||||||
screen = mouse.screen
|
screen = awful.screen.focused()
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
nil,
|
nil,
|
||||||
|
@ -137,7 +137,7 @@ function task.attach(widget, args)
|
||||||
task.position = args.position or "top_right"
|
task.position = args.position or "top_right"
|
||||||
task.timeout = args.timeout or 7
|
task.timeout = args.timeout or 7
|
||||||
task.scr_pos = args.scr_pos or 1
|
task.scr_pos = args.scr_pos or 1
|
||||||
task.followmouse = args.followmouse or false
|
task.followtag = args.followtag or false
|
||||||
task.cmdline = args.cmdline or "next"
|
task.cmdline = args.cmdline or "next"
|
||||||
|
|
||||||
task.notify_icon = icons_dir .. "/taskwarrior/task.png"
|
task.notify_icon = icons_dir .. "/taskwarrior/task.png"
|
||||||
|
|
|
@ -12,7 +12,6 @@ local async = require("lain.asyncshell")
|
||||||
local naughty = require("naughty")
|
local naughty = require("naughty")
|
||||||
local wibox = require("wibox")
|
local wibox = require("wibox")
|
||||||
|
|
||||||
local mouse = mouse
|
|
||||||
local string = { format = string.format,
|
local string = { format = string.format,
|
||||||
gsub = string.gsub }
|
gsub = string.gsub }
|
||||||
local tonumber = tonumber
|
local tonumber = tonumber
|
||||||
|
@ -33,7 +32,7 @@ local function worker(args)
|
||||||
local port = args.port or 993
|
local port = args.port or 993
|
||||||
local timeout = args.timeout or 60
|
local timeout = args.timeout or 60
|
||||||
local is_plain = args.is_plain or false
|
local is_plain = args.is_plain or false
|
||||||
local followmouse = args.followmouse or false
|
local followtag = args.followtag or false
|
||||||
local settings = args.settings or function() end
|
local settings = args.settings or function() end
|
||||||
|
|
||||||
local head_command = "curl --connect-timeout 3 -fsm 3"
|
local head_command = "curl --connect-timeout 3 -fsm 3"
|
||||||
|
@ -53,8 +52,8 @@ local function worker(args)
|
||||||
position = "top_left"
|
position = "top_left"
|
||||||
}
|
}
|
||||||
|
|
||||||
if followmouse then
|
if followtag then
|
||||||
mail_notification_preset.screen = mouse.screen
|
mail_notification_preset.screen = awful.screen.focused()
|
||||||
end
|
end
|
||||||
|
|
||||||
curl = string.format("%s --url imaps://%s:%s/INBOX -u %s:%q %s -k",
|
curl = string.format("%s --url imaps://%s:%s/INBOX -u %s:%q %s -k",
|
||||||
|
|
|
@ -17,7 +17,6 @@ local wibox = require("wibox")
|
||||||
local os = { execute = os.execute,
|
local os = { execute = os.execute,
|
||||||
getenv = os.getenv }
|
getenv = os.getenv }
|
||||||
local math = { floor = math.floor }
|
local math = { floor = math.floor }
|
||||||
local mouse = mouse
|
|
||||||
local string = { format = string.format,
|
local string = { format = string.format,
|
||||||
match = string.match,
|
match = string.match,
|
||||||
gmatch = string.gmatch }
|
gmatch = string.gmatch }
|
||||||
|
@ -38,7 +37,7 @@ local function worker(args)
|
||||||
local cover_size = args.cover_size or 100
|
local cover_size = args.cover_size or 100
|
||||||
local default_art = args.default_art or ""
|
local default_art = args.default_art or ""
|
||||||
local notify = args.notify or "on"
|
local notify = args.notify or "on"
|
||||||
local followmouse = args.followmouse or false
|
local followtag = args.followtag or false
|
||||||
local echo_cmd = args.echo_cmd or "echo"
|
local echo_cmd = args.echo_cmd or "echo"
|
||||||
local settings = args.settings or function() end
|
local settings = args.settings or function() end
|
||||||
|
|
||||||
|
@ -118,8 +117,8 @@ local function worker(args)
|
||||||
current_icon = default_art
|
current_icon = default_art
|
||||||
end
|
end
|
||||||
|
|
||||||
if followmouse then
|
if followtag then
|
||||||
mpd_notification_preset.screen = mouse.screen
|
mpd_notification_preset.screen = awful.screen.focused()
|
||||||
end
|
end
|
||||||
|
|
||||||
mpd.id = naughty.notify({
|
mpd.id = naughty.notify({
|
||||||
|
|
|
@ -41,9 +41,7 @@ local pulsebar = {
|
||||||
notifications = {
|
notifications = {
|
||||||
font = beautiful.font:sub(beautiful.font:find(""), beautiful.font:find(" ")),
|
font = beautiful.font:sub(beautiful.font:find(""), beautiful.font:find(" ")),
|
||||||
font_size = "11",
|
font_size = "11",
|
||||||
color = beautiful.fg_normal,
|
color = beautiful.fg_normal
|
||||||
bar_size = 18,
|
|
||||||
screen = 1
|
|
||||||
},
|
},
|
||||||
|
|
||||||
_current_level = 0,
|
_current_level = 0,
|
||||||
|
@ -57,7 +55,6 @@ function pulsebar.notify()
|
||||||
title = "",
|
title = "",
|
||||||
text = "",
|
text = "",
|
||||||
timeout = 5,
|
timeout = 5,
|
||||||
screen = pulsebar.notifications.screen,
|
|
||||||
font = string.format("%s %s", alsabar.notifications.font,
|
font = string.format("%s %s", alsabar.notifications.font,
|
||||||
alsabar.notifications.font_size),
|
alsabar.notifications.font_size),
|
||||||
fg = pulsebar.notifications.color
|
fg = pulsebar.notifications.color
|
||||||
|
@ -70,12 +67,12 @@ function pulsebar.notify()
|
||||||
preset.title = string.format("%s - %s%%", pulsebar.sink, pulsebar._current_level)
|
preset.title = string.format("%s - %s%%", pulsebar.sink, pulsebar._current_level)
|
||||||
end
|
end
|
||||||
|
|
||||||
int = math.modf((pulsebar._current_level / 100) * pulsebar.notifications.bar_size)
|
int = math.modf((pulsebar._current_level / 100) * awful.screen.focused().mywibox.height)
|
||||||
preset.text = string.format("[%s%s]", string.rep("|", int),
|
preset.text = string.format("[%s%s]", string.rep("|", int),
|
||||||
string.rep(" ", pulsebar.notifications.bar_size - int))
|
string.rep(" ", awful.screen.focused().mywibox.height - int))
|
||||||
|
|
||||||
if pulsebar.followmouse then
|
if pulsebar.followtag then
|
||||||
preset.screen = mouse.screen
|
preset.screen = awful.screen.focused()
|
||||||
end
|
end
|
||||||
|
|
||||||
if pulsebar._notify ~= nil then
|
if pulsebar._notify ~= nil then
|
||||||
|
@ -106,7 +103,7 @@ local function worker(args)
|
||||||
pulsebar.notifications = args.notifications or pulsebar.notifications
|
pulsebar.notifications = args.notifications or pulsebar.notifications
|
||||||
pulsebar.sink = args.sink or 0
|
pulsebar.sink = args.sink or 0
|
||||||
pulsebar.step = args.step or pulsebar.step
|
pulsebar.step = args.step or pulsebar.step
|
||||||
pulsebar.followmouse = args.followmouse or false
|
pulsebar.followtag = args.followtag or false
|
||||||
|
|
||||||
pulsebar.bar = wibox.widget {
|
pulsebar.bar = wibox.widget {
|
||||||
forced_height = height,
|
forced_height = height,
|
||||||
|
@ -143,11 +140,11 @@ local function worker(args)
|
||||||
then
|
then
|
||||||
pulsebar._muted = true
|
pulsebar._muted = true
|
||||||
pulsebar.tooltip:set_text ("[Muted]")
|
pulsebar.tooltip:set_text ("[Muted]")
|
||||||
pulsebar.bar.color(pulsebar.colors.mute)
|
pulsebar.bar.color = pulsebar.colors.mute
|
||||||
else
|
else
|
||||||
pulsebar._muted = false
|
pulsebar._muted = false
|
||||||
pulsebar.tooltip:set_text(string.format("%s: %s", pulsebar.sink, volu))
|
pulsebar.tooltip:set_text(string.format("%s: %s", pulsebar.sink, volu))
|
||||||
pulsebar.bar.color(pulsebar.colors.unmute)
|
pulsebar.bar.color = pulsebar.colors.unmute
|
||||||
end
|
end
|
||||||
settings()
|
settings()
|
||||||
end
|
end
|
||||||
|
|
|
@ -13,6 +13,7 @@ local async = require("lain.asyncshell")
|
||||||
local json = require("lain.util").dkjson
|
local json = require("lain.util").dkjson
|
||||||
local lain_icons = require("lain.helpers").icons_dir
|
local lain_icons = require("lain.helpers").icons_dir
|
||||||
|
|
||||||
|
local focused = require("awful.screen").focused
|
||||||
local naughty = require("naughty")
|
local naughty = require("naughty")
|
||||||
local wibox = require("wibox")
|
local wibox = require("wibox")
|
||||||
|
|
||||||
|
@ -60,7 +61,7 @@ local function worker(args)
|
||||||
return string.format("<b>%s</b>: %s, %d - %d ", day, desc, tmin, tmax)
|
return string.format("<b>%s</b>: %s, %d - %d ", day, desc, tmin, tmax)
|
||||||
end
|
end
|
||||||
local weather_na_markup = args.weather_na_markup or " N/A "
|
local weather_na_markup = args.weather_na_markup or " N/A "
|
||||||
local followmouse = args.followmouse or false
|
local followtag = args.followtag or false
|
||||||
local settings = args.settings or function() end
|
local settings = args.settings or function() end
|
||||||
|
|
||||||
weather.widget = wibox.widget.textbox(weather_na_markup)
|
weather.widget = wibox.widget.textbox(weather_na_markup)
|
||||||
|
@ -70,8 +71,8 @@ local function worker(args)
|
||||||
function weather.show(t_out)
|
function weather.show(t_out)
|
||||||
weather.hide()
|
weather.hide()
|
||||||
|
|
||||||
if followmouse then
|
if followtag then
|
||||||
notification_preset.screen = mouse.screen
|
notification_preset.screen = focused()
|
||||||
end
|
end
|
||||||
|
|
||||||
if not weather.notification_text then
|
if not weather.notification_text then
|
||||||
|
|
2
wiki
2
wiki
|
@ -1 +1 @@
|
||||||
Subproject commit bc5582fb3d3d7bf54f2848e9b58aa01c9c33d79e
|
Subproject commit 6e439e9a28174909c4ab0dd23eaf93785cc170e7
|
Loading…
Add table
Reference in a new issue