]>
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:
14d047e )
# -------------------------------------------------------------------------
# Decoding options
# -------------------------------------------------------------------------
# -------------------------------------------------------------------------
# Decoding options
# -------------------------------------------------------------------------
-USAGE="Usage: $0 [-h(elp)] | [-n(arrow mode)] | [-w(eb output)]"
+USAGE="Usage: $0 [-h(elp)] | [-n(arrow mode)] | [-w(eb output) | --type=<fstype> | --exclude-type=<fstype> ]"
NARROW_MODE=0
WEB_OUTPUT=0
NARROW_MODE=0
WEB_OUTPUT=0
while [ $# -gt 0 ]; do
case "$1" in
while [ $# -gt 0 ]; do
case "$1" in
+--type=*)
+DF_OPTIONS+=" $1"
+;;
+--exclude-type=*)
+DF_OPTIONS+=" $1"
+;;
+# Add additional df options
+DF_COMMAND+=$DF_OPTIONS
+
# -------------------------------------------------------------------------
# Grabbing "df" result
# -------------------------------------------------------------------------
# -------------------------------------------------------------------------
# Grabbing "df" result
# -------------------------------------------------------------------------
- alsabar.bar:buttons (awful.util.table.join (
- awful.button ({}, 1, function()
+ alsabar.bar:buttons(awful.util.table.join (
+ awful.button({}, 1, function()
awful.util.spawn(alsabar.mixer)
end),
awful.util.spawn(alsabar.mixer)
end),
- awful.button ({}, 2, function()
+ awful.button({}, 2, function()
awful.util.spawn(string.format("%s set %s 100%%", alsabar.cmd, alsabar.channel))
pulsebar.update()
end),
awful.util.spawn(string.format("%s set %s 100%%", alsabar.cmd, alsabar.channel))
pulsebar.update()
end),
- awful.button ({}, 3, function()
+ awful.button({}, 3, function()
awful.util.spawn(string.format("%s set %s toggle", alsabar.cmd, alsabar.channel))
alsabar.update()
end),
awful.util.spawn(string.format("%s set %s toggle", alsabar.cmd, alsabar.channel))
alsabar.update()
end),
- awful.button ({}, 4, function()
+ awful.button({}, 4, function()
awful.util.spawn(string.format("%s set %s %s+", alsabar.cmd, alsabar.channel, alsabar.step))
alsabar.update()
end),
awful.util.spawn(string.format("%s set %s %s+", alsabar.cmd, alsabar.channel, alsabar.step))
alsabar.update()
end),
- awful.button ({}, 5, function()
+ awful.button({}, 5, function()
awful.util.spawn(string.format("%s set %s %s-", alsabar.cmd, alsabar.channel, alsabar.step))
alsabar.update()
end)
awful.util.spawn(string.format("%s set %s %s-", alsabar.cmd, alsabar.channel, alsabar.step))
alsabar.update()
end)
local calendar = {}
local cal_notification = nil
local calendar = {}
local cal_notification = nil
-function calendar: hide()
+function calendar. hide()
if cal_notification ~= nil then
naughty.destroy(cal_notification)
cal_notification = nil
end
end
if cal_notification ~= nil then
naughty.destroy(cal_notification)
cal_notification = nil
end
end
-function calendar: show(t_out, inc_offset, scr)
- calendar: hide()
+function calendar. show(t_out, inc_offset, scr)
+ calendar. hide()
local f, c_text
local offs = inc_offset or 0
local f, c_text
local offs = inc_offset or 0
-function calendar: attach(widget, args)
+function calendar. attach(widget, args)
local args = args or {}
calendar.cal = args.cal or "/usr/bin/cal"
local args = args or {}
calendar.cal = args.cal or "/usr/bin/cal"
widget:connect_signal("mouse::enter", function () calendar:show(0, 0, calendar.scr_pos) end)
widget:connect_signal("mouse::leave", function () calendar:hide() end)
widget:buttons(awful.util.table.join(awful.button({ }, 1, function ()
widget:connect_signal("mouse::enter", function () calendar:show(0, 0, 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),
+ calendar. show(0, -1, calendar.scr_pos) end),
awful.button({ }, 3, function ()
awful.button({ }, 3, function ()
- calendar: show(0, 1, calendar.scr_pos) end),
+ calendar. show(0, 1, calendar.scr_pos) end),
awful.button({ }, 4, function ()
awful.button({ }, 4, function ()
- calendar: show(0, -1, calendar.scr_pos) end),
+ calendar. show(0, -1, calendar.scr_pos) end),
awful.button({ }, 5, function ()
calendar:show(0, 1, calendar.scr_pos) end)))
end
awful.button({ }, 5, function ()
calendar:show(0, 1, calendar.scr_pos) end)))
end
-- Keyboard layout switcher
-- lain.widgets.contrib.kblayout
-- Keyboard layout switcher
-- lain.widgets.contrib.kblayout
-local function worker (args)
+local function worker(args)
local kbdlayout = {}
kbdlayout.widget = wibox.widget.textbox('')
local kbdlayout = {}
kbdlayout.widget = wibox.widget.textbox('')
awful.button({ }, 1, function () kbdlayout.next() end),
awful.button({ }, 3, function () kbdlayout.prev() end)))
awful.button({ }, 1, function () kbdlayout.next() end),
awful.button({ }, 3, function () kbdlayout.prev() end)))
- local function run_settings (layout, variant)
+ local function run_settings(layout, variant)
widget = kbdlayout.widget
kbdlayout_now = { layout=string.match(layout, "[^,]+"), -- Make sure to match the primary layout only.
variant=variant }
settings()
end
widget = kbdlayout.widget
kbdlayout_now = { layout=string.match(layout, "[^,]+"), -- Make sure to match the primary layout only.
variant=variant }
settings()
end
- function kbdlayout.update ()
+ function kbdlayout.update()
local status = read_pipe('setxkbmap -query')
run_settings(string.match(status, "layout:%s*([^\n]*)"),
string.match(status, "variant:%s*([^\n]*)"))
end
local status = read_pipe('setxkbmap -query')
run_settings(string.match(status, "layout:%s*([^\n]*)"),
string.match(status, "variant:%s*([^\n]*)"))
end
- function kbdlayout.set (i)
+ function kbdlayout.set(i)
idx = ((i - 1) % #layouts) + 1 -- Make sure to wrap around as needed.
local to_execute = 'setxkbmap ' .. layouts[idx].layout
idx = ((i - 1) % #layouts) + 1 -- Make sure to wrap around as needed.
local to_execute = 'setxkbmap ' .. layouts[idx].layout
- function kbdlayout.next ()
+ function kbdlayout.next()
kbdlayout.set(idx + 1)
end
kbdlayout.set(idx + 1)
end
- function kbdlayout.prev ()
+ function kbdlayout.prev()
kbdlayout.set(idx - 1)
end
kbdlayout.set(idx - 1)
end
if i==nil then return nil else return i-1 end
end
if i==nil then return nil else return i-1 end
end
if task_notification ~= nil then
naughty.destroy(task_notification)
task_notification = nil
end
end
if task_notification ~= nil then
naughty.destroy(task_notification)
task_notification = nil
end
end
-function task: show(scr_pos)
- task: hide()
+function task. show(scr_pos)
+ task. hide()
-function task: prompt_add()
+function task. prompt_add()
awful.prompt.run({ prompt = "Add task: " },
mypromptbox[mouse.screen].widget,
function (...)
awful.prompt.run({ prompt = "Add task: " },
mypromptbox[mouse.screen].widget,
function (...)
awful.util.getdir("cache") .. "/history_task_add")
end
awful.util.getdir("cache") .. "/history_task_add")
end
-function task: prompt_search()
+function task. prompt_search()
awful.prompt.run({ prompt = "Search task: " },
mypromptbox[mouse.screen].widget,
function (...)
awful.prompt.run({ prompt = "Search task: " },
mypromptbox[mouse.screen].widget,
function (...)
awful.util.getdir("cache") .. "/history_task")
end
awful.util.getdir("cache") .. "/history_task")
end
-function task: attach(widget, args)
+function task. attach(widget, args)
local args = args or {}
task.font_size = tonumber(args.font_size) or 12
local args = args or {}
task.font_size = tonumber(args.font_size) or 12
task.notify_icon = icons_dir .. "/taskwarrior/task.png"
task.notify_icon_small = icons_dir .. "/taskwarrior/tasksmall.png"
task.notify_icon = icons_dir .. "/taskwarrior/task.png"
task.notify_icon_small = icons_dir .. "/taskwarrior/tasksmall.png"
- widget:connect_signal("mouse::enter", function () task: show(task.scr_pos) end)
- widget:connect_signal("mouse::leave", function () task: hide() end)
+ widget:connect_signal("mouse::enter", function () task. show(task.scr_pos) end)
+ widget:connect_signal("mouse::leave", function () task. hide() end)
end
return setmetatable(task, { __call = function(_, ...) return create(...) end })
end
return setmetatable(task, { __call = function(_, ...) return create(...) end })
local fs = {}
local fs_notification = nil
local fs = {}
local fs_notification = nil
if fs_notification ~= nil then
naughty.destroy(fs_notification)
fs_notification = nil
end
end
if fs_notification ~= nil then
naughty.destroy(fs_notification)
fs_notification = nil
end
end
-function fs:show(t_out )
- fs: hide()
+function fs.show(t_out, fs_args )
+ fs. hide()
- local ws = helpers.read_pipe(helpers.scripts_dir .. "dfs"):gsub("\n*$", "")
+ local cmd = (fs_args and string.format("dfs %s", fs_args)) or "dfs"
+ local ws = helpers.read_pipe(helpers.scripts_dir .. cmd):gsub("\n*$", "")
if fs.followmouse then
fs.notification_preset.screen = mouse.screen
if fs.followmouse then
fs.notification_preset.screen = mouse.screen
password = helpers.read_pipe(password):gsub("\n", "")
end
password = helpers.read_pipe(password):gsub("\n", "")
end
maildir.widget = wibox.widget.textbox('')
function update()
maildir.widget = wibox.widget.textbox('')
function update()
- if ext_mail_cmd ~= nil
- then
awful.util.spawn(ext_mail_cmd)
end
awful.util.spawn(ext_mail_cmd)
end
p:close()
newmail = "no mail"
p:close()
newmail = "no mail"
-- Count the total number of mails irrespective of where it was found
total = 0
-- Count the total number of mails irrespective of where it was found
total = 0
- pulsebar.bar:buttons (awful.util.table.join (
- awful.button ({}, 1, function()
+ pulsebar.bar:buttons(awful.util.table.join (
+ awful.button({}, 1, function()
awful.util.spawn(pulsebar.mixer)
end),
awful.util.spawn(pulsebar.mixer)
end),
- awful.button ({}, 2, function()
+ awful.button({}, 2, function()
awful.util.spawn(string.format("pactl set-sink-lolume %d 100%%", pulsebar.sink))
pulsebar.update()
end),
awful.util.spawn(string.format("pactl set-sink-lolume %d 100%%", pulsebar.sink))
pulsebar.update()
end),
- awful.button ({}, 3, function()
+ awful.button({}, 3, function()
awful.util.spawn(string.format("pactl set-sink-mute %d toggle", pulsebar.sink))
pulsebar.update()
end),
awful.util.spawn(string.format("pactl set-sink-mute %d toggle", pulsebar.sink))
pulsebar.update()
end),
- awful.button ({}, 4, function()
+ awful.button({}, 4, function()
awful.util.spawn(string.format("pactl set-sink-volume %d +%s", pulsebar.sink, pulsebar.step))
pulsebar.update()
end),
awful.util.spawn(string.format("pactl set-sink-volume %d +%s", pulsebar.sink, pulsebar.step))
pulsebar.update()
end),
- awful.button ({}, 5, function()
+ awful.button({}, 5, function()
awful.util.spawn(string.format("pactl set-sink-volume %d -%s", pulsebar.sink, pulsebar.step))
pulsebar.update()
end)
awful.util.spawn(string.format("pactl set-sink-volume %d -%s", pulsebar.sink, pulsebar.step))
pulsebar.update()
end)