]>
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 (parent:
c0deea2 )
calendar.notification_preset.screen = src or 1
end
calendar.notification_preset.screen = src or 1
end
- async(string.format("%s -c '%s'", awful.util.shell, f) , function(ws)
fg, bg = calendar.notification_preset.fg, calendar.notification_preset.bg
ws = ws:gsub("%c%[7m%d+%c%[27m", 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%[7m%d+%c%[27m", markup.bold(markup.color(bg, fg, today)))
calendar.notification = naughty.notify({
- widget:connect_signal("mouse::enter", function () calendar.show() end)
+ widget:connect_signal("mouse::enter", function () calendar.show(0 ) end)
widget:connect_signal("mouse::leave", function () calendar.hide() end)
widget:buttons(awful.util.table.join(awful.button({ }, 1, function ()
calendar.show(0, -1, calendar.scr_pos) end),
widget:connect_signal("mouse::leave", function () calendar.hide() end)
widget:buttons(awful.util.table.join(awful.button({ }, 1, function ()
calendar.show(0, -1, calendar.scr_pos) end),
end
function kbdlayout.update()
end
function kbdlayout.update()
- helpers.async(string.format("%s -c 'setxkbmap -query'", awful.util.shell),
- function(status)
+ helpers.async("setxkbmap -query", function(status)
kbd_run_settings(string.match(status, "layout:%s*([^\n]*)"),
string.match(status, "variant:%s*([^\n]*)"))
end)
kbd_run_settings(string.match(status, "layout:%s*([^\n]*)"),
string.match(status, "variant:%s*([^\n]*)"))
end)
}
local path = string.format("%s/%s", music_dir, string.match(moc_now.file, ".*/"))
}
local path = string.format("%s/%s", music_dir, string.match(moc_now.file, ".*/"))
- local cover = string.format("%s -c \"find '%s' -maxdepth 1 -type f | egrep -i -m1 '%s'\"", shell , path, cover_pattern)
- helpers.async(cover , function(current_icon)
+ local cover = string.format("find '%s' -maxdepth 1 -type f | egrep -i -m1 '%s'" , path, cover_pattern)
+ helpers.async({ shell, "-c", cover } , function(current_icon)
common.icon = current_icon:gsub("\n", "")
moc.id = naughty.notify(common).id
end)
common.icon = current_icon:gsub("\n", "")
moc.id = naughty.notify(common).id
end)
end
function redshift:toggle()
end
function redshift:toggle()
- async(string.format("%s -c 'ps -p %d -o pid='", awful.util.shell, redshift.pid) , function(f)
+ async({ awful.util.shell, "-c", string.format("ps -p %d -o pid=", redshift.pid) } , function(f)
if f and #f > 0 then -- redshift is running
-- Sending -USR1 toggles redshift (See project website)
execute("pkill -USR1 redshift")
if f and #f > 0 then -- redshift is running
-- Sending -USR1 toggles redshift (See project website)
execute("pkill -USR1 redshift")
task.notification_preset.screen = scr
end
task.notification_preset.screen = scr
end
- helpers.async(string.format("%s -c '%s'", awful.util.shell, task.cmd),
- function(f)
+ helpers.async(task.show_cmd, function(f)
task.notification = naughty.notify({
preset = task_notification_preset,
task.notification = naughty.notify({
preset = task_notification_preset,
text = markup.font(task.notification_preset.font,
awful.util.escape(f:gsub("\n*$", "")))
})
text = markup.font(task.notification_preset.font,
awful.util.escape(f:gsub("\n*$", "")))
})
prompt = task.prompt_text,
textbox = awful.screen.focused().mypromptbox.widget,
exe_callback = function(t)
prompt = task.prompt_text,
textbox = awful.screen.focused().mypromptbox.widget,
exe_callback = function(t)
- helpers.async(string.format("%s -c '%s'", awful.util.shell, t),
- function(f)
+ helpers.async(t, function(f)
- preset = task_ notification_preset,
+ preset = task. notification_preset,
title = t,
text = markup.font(task.notification_preset.font,
awful.util.escape(f:gsub("\n*$", "")))
title = t,
text = markup.font(task.notification_preset.font,
awful.util.escape(f:gsub("\n*$", "")))
function task.attach(widget, args)
local args = args or {}
function task.attach(widget, args)
local args = args or {}
- task.show_cmd = args.cmd or "task "
+ task.show_cmd = args.show_cmd or "task next "
task.prompt_text = args.prompt_text or "Enter task command: "
task.followtag = args.followtag or false
task.notification_preset = args.notification_preset
task.prompt_text = args.prompt_text or "Enter task command: "
task.followtag = args.followtag or false
task.notification_preset = args.notification_preset
function update()
fs_info, fs_now = {}, {}
function update()
fs_info, fs_now = {}, {}
- helpers.async(string.format("%s -c 'LC_ALL=C df -k --output=target,size,used,avail,pcent'", shell) , function(f)
+ helpers.async({ shell, "-c", "LC_ALL=C df -k --output=target,size,used,avail,pcent" } , function(f)
for line in string.gmatch(f, "\n[^\n]+") do
local m,s,u,a,p = string.match(line, "(/.-%s).-(%d+).-(%d+).-(%d+).-([%d]+)%%")
m = m:gsub(" ", "") -- clean target from any whitespace
for line in string.gmatch(f, "\n[^\n]+") do
local m,s,u,a,p = string.match(line, "(/.-%s).-(%d+).-(%d+).-(%d+).-([%d]+)%%")
m = m:gsub(" ", "") -- clean target from any whitespace
local mpdh = string.format("telnet://%s:%s", host, port)
local echo = string.format("printf \"%sstatus\\ncurrentsong\\nclose\\n\"", password)
local mpdh = string.format("telnet://%s:%s", host, port)
local echo = string.format("printf \"%sstatus\\ncurrentsong\\nclose\\n\"", password)
- local cmd = string.format("%s -c '%s | curl --connect-timeout 1 -fsm 3 %s'", shell , echo, mpdh)
+ local cmd = string.format("%s | curl --connect-timeout 1 -fsm 3 %s" , echo, mpdh)
mpd_notification_preset = { title = "Now playing", timeout = 6 }
helpers.set_map("current mpd track", nil)
function mpd.update()
mpd_notification_preset = { title = "Now playing", timeout = 6 }
helpers.set_map("current mpd track", nil)
function mpd.update()
- helpers.async(cmd , function(f)
+ helpers.async({ shell, "-c", cmd } , function(f)
mpd_now = {
random_mode = false,
single_mode = false,
mpd_now = {
random_mode = false,
single_mode = false,
if not string.match(mpd_now.file, "http.*://") then -- local file instead of http stream
local path = string.format("%s/%s", music_dir, string.match(mpd_now.file, ".*/"))
if not string.match(mpd_now.file, "http.*://") then -- local file instead of http stream
local path = string.format("%s/%s", music_dir, string.match(mpd_now.file, ".*/"))
- local cover = string.format("%s -c \"find '%s' -maxdepth 1 -type f | egrep -i -m1 '%s'\"", shell , path, cover_pattern)
- helpers.async(cover , function(current_icon)
+ local cover = string.format("find '%s' -maxdepth 1 -type f | egrep -i -m1 '%s'" , path, cover_pattern)
+ helpers.async({ shell, "-c", cover } , function(current_icon)
common.icon = current_icon:gsub("\n", "")
mpd.id = naughty.notify(common).id
end)
common.icon = current_icon:gsub("\n", "")
mpd.id = naughty.notify(common).id
end)
local helpers = require("lain.helpers")
local naughty = require("naughty")
local wibox = require("wibox")
local helpers = require("lain.helpers")
local naughty = require("naughty")
local wibox = require("wibox")
-local shell = require("awful.util").shell
local string = { format = string.format,
match = string.match }
local setmetatable = setmetatable
local string = { format = string.format,
match = string.match }
local setmetatable = setmetatable
net.iface = (args.iface and type(args.iface) == "string" and {args.iface}) or {}
function net.get_device()
net.iface = (args.iface and type(args.iface) == "string" and {args.iface}) or {}
function net.get_device()
- helpers.async(string.format("%s -c 'ip link show'", shell , device_cmd), function(ws)
+ helpers.async(string.format("ip link show" , device_cmd), function(ws)
ws = ws:match("(%w+): <BROADCAST,MULTICAST,.-,UP,LOWER_UP>")
net.iface = ws and { ws } or {}
end)
ws = ws:match("(%w+): <BROADCAST,MULTICAST,.-,UP,LOWER_UP>")
net.iface = ws and { ws } or {}
end)
-Subproject commit 3d8de07f057bcc4cb16bb1244e53276ea11ecff4
+Subproject commit 991e3bb813a650a6d6bcd27a9563a746fe489716