]>
git.madduck.net Git - etc/awesome.git/commitdiff
madduck's git repository
Every one of the projects in this repository is available at the canonical
URL git://git.madduck.net/madduck/pub/<projectpath> — see
each project's metadata for the exact URL.
All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@ git. madduck. net .
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
SSH access, as well as push access can be individually
arranged .
If you use my repositories frequently, consider adding the following
snippet to ~/.gitconfig and using the third clone URL listed for each
project:
[url "git://git.madduck.net/madduck/"]
insteadOf = madduck:
summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
ddbf283 )
+-- shallow copy a table
+function helpers.table_shallowcopy(orig)
+ local orig_type = type(orig)
+ local copy
+ if orig_type == 'table' then
+ copy = {}
+ for orig_key, orig_value in pairs(orig) do
+ copy[orig_key] = orig_value
+ end
+ else -- number, string, boolean, etc
+ copy = orig
+ end
+ return copy
+end
+
alsabar.notification_preset = args.notification_preset
if not alsabar.notification_preset then
alsabar.notification_preset = args.notification_preset
if not alsabar.notification_preset then
- alsabar.notification_preset = naughty.config.defaults
- alsabar.notification_preset.font = "Monospace 11 "
+ alsabar.notification_preset = {}
+ alsabar.notification_preset.font = "Monospace 10 "
end
local format_cmd = string.format("%s get %s", alsabar.cmd, alsabar.channel)
end
local format_cmd = string.format("%s get %s", alsabar.cmd, alsabar.channel)
-local async = require("lain.helpers").async
-local icons_dir = require("lain.helpers").icons_dir
+local helpers = require("lain.helpers")
local markup = require("lain.util.markup")
local awful = require("awful")
local naughty = require("naughty")
local markup = require("lain.util.markup")
local awful = require("awful")
local naughty = require("naughty")
calendar.notification_preset.screen = src or 1
end
calendar.notification_preset.screen = src or 1
end
+ helpers. async(f, function(ws)
fg, bg = calendar.notification_preset.fg, calendar.notification_preset.bg
ws = ws:gsub("%c%[%d+[m]?%d+%c%[%d+[m]?", markup.bold(markup.color(bg, fg, today)))
calendar.notification = naughty.notify({
fg, bg = calendar.notification_preset.fg, calendar.notification_preset.bg
ws = ws:gsub("%c%[%d+[m]?%d+%c%[%d+[m]?", markup.bold(markup.color(bg, fg, today)))
calendar.notification = naughty.notify({
local args = args or {}
calendar.cal = args.cal or "/usr/bin/cal --color=always"
calendar.followtag = args.followtag or false
local args = args or {}
calendar.cal = args.cal or "/usr/bin/cal --color=always"
calendar.followtag = args.followtag or false
- calendar.icons = args.icons or icons_dir .. "cal/white/"
+ calendar.icons = args.icons or helpers. icons_dir .. "cal/white/"
calendar.notification_preset = args.notification_preset
if not calendar.notification_preset then
calendar.notification_preset = args.notification_preset
if not calendar.notification_preset then
- calendar.notification_preset = naughty.config.defaults
- calendar.notification_preset.font = "Monospace 10"
- calendar.notification_preset.fg = "#FFFFFF"
- calendar.notification_preset.bg = "#000000"
+ calendar.notification_preset = {
+ font = "Monospace 10",
+ fg = "#FFFFFF",
+ bg = "#000000"
+ }
task.notification_preset = args.notification_preset
if not task.notification_preset then
task.notification_preset = args.notification_preset
if not task.notification_preset then
- task.notification_preset = naughty.config.defaults
- task.notification_preset.font = "Monospace 10"
- task.notification_preset.icon = helpers.icons_dir .. "/taskwarrior.png"
+ task.notification_preset = {
+ font = "Monospace 10",
+ icon = helpers.icons_dir .. "/taskwarrior.png"
+ }
local time = bat:remaining_time()
local msg = "\t"
local time = bat:remaining_time()
local msg = "\t"
- if status ~= "idle" and status ~= "nil"
- then
- if time == "N/A"
- then
+ if status ~= "idle" and status ~= "nil" then
+ if time == "N/A" then
msg = "...Calculating time remaining..."
else
msg = time .. (status == "charging" and " until charged" or " remaining")
msg = "...Calculating time remaining..."
else
msg = time .. (status == "charging" and " until charged" or " remaining")
.. string.format("\n%s \t\t\t %s", status:upper(), msg)
tpbat.notification = naughty.notify({
.. string.format("\n%s \t\t\t %s", status:upper(), msg)
tpbat.notification = naughty.notify({
- preset = naughty.config.defaults,
- text = str,
- screen = client.focus and client.focus.screen or 1
+ screen = client.focus and client.focus.screen or 1
end
widget = tpbat.widget
end
widget = tpbat.widget
fs.notification_preset = args.notification_preset
if not fs.notification_preset then
fs.notification_preset = args.notification_preset
if not fs.notification_preset then
- fs.notification_preset = naughty.config.defaults
- fs.notification_preset.font = "Monospace 10"
- fs.notification_preset.fg = "#FFFFFF"
- fs.notification_preset.bg = "#000000"
+ fs.notification_preset = {
+ font = "Monospace 10",
+ fg = "#FFFFFF",
+ bg = "#000000"
+ }
end
helpers.set_map(partition, false)
end
helpers.set_map(partition, false)
pulsebar.notifications = args.notification_preset
if not pulsebar.notification_preset then
pulsebar.notifications = args.notification_preset
if not pulsebar.notification_preset then
- pulsebar.notification_preset = naughty.config.defaults
- pulsebar.notification_preset.font = "Monospace 11 "
+ pulsebar.notification_preset = {}
+ pulsebar.notification_preset.font = "Monospace 10 "
end
pulsebar.bar = wibox.widget {
end
pulsebar.bar = wibox.widget {