]> 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:

pulsebar: corrected colors typo; closes #251
authorcopycat-killer <dada@archlinux.info>
Fri, 6 Jan 2017 10:21:19 +0000 (11:21 +0100)
committercopycat-killer <dada@archlinux.info>
Fri, 6 Jan 2017 10:21:19 +0000 (11:21 +0100)
14 files changed:
util/init.lua
util/quake.lua
util/separators.lua
widgets/alsabar.lua
widgets/borderbox.lua [deleted file]
widgets/calendar.lua
widgets/contrib/gpmdp.lua
widgets/contrib/moc.lua
widgets/contrib/task.lua
widgets/imap.lua
widgets/mpd.lua
widgets/pulsebar.lua
widgets/weather.lua
wiki

index 14a1e14a86b988eac61249a144d2259de697402a..9a6d18275ca18e9dd2d6892f5de6dcd83e1e42e4 100644 (file)
@@ -211,13 +211,7 @@ end
 
 -- On the fly useless gaps change
 function util.useless_gaps_resize(thatmuch)
 
 -- On the fly useless gaps change
 function util.useless_gaps_resize(thatmuch)
-    beautiful.useless_gap_width = tonumber(beautiful.useless_gap_width) + 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
+    beautiful.useless_gap = tonumber(beautiful.useless_gap) + thatmuch
     awful.layout.arrange(mouse.screen)
 end
 
     awful.layout.arrange(mouse.screen)
 end
 
index e54b6644a0a7e40680f80395ace14f3cb2d27e93..5020eee662bddad0cf16b1ba818c180a5817b2b3 100644 (file)
@@ -6,15 +6,14 @@
                                                    
 --]]
 
                                                    
 --]]
 
-local awful  = require("awful")
-local capi   = { client = client,
-                 mouse  = mouse,
-                 screen = screen,
-                 timer  = timer or require("gears.timer") }
-local math   = { floor = math.floor }
-local string = string
+local awful        = require("awful")
+local capi         = { client = client,
+                       timer  = require("gears.timer") }
+local math         = { floor  = math.floor }
+local string       = string
 
 local pairs        = pairs
 
 local pairs        = pairs
+local screen       = screen
 local setmetatable = setmetatable
 local tostring     = tostring
 
 local setmetatable = setmetatable
 local tostring     = tostring
 
@@ -65,21 +64,22 @@ function quake:display()
    client.border_width = self.border
    client.size_hints_honor = false
    if self.notexist then
    client.border_width = self.border
    client.size_hints_honor = false
    if self.notexist then
+       self:compute_size()
        client:geometry(self.geometry)
        self.notexist = false
    end
 
    -- Not sticky and on top
        client:geometry(self.geometry)
        self.notexist = false
    end
 
    -- Not sticky and on top
+   client.sticky = false
    client.ontop = true
    client.above = true
    client.skip_taskbar = true
    client.ontop = true
    client.above = true
    client.skip_taskbar = true
-   client.sticky = false
 
    -- Toggle display
    if self.visible then
        client.hidden = false
        client:raise()
 
    -- Toggle display
    if self.visible then
        client.hidden = false
        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)})
        capi.client.focus = client
    else
        client:tags({awful.tag.selected(self.screen)})
        capi.client.focus = client
    else
@@ -94,36 +94,38 @@ function quake:display()
    return client
 end
 
    return client
 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)
    local conf = config or {}
 
 function quake:new(config)
    local conf = config or {}
 
-   conf.app      = conf.app      or "xterm"    -- application to spawn
-   conf.name     = conf.name     or "QuakeDD"  -- window name
-   conf.argname  = conf.argname  or "-name %s" -- how to specify window name
-   conf.extra    = conf.extra    or ""         -- extra arguments
-   conf.visible  = conf.visible  or false      -- initially not visible
-   conf.screen   = conf.screen   or capi.mouse.screen
-   conf.border   = conf.border   or 1
+   conf.app       = conf.app       or "xterm"    -- application to spawn
+   conf.name      = conf.name      or "QuakeDD"  -- window name
+   conf.argname   = conf.argname   or "-name %s" -- how to specify window name
+   conf.extra     = conf.extra     or ""         -- extra arguments
+   conf.visible   = conf.visible   or false      -- initially not visible
+   conf.border    = conf.border    or 1          -- client border width
+   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
-   height       = conf.height       or 0.25     -- height
-   width        = conf.width        or 1        -- width
-   vert         = conf.vert         or "top"    -- top, bottom 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 }
+   conf.height       = conf.height       or 0.25     -- height
+   conf.width        = conf.width        or 1        -- width
+   conf.vert         = conf.vert         or "top"    -- top, bottom or center
+   conf.horiz        = conf.horiz        or "center" -- left, right or center
 
    local console = setmetatable(conf, { __index = quake })
    capi.client.connect_signal("manage", function(c)
 
    local console = setmetatable(conf, { __index = quake })
    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.
    local reattach = capi.timer { timeout = 0 }
    reattach:connect_signal("timeout", function()
    -- "Reattach" currently running quake application. This is in case awesome is restarted.
    local reattach = capi.timer { timeout = 0 }
    reattach:connect_signal("timeout", function()
+       if self.followtag then
+           self.screen = awful.screen.focused()
+       end
        reattach:stop()
        console:display()
    end)
        reattach:stop()
        console:display()
    end)
@@ -149,8 +154,11 @@ function quake:new(config)
 end
 
 function quake:toggle()
 end
 
 function quake:toggle()
-    current_tag = awful.tag.selected(self.screen)
-    if self.last_tag ~= tostring(current_tag) and self.visible then
+    if self.followtag 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())
     else
         self.visible = not self.visible
         awful.client.movetotag(current_tag, self:display())
     else
         self.visible = not self.visible
index 6e5ef96f9be785b53e470090fc438b1f0cff5f2e..af3e3a82b6762b2c107562a1a44c3d97e44ac711 100644 (file)
@@ -15,7 +15,7 @@ local gears     = require("gears")
 -- lain.util.separators
 local separators = {}
 
 -- lain.util.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
 
 -- [[ Arrow
 local width  = beautiful.separators_width or 9
 
 -- [[ Arrow
index 093c461f5ef91675a3bba32f93124dc01b74fb13..5a54829be77b6f33cc15a2400d345576e4ca8ba4 100644 (file)
@@ -16,7 +16,6 @@ local naughty      = require("naughty")
 local wibox        = require("wibox")
 
 local math         = { modf   = math.modf }
 local wibox        = require("wibox")
 
 local math         = { modf   = math.modf }
-local mouse        = mouse
 local string       = { format = string.format,
                        match  = string.match,
                        rep    = string.rep }
 local string       = { format = string.format,
                        match  = string.match,
                        rep    = string.rep }
@@ -43,7 +42,6 @@ local alsabar = {
         font      = beautiful.font:sub(beautiful.font:find(""), beautiful.font:find(" ")),
         font_size = "11",
         color     = beautiful.fg_normal,
         font      = beautiful.font:sub(beautiful.font:find(""), beautiful.font:find(" ")),
         font_size = "11",
         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)
     end
 
         preset.title = string.format("%s - %s%%", alsabar.channel, alsabar._current_level)
     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
-        preset.screen = mouse.screen
+    if alsabar.followtag then
+        preset.screen = awful.screen.focused()
     end
 
     if alsabar._notify ~= nil then
     end
 
     if alsabar._notify ~= nil then
@@ -107,7 +105,7 @@ local function worker(args)
     alsabar.step          = args.step or alsabar.step
     alsabar.colors        = args.colors or alsabar.colors
     alsabar.notifications = args.notifications or alsabar.notifications
     alsabar.step          = args.step or alsabar.step
     alsabar.colors        = args.colors or alsabar.colors
     alsabar.notifications = args.notifications or alsabar.notifications
-    alsabar.followmouse   = args.followmouse or false
+    alsabar.followtag     = args.followtag or false
 
     alsabar.bar = wibox.widget {
         forced_height    = height,
 
     alsabar.bar = wibox.widget {
         forced_height    = height,
diff --git a/widgets/borderbox.lua b/widgets/borderbox.lua
deleted file mode 100644 (file)
index 149b835..0000000
+++ /dev/null
@@ -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 })
index 1728dfc2aad3ebd76bf8c0cfc0c6ce124887256d..76faca493e224d3aa2fa839f7fe85bafd5ab8fb4 100644 (file)
@@ -14,7 +14,6 @@ local naughty      = require("naughty")
 
 local io           = { popen = io.popen }
 local os           = { date = os.date }
 
 local io           = { popen = io.popen }
 local os           = { date = os.date }
-local mouse        = mouse
 local string       = { format = string.format,
                        sub    = string.sub,
                        gsub   = string.gsub }
 local string       = { format = string.format,
                        sub    = string.sub,
                        gsub   = string.gsub }
@@ -47,13 +46,13 @@ function calendar.show(t_out, inc_offset, scr)
     if offs == 0 or calendar.offset == 0
     then -- current month showing, today highlighted
         calendar.offset = 0
     if offs == 0 or calendar.offset == 0
     then -- current month showing, today highlighted
         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
         f = io.popen(calendar.cal_format(today))
     else -- no current month showing, no day to highlight
        local month = tonumber(os.date('%m'))
 
         -- bg and fg inverted to highlight today
         f = io.popen(calendar.cal_format(today))
     else -- no current month showing, no day to highlight
        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>"
     f:close()
 
              .. "</span></tt>"
     f:close()
 
-    if calendar.followmouse then
-        scrp = mouse.screen
+    if calendar.followtag then
+        scrp = awful.screen.focused()
     else
         scrp = scr or calendar.scr_pos
     end
     else
         scrp = scr or calendar.scr_pos
     end
@@ -111,7 +110,7 @@ function calendar.attach(widget, args)
     calendar.bg          = args.bg or beautiful.bg_normal or "#000000"
     calendar.position    = args.position or "top_right"
     calendar.scr_pos     = args.scr_pos or 1
     calendar.bg          = args.bg or beautiful.bg_normal or "#000000"
     calendar.position    = args.position or "top_right"
     calendar.scr_pos     = args.scr_pos or 1
-    calendar.followmouse = args.followmouse or false
+    calendar.followtag   = args.followtag or false
 
     calendar.offset      = 0
     calendar.notify_icon = nil
 
     calendar.offset      = 0
     calendar.notify_icon = nil
index fa514407f61589762fbc03cae64237b7e4dd6f95..ee40a8d108fa6c5f42d21bf6bccd7f596e15edda 100644 (file)
@@ -6,15 +6,18 @@
                                                      
 --]]
 
                                                      
 --]]
 
-local helpers = require("lain.helpers")
-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 helpers      = require("lain.helpers")
+local json         = require("lain.util.dkjson")
 
 
+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
 -- lain.widget.contrib.gpmdp
 
 -- Google Play Music Desktop infos
 -- lain.widget.contrib.gpmdp
@@ -24,7 +27,7 @@ local function worker(args)
     local args          = args or {}
     local timeout       = args.timeout or 2
     local notify        = args.notify or "off"
     local args          = args or {}
     local timeout       = args.timeout or 2
     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
                           os.getenv("HOME") .. "/.config/Google Play Music Desktop Player/json_store/playback.json"
     local settings      = args.settings or function() end
     local file_location = args.file_location or
                           os.getenv("HOME") .. "/.config/Google Play Music Desktop Player/json_store/playback.json"
     local settings      = args.settings or function() end
@@ -39,14 +42,14 @@ local function worker(args)
     helpers.set_map("gpmdp_current", nil)
 
     function gpmdp.update()
     helpers.set_map("gpmdp_current", nil)
 
     function gpmdp.update()
-        file, err = io.open(file_location, "r")
-        if not file
+        local filelines = helpers.lines_from(file_location)
+
+        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)
-            file:close()
-            gpm_now = {}
+            dict, pos, err = json.decode(table.concat(filelines), 1, nil)
+            local gpm_now = {}
             gpm_now.artist    = dict.song.artist
             gpm_now.album     = dict.song.album
             gpm_now.title     = dict.song.title
             gpm_now.artist    = dict.song.artist
             gpm_now.album     = dict.song.album
             gpm_now.title     = dict.song.title
@@ -54,7 +57,7 @@ local function worker(args)
             gpm_now.playing   = dict.playing
         end
 
             gpm_now.playing   = dict.playing
         end
 
-        if (pread("pidof 'Google Play Music Desktop Player'") ~= '') then
+        if pread("pidof 'Google Play Music Desktop Player'") ~= '' then
             gpm_now.running = true
         else
             gpm_now.running = false
             gpm_now.running = true
         else
             gpm_now.running = false
@@ -69,10 +72,10 @@ local function worker(args)
             if notify == "on" and gpm_now.title ~= helpers.get_map("gpmdp_current")
             then
                 helpers.set_map("gpmdp_current", gpm_now.title)
             if notify == "on" and gpm_now.title ~= helpers.get_map("gpmdp_current")
             then
                 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
-                    gpmdp_notification_preset.screen = mouse.screen
+                if followtag then
+                    gpmdp_notification_preset.screen = focused()
                 end
 
                 gpmdp.id = naughty.notify({
                 end
 
                 gpmdp.id = naughty.notify({
index b79dbe2034ae44d071ade51ea9c976c606c4735d..d4571e16711049dade9f72f8eebb0c1e7b6bb45a 100644 (file)
@@ -6,18 +6,19 @@
                                                                   
 --]]
 
                                                                   
 --]]
 
-local helpers = require("lain.helpers")
-local async   = require("lain.asyncshell")
+local helpers  = require("lain.helpers")
+local async    = require("lain.asyncshell")
 
 
+local focused  = require("awful.screen").focused
 local escape_f = require("awful.util").escape
 local naughty  = require("naughty")
 local wibox    = require("wibox")
 
 local escape_f = require("awful.util").escape
 local naughty  = require("naughty")
 local wibox    = require("wibox")
 
-local io     = { popen   = io.popen }
-local os     = { execute = os.execute,
-                 getenv  = os.getenv }
-local string = { format  = string.format,
-                 gmatch  = string.gmatch }
+local io       = { popen   = io.popen }
+local os       = { execute = os.execute,
+                   getenv  = os.getenv }
+local string   = { format  = string.format,
+                   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 cover_size  = args.cover_size or 100
     local default_art = args.default_art or ""
     local music_dir   = args.music_dir or os.getenv("HOME") .. "/Music"
     local cover_size  = args.cover_size or 100
     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 mpdcover = helpers.scripts_dir .. "mpdcover"
     local settings    = args.settings or function() end
 
     local mpdcover = helpers.scripts_dir .. "mpdcover"
@@ -85,8 +86,8 @@ local function worker(args)
                     os.execute(string.format("%s %q %q %d %q", mpdcover, "",
                                moc_now.file, cover_size, default_art))
 
                     os.execute(string.format("%s %q %q %d %q", mpdcover, "",
                                moc_now.file, cover_size, default_art))
 
-                    if followmouse then
-                        moc_notification_preset.screen = mouse.screen
+                    if followtag then
+                        moc_notification_preset.screen = focused()
                     end
 
                     moc.id = naughty.notify({
                     end
 
                     moc.id = naughty.notify({
index fc438d9bfce40fc7534a91765473391657e77197..1b8f119811059cfaa6a6bfde6ce936a84b3291c8 100644 (file)
@@ -42,8 +42,8 @@ function task.show(scr_pos)
 
     local f, c_text, scrp
 
 
     local f, c_text, scrp
 
-    if task.followmouse then
-        scrp = mouse.screen
+    if task.followtag then
+        scrp = awful.screen.focused()
     else
         scrp = scr_pos or task.scr_pos
     end
     else
         scrp = scr_pos or task.scr_pos
     end
@@ -69,7 +69,7 @@ end
 
 function task.prompt_add()
   awful.prompt.run({ prompt = "Add task: " },
 
 function task.prompt_add()
   awful.prompt.run({ prompt = "Add task: " },
-      mypromptbox[mouse.screen].widget,
+      mypromptbox[awful.screen.focused()].widget,
       function (...)
           local f = io.popen("task add " .. ...)
           c_text = "\n<span font='"
       function (...)
           local f = io.popen("task add " .. ...)
           c_text = "\n<span font='"
@@ -94,7 +94,7 @@ end
 
 function task.prompt_search()
   awful.prompt.run({ prompt = "Search task: " },
 
 function task.prompt_search()
   awful.prompt.run({ prompt = "Search task: " },
-      mypromptbox[mouse.screen].widget,
+      mypromptbox[awful.screen.focused()].widget,
       function (...)
           local f = io.popen("task " .. ...)
           c_text = f:read("*all"):gsub(" \n*$", "")
       function (...)
           local f = io.popen("task " .. ...)
           c_text = f:read("*all"):gsub(" \n*$", "")
@@ -119,7 +119,7 @@ function task.prompt_search()
               fg       = task.fg,
               bg       = task.bg,
               timeout  = task.timeout,
               fg       = task.fg,
               bg       = task.bg,
               timeout  = task.timeout,
-              screen   = mouse.screen
+              screen   = awful.screen.focused()
           })
       end,
       nil,
           })
       end,
       nil,
@@ -137,7 +137,7 @@ function task.attach(widget, args)
     task.position    = args.position or "top_right"
     task.timeout     = args.timeout or 7
     task.scr_pos     = args.scr_pos or 1
     task.position    = args.position or "top_right"
     task.timeout     = args.timeout or 7
     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.notify_icon = icons_dir .. "/taskwarrior/task.png"
     task.cmdline     = args.cmdline or "next"
 
     task.notify_icon = icons_dir .. "/taskwarrior/task.png"
index de2f7b454d5493191aca1c3c7d00e6425b9c328d..06b42452da9f20dfe2f10a6fa66a74f108d15656 100644 (file)
@@ -12,7 +12,6 @@ local async        = require("lain.asyncshell")
 local naughty      = require("naughty")
 local wibox        = require("wibox")
 
 local naughty      = require("naughty")
 local wibox        = require("wibox")
 
-local mouse        = mouse
 local string       = { format = string.format,
                        gsub   = string.gsub }
 local tonumber     = tonumber
 local string       = { format = string.format,
                        gsub   = string.gsub }
 local tonumber     = tonumber
@@ -33,7 +32,7 @@ local function worker(args)
     local port        = args.port or 993
     local timeout     = args.timeout or 60
     local is_plain    = args.is_plain or false
     local port        = args.port or 993
     local timeout     = args.timeout or 60
     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 head_command  = "curl --connect-timeout 3 -fsm 3"
     local settings    = args.settings or function() end
 
     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
-            mail_notification_preset.screen = mouse.screen
+        if followtag then
+            mail_notification_preset.screen = awful.screen.focused()
         end
 
         curl = string.format("%s --url imaps://%s:%s/INBOX -u %s:%q %s -k",
         end
 
         curl = string.format("%s --url imaps://%s:%s/INBOX -u %s:%q %s -k",
index c9b3de57d576445400255e2d91da190a59fa5664..5a4e53432a4f11cfd439c7679a88fc19223074e4 100644 (file)
@@ -17,7 +17,6 @@ local wibox        = require("wibox")
 local os           = { execute = os.execute,
                        getenv  = os.getenv }
 local math         = { floor   = math.floor }
 local os           = { execute = os.execute,
                        getenv  = os.getenv }
 local math         = { floor   = math.floor }
-local mouse        = mouse
 local string       = { format  = string.format,
                        match   = string.match,
                        gmatch  = string.gmatch }
 local string       = { format  = string.format,
                        match   = string.match,
                        gmatch  = string.gmatch }
@@ -38,7 +37,7 @@ local function worker(args)
     local cover_size  = args.cover_size or 100
     local default_art = args.default_art or ""
     local notify      = args.notify or "on"
     local cover_size  = args.cover_size or 100
     local default_art = args.default_art or ""
     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 settings    = args.settings or function() end
 
     local echo_cmd    = args.echo_cmd or "echo"
     local settings    = args.settings or function() end
 
@@ -118,8 +117,8 @@ local function worker(args)
                         current_icon = default_art
                     end
 
                         current_icon = default_art
                     end
 
-                    if followmouse then
-                        mpd_notification_preset.screen = mouse.screen
+                    if followtag then
+                        mpd_notification_preset.screen = awful.screen.focused()
                     end
 
                     mpd.id = naughty.notify({
                     end
 
                     mpd.id = naughty.notify({
index c0787c9dc9f8f458bee059290f5adbbc1739c695..6818a5cd6a9924ae924938b40895d8660c562a9c 100644 (file)
@@ -41,9 +41,7 @@ local pulsebar = {
     notifications = {
         font      = beautiful.font:sub(beautiful.font:find(""), beautiful.font:find(" ")),
         font_size = "11",
     notifications = {
         font      = beautiful.font:sub(beautiful.font:find(""), beautiful.font:find(" ")),
         font_size = "11",
-        color     = beautiful.fg_normal,
-        bar_size  = 18,
-        screen    = 1
+        color     = beautiful.fg_normal
     },
 
     _current_level = 0,
     },
 
     _current_level = 0,
@@ -57,7 +55,6 @@ function pulsebar.notify()
         title   = "",
         text    = "",
         timeout = 5,
         title   = "",
         text    = "",
         timeout = 5,
-        screen  = pulsebar.notifications.screen,
         font    = string.format("%s %s", alsabar.notifications.font,
                   alsabar.notifications.font_size),
         fg      = pulsebar.notifications.color
         font    = string.format("%s %s", alsabar.notifications.font,
                   alsabar.notifications.font_size),
         fg      = pulsebar.notifications.color
@@ -70,12 +67,12 @@ function pulsebar.notify()
         preset.title = string.format("%s - %s%%", pulsebar.sink, pulsebar._current_level)
     end
 
         preset.title = string.format("%s - %s%%", pulsebar.sink, pulsebar._current_level)
     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
-        preset.screen = mouse.screen
+    if pulsebar.followtag then
+        preset.screen = awful.screen.focused()
     end
 
     if pulsebar._notify ~= nil then
     end
 
     if pulsebar._notify ~= nil then
@@ -106,7 +103,7 @@ local function worker(args)
     pulsebar.notifications = args.notifications or pulsebar.notifications
     pulsebar.sink          = args.sink or 0
     pulsebar.step          = args.step or pulsebar.step
     pulsebar.notifications = args.notifications or pulsebar.notifications
     pulsebar.sink          = args.sink or 0
     pulsebar.step          = args.step or pulsebar.step
-    pulsebar.followmouse   = args.followmouse or false
+    pulsebar.followtag   = args.followtag or false
 
     pulsebar.bar = wibox.widget {
         forced_height    = height,
 
     pulsebar.bar = wibox.widget {
         forced_height    = height,
@@ -143,11 +140,11 @@ local function worker(args)
             then
                 pulsebar._muted = true
                 pulsebar.tooltip:set_text ("[Muted]")
             then
                 pulsebar._muted = true
                 pulsebar.tooltip:set_text ("[Muted]")
-                pulsebar.bar.color(pulsebar.colors.mute)
+                pulsebar.bar.color = pulsebar.colors.mute
             else
                 pulsebar._muted = false
                 pulsebar.tooltip:set_text(string.format("%s: %s", pulsebar.sink, volu))
             else
                 pulsebar._muted = false
                 pulsebar.tooltip:set_text(string.format("%s: %s", pulsebar.sink, volu))
-                pulsebar.bar.color(pulsebar.colors.unmute)
+                pulsebar.bar.color = pulsebar.colors.unmute
             end
             settings()
         end
             end
             settings()
         end
index 545e6d1a3c6ca6e7a6867150689f45c4e62100f9..015f43a56fdc665bb1bb33ac91b89ce76b880419 100644 (file)
@@ -13,6 +13,7 @@ local async        = require("lain.asyncshell")
 local json         = require("lain.util").dkjson
 local lain_icons   = require("lain.helpers").icons_dir
 
 local json         = require("lain.util").dkjson
 local lain_icons   = require("lain.helpers").icons_dir
 
+local focused      = require("awful.screen").focused
 local naughty      = require("naughty")
 local wibox        = require("wibox")
 
 local naughty      = require("naughty")
 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)
                                   end
     local weather_na_markup     = args.weather_na_markup or " N/A "
                                       return string.format("<b>%s</b>: %s, %d - %d ", day, desc, tmin, tmax)
                                   end
     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
 
     weather.widget    = wibox.widget.textbox(weather_na_markup)
     local settings              = args.settings or function() end
 
     weather.widget    = wibox.widget.textbox(weather_na_markup)
@@ -70,8 +71,8 @@ local function worker(args)
     function weather.show(t_out)
         weather.hide()
 
     function weather.show(t_out)
         weather.hide()
 
-        if followmouse then
-            notification_preset.screen = mouse.screen
+        if followtag then
+            notification_preset.screen = focused()
         end
 
         if not weather.notification_text then
         end
 
         if not weather.notification_text then
diff --git a/wiki b/wiki
index bc5582fb3d3d7bf54f2848e9b58aa01c9c33d79e..6e439e9a28174909c4ab0dd23eaf93785cc170e7 160000 (submodule)
--- a/wiki
+++ b/wiki
@@ -1 +1 @@
-Subproject commit bc5582fb3d3d7bf54f2848e9b58aa01c9c33d79e
+Subproject commit 6e439e9a28174909c4ab0dd23eaf93785cc170e7