commit f25e579fed85cbb3c4a532a09a0b60230a69b092 Author: sqozz Date: Wed Jan 14 19:51:01 2015 +0100 initial commit diff --git a/awesome/eminent/init.lua b/awesome/eminent/init.lua new file mode 100644 index 0000000..0b45a30 --- /dev/null +++ b/awesome/eminent/init.lua @@ -0,0 +1,57 @@ +------------------------------------------ +-- Effortless wmii-style dynamic tagging. +------------------------------------------ +-- Lucas de Vries +-- Licensed under the WTFPL version 2 +-- * http://sam.zoy.org/wtfpl/COPYING +----------------------------------------- +-- Cut version +----------------------------------------- + +-- Grab environment +local ipairs = ipairs +local awful = require("awful") +local table = table +local capi = { + screen = screen, +} + +-- Eminent: Effortless wmii-style dynamic tagging +module("eminent") + +-- Grab the original functions we're replacing +local deflayout = nil +local orig = { + new = awful.tag.new, + taglist = awful.widget.taglist.new, + filter = awful.widget.taglist.filter.all, +} + +-- Return tags with stuff on them, mark others hidden +function gettags(screen) + local tags = {} + + for k, t in ipairs(capi.screen[screen]:tags()) do + if t.selected or #t:clients() > 0 then + awful.tag.setproperty(t, "hide", false) + table.insert(tags, t) + else + awful.tag.setproperty(t, "hide", true) + end + end + + return tags +end + +-- Pre-create tags +awful.tag.new = function (names, screen, layout) + deflayout = layout and layout[1] or layout + return orig.new(names, screen, layout) +end + +-- Taglist label functions +awful.widget.taglist.filter.all = function (t, args) + if t.selected or #t:clients() > 0 then + return orig.filter(t, args) + end +end diff --git a/awesome/lain/.gitmodules b/awesome/lain/.gitmodules new file mode 100644 index 0000000..350c0f8 --- /dev/null +++ b/awesome/lain/.gitmodules @@ -0,0 +1,3 @@ +[submodule "wiki"] + path = wiki + url = https://github.com/copycat-killer/lain.wiki.git diff --git a/awesome/lain/README.rst b/awesome/lain/README.rst new file mode 100644 index 0000000..a06b64e --- /dev/null +++ b/awesome/lain/README.rst @@ -0,0 +1,47 @@ +Lain +==== + +-------------------------------------------------- +Layouts, widgets and utilities for Awesome WM 3.5+ +-------------------------------------------------- + +:Author: Luke Bonham +:Version: git +:License: GNU-GPLv2_ +:Source: https://github.com/copycat-killer/lain + +Description +----------- + +Successor of awesome-vain_, this module provides new layouts, a set of widgets and utility functions, in order to improve Awesome_ usability and configurability. + +Read the wiki_ for all the info. + +Contributions +------------- + +Any contribution is welcome! Feel free to make a pull request. + +Just make sure that: + +- Your code fits with the general style of the module. In particular, you should use the same indentation pattern that the code uses, and also avoid adding space at the ends of lines. + +- Your code its easy to understand, maintainable, and modularized. You should also avoid code duplication wherever possible by adding functions or using ``lain.helpers``. If something is unclear, and you can't write it in such a way that it will be clear, explain it with a comment. + +- You test your changes before submitting to make sure that not only your code works, but did not break other parts of the module too! + +- You eventually update ``wiki`` submodule with a thorough section. + +Contributed widgets have to be put in ``lain/widgets/contrib``. + +Screenshots +----------- + +.. image:: http://i.imgur.com/8D9A7lW.png +.. image:: http://i.imgur.com/9Iv3OR3.png +.. image:: http://i.imgur.com/STCPcaJ.png + +.. _GNU-GPLv2: http://www.gnu.org/licenses/gpl-2.0.html +.. _awesome-vain: https://github.com/vain/awesome-vain +.. _Awesome: http://awesome.naquadah.org/ +.. _wiki: https://github.com/copycat-killer/lain/wiki diff --git a/awesome/lain/asyncshell.lua b/awesome/lain/asyncshell.lua new file mode 100644 index 0000000..4a01caa --- /dev/null +++ b/awesome/lain/asyncshell.lua @@ -0,0 +1,82 @@ + +--[[ + + Licensed under GNU General Public License v2 + * (c) 2013, Alexander Yakushev + +--]] + +-- Asynchronous io.popen for Awesome WM. +-- How to use... +-- ...asynchronously: +-- asyncshell.request('wscript -Kiev', function(f) wwidget.text = f:read("*l") end) +-- ...synchronously +-- widget:set_text(asyncshell.demand('wscript -Kiev', 5):read("*l") or "Error") + +-- This is more cpu demanding, but makes things faster. + +local spawn = require('awful.util').spawn + +asyncshell = {} +asyncshell.request_table = {} +asyncshell.id_counter = 0 +asyncshell.folder = "/tmp/asyncshell" +asyncshell.file_template = asyncshell.folder .. '/req' + +-- Create a directory for asynchell response files +os.execute("mkdir -p " .. asyncshell.folder) + +-- Returns next tag - unique identifier of the request +local function next_id() + asyncshell.id_counter = (asyncshell.id_counter + 1) % 100000 + return asyncshell.id_counter +end + +-- Sends an asynchronous request for an output of the shell command. +-- @param command Command to be executed and taken output from +-- @param callback Function to be called when the command finishes +-- @return Request ID +function asyncshell.request(command, callback) + local id = next_id() + local tmpfname = asyncshell.file_template .. id + asyncshell.request_table[id] = { callback = callback } + local req = + string.format("sh -c '%s > %s; " .. + 'echo "asyncshell.deliver(%s)" | ' .. + "awesome-client' 2> /dev/null", + string.gsub(command, "'", "'\\''"), tmpfname, + id, tmpfname) + spawn(req, false) + return id +end + +-- Calls the remembered callback function on the output of the shell +-- command. +-- @param id Request ID +-- @param output The output file of the shell command to be delievered +function asyncshell.deliver(id) + if asyncshell.request_table[id] and + asyncshell.request_table[id].callback then + local output = io.open(asyncshell.file_template .. id, 'r') + asyncshell.request_table[id].callback(output) + end +end + +-- Sends a synchronous request for an output of the command. Waits for +-- the output, but if the given timeout expires returns nil. +-- @param command Command to be executed and taken output from +-- @param timeout Maximum amount of time to wait for the result +-- @return File handler on success, nil otherwise +function asyncshell.demand(command, timeout) + local id = next_id() + local tmpfname = asyncshell.file_template .. id + local f = io.popen(string.format("(%s > %s; echo asyncshell_done) & " .. + "(sleep %s; echo asynchell_timeout)", + command, tmpfname, timeout)) + local result = f:read("*line") + if result == "asyncshell_done" then + return io.open(tmpfname) + end +end + +return asyncshell diff --git a/awesome/lain/helpers.lua b/awesome/lain/helpers.lua new file mode 100644 index 0000000..1dfb09b --- /dev/null +++ b/awesome/lain/helpers.lua @@ -0,0 +1,103 @@ + +--[[ + + Licensed under GNU General Public License v2 + * (c) 2013, Luke Bonham + +--]] + +local debug = require("debug") + +local capi = { timer = timer } +local io = { open = io.open, + lines = io.lines } +local rawget = rawget + +-- Lain helper functions for internal use +-- lain.helpers +local helpers = {} + +helpers.lain_dir = debug.getinfo(1, 'S').source:match[[^@(.*/).*$]] +helpers.icons_dir = helpers.lain_dir .. 'icons/' +helpers.scripts_dir = helpers.lain_dir .. 'scripts/' + +-- {{{ Modules loader + +function helpers.wrequire(table, key) + local module = rawget(table, key) + return module or require(table._NAME .. '.' .. key) +end + +-- }}} + +-- {{{ File operations + +-- see if the file exists and is readable +function helpers.file_exists(file) + local f = io.open(file) + if f then + local s = f:read() + f:close() + f = s + end + return f ~= nil +end + +-- get all lines from a file, returns an empty +-- list/table if the file does not exist +function helpers.lines_from(file) + if not helpers.file_exists(file) then return {} end + lines = {} + for line in io.lines(file) do + lines[#lines + 1] = line + end + return lines +end + +-- get first line of a file, return nil if +-- the file does not exist +function helpers.first_line(file) + return helpers.lines_from(file)[1] +end + +-- get first non empty line from a file, +-- returns nil otherwise +function helpers.first_nonempty_line(file) + for k,v in pairs(helpers.lines_from(file)) do + if #v then return v end + end + return nil +end + +-- }}} + +-- {{{ Timer maker + +helpers.timer_table = {} + +function helpers.newtimer(name, timeout, fun, nostart) + helpers.timer_table[name] = capi.timer({ timeout = timeout }) + helpers.timer_table[name]:connect_signal("timeout", fun) + helpers.timer_table[name]:start() + if not nostart then + helpers.timer_table[name]:emit_signal("timeout") + end +end + +-- }}} + +-- {{{ A map utility + +helpers.map_table = {} + +function helpers.set_map(element, value) + helpers.map_table[element] = value +end + +function helpers.get_map(element) + return helpers.map_table[element] +end + +-- }}} + +return helpers diff --git a/awesome/lain/icons/cal/white/1.png b/awesome/lain/icons/cal/white/1.png new file mode 100644 index 0000000..90b696c Binary files /dev/null and b/awesome/lain/icons/cal/white/1.png differ diff --git a/awesome/lain/icons/cal/white/10.png b/awesome/lain/icons/cal/white/10.png new file mode 100644 index 0000000..b462ffb Binary files /dev/null and b/awesome/lain/icons/cal/white/10.png differ diff --git a/awesome/lain/icons/cal/white/11.png b/awesome/lain/icons/cal/white/11.png new file mode 100644 index 0000000..cf43296 Binary files /dev/null and b/awesome/lain/icons/cal/white/11.png differ diff --git a/awesome/lain/icons/cal/white/12.png b/awesome/lain/icons/cal/white/12.png new file mode 100644 index 0000000..42cf092 Binary files /dev/null and b/awesome/lain/icons/cal/white/12.png differ diff --git a/awesome/lain/icons/cal/white/13.png b/awesome/lain/icons/cal/white/13.png new file mode 100644 index 0000000..37db670 Binary files /dev/null and b/awesome/lain/icons/cal/white/13.png differ diff --git a/awesome/lain/icons/cal/white/14.png b/awesome/lain/icons/cal/white/14.png new file mode 100644 index 0000000..0188504 Binary files /dev/null and b/awesome/lain/icons/cal/white/14.png differ diff --git a/awesome/lain/icons/cal/white/15.png b/awesome/lain/icons/cal/white/15.png new file mode 100644 index 0000000..64418a6 Binary files /dev/null and b/awesome/lain/icons/cal/white/15.png differ diff --git a/awesome/lain/icons/cal/white/16.png b/awesome/lain/icons/cal/white/16.png new file mode 100644 index 0000000..8b86700 Binary files /dev/null and b/awesome/lain/icons/cal/white/16.png differ diff --git a/awesome/lain/icons/cal/white/17.png b/awesome/lain/icons/cal/white/17.png new file mode 100644 index 0000000..033b5ff Binary files /dev/null and b/awesome/lain/icons/cal/white/17.png differ diff --git a/awesome/lain/icons/cal/white/18.png b/awesome/lain/icons/cal/white/18.png new file mode 100644 index 0000000..817c426 Binary files /dev/null and b/awesome/lain/icons/cal/white/18.png differ diff --git a/awesome/lain/icons/cal/white/19.png b/awesome/lain/icons/cal/white/19.png new file mode 100644 index 0000000..0e6dafc Binary files /dev/null and b/awesome/lain/icons/cal/white/19.png differ diff --git a/awesome/lain/icons/cal/white/2.png b/awesome/lain/icons/cal/white/2.png new file mode 100644 index 0000000..b93789a Binary files /dev/null and b/awesome/lain/icons/cal/white/2.png differ diff --git a/awesome/lain/icons/cal/white/20.png b/awesome/lain/icons/cal/white/20.png new file mode 100644 index 0000000..3d8d7c6 Binary files /dev/null and b/awesome/lain/icons/cal/white/20.png differ diff --git a/awesome/lain/icons/cal/white/21.png b/awesome/lain/icons/cal/white/21.png new file mode 100644 index 0000000..79a74f3 Binary files /dev/null and b/awesome/lain/icons/cal/white/21.png differ diff --git a/awesome/lain/icons/cal/white/22.png b/awesome/lain/icons/cal/white/22.png new file mode 100644 index 0000000..e8845ce Binary files /dev/null and b/awesome/lain/icons/cal/white/22.png differ diff --git a/awesome/lain/icons/cal/white/23.png b/awesome/lain/icons/cal/white/23.png new file mode 100644 index 0000000..a8d4dfb Binary files /dev/null and b/awesome/lain/icons/cal/white/23.png differ diff --git a/awesome/lain/icons/cal/white/24.png b/awesome/lain/icons/cal/white/24.png new file mode 100644 index 0000000..1a3b38a Binary files /dev/null and b/awesome/lain/icons/cal/white/24.png differ diff --git a/awesome/lain/icons/cal/white/25.png b/awesome/lain/icons/cal/white/25.png new file mode 100644 index 0000000..c3621b7 Binary files /dev/null and b/awesome/lain/icons/cal/white/25.png differ diff --git a/awesome/lain/icons/cal/white/26.png b/awesome/lain/icons/cal/white/26.png new file mode 100644 index 0000000..f26731b Binary files /dev/null and b/awesome/lain/icons/cal/white/26.png differ diff --git a/awesome/lain/icons/cal/white/27.png b/awesome/lain/icons/cal/white/27.png new file mode 100644 index 0000000..e4dde77 Binary files /dev/null and b/awesome/lain/icons/cal/white/27.png differ diff --git a/awesome/lain/icons/cal/white/28.png b/awesome/lain/icons/cal/white/28.png new file mode 100644 index 0000000..b924c22 Binary files /dev/null and b/awesome/lain/icons/cal/white/28.png differ diff --git a/awesome/lain/icons/cal/white/29.png b/awesome/lain/icons/cal/white/29.png new file mode 100644 index 0000000..e9a74f8 Binary files /dev/null and b/awesome/lain/icons/cal/white/29.png differ diff --git a/awesome/lain/icons/cal/white/3.png b/awesome/lain/icons/cal/white/3.png new file mode 100644 index 0000000..1124271 Binary files /dev/null and b/awesome/lain/icons/cal/white/3.png differ diff --git a/awesome/lain/icons/cal/white/30.png b/awesome/lain/icons/cal/white/30.png new file mode 100644 index 0000000..8147d78 Binary files /dev/null and b/awesome/lain/icons/cal/white/30.png differ diff --git a/awesome/lain/icons/cal/white/31.png b/awesome/lain/icons/cal/white/31.png new file mode 100644 index 0000000..a1be3e8 Binary files /dev/null and b/awesome/lain/icons/cal/white/31.png differ diff --git a/awesome/lain/icons/cal/white/4.png b/awesome/lain/icons/cal/white/4.png new file mode 100644 index 0000000..16713bc Binary files /dev/null and b/awesome/lain/icons/cal/white/4.png differ diff --git a/awesome/lain/icons/cal/white/5.png b/awesome/lain/icons/cal/white/5.png new file mode 100644 index 0000000..466aa71 Binary files /dev/null and b/awesome/lain/icons/cal/white/5.png differ diff --git a/awesome/lain/icons/cal/white/6.png b/awesome/lain/icons/cal/white/6.png new file mode 100644 index 0000000..a1c9798 Binary files /dev/null and b/awesome/lain/icons/cal/white/6.png differ diff --git a/awesome/lain/icons/cal/white/7.png b/awesome/lain/icons/cal/white/7.png new file mode 100644 index 0000000..e971951 Binary files /dev/null and b/awesome/lain/icons/cal/white/7.png differ diff --git a/awesome/lain/icons/cal/white/8.png b/awesome/lain/icons/cal/white/8.png new file mode 100644 index 0000000..909b726 Binary files /dev/null and b/awesome/lain/icons/cal/white/8.png differ diff --git a/awesome/lain/icons/cal/white/9.png b/awesome/lain/icons/cal/white/9.png new file mode 100644 index 0000000..dc636c4 Binary files /dev/null and b/awesome/lain/icons/cal/white/9.png differ diff --git a/awesome/lain/icons/layout/default/cascade.png b/awesome/lain/icons/layout/default/cascade.png new file mode 100644 index 0000000..292a057 Binary files /dev/null and b/awesome/lain/icons/layout/default/cascade.png differ diff --git a/awesome/lain/icons/layout/default/cascadebrowse.png b/awesome/lain/icons/layout/default/cascadebrowse.png new file mode 100644 index 0000000..2f12ada Binary files /dev/null and b/awesome/lain/icons/layout/default/cascadebrowse.png differ diff --git a/awesome/lain/icons/layout/default/cascadebrowsew.png b/awesome/lain/icons/layout/default/cascadebrowsew.png new file mode 100644 index 0000000..c46b48b Binary files /dev/null and b/awesome/lain/icons/layout/default/cascadebrowsew.png differ diff --git a/awesome/lain/icons/layout/default/cascadew.png b/awesome/lain/icons/layout/default/cascadew.png new file mode 100644 index 0000000..da64bd6 Binary files /dev/null and b/awesome/lain/icons/layout/default/cascadew.png differ diff --git a/awesome/lain/icons/layout/default/centerfair.png b/awesome/lain/icons/layout/default/centerfair.png new file mode 100644 index 0000000..188c243 Binary files /dev/null and b/awesome/lain/icons/layout/default/centerfair.png differ diff --git a/awesome/lain/icons/layout/default/centerfairw.png b/awesome/lain/icons/layout/default/centerfairw.png new file mode 100644 index 0000000..ed4bcf5 Binary files /dev/null and b/awesome/lain/icons/layout/default/centerfairw.png differ diff --git a/awesome/lain/icons/layout/default/centerwork.png b/awesome/lain/icons/layout/default/centerwork.png new file mode 100644 index 0000000..826b331 Binary files /dev/null and b/awesome/lain/icons/layout/default/centerwork.png differ diff --git a/awesome/lain/icons/layout/default/centerworkw.png b/awesome/lain/icons/layout/default/centerworkw.png new file mode 100644 index 0000000..fcfa7e3 Binary files /dev/null and b/awesome/lain/icons/layout/default/centerworkw.png differ diff --git a/awesome/lain/icons/layout/default/termfair.png b/awesome/lain/icons/layout/default/termfair.png new file mode 100644 index 0000000..06226c1 Binary files /dev/null and b/awesome/lain/icons/layout/default/termfair.png differ diff --git a/awesome/lain/icons/layout/default/termfairw.png b/awesome/lain/icons/layout/default/termfairw.png new file mode 100644 index 0000000..0a8b576 Binary files /dev/null and b/awesome/lain/icons/layout/default/termfairw.png differ diff --git a/awesome/lain/icons/layout/zenburn/cascade.png b/awesome/lain/icons/layout/zenburn/cascade.png new file mode 100644 index 0000000..532842d Binary files /dev/null and b/awesome/lain/icons/layout/zenburn/cascade.png differ diff --git a/awesome/lain/icons/layout/zenburn/cascadebrowse.png b/awesome/lain/icons/layout/zenburn/cascadebrowse.png new file mode 100644 index 0000000..87be658 Binary files /dev/null and b/awesome/lain/icons/layout/zenburn/cascadebrowse.png differ diff --git a/awesome/lain/icons/layout/zenburn/centerfair.png b/awesome/lain/icons/layout/zenburn/centerfair.png new file mode 100644 index 0000000..01cda8e Binary files /dev/null and b/awesome/lain/icons/layout/zenburn/centerfair.png differ diff --git a/awesome/lain/icons/layout/zenburn/centerwork.png b/awesome/lain/icons/layout/zenburn/centerwork.png new file mode 100644 index 0000000..6a2cecc Binary files /dev/null and b/awesome/lain/icons/layout/zenburn/centerwork.png differ diff --git a/awesome/lain/icons/layout/zenburn/termfair.png b/awesome/lain/icons/layout/zenburn/termfair.png new file mode 100644 index 0000000..b7d5880 Binary files /dev/null and b/awesome/lain/icons/layout/zenburn/termfair.png differ diff --git a/awesome/lain/icons/mail.png b/awesome/lain/icons/mail.png new file mode 100644 index 0000000..60ba6e0 Binary files /dev/null and b/awesome/lain/icons/mail.png differ diff --git a/awesome/lain/icons/no_net.png b/awesome/lain/icons/no_net.png new file mode 100755 index 0000000..1a3e8a8 Binary files /dev/null and b/awesome/lain/icons/no_net.png differ diff --git a/awesome/lain/icons/redshift/redshift_off.png b/awesome/lain/icons/redshift/redshift_off.png new file mode 100644 index 0000000..a92200f Binary files /dev/null and b/awesome/lain/icons/redshift/redshift_off.png differ diff --git a/awesome/lain/icons/redshift/redshift_on.png b/awesome/lain/icons/redshift/redshift_on.png new file mode 100644 index 0000000..205e0a7 Binary files /dev/null and b/awesome/lain/icons/redshift/redshift_on.png differ diff --git a/awesome/lain/icons/taskwarrior/task.png b/awesome/lain/icons/taskwarrior/task.png new file mode 100644 index 0000000..859ca29 Binary files /dev/null and b/awesome/lain/icons/taskwarrior/task.png differ diff --git a/awesome/lain/icons/taskwarrior/tasksmall.png b/awesome/lain/icons/taskwarrior/tasksmall.png new file mode 100755 index 0000000..2de6946 Binary files /dev/null and b/awesome/lain/icons/taskwarrior/tasksmall.png differ diff --git a/awesome/lain/init.lua b/awesome/lain/init.lua new file mode 100644 index 0000000..5086435 --- /dev/null +++ b/awesome/lain/init.lua @@ -0,0 +1,21 @@ + +--[[ + + Lain + Layouts, widgets and utilities for Awesome WM + + Licensed under GNU General Public License v2 + * (c) 2013, Luke Bonham + +--]] + +package.loaded.lain = nil + +local lain = +{ + layout = require("lain.layout"), + util = require("lain.util"), + widgets = require("lain.widgets") +} + +return lain diff --git a/awesome/lain/layout/cascade.lua b/awesome/lain/layout/cascade.lua new file mode 100644 index 0000000..999c599 --- /dev/null +++ b/awesome/lain/layout/cascade.lua @@ -0,0 +1,80 @@ + +--[[ + + Licensed under GNU General Public License v2 + * (c) 2014, projektile + * (c) 2013, Luke Bonham + * (c) 2010-2012, Peter Hofmann + +--]] + +local tag = require("awful.tag") +local beautiful = require("beautiful") + +local cascade = +{ + name = "cascade", + nmaster = 0, + offset_x = 32, + offset_y = 8 +} + +function cascade.arrange(p) + + -- Cascade windows. + + -- A global border can be defined with + -- beautiful.global_border_width. + local global_border = tonumber(beautiful.global_border_width) or 0 + if global_border < 0 then global_border = 0 end + + -- Themes border width requires an offset. + local bw = tonumber(beautiful.border_width) or 0 + + -- Screen. + local wa = p.workarea + local cls = p.clients + + wa.height = wa.height - ((global_border * 2) + (bw * 2)) + wa.width = wa.width - ((global_border * 2) + (bw * 2)) + wa.x = wa.x + global_border + wa.y = wa.y + global_border + + -- Opening a new window will usually force all existing windows to + -- get resized. This wastes a lot of CPU time. So let's set a lower + -- bound to "how_many": This wastes a little screen space but you'll + -- get a much better user experience. + local t = tag.selected(p.screen) + local num_c + if cascade.nmaster > 0 + then + num_c = cascade.nmaster + else + num_c = tag.getnmaster(t) + end + + local how_many = #cls + if how_many < num_c + then + how_many = num_c + end + + local current_offset_x = cascade.offset_x * (how_many - 1) + local current_offset_y = cascade.offset_y * (how_many - 1) + + -- Iterate. + for i = 1,#cls,1 + do + local c = cls[i] + local g = {} + + g.x = wa.x + (how_many - i) * cascade.offset_x + g.y = wa.y + (i - 1) * cascade.offset_y + g.width = wa.width - current_offset_x + g.height = wa.height - current_offset_y + + c:geometry(g) + end +end + +return cascade diff --git a/awesome/lain/layout/cascadetile.lua b/awesome/lain/layout/cascadetile.lua new file mode 100644 index 0000000..e9b9425 --- /dev/null +++ b/awesome/lain/layout/cascadetile.lua @@ -0,0 +1,167 @@ + +--[[ + + Licensed under GNU General Public License v2 + * (c) 2014, projektile + * (c) 2013, Luke Bonham + * (c) 2010-2012, Peter Hofmann + +--]] + +local tag = require("awful.tag") +local beautiful = require("beautiful") +local tonumber = tonumber + +local cascadetile = +{ + name = "cascadetile", + nmaster = 0, + ncol = 0, + mwfact = 0, + offset_x = 5, + offset_y = 32, + extra_padding = 0 +} + +function cascadetile.arrange(p) + + -- Layout with one fixed column meant for a master window. Its + -- width is calculated according to mwfact. Other clients are + -- cascaded or "tabbed" in a slave column on the right. + + -- It's a bit hard to demonstrate the behaviour with ASCII-images... + -- + -- (1) (2) (3) (4) + -- +----------+---+ +----------+---+ +----------+---+ +----------+---+ + -- | | | | | 3 | | | 4 | | +---+| + -- | | | -> | | | -> | +---++ -> | +---+|+ + -- | 1 | 2 | | 1 +---++ | 1 | 3 || | 1 +---+|+| + -- | | | | | 2 || | +---++| | +---+|+ | + -- | | | | | || | | 2 | | | | 2 |+ | + -- +----------+---+ +---------+---++ +--------+---+-+ +------+---+---+ + + -- A useless gap (like the dwm patch) can be defined with + -- beautiful.useless_gap_width. + local useless_gap = tonumber(beautiful.useless_gap_width) or 0 + if useless_gap < 0 then useless_gap = 0 end + + -- A global border can be defined with + -- beautiful.global_border_width + local global_border = tonumber(beautiful.global_border_width) or 0 + if global_border < 0 then global_border = 0 end + + -- Themes border width requires an offset + local bw = tonumber(beautiful.border_width) or 0 + + -- Screen. + local wa = p.workarea + local cls = p.clients + + -- Borders are factored in. + wa.height = wa.height - ((global_border * 2) + (bw * 2)) + wa.width = wa.width - ((global_border * 2) + (bw * 2)) + + -- Width of main column? + local t = tag.selected(p.screen) + local mwfact + if cascadetile.mwfact > 0 + then + mwfact = cascadetile.mwfact + else + mwfact = tag.getmwfact(t) + end + + -- Make slave windows overlap main window? Do this if ncol is 1. + local overlap_main + if cascadetile.ncol > 0 + then + overlap_main = cascadetile.ncol + else + overlap_main = tag.getncol(t) + end + + -- Minimum space for slave windows? See cascade.lua. + local num_c + if cascadetile.nmaster > 0 + then + num_c = cascadetile.nmaster + else + num_c = tag.getnmaster(t) + end + + local how_many = #cls - 1 + if how_many < num_c + then + how_many = num_c + end + local current_offset_x = cascadetile.offset_x * (how_many - 1) + local current_offset_y = cascadetile.offset_y * (how_many - 1) + + if #cls > 0 + then + -- Main column, fixed width and height. + local c = cls[#cls] + local g = {} + local mainwid = wa.width * mwfact + local slavewid = wa.width - mainwid + + if overlap_main == 1 + then + g.width = wa.width + + -- The size of the main window may be reduced a little bit. + -- This allows you to see if there are any windows below the + -- main window. + -- This only makes sense, though, if the main window is + -- overlapping everything else. + g.width = g.width - cascadetile.extra_padding + else + g.width = mainwid + end + + g.height = wa.height + g.x = wa.x + global_border + g.y = wa.y + global_border + if useless_gap > 0 + then + -- Reduce width once and move window to the right. Reduce + -- height twice, however. + g.width = g.width - useless_gap + g.height = g.height - 2 * useless_gap + g.x = g.x + useless_gap + g.y = g.y + useless_gap + + -- When there's no window to the right, add an additional + -- gap. + if overlap_main == 1 + then + g.width = g.width - useless_gap + end + end + c:geometry(g) + + -- Remaining clients stacked in slave column, new ones on top. + if #cls > 1 + then + for i = (#cls - 1),1,-1 + do + c = cls[i] + g = {} + g.width = slavewid - current_offset_x + g.height = wa.height - current_offset_y + g.x = wa.x + mainwid + (how_many - i) * cascadetile.offset_x + g.y = wa.y + (i - 1) * cascadetile.offset_y + global_border + if useless_gap > 0 + then + g.width = g.width - 2 * useless_gap + g.height = g.height - 2 * useless_gap + g.x = g.x + useless_gap + g.y = g.y + useless_gap + end + c:geometry(g) + end + end + end +end + +return cascadetile diff --git a/awesome/lain/layout/centerfair.lua b/awesome/lain/layout/centerfair.lua new file mode 100644 index 0000000..67462f7 --- /dev/null +++ b/awesome/lain/layout/centerfair.lua @@ -0,0 +1,163 @@ + +--[[ + + Licensed under GNU General Public License v2 + * (c) 2014, projektile + * (c) 2013, Luke Bonham + * (c) 2010, Nicolas Estibals + * (c) 2010-2012, Peter Hofmann + +--]] + +local tag = require("awful.tag") +local beautiful = require("beautiful") +local math = { ceil = math.ceil, + floor = math.floor, + max = math.max } +local tonumber = tonumber + +local centerfair = { name = "centerfair" } + +function centerfair.arrange(p) + -- Layout with fixed number of vertical columns (read from nmaster). + -- Cols are centerded until there is nmaster columns, then windows + -- are stacked in the slave columns, with at most ncol clients per + -- column if possible. + + -- with nmaster=3 and ncol=1 you'll have + -- (1) (2) (3) + -- +---+---+---+ +-+---+---+-+ +---+---+---+ + -- | | | | | | | | | | | | | + -- | | 1 | | -> | | 1 | 2 | | -> | 1 | 2 | 3 | -> + -- | | | | | | | | | | | | | + -- +---+---+---+ +-+---+---+-+ +---+---+---+ + + -- (4) (5) + -- +---+---+---+ +---+---+---+ + -- | | | 3 | | | 2 | 4 | + -- + 1 + 2 +---+ -> + 1 +---+---+ + -- | | | 4 | | | 3 | 5 | + -- +---+---+---+ +---+---+---+ + + -- A useless gap (like the dwm patch) can be defined with + -- beautiful.useless_gap_width . + local useless_gap = tonumber(beautiful.useless_gap_width) or 0 + if useless_gap < 0 then useless_gap = 0 end + + -- A global border can be defined with + -- beautiful.global_border_width + local global_border = tonumber(beautiful.global_border_width) or 0 + if global_border < 0 then global_border = 0 end + + -- Themes border width requires an offset + local bw = tonumber(beautiful.border_width) or 0 + + -- Screen. + local wa = p.workarea + local cls = p.clients + + -- Borders are factored in. + wa.height = wa.height - ((global_border * 2) + (bw * 2)) + wa.width = wa.width - ((global_border * 2) + (bw * 2)) + + -- How many vertical columns? Read from nmaster on the tag. + local t = tag.selected(p.screen) + local num_x = centerfair.nmaster or tag.getnmaster(t) + local ncol = centerfair.ncol or tag.getncol(t) + if num_x <= 2 then num_x = 2 end + + local width = math.floor((wa.width-(num_x+1)*useless_gap) / num_x) + + local offset_y = wa.y + useless_gap + if #cls < num_x + then + -- Less clients than the number of columns, let's center it! + local offset_x = wa.x + useless_gap + (wa.width - #cls*width - (#cls+1)*useless_gap) / 2 + local g = {} + g.width = width + g.height = wa.height - 2*useless_gap - 2 + g.y = offset_y + global_border + for i = 1, #cls do + g.x = offset_x + (#cls - i) * (width + useless_gap + 2) + global_border + cls[i]:geometry(g) + end + else + -- More clients than the number of columns, let's arrange it! + local offset_x = wa.x + if useless_gap > 0 then + offset_x = offset_x + end + + -- Master client deserves a special treatement + local g = {} + g.width = wa.width - (num_x - 1) * width - num_x * 2*useless_gap - 2 + g.height = wa.height - 2*useless_gap - 2 + g.x = offset_x + useless_gap + global_border + g.y = offset_y + global_border + + cls[#cls]:geometry(g) + + -- Treat the other clients + + -- Compute distribution of clients among columns + local num_y ={} + do + local remaining_clients = #cls-1 + local ncol_min = math.ceil(remaining_clients/(num_x-1)) + if ncol >= ncol_min + then + for i = (num_x-1), 1, -1 do + if (remaining_clients-i+1) < ncol + then + num_y[i] = remaining_clients-i + 1 + else + num_y[i] = ncol + end + remaining_clients = remaining_clients - num_y[i] + end + else + local rem = remaining_clients % (num_x-1) + if rem ==0 + then + for i = 1, num_x-1 do + num_y[i] = ncol_min + end + else + for i = 1, num_x-1 do + num_y[i] = ncol_min - 1 + end + for i = 0, rem-1 do + num_y[num_x-1-i] = num_y[num_x-1-i] + 1 + end + end + end + end + + -- Compute geometry of the other clients + local nclient = #cls-1 -- we start with the 2nd client + g.x = g.x + g.width+useless_gap + 2 + g.width = width + + if useless_gap > 0 then + g.width = g.width + useless_gap - 2 + end + + for i = 1, (num_x-1) do + to_remove = 2 + g.height = math.floor((wa.height - (num_y[i] * useless_gap)) / num_y[i]) + g.y = offset_y + global_border + for j = 0, (num_y[i]-2) do + cls[nclient]:geometry(g) + nclient = nclient - 1 + g.y = g.y + g.height+useless_gap + 2 + to_remove = to_remove + 2 + end + g.height = wa.height - num_y[i]*useless_gap - (num_y[i]-1)*g.height - useless_gap - to_remove + cls[nclient]:geometry(g) + nclient = nclient - 1 + g.x = g.x+g.width+useless_gap + 2 + end + end +end + +return centerfair diff --git a/awesome/lain/layout/centerwork.lua b/awesome/lain/layout/centerwork.lua new file mode 100644 index 0000000..61f4907 --- /dev/null +++ b/awesome/lain/layout/centerwork.lua @@ -0,0 +1,131 @@ + +--[[ + + Licensed under GNU General Public License v2 + * (c) 2014, projektile + * (c) 2013, Luke Bonham + * (c) 2010-2012, Peter Hofmann + +--]] + +local awful = require("awful") +local beautiful = require("beautiful") +local tonumber = tonumber +local math = { floor = math.floor } + +local centerwork = +{ + name = "centerwork", + top_left = 0, + top_right = 1, + bottom_left = 2, + bottom_right = 3 +} + +function centerwork.arrange(p) + -- A useless gap (like the dwm patch) can be defined with + -- beautiful.useless_gap_width . + local useless_gap = tonumber(beautiful.useless_gap_width) or 0 + + -- A global border can be defined with + -- beautiful.global_border_width + local global_border = tonumber(beautiful.global_border_width) or 0 + if global_border < 0 then global_border = 0 end + + -- Themes border width requires an offset + local bw = tonumber(beautiful.border_width) or 0 + + -- Screen. + local wa = p.workarea + local cls = p.clients + + -- Borders are factored in. + wa.height = wa.height - ((global_border * 2) + (bw * 2)) + wa.width = wa.width - ((global_border * 2) + (bw * 2)) + + -- Width of main column? + local t = awful.tag.selected(p.screen) + local mwfact = awful.tag.getmwfact(t) + + if #cls > 0 + then + -- Main column, fixed width and height. + local c = cls[#cls] + local g = {} + local mainwid = math.floor(wa.width * mwfact) + local slavewid = wa.width - mainwid + local slaveLwid = math.floor(slavewid / 2) + local slaveRwid = slavewid - slaveLwid + local slaveThei = math.floor(wa.height / 2) + local slaveBhei = wa.height - slaveThei + + g.height = wa.height - 2 * useless_gap + g.width = mainwid + g.x = wa.x + slaveLwid + global_border + g.y = wa.y + useless_gap + global_border + + c:geometry(g) + + -- Auxiliary windows. + if #cls > 1 + then + local at = 0 + for i = (#cls - 1),1,-1 + do + -- It's all fixed. If there are more than 5 clients, + -- those additional clients will float. This is + -- intentional. + if at == 4 + then + break + end + + c = cls[i] + g = {} + + if at == centerwork.top_left + then + -- top left + g.x = wa.x + useless_gap + global_border + g.y = wa.y + useless_gap + global_border + g.width = slaveLwid - 2 * useless_gap + g.height = slaveThei - useless_gap + elseif at == centerwork.top_right + then + -- top right + g.x = wa.x + slaveLwid + mainwid + useless_gap + global_border + g.y = wa.y + useless_gap + global_border + g.width = slaveRwid - 2 * useless_gap + g.height = slaveThei - useless_gap + elseif at == centerwork.bottom_left + then + -- bottom left + g.x = wa.x + useless_gap + global_border + g.y = wa.y + slaveThei + useless_gap + global_border + g.width = slaveLwid - 2 * useless_gap + g.height = slaveBhei - 2 * useless_gap + elseif at == centerwork.bottom_right + then + -- bottom right + g.x = wa.x + slaveLwid + mainwid + useless_gap + global_border + g.y = wa.y + slaveThei + useless_gap + global_border + g.width = slaveRwid - 2 * useless_gap + g.height = slaveBhei - 2 * useless_gap + end + + c:geometry(g) + + at = at + 1 + end + + -- Set remaining clients to floating. + for i = (#cls - 1 - 4),1,-1 + do + c = cls[i] + awful.client.floating.set(c, true) + end + end + end +end + +return centerwork diff --git a/awesome/lain/layout/init.lua b/awesome/lain/layout/init.lua new file mode 100644 index 0000000..d79679a --- /dev/null +++ b/awesome/lain/layout/init.lua @@ -0,0 +1,20 @@ + +--[[ + + Lain + Layouts, widgets and utilities for Awesome WM + + Layouts section + + Licensed under GNU General Public License v2 + * (c) 2013, Luke Bonham + * (c) 2010-2012, Peter Hofmann + +--]] + +local wrequire = require("lain.helpers").wrequire +local setmetatable = setmetatable + +local layout = { _NAME = "lain.layout" } + +return setmetatable(layout, { __index = wrequire }) diff --git a/awesome/lain/layout/termfair.lua b/awesome/lain/layout/termfair.lua new file mode 100644 index 0000000..4e45eec --- /dev/null +++ b/awesome/lain/layout/termfair.lua @@ -0,0 +1,138 @@ + +--[[ + + Licensed under GNU General Public License v2 + * (c) 2014, projektile + * (c) 2013, Luke Bonham + * (c) 2010-2012, Peter Hofmann + +--]] + +local tag = require("awful.tag") +local beautiful = require("beautiful") +local math = { ceil = math.ceil, + floor = math.floor, + max = math.max } +local tonumber = tonumber + +local termfair = { name = "termfair" } + +function termfair.arrange(p) + -- Layout with fixed number of vertical columns (read from nmaster). + -- New windows align from left to right. When a row is full, a now + -- one above it is created. Like this: + + -- (1) (2) (3) + -- +---+---+---+ +---+---+---+ +---+---+---+ + -- | | | | | | | | | | | | + -- | 1 | | | -> | 2 | 1 | | -> | 3 | 2 | 1 | -> + -- | | | | | | | | | | | | + -- +---+---+---+ +---+---+---+ +---+---+---+ + + -- (4) (5) (6) + -- +---+---+---+ +---+---+---+ +---+---+---+ + -- | 4 | | | | 5 | 4 | | | 6 | 5 | 4 | + -- +---+---+---+ -> +---+---+---+ -> +---+---+---+ + -- | 3 | 2 | 1 | | 3 | 2 | 1 | | 3 | 2 | 1 | + -- +---+---+---+ +---+---+---+ +---+---+---+ + + -- A useless gap (like the dwm patch) can be defined with + -- beautiful.useless_gap_width. + local useless_gap = tonumber(beautiful.useless_gap_width) or 0 + if useless_gap < 0 then useless_gap = 0 end + + -- A global border can be defined with + -- beautiful.global_border_width + local global_border = tonumber(beautiful.global_border_width) or 0 + if global_border < 0 then global_border = 0 end + + -- Themes border width requires an offset + local bw = tonumber(beautiful.border_width) or 0 + + -- Screen. + local wa = p.workarea + local cls = p.clients + + -- Borders are factored in. + wa.height = wa.height - ((global_border * 2) + (bw * 2)) + wa.width = wa.width - ((global_border * 2) + (bw * 2)) + + -- How many vertical columns? + local t = tag.selected(p.screen) + local num_x = termfair.nmaster or tag.getnmaster(t) + + -- Do at least "desired_y" rows. + local desired_y = termfair.ncol or tag.getncol(t) + + if #cls > 0 + then + local num_y = math.max(math.ceil(#cls / num_x), desired_y) + local cur_num_x = num_x + local at_x = 0 + local at_y = 0 + local remaining_clients = #cls + local width = math.floor(wa.width / num_x) + local height = math.floor(wa.height / num_y) + + -- We start the first row. Left-align by limiting the number of + -- available slots. + if remaining_clients < num_x + then + cur_num_x = remaining_clients + end + + -- Iterate in reversed order. + for i = #cls,1,-1 + do + -- Get x and y position. + local c = cls[i] + local this_x = cur_num_x - at_x - 1 + local this_y = num_y - at_y - 1 + + -- Calc geometry. + local g = {} + if this_x == (num_x - 1) + then + g.width = wa.width - (num_x - 1) * width - useless_gap + else + g.width = width - useless_gap + end + if this_y == (num_y - 1) + then + g.height = wa.height - (num_y - 1) * height - useless_gap + else + g.height = height - useless_gap + end + + g.x = wa.x + this_x * width + global_border + g.y = wa.y + this_y * height + global_border + + if useless_gap > 0 + then + -- All clients tile evenly. + g.x = g.x + (useless_gap / 2) + g.y = g.y + (useless_gap / 2) + + end + c:geometry(g) + remaining_clients = remaining_clients - 1 + + -- Next grid position. + at_x = at_x + 1 + if at_x == num_x + then + -- Row full, create a new one above it. + at_x = 0 + at_y = at_y + 1 + + -- We start a new row. Left-align. + if remaining_clients < num_x + then + cur_num_x = remaining_clients + end + end + end + end +end + +return termfair diff --git a/awesome/lain/layout/uselessfair.lua b/awesome/lain/layout/uselessfair.lua new file mode 100644 index 0000000..6a386c3 --- /dev/null +++ b/awesome/lain/layout/uselessfair.lua @@ -0,0 +1,121 @@ + +--[[ + + Licensed under GNU General Public License v2 + * (c) 2014, projektile + * (c) 2013, Luke Bonham + * (c) 2012, Josh Komoroske + * (c) 2010-2012, Peter Hofmann + +--]] + +local beautiful = require("beautiful") +local ipairs = ipairs +local math = { ceil = math.ceil, sqrt = math.sqrt } +local tonumber = tonumber + +local uselessfair = {} + +local function fair(p, orientation) + -- A useless gap (like the dwm patch) can be defined with + -- beautiful.useless_gap_width. + local useless_gap = tonumber(beautiful.useless_gap_width) or 0 + if useless_gap < 0 then useless_gap = 0 end + + -- A global border can be defined with + -- beautiful.global_border_width. + local global_border = tonumber(beautiful.global_border_width) or 0 + if global_border < 0 then global_border = 0 end + + -- Themes border width requires an offset. + local bw = tonumber(beautiful.border_width) or 0 + + -- get our orientation right. + local wa = p.workarea + local cls = p.clients + + wa.height = wa.height - ((global_border * 2) + (bw * 2)) + wa.width = wa.width - ((global_border * 2) + (bw * 2)) + + if #cls > 0 then + local cells = math.ceil(math.sqrt(#cls)) + local strips = math.ceil(#cls / cells) + + local cell = 0 + local strip = 0 + for k, c in ipairs(cls) do + local g = {} + -- Save actual grid index for use in the useless_gap + -- routine. + local this_x = 0 + local this_y = 0 + if ( orientation == "east" and #cls > 2 ) + or ( orientation == "south" and #cls <= 2 ) then + if #cls < (strips * cells) and strip == strips - 1 then + g.width = wa.width / (cells - ((strips * cells) - #cls)) + else + g.width = wa.width / cells + end + g.height = wa.height / strips + + this_x = cell + this_y = strip + + g.x = wa.x + cell * g.width + global_border + g.y = wa.y + strip * g.height + global_border + + else + if #cls < (strips * cells) and strip == strips - 1 then + g.height = wa.height / (cells - ((strips * cells) - #cls)) + else + g.height = wa.height / cells + end + g.width = wa.width / strips + + this_x = strip + this_y = cell + + g.x = wa.x + strip * g.width + global_border + g.y = wa.y + cell * g.height + global_border + + end + + -- Useless gap. + if useless_gap > 0 + then + -- All clients tile evenly. + g.width = g.width - useless_gap + g.x = g.x + (useless_gap / 2) + g.height = g.height - useless_gap + g.y = g.y + (useless_gap / 2) + + end + -- End of useless gap. + + c:geometry(g) + + cell = cell + 1 + if cell == cells then + cell = 0 + strip = strip + 1 + end + end + end +end + +--- Horizontal fair layout. +-- @param screen The screen to arrange. +uselessfair.horizontal = {} +uselessfair.horizontal.name = "uselessfairh" +function uselessfair.horizontal.arrange(p) + return fair(p, "east") +end + +-- Vertical fair layout. +-- @param screen The screen to arrange. +uselessfair.name = "uselessfair" +function uselessfair.arrange(p) + return fair(p, "south") +end + +return uselessfair diff --git a/awesome/lain/layout/uselesspiral.lua b/awesome/lain/layout/uselesspiral.lua new file mode 100644 index 0000000..ba63bca --- /dev/null +++ b/awesome/lain/layout/uselesspiral.lua @@ -0,0 +1,123 @@ + +--[[ + + Licensed under GNU General Public License v2 + * (c) 2014 projektile + * (c) 2013 Luke Bonham + * (c) 2009 Uli Schlachter + * (c) 2008 Julien Danjolu + +--]] + +local beautiful = require("beautiful") +local ipairs = ipairs +local tonumber = tonumber +local math = require("math") + +local uselesspiral = {} + +local function spiral(p, spiral) + -- A useless gap (like the dwm patch) can be defined with + -- beautiful.useless_gap_width. + local useless_gap = tonumber(beautiful.useless_gap_width) or 0 + if useless_gap < 0 then useless_gap = 0 end + + -- A global border can be defined with + -- beautiful.global_border_width + local global_border = tonumber(beautiful.global_border_width) or 0 + if global_border < 0 then global_border = 0 end + + -- Themes border width requires an offset + local bw = tonumber(beautiful.border_width) or 0 + + -- get our orientation right + local wa = p.workarea + local cls = p.clients + local n = #cls -- number of windows total; k = which window number + + wa.height = wa.height - ((global_border * 2) + (bw * 2)) + wa.width = wa.width - ((global_border * 2) + (bw * 2)) + + local static_wa = wa + + for k, c in ipairs(cls) do + if k < n then + if k % 2 == 0 then + wa.height = (wa.height / 2) + else + wa.width = (wa.width / 2) + end + end + + if k % 4 == 0 and spiral then + wa.x = wa.x - wa.width + elseif k % 2 == 0 or + (k % 4 == 3 and k < n and spiral) then + wa.x = wa.x + wa.width + end + + if k % 4 == 1 and k ~= 1 and spiral then + wa.y = wa.y - wa.height + elseif k % 2 == 1 and k ~= 1 or + (k % 4 == 0 and k < n and spiral) then + wa.y = wa.y + wa.height + end + + local wa2 = {} + wa2.x = wa.x + (useless_gap / 2) + global_border + wa2.y = wa.y + (useless_gap / 2) + global_border + wa2.height = wa.height - (useless_gap / 2) + wa2.width = wa.width - (useless_gap / 2) + + -- Useless gap. + if useless_gap > 0 + then + -- Top and left clients are shrinked by two steps and + -- get moved away from the border. Other clients just + -- get shrinked in one direction. + + top = false + left = false + + if wa2.y == static_wa.y then + top = true + end + + if wa2.x == static_wa.x then + left = true + end + + if top then + wa2.height = wa2.height - useless_gap + wa2.y = wa2.y - (useless_gap / 2) + else + wa2.height = wa2.height - (useless_gap / 2) + end + + if left then + wa2.width = wa2.width - useless_gap + wa2.x = wa2.x - (useless_gap / 2) + else + wa2.width = wa2.width - (useless_gap / 2) + end + end + -- End of useless gap. + + c:geometry(wa2) + end +end + +--- Dwindle layout +uselesspiral.dwindle = {} +uselesspiral.dwindle.name = "uselessdwindle" +function uselesspiral.dwindle.arrange(p) + return spiral(p, false) +end + +--- Spiral layout +uselesspiral.name = "uselesspiral" +function uselesspiral.arrange(p) + return spiral(p, true) +end + +return uselesspiral diff --git a/awesome/lain/layout/uselesstile.lua b/awesome/lain/layout/uselesstile.lua new file mode 100644 index 0000000..eccfdad --- /dev/null +++ b/awesome/lain/layout/uselesstile.lua @@ -0,0 +1,239 @@ + +--[[ + + Licensed under GNU General Public License v2 + * (c) 2014 projektile + * (c) 2013 Luke Bonham + * (c) 2009 Donald Ephraim Curtis + * (c) 2008 Julien Danjolu + +--]] + +local tag = require("awful.tag") +local beautiful = require("beautiful") +local ipairs = ipairs +local math = { floor = math.floor, + max = math.max, + min = math.min } +local tonumber = tonumber + +local uselesstile = {} + +local function tile_group(cls, wa, orientation, fact, group) + -- A useless gap (like the dwm patch) can be defined with + -- beautiful.useless_gap_width . + local useless_gap = tonumber(beautiful.useless_gap_width) or 0 + if useless_gap < 0 then useless_gap = 0 end + + -- A global border can be defined with + -- beautiful.global_border_width + local global_border = tonumber(beautiful.global_border_width) or 0 + if global_border < 0 then global_border = 0 end + + -- Themes border width requires an offset + local bw = tonumber(beautiful.border_width) or 0 + + -- get our orientation right + local height = "height" + local width = "width" + local x = "x" + local y = "y" + if orientation == "top" or orientation == "bottom" then + height = "width" + width = "height" + x = "y" + y = "x" + end + + -- make this more generic (not just width) + --if for top + available = wa[width] - (group.coord - wa[x]) -- it's truly not here + + -- find our total values + local total_fact = 0 + local min_fact = 1 + local size = group.size + for c = group.first,group.last do + -- determine the width/height based on the size_hint + local i = c - group.first +1 + local size_hints = cls[c].size_hints + local size_hint = size_hints["min_"..width] or size_hints["base_"..width] or 0 + size_hint = size_hint + cls[c].border_width*2 + size = math.max(size_hint, size) + + -- calculate the height + if not fact[i] then + fact[i] = min_fact + else + min_fact = math.min(fact[i],min_fact) + end + total_fact = total_fact + fact[i] + end + size = math.min(size, (available - global_border)) + local coord = wa[y] + local geom = {} + local used_size = 0 + local unused = wa[height] - (global_border * 2) + local stat_coord = wa[x] + --stat_coord = size + for c = group.first,group.last do + local i = c - group.first +1 + geom[width] = size - global_border - (bw * 2) + geom[height] = math.floor(unused * fact[i] / total_fact) - (bw * 2) + geom[x] = group.coord + global_border + (useless_gap / 2) + geom[y] = coord + global_border + (useless_gap / 2) + + coord = coord + geom[height] + unused = unused - geom[height] + total_fact = total_fact - fact[i] + used_size = math.max(used_size, geom[width]) + + -- Useless gap + if useless_gap > 0 + then + -- Top and left clients are shrinked by two steps and + -- get moved away from the border. Other clients just + -- get shrinked in one direction. + + top = false + left = false + + if geom[y] == wa[y] then + top = true + end + + if geom[x] == 0 or geom[x] == wa[x] then + left = true + end + + if top then + geom[height] = geom[height] - (2 * useless_gap) + geom[y] = geom[y] + useless_gap + else + geom[height] = geom[height] - useless_gap + end + + if left then + geom[width] = geom[width] - (2 * useless_gap) + geom[x] = geom[x] + useless_gap + else + geom[width] = geom[width] - useless_gap + end + end + -- End of useless gap. + + geom = cls[c]:geometry(geom) + end + + return used_size +end + +local function tile(param, orientation) + local t = tag.selected(param.screen) + orientation = orientation or "right" + + -- this handles are different orientations + local height = "height" + local width = "width" + local x = "x" + local y = "y" + if orientation == "top" or orientation == "bottom" then + height = "width" + width = "height" + x = "y" + y = "x" + end + + local cls = param.clients + local nmaster = math.min(tag.getnmaster(t), #cls) + local nother = math.max(#cls - nmaster,0) + + local mwfact = tag.getmwfact(t) + local wa = param.workarea + local ncol = tag.getncol(t) + + local data = tag.getdata(t).windowfact + + if not data then + data = {} + tag.getdata(t).windowfact = data + end + + local coord = wa[x] + local place_master = true + if orientation == "left" or orientation == "top" then + -- if we are on the left or top we need to render the other windows first + place_master = false + end + + -- this was easier than writing functions because there is a lot of data we need + for d = 1,2 do + if place_master and nmaster > 0 then + local size = wa[width] + if nother > 0 then + size = math.min(wa[width] * mwfact, wa[width] - (coord - wa[x])) + end + if not data[0] then + data[0] = {} + end + coord = coord + tile_group(cls, wa, orientation, data[0], {first=1, last=nmaster, coord = coord, size = size}) + end + + if not place_master and nother > 0 then + local last = nmaster + + -- we have to modify the work area size to consider left and top views + local wasize = wa[width] + if nmaster > 0 and (orientation == "left" or orientation == "top") then + wasize = wa[width] - wa[width]*mwfact + end + for i = 1,ncol do + -- Try to get equal width among remaining columns + local size = math.min((wasize - (coord - wa[x])) / (ncol - i + 1)) --+ (global_border/(ncol))/(ncol+i^2) + local first = last + 1 + last = last + math.floor((#cls - last)/(ncol - i + 1)) + -- tile the column and update our current x coordinate + if not data[i] then + data[i] = {} + end + coord = coord + tile_group(cls, wa, orientation, data[i], { first = first, last = last, coord = coord, size = size }) + end + end + place_master = not place_master + end + +end + +uselesstile.right = {} +uselesstile.right.name = "uselesstile" +uselesstile.right.arrange = tile + +--- The main tile algo, on left. +-- @param screen The screen number to tile. +uselesstile.left = {} +uselesstile.left.name = "uselesstileleft" +function uselesstile.left.arrange(p) + return tile(p, "left") +end + +--- The main tile algo, on bottom. +-- @param screen The screen number to tile. +uselesstile.bottom = {} +uselesstile.bottom.name = "uselesstilebottom" +function uselesstile.bottom.arrange(p) + return tile(p, "bottom") +end + +--- The main tile algo, on top. +-- @param screen The screen number to tile. +uselesstile.top = {} +uselesstile.top.name = "uselesstiletop" +function uselesstile.top.arrange(p) + return tile(p, "top") +end + +uselesstile.arrange = uselesstile.right.arrange +uselesstile.name = uselesstile.right.name + +return uselesstile + diff --git a/awesome/lain/scripts/dfs b/awesome/lain/scripts/dfs new file mode 100755 index 0000000..d78d2bb --- /dev/null +++ b/awesome/lain/scripts/dfs @@ -0,0 +1,387 @@ +#!/bin/bash +# +# Adapted from Eridan's "fs" (cleanup, enhancements and switch to bash/Linux) +# JM, 10/12/2004 +# +# Integrated into Lain in september 2013 +# https://github.com/copycat-killer/lain + +# Requires gawk + +# ------------------------------------------------------------------------- +# Decoding options +# ------------------------------------------------------------------------- +USAGE="Usage: $0 [-h(elp)] | [-n(arrow mode)] | [-w(eb output)]" + +NARROW_MODE=0 +WEB_OUTPUT=0 + +while [ $# -gt 0 ]; do +case "$1" in +"-h" ) +echo $USAGE +exit +;; +"-d" ) +DEBUG=1 +;; +"-n" ) +NARROW_MODE=1 +;; +"-w" ) +WEB_OUTPUT=1 +;; +* ) +echo $USAGE +exit +;; +esac +shift +done + +# ------------------------------------------------------------------------- +# Preparations +# ------------------------------------------------------------------------- +SYSTEM=`uname -s` +PATTERN="/" + +case "$SYSTEM" in +"Linux" ) +DF_COMMAND="/usr/bin/env df -k" +SORT_COMMAND="/usr/bin/env sort -k6" +AWK_COMMAND="/usr/bin/env awk" +;; +* ) +DF_COMMAND="/bin/df -k" +SORT_COMMAND="/usr/bin/sort -k6" +AWK_COMMAND="/usr/bin/env gawk" +;; +esac + +# ------------------------------------------------------------------------- +# Grabbing "df" result +# ------------------------------------------------------------------------- +DF_RESULT=`$DF_COMMAND` +if [ ! -z $DEBUG ]; then +echo "--> DF_RESULT:" +echo "$DF_RESULT" +echo "" +fi + +# ------------------------------------------------------------------------- +# Preprocessing "df" result, to join split logical lines +# ------------------------------------------------------------------------- +PREPROCESSING_RESULT=` \ + echo "$DF_RESULT" | $AWK_COMMAND -v PATTERN=$PATTERN \ + ' + NF == 1 { + printf ("%s", $0) + } + +NF == 5 { + printf ("%s\n", $0) +} + +NF > 6 { +} + +NF == 6 { + printf ("%s\n", $0) +}' +` +if [ ! -z $DEBUG ]; then +echo "--> PREPROCESSING_RESULT:" +echo "$PREPROCESSING_RESULT" +echo "" +fi + +SORTED_FILE_SYSTEMS_INFO=`echo "$PREPROCESSING_RESULT" | $SORT_COMMAND` + +if [ ! -z $DEBUG ]; then +echo "--> SORTED_FILE_SYSTEMS_INFO:" +echo "$SORTED_FILE_SYSTEMS_INFO" +echo "" +fi + +# ------------------------------------------------------------------------- +# Computing mount point max length +# ------------------------------------------------------------------------- +MOUNT_POINT_MAX_LENGTH=` \ + echo $SORTED_FILE_SYSTEMS_INFO | $AWK_COMMAND -v PATTERN=$PATTERN \ + ' + BEGIN { + mount_point_length_max = 15; + } + +END { + printf ("%d", mount_point_length_max); +} + +$0 ~ PATTERN { +# printf ("$6 = %s\n", $6); + + mount_point = $6; +# printf ("mount_point = %s\n", mount_point); + + mount_point_length = length (mount_point); +# printf ("mount_point_length = %d\n", mount_point_length); + + if (mount_point_length > mount_point_length_max) + mount_point_length_max = mount_point_length; +}' +` +if [ ! -z $DEBUG ]; then +echo "MOUNT_POINT_MAX_LENGTH: $MOUNT_POINT_MAX_LENGTH" +fi + +# ------------------------------------------------------------------------- +# Computing mount point data max size +# ------------------------------------------------------------------------- +MOUNT_POINT_MAX_SIZE=` \ + echo "$SORTED_FILE_SYSTEMS_INFO" | $AWK_COMMAND -v PATTERN=$PATTERN \ + ' + BEGIN { + mount_point_size_max = 0; + } + +END { + printf ("%d", mount_point_size_max); +} + +$0 ~ PATTERN { +# df -k shows k_bytes! +# printf ("$2 = %s\n", $2); + + mount_point_size = $2 * 1024; +# printf ("mount_point_size = %d\n", mount_point_size); + + if (mount_point_size > mount_point_size_max) + mount_point_size_max = mount_point_size; +}' +` +if [ ! -z $DEBUG ]; then +echo "MOUNT_POINT_MAX_SIZE: $MOUNT_POINT_MAX_SIZE" +fi + +# ------------------------------------------------------------------------- +# Let's go! +# ------------------------------------------------------------------------- +echo "$SORTED_FILE_SYSTEMS_INFO" | $AWK_COMMAND -v DEBUG=$DEBUG -v PATTERN=$PATTERN -v NARROW_MODE=$NARROW_MODE -v LEFT_COLUMN=$MOUNT_POINT_MAX_LENGTH -v MAX_SIZE=$MOUNT_POINT_MAX_SIZE -v SCALE=$SCALE -v WEB_OUTPUT=$WEB_OUTPUT \ + ' +# {printf ("$0 = %s\n", $0);} +# {printf ("$1 = %s\n", $1);} +# {printf ("PATTERN = %s\n", PATTERN);} +# {printf ("LEFT_COLUMN = %s\n", LEFT_COLUMN);} + + BEGIN { + k_bytes = 1024.0; + m_bytes = 1024.0 * k_bytes; + g_bytes = 1024.0 * m_bytes; + t_bytes = 1024.0 * g_bytes; + + if (WEB_OUTPUT) + { + all_stars = "**************************************************"; + current_date = strftime ("%d-%m-%Y @ %H:%M:%S", localtime (systime ())); + free_threshold = 10; # % + + printf ("\n"); + + printf ( \ + "\n" \ + "

%s -- STATUS OF ALCOR FILE SYSTEMS


\n", + current_date ) + + printf ("\n"); + + printf ( \ + "\n" \ + "\n" \ + "\n" \ + "\n" \ + "\n" \ + "\n" \ + "\n" ); + } + else + { + narrow_margin = " "; +# printf ("%-*s", LEFT_COLUMN + 2, "Mount point"); + if (NARROW_MODE) + printf ("\n%s", narrow_margin); + else + printf ("%-*s", LEFT_COLUMN + 2, ""); + print " Used Free Total "; + if (! NARROW_MODE) + print ""; + } + } + +END { + if (WEB_OUTPUT) + { + printf ("
Mount point%% Usato (*)" \ + " - %% Free (*)%% UsedFreeTotal
\n"); + + printf ("\n"); + } + else + { + if (NARROW_MODE) + printf ("%s", narrow_margin); + else + printf ("%-*s", LEFT_COLUMN + 2, ""); + print "|----|----|----|----|----|----|----|----|----|----|" + if (NARROW_MODE) + printf ("\n%s", narrow_margin); + else + printf ("%-*s", LEFT_COLUMN + 2, ""); + print "0 10 20 30 40 50 60 70 80 90 100"; + print ""; + } +} + +$0 ~ PATTERN { + + if (index ($0, "members") == 0 && index ($0, "Download") == 0 && index ($0, "admin") == 0) + { +# df -k shows k_bytes! + + total_size = $2 * k_bytes; + free_size = $4 * k_bytes; + percentage_occupied = substr($5, 0, 3); + mount_point = $6; + + percentage_free = int (100 - percentage_occupied); + +# reduction_factor: 2 + stars_number = int (percentage_occupied / 2); + + if (WEB_OUTPUT) + { + posGroup = index (mount_point, "scratch"); + if (posGroup == 0) + posGroup = index (mount_point, "u1"); + if (posGroup == 0) + posGroup = index (mount_point, "u2"); + if (posGroup == 0) + posGroup = index (mount_point, "u4"); + if (posGroup == 0) + posGroup = index (mount_point, "u5"); + + printf ("\n"); + + if (posGroup > 0 || percentage_free < free_threshold) + { + if (percentage_free < free_threshold) + { + class = "titlered"; + if (posGroup == 0) + posGroup = 1; # to display the whole mount_point in this color anyway + } + else if ((index (mount_point, "scratch") != 0) || (index (mount_point, "u1") != 0) || (index (mount_point, "u2") != 0)) + { + class = "titleorange"; + posGroup = 1; # to display the whole mount_point in this color + } + else if ((index (mount_point, "u4") != 0) || (index (mount_point, "u5") != 0)) + { + class = "titlebrown"; + posGroup = 1; # to display the whole mount_point in this color + } + + printf ( \ + "%s%s\n", + substr (mount_point, 1, posGroup - 1), + class, + substr (mount_point, posGroup) ); + } + else + { + printf ("%s\n", mount_point); + } + + printf ( \ + "%s%s\n", + substr (all_stars, 1, stars_number), substr (all_stars, stars_number + 1, 49) ); + + if (percentage_free < free_threshold) + { + color_beginning = ""; + color_end = "" + } + else + { + color_beginning = ""; + color_end = "" + } + + if (total_size > 1 * t_bytes) + printf ( \ + "%s%3d%%%s%5.1f Tb%5.1f Tb\n", \ + color_beginning, percentage_occupied, color_end, free_size / t_bytes, total_size / t_bytes \ + ); + else if (total_size > 1 * g_bytes) + printf ( \ + "%s%3d%%%s%5.1f Gb%5.1f Gb\n", \ + color_beginning, percentage_occupied, color_end, free_size / g_bytes, total_size / g_bytes \ + ); + else if (total_size > 1 * m_byptes) + printf ( \ + "%s%3d%%%s%5.1f Mb%5.1f Mb\n", \ + color_beginning, percentage_occupied, color_end, free_size / m_bytes, total_size / m_bytes \ + ); + else + printf ( \ + "%s%3d%%%s%5.1f Kb%5.1f Kb\n", \ + color_beginning, percentage_occupied, color_end, free_size / k_bytes, total_size / k_bytes \ + ); + + printf ("\n"); + } + + else + { +# printf ("percentage_occupied = %d\n", percentage_occupied); +# printf ("percentage_free = %d\n", percentage_free); + + printf ("%-*s", LEFT_COLUMN + 2, mount_point); + if (NARROW_MODE) + printf ("\n%s", narrow_margin); + +# printf ("stars_number = %d\n", stars_number); + + printf ("|"); + for (i = 1; i <= stars_number; i++) + { + printf ("%s", "*"); + } + for (i = stars_number + 1; i <= 49; i++) + { + printf ("%s", "-"); + } + + + if (total_size > 1 * t_bytes) + printf ( \ + "| %3d%% %5.1f %5.1f Tb\n", \ + percentage_occupied, free_size / t_bytes, total_size / t_bytes \ + ); + else if (total_size > 1 * g_bytes) + printf ( \ + "| %3d%% %5.1f %5.1f Gb\n", \ + percentage_occupied, free_size / g_bytes, total_size / g_bytes \ + ); + else if (total_size > 1 * m_byptes) + printf ( \ + "| %3d%% %5.1f %5.1f Mb\n", \ + percentage_occupied, free_size / m_bytes, total_size / m_bytes \ + ); + else + printf ( \ + "| %3d%% %5.1f %5.1f Kb\n", \ + percentage_occupied, free_size / k_bytes, total_size / k_bytes \ + ); + } + } # if +}' diff --git a/awesome/lain/scripts/mpdcover b/awesome/lain/scripts/mpdcover new file mode 100755 index 0000000..6f9062c --- /dev/null +++ b/awesome/lain/scripts/mpdcover @@ -0,0 +1,68 @@ +#!/bin/bash +# +# A simple cover fetcher script for current playing song on mpd. +# +# Original author: Wolfgang Mueller +# +# Adapted for Lain internal use. +# https://github.com/copycat-killer/lain +# +# You can use, edit and redistribute this script in any way you like. +# +# Dependencies: imagemagick. +# +# Usage: mpdcover + +# Configuration------------------------------------------------------- + +# Music directory +MUSIC_DIR=$1 + +# Song file +file=$2 + +# Regex expression used for image search +IMG_REG="(Front|front|Cover|cover|Art|art|Folder|folder)\.(jpg|jpeg|png|gif)$" + +# Path of temporary resized cover +TEMP_PATH="/tmp/mpdcover.png" + +# Resize cover +COVER_RESIZE="$3x$3" + +if [ $COVER_RESIZE == "x" ]; then + COVER_RESIZE="100x100" +fi + +# The default cover to use (optional) +DEFAULT_ART=$4 + +# Thumbnail background (transparent) +COVER_BACKGROUND="none" + +#-------------------------------------------------------------------- + +# check if anything is playing at all +[[ -z $file ]] && exit 1 + +# Art directory +art="$MUSIC_DIR/${file%/*}" + +# find every file that matches IMG_REG set the first matching file to be the +# cover. +cover="$(find "$art/" -maxdepth 1 -type f | egrep -i -m1 "$IMG_REG")" + +# when no cover is found, use DEFAULT_ART as cover +cover="${cover:=$DEFAULT_ART}" + +# check if art is available +if [[ -n $cover ]]; then + if [[ -n $COVER_RESIZE ]]; then + convert "$cover" -scale $COVER_RESIZE -gravity "center" -background "$COVER_BACKGROUND" "$TEMP_PATH" + cover="$TEMP_PATH" + fi +else + rm $TEMP_PATH +fi + +exit 0 diff --git a/awesome/lain/util/init.lua b/awesome/lain/util/init.lua new file mode 100644 index 0000000..ac3afec --- /dev/null +++ b/awesome/lain/util/init.lua @@ -0,0 +1,229 @@ + +--[[ + + Lain + Layouts, widgets and utilities for Awesome WM + + Utilities section + + Licensed under GNU General Public License v2 + * (c) 2013, Luke Bonham + * (c) 2010-2012, Peter Hofmann + +--]] + +local awful = require("awful") +local beautiful = require("beautiful") +local math = { sqrt = math.sqrt } +local mouse = mouse +local pairs = pairs +local string = { gsub = string.gsub } +local client = client +local screen = screen +local tonumber = tonumber + +local wrequire = require("lain.helpers").wrequire +local setmetatable = setmetatable + +-- Lain utilities submodule +-- lain.util +local util = { _NAME = "lain.util" } + +-- Like awful.menu.clients, but only show clients of currently selected +-- tags. +function util.menu_clients_current_tags(menu, args) + -- List of currently selected tags. + local cls_tags = awful.tag.selectedlist(mouse.screen) + + -- Final list of menu items. + local cls_t = {} + + if cls_tags == nil then return nil end + + -- For each selected tag get all clients of that tag and add them to + -- the menu. A click on a menu item will raise that client. + for i = 1,#cls_tags + do + local t = cls_tags[i] + local cls = t:clients() + + for k, c in pairs(cls) + do + cls_t[#cls_t + 1] = { awful.util.escape(c.name) or "", + function () + c.minimized = false + client.focus = c + c:raise() + end, + c.icon } + end + end + + -- No clients? Then quit. + if #cls_t <= 0 then return nil end + + -- menu may contain some predefined values, otherwise start with a + -- fresh menu. + if not menu then menu = {} end + + -- Set the list of items and show the menu. + menu.items = cls_t + local m = awful.menu.new(menu) + m:show(args) + return m +end + +-- Magnify a client: Set it to "float" and resize it. +function util.magnify_client(c) + if not awful.client.floating.get(c) then + awful.client.floating.set(c, true) + + local mg = screen[mouse.screen].geometry + local tag = awful.tag.selected(mouse.screen) + local mwfact = awful.tag.getmwfact(tag) + local g = {} + g.width = math.sqrt(mwfact) * mg.width + g.height = math.sqrt(mwfact) * mg.height + g.x = mg.x + (mg.width - g.width) / 2 + g.y = mg.y + (mg.height - g.height) / 2 + c:geometry(g) + else + awful.client.floating.set(c, false) + end +end + +-- Read the nice value of pid from /proc. +local function get_nice_value(pid) + local n = first_line('/proc/' .. pid .. '/stat') + if n == nil + then + -- This should not happen. But I don't want to crash, either. + return 0 + end + + -- Remove pid and tcomm. This is necessary because tcomm may contain + -- nasty stuff such as whitespace or additional parentheses... + n = string.gsub(n, '.*%) ', '') + + -- Field number 17 now is the nice value. + fields = split(n, ' ') + return tonumber(fields[17]) +end + +-- To be used as a signal handler for "focus" +-- This requires beautiful.border_focus{,_highprio,_lowprio}. +function util.niceborder_focus(c) + local n = get_nice_value(c.pid) + if n == 0 + then + c.border_color = beautiful.border_focus + elseif n < 0 + then + c.border_color = beautiful.border_focus_highprio + else + c.border_color = beautiful.border_focus_lowprio + end +end + +-- To be used as a signal handler for "unfocus" +-- This requires beautiful.border_normal{,_highprio,_lowprio}. +function util.niceborder_unfocus(c) + local n = get_nice_value(c.pid) + if n == 0 + then + c.border_color = beautiful.border_normal + elseif n < 0 + then + c.border_color = beautiful.border_normal_highprio + else + c.border_color = beautiful.border_normal_lowprio + end +end + +-- Non-empty tag browsing +-- direction in {-1, 1} <-> {previous, next} non-empty tag +function util.tag_view_nonempty(direction, sc) + local s = sc or mouse.screen or 1 + local scr = screen[s] + + for i = 1, #awful.tag.gettags(s) do + awful.tag.viewidx(direction,s) + if #awful.client.visible(s) > 0 then + return + end + end +end + +-- {{{ Dynamic tagging +-- +-- Add a new tag +function util.add_tag(mypromptbox) + awful.prompt.run({prompt="New tag name: "}, mypromptbox[mouse.screen].widget, + function(text) + if text:len() > 0 then + props = { selected = true } + tag = awful.tag.add(new_name, props) + tag.name = text + tag:emit_signal("property::name") + end + end) +end + +-- Rename current tag +-- @author: minism +function util.rename_tag(mypromptbox) + local tag = awful.tag.selected(mouse.screen) + awful.prompt.run({prompt="Rename tag: "}, mypromptbox[mouse.screen].widget, + function(text) + if text:len() > 0 then + tag.name = text + tag:emit_signal("property::name") + end + end) +end + +-- Move current tag +-- pos in {-1, 1} <-> {previous, next} tag position +function util.move_tag(pos) + local tag = awful.tag.selected(mouse.screen) + local idx = awful.tag.getidx(tag) + if tonumber(pos) <= -1 then + awful.tag.move(idx - 1, tag) + else + awful.tag.move(idx + 1, tag) + end +end + +-- Remove current tag (if empty) +-- Any rule set on the tag shall be broken +function util.remove_tag() + local tag = awful.tag.selected(mouse.screen) + local prevtag = awful.tag.gettags(mouse.screen)[awful.tag.getidx(tag) - 1] + awful.tag.delete(tag, prevtag) +end +-- +-- }}} + +-- 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 + awful.layout.arrange(mouse.screen) +end + +-- Check if an element exist on a table +function util.element_in_table(element, tbl) + for _, i in pairs(tbl) do + if i == element then + return true + end + end + return false +end + +return setmetatable(util, { __index = wrequire }) diff --git a/awesome/lain/util/markup.lua b/awesome/lain/util/markup.lua new file mode 100644 index 0000000..d367bca --- /dev/null +++ b/awesome/lain/util/markup.lua @@ -0,0 +1,69 @@ + +--[[ + + Licensed under MIT License + * (c) 2013, Luke Bonham + * (c) 2009, Uli Schlachter + * (c) 2009, Majic + +--]] + +local beautiful = require("beautiful") +local tostring = tostring +local setmetatable = setmetatable + +-- Lain markup util submodule +-- lain.util.markup +local markup = {} + +local fg = {} +local bg = {} + +-- Convenience tags. +function markup.bold(text) return '' .. tostring(text) .. '' end +function markup.italic(text) return '' .. tostring(text) .. '' end +function markup.strike(text) return '' .. tostring(text) .. '' end +function markup.underline(text) return '' .. tostring(text) .. '' end +function markup.monospace(text) return '' .. tostring(text) .. '' end +function markup.big(text) return '' .. tostring(text) .. '' end +function markup.small(text) return '' .. tostring(text) .. '' end + +-- Set the font. +function markup.font(font, text) + return '' .. tostring(text) ..'' +end + +-- Set the foreground. +function fg.color(color, text) + return '' .. tostring(text) .. '' +end + +-- Set the background. +function bg.color(color, text) + return '' .. tostring(text) .. '' +end + +-- Context: focus +function fg.focus(text) return fg.color(beautiful.fg_focus, text) end +function bg.focus(text) return bg.color(beautiful.bg_focus, text) end +function markup.focus(text) return bg.focus(fg.focus(text)) end + +-- Context: normal +function fg.normal(text) return fg.color(beautiful.fg_normal, text) end +function bg.normal(text) return bg.color(beautiful.bg_normal, text) end +function markup.normal(text) return bg.normal(fg.normal(text)) end + +-- Context: urgent +function fg.urgent(text) return fg.color(beautiful.fg_urgent, text) end +function bg.urgent(text) return bg.color(beautiful.bg_urgent, text) end +function markup.urgent(text) return bg.urgent(fg.urgent(text)) end + +markup.fg = fg +markup.bg = bg + +-- link markup.{fg,bg}(...) calls to markup.{fg,bg}.color(...) +setmetatable(markup.fg, { __call = function(_, ...) return markup.fg.color(...) end }) +setmetatable(markup.bg, { __call = function(_, ...) return markup.bg.color(...) end }) + +-- link markup(...) calls to markup.fg.color(...) +return setmetatable(markup, { __call = function(_, ...) return markup.fg.color(...) end }) diff --git a/awesome/lain/widgets/abase.lua b/awesome/lain/widgets/abase.lua new file mode 100644 index 0000000..075d615 --- /dev/null +++ b/awesome/lain/widgets/abase.lua @@ -0,0 +1,42 @@ + +--[[ + + Licensed under GNU General Public License v2 + * (c) 2014, Luke Bonham + +--]] + +local newtimer = require("lain.helpers").newtimer +local async = require("lain.asyncshell") +local wibox = require("wibox") + +local setmetatable = setmetatable + +-- Basic template for custom widgets +-- Asynchronous version +-- lain.widgets.abase + +local function worker(args) + local abase = {} + local args = args or {} + local timeout = args.timeout or 5 + local cmd = args.cmd or "" + local settings = args.settings or function() end + + abase.widget = wibox.widget.textbox('') + + function abase.update() + async.request(cmd, function(f) + output = f:read("*a") + f:close() + widget = abase.widget + settings() + end) + end + + newtimer(cmd, timeout, abase.update) + + return setmetatable(abase, { __index = abase.widget }) +end + +return setmetatable({}, { __call = function(_, ...) return worker(...) end }) diff --git a/awesome/lain/widgets/alsa.lua b/awesome/lain/widgets/alsa.lua new file mode 100644 index 0000000..f62a150 --- /dev/null +++ b/awesome/lain/widgets/alsa.lua @@ -0,0 +1,65 @@ + +--[[ + + Licensed under GNU General Public License v2 + * (c) 2013, Luke Bonham + * (c) 2010, Adrian C. + +--]] + +local newtimer = require("lain.helpers").newtimer + +local wibox = require("wibox") + +local io = { popen = io.popen } +local string = { match = string.match } + +local setmetatable = setmetatable + +-- ALSA volume +-- lain.widgets.alsa +local alsa = {} + +local function worker(args) + local args = args or {} + local timeout = args.timeout or 5 + local channel = args.channel or "Master" + local settings = args.settings or function() end + + alsa.widget = wibox.widget.textbox('') + + function alsa.update() + local f = assert(io.popen('amixer -M get ' .. channel)) + local mixer = f:read("*a") + f:close() + + volume_now = {} + + volume_now.level, volume_now.status = string.match(mixer, "([%d]+)%%.*%[([%l]*)") + + if volume_now.level == nil + then + volume_now.level = "0" + volume_now.status = "off" + end + + if volume_now.status == "" + then + if volume_now.level == "0" + then + volume_now.status = "off" + else + volume_now.status = "on" + end + end + + widget = alsa.widget + settings() + end + + newtimer("alsa", timeout, alsa.update) + + return setmetatable(alsa, { __index = alsa.widget }) +end + +return setmetatable(alsa, { __call = function(_, ...) return worker(...) end }) diff --git a/awesome/lain/widgets/alsabar.lua b/awesome/lain/widgets/alsabar.lua new file mode 100644 index 0000000..65a2b33 --- /dev/null +++ b/awesome/lain/widgets/alsabar.lua @@ -0,0 +1,173 @@ + +--[[ + + Licensed under GNU General Public License v2 + * (c) 2013, Luke Bonham + * (c) 2013, Rman + +--]] + +local newtimer = require("lain.helpers").newtimer + +local awful = require("awful") +local beautiful = require("beautiful") +local naughty = require("naughty") + +local io = { popen = io.popen } +local math = { modf = math.modf } +local string = { format = string.format, + match = string.match, + rep = string.rep } +local tonumber = tonumber + +local setmetatable = setmetatable + +-- ALSA volume bar +-- lain.widgets.alsabar +local alsabar = { + channel = "Master", + step = "5%", + + colors = { + background = beautiful.bg_normal, + mute = "#EB8F8F", + unmute = "#A4CE8A" + }, + + terminal = terminal or "xterm", + mixer = terminal .. " -e alsamixer", + + notifications = { + font = beautiful.font:sub(beautiful.font:find(""), beautiful.font:find(" ")), + font_size = "11", + color = beautiful.fg_normal, + bar_size = 18, + screen = 1 + }, + + _current_level = 0, + _muted = false +} + +function alsabar.notify() + alsabar.update() + + local preset = { + title = "", + text = "", + timeout = 4, + screen = alsabar.notifications.screen, + font = alsabar.notifications.font .. " " .. + alsabar.notifications.font_size, + fg = alsabar.notifications.color + } + + if alsabar._muted + then + preset.title = alsabar.channel .. " - Muted" + else + preset.title = alsabar.channel .. " - " .. alsabar._current_level .. "%" + end + + int = math.modf((alsabar._current_level / 100) * alsabar.notifications.bar_size) + preset.text = "[" + .. string.rep("|", int) + .. string.rep(" ", alsabar.notifications.bar_size - int) + .. "]" + + if alsabar._notify ~= nil then + alsabar._notify = naughty.notify ({ + replaces_id = alsabar._notify.id, + preset = preset, + }) + else + alsabar._notify = naughty.notify ({ + preset = preset, + }) + end +end + +local function worker(args) + local args = args or {} + local timeout = args.timeout or 4 + local settings = args.settings or function() end + local width = args.width or 63 + local height = args.heigth or 1 + local ticks = args.ticks or false + local ticks_size = args.ticks_size or 7 + local vertical = args.vertical or false + + alsabar.channel = args.channel or alsabar.channel + alsabar.step = args.step or alsabar.step + alsabar.colors = args.colors or alsabar.colors + alsabar.notifications = args.notifications or alsabar.notifications + + alsabar.bar = awful.widget.progressbar() + + alsabar.bar:set_background_color(alsabar.colors.background) + alsabar.bar:set_color(alsabar.colors.unmute) + alsabar.tooltip = awful.tooltip({ objects = { alsabar.bar } }) + alsabar.bar:set_width(width) + alsabar.bar:set_height(height) + alsabar.bar:set_ticks(ticks) + alsabar.bar:set_ticks_size(ticks_size) + alsabar.bar:set_vertical(vertical) + + function alsabar.update() + -- Get mixer control contents + local f = io.popen("amixer -M get " .. alsabar.channel) + local mixer = f:read("*a") + f:close() + + -- Capture mixer control state: [5%] ... ... [on] + local volu, mute = string.match(mixer, "([%d]+)%%.*%[([%l]*)") + + if volu == nil then + volu = 0 + mute = "off" + end + + alsabar._current_level = tonumber(volu) + alsabar.bar:set_value(alsabar._current_level / 100) + + if not mute and tonumber(volu) == 0 or mute == "off" + then + alsabar._muted = true + alsabar.tooltip:set_text (" [Muted] ") + alsabar.bar:set_color(alsabar.colors.mute) + else + alsabar._muted = false + alsabar.tooltip:set_text(string.format(" %s:%s ", alsabar.channel, volu)) + alsabar.bar:set_color(alsabar.colors.unmute) + end + + volume_now = {} + volume_now.level = tonumber(volu) + volume_now.status = mute + settings() + end + + newtimer("alsabar", timeout, alsabar.update) + + alsabar.bar:buttons (awful.util.table.join ( + awful.button ({}, 1, function() + awful.util.spawn(alsabar.mixer) + end), + awful.button ({}, 3, function() + awful.util.spawn(string.format("amixer set %s toggle", alsabar.channel)) + alsabar.update() + end), + awful.button ({}, 4, function() + awful.util.spawn(string.format("amixer set %s %s+", alsabar.channel, alsabar.step)) + alsabar.update() + end), + awful.button ({}, 5, function() + awful.util.spawn(string.format("amixer set %s %s-", alsabar.channel, alsabar.step)) + alsabar.update() + end) + )) + + return alsabar +end + +return setmetatable(alsabar, { __call = function(_, ...) return worker(...) end }) diff --git a/awesome/lain/widgets/base.lua b/awesome/lain/widgets/base.lua new file mode 100644 index 0000000..39b0863 --- /dev/null +++ b/awesome/lain/widgets/base.lua @@ -0,0 +1,40 @@ + +--[[ + + Licensed under GNU General Public License v2 + * (c) 2014, Luke Bonham + +--]] + +local newtimer = require("lain.helpers").newtimer +local wibox = require("wibox") + +local io = { popen = io.popen } +local setmetatable = setmetatable + +-- Basic template for custom widgets +-- lain.widgets.base + +local function worker(args) + local base = {} + local args = args or {} + local timeout = args.timeout or 5 + local cmd = args.cmd or "" + local settings = args.settings or function() end + + base.widget = wibox.widget.textbox('') + + function base.update() + local f = assert(io.popen(cmd)) + output = f:read("*a") + f:close() + widget = base.widget + settings() + end + + newtimer(cmd, timeout, base.update) + + return setmetatable(base, { __index = base.widget }) +end + +return setmetatable({}, { __call = function(_, ...) return worker(...) end }) diff --git a/awesome/lain/widgets/bat.lua b/awesome/lain/widgets/bat.lua new file mode 100644 index 0000000..572d099 --- /dev/null +++ b/awesome/lain/widgets/bat.lua @@ -0,0 +1,149 @@ + +--[[ + + Licensed under GNU General Public License v2 + * (c) 2013, Luke Bonham + * (c) 2010-2012, Peter Hofmann + +--]] + +local newtimer = require("lain.helpers").newtimer +local first_line = require("lain.helpers").first_line + +local naughty = require("naughty") +local wibox = require("wibox") + +local math = { floor = math.floor } +local string = { format = string.format } +local tonumber = tonumber + +local setmetatable = setmetatable + +-- Battery infos +-- lain.widgets.bat +local bat = {} + +local function worker(args) + local args = args or {} + local timeout = args.timeout or 30 + local battery = args.battery or "BAT0" + local notify = args.notify or "on" + local settings = args.settings or function() end + + bat.widget = wibox.widget.textbox('') + + bat_notification_low_preset = { + title = "Battery low", + text = "Plug the cable!", + timeout = 15, + fg = "#202020", + bg = "#CDCDCD" + } + + bat_notification_critical_preset = { + title = "Battery exhausted", + text = "Shutdown imminent", + timeout = 15, + fg = "#000000", + bg = "#FFFFFF" + } + + function update() + bat_now = { + status = "Not present", + perc = "N/A", + time = "N/A", + watt = "N/A" + } + + local bstr = "/sys/class/power_supply/" .. battery + + local present = first_line(bstr .. "/present") + + if present == "1" + then + local rate = first_line(bstr .. "/power_now") or + first_line(bstr .. "/current_now") + + local ratev = first_line(bstr .. "/voltage_now") + + local rem = first_line(bstr .. "/energy_now") or + first_line(bstr .. "/charge_now") + + local tot = first_line(bstr .. "/energy_full") or + first_line(bstr .. "/charge_full") + + bat_now.status = first_line(bstr .. "/status") or "N/A" + + rate = tonumber(rate) or 1 + ratev = tonumber(ratev) + rem = tonumber(rem) + tot = tonumber(tot) + + local time_rat = 0 + if bat_now.status == "Charging" + then + time_rat = (tot - rem) / rate + elseif bat_now.status == "Discharging" + then + time_rat = rem / rate + end + + local hrs = math.floor(time_rat) + if hrs < 0 then hrs = 0 elseif hrs > 23 then hrs = 23 end + + local min = math.floor((time_rat - hrs) * 60) + if min < 0 then min = 0 elseif min > 59 then min = 59 end + + bat_now.time = string.format("%02d:%02d", hrs, min) + + bat_now.perc = first_line(bstr .. "/capacity") + + if not bat_now.perc then + local perc = (rem / tot) * 100 + if perc <= 100 then + bat_now.perc = string.format("%d", perc) + elseif perc > 100 then + bat_now.perc = "100" + elseif perc < 0 then + bat_now.perc = "0" + end + end + + if rate ~= nil and ratev ~= nil then + bat_now.watt = string.format("%.2fW", (rate * ratev) / 1e12) + else + bat_now.watt = "N/A" + end + + end + + widget = bat.widget + settings() + + -- notifications for low and critical states + if bat_now.status == "Discharging" and notify == "on" and bat_now.perc ~= nil + then + local nperc = tonumber(bat_now.perc) or 100 + if nperc <= 5 + then + bat.id = naughty.notify({ + preset = bat_notification_critical_preset, + replaces_id = bat.id, + }).id + elseif nperc <= 15 + then + bat.id = naughty.notify({ + preset = bat_notification_low_preset, + replaces_id = bat.id, + }).id + end + end + end + + newtimer("bat", timeout, update) + + return bat.widget +end + +return setmetatable(bat, { __call = function(_, ...) return worker(...) end }) diff --git a/awesome/lain/widgets/borderbox.lua b/awesome/lain/widgets/borderbox.lua new file mode 100644 index 0000000..cce8517 --- /dev/null +++ b/awesome/lain/widgets/borderbox.lua @@ -0,0 +1,62 @@ + +--[[ + + 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 }) diff --git a/awesome/lain/widgets/calendar.lua b/awesome/lain/widgets/calendar.lua new file mode 100644 index 0000000..631b358 --- /dev/null +++ b/awesome/lain/widgets/calendar.lua @@ -0,0 +1,133 @@ + +--[[ + + Licensed under GNU General Public License v2 + * (c) 2013, Luke Bonham + +--]] + +local icons_dir = require("lain.helpers").icons_dir + +local awful = require("awful") +local beautiful = require("beautiful") +local naughty = require("naughty") + +local io = { popen = io.popen } +local os = { date = os.date } +local tonumber = tonumber + +local setmetatable = setmetatable + +-- Calendar notification +-- lain.widgets.calendar +local calendar = {} +local cal_notification = nil + +function calendar:hide() + if cal_notification ~= nil then + naughty.destroy(cal_notification) + cal_notification = nil + end +end + +function calendar:show(t_out, inc_offset, scr) + calendar:hide() + + local offs = inc_offset or 0 + local tims = t_out or 0 + local f, c_text + local today = tonumber(os.date('%d')) + local init_t = calendar.cal .. ' | sed -r -e "s/(^| )( ' + + calendar.offset = calendar.offset + offs + + if offs == 0 or calendar.offset == 0 + then -- current month showing, today highlighted + if today >= 10 + then + init_t = calendar.cal .. ' | sed -r -e "s/_\\x08//g" | sed -r -e "s/(^| )(' + end + + calendar.offset = 0 + calendar.notify_icon = calendar.icons .. today .. ".png" + + -- bg and fg inverted to highlight today + f = io.popen( init_t .. today .. + ')($| )/\\1\\2<\\/span><\\/b>\\3/"' ) + + else -- no current month showing, no day to highlight + local month = tonumber(os.date('%m')) + local year = tonumber(os.date('%Y')) + + month = month + calendar.offset + + if month > 12 then + month = month % 12 + year = year + 1 + if month <= 0 then + month = 12 + end + elseif month < 1 then + month = month + 12 + year = year - 1 + if month <= 0 then + month = 1 + end + end + + calendar.notify_icon = nil + + f = io.popen(calendar.cal .. ' ' .. month .. ' ' .. year) + end + + c_text = "" + .. f:read() .. "\n\n" + .. f:read() .. "\n" + .. f:read("*a"):gsub("\n*$", "") + .. "" + f:close() + + cal_notification = naughty.notify({ + text = c_text, + icon = calendar.notify_icon, + position = calendar.position, + fg = calendar.fg, + bg = calendar.bg, + timeout = tims, + screen = scr or 1 + }) +end + +function calendar:attach(widget, args) + local args = args or {} + calendar.cal = args.cal or "/usr/bin/cal" + calendar.icons = args.icons or icons_dir .. "cal/white/" + calendar.font = args.font or beautiful.font:sub(beautiful.font:find(""), + beautiful.font:find(" ")) + calendar.font_size = tonumber(args.font_size) or 11 + calendar.fg = args.fg or beautiful.fg_normal or "#FFFFFF" + calendar.bg = args.bg or beautiful.bg_normal or "#FFFFFF" + calendar.position = args.position or "top_right" + calendar.scr_pos = args.scr_pos or 1 + + calendar.offset = 0 + calendar.notify_icon = nil + + widget:connect_signal("mouse::enter", function () calendar:show(0, 0, 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, scr_pos) end), + awful.button({ }, 3, function () + calendar:show(0, 1, scr_pos) end), + awful.button({ }, 4, function () + calendar:show(0, -1, scr_pos) end), + awful.button({ }, 5, function () + calendar:show(0, 1, scr_pos) end))) +end + +return setmetatable(calendar, { __call = function(_, ...) return create(...) end }) diff --git a/awesome/lain/widgets/contrib/ccurr.lua b/awesome/lain/widgets/contrib/ccurr.lua new file mode 100644 index 0000000..f696a35 --- /dev/null +++ b/awesome/lain/widgets/contrib/ccurr.lua @@ -0,0 +1,82 @@ + +--[[ + + Licensed under GNU General Public License v2 + * (c) 2014, Aaron Lebo + +--]] + +local newtimer = require("lain.helpers").newtimer + +local wibox = require("wibox") +local json = require("dkjson") + +local string = { format = string.format } +local tonumber = tonumber + +-- Crypto currencies widget +-- lain.widgets.contrib.ccurr +local ccurr = {} + +-- Currently gets +-- * BTC/USD +-- * DOGE/USD +-- using Coinbase and Cryptsy APIs. + +-- requires http://dkolf.de/src/dkjson-lua.fsl/home +-- based upon http://awesome.naquadah.org/wiki/Bitcoin_Price_Widget + +local function get(url) + local f = io.popen('curl -m 5 -s "' .. url .. '"') + if not f then + return 0 + else + local s = f:read("*all") + f:close() + return s + end +end + +local function parse(j) + local obj, pos, err = json.decode(j, 1, nil) + if err then + return nil + else + return obj + end +end + +local function worker(args) + local args = args or {} + local timeout = args.timeout or 600 + local btc_url = args.btc_url or "https://coinbase.com/api/v1/prices/buy" + local doge_url = args.doge_url or "http://pubapi.cryptsy.com/api.php?method=singlemarketdata&marketid=132" + local settings = args.settings or function() end + + ccurr.widget = wibox.widget.textbox('') + + local function update() + price_now = { + btc = "N/A", + doge = "N/A" + } + + btc = parse(get(btc_url)) + doge = parse(get(doge_url)) + + if btc and doge then + price_now.btc = tonumber(btc["subtotal"]["amount"]) + price_now.doge = tonumber(doge["return"]["markets"]["DOGE"]["lasttradeprice"]) + price_now.doge = string.format("%.4f", price_now.btc * price_now.doge) + end + + widget = ccurr.widget + settings() + end + + newtimer("ccurr", timeout, update) + + return ccurr.widget +end + +return setmetatable(ccurr, { __call = function(_, ...) return worker(...) end }) diff --git a/awesome/lain/widgets/contrib/init.lua b/awesome/lain/widgets/contrib/init.lua new file mode 100644 index 0000000..ccaed82 --- /dev/null +++ b/awesome/lain/widgets/contrib/init.lua @@ -0,0 +1,19 @@ + +--[[ + + Lain + Layouts, widgets and utilities for Awesome WM + + Users contributed widgets section + + Licensed under GNU General Public License v2 + * (c) 2013, Luke Bonham + +--]] + +local wrequire = require("lain.helpers").wrequire +local setmetatable = setmetatable + +local widgets = { _NAME = "lain.widgets.contrib" } + +return setmetatable(widgets, { __index = wrequire }) diff --git a/awesome/lain/widgets/contrib/redshift.lua b/awesome/lain/widgets/contrib/redshift.lua new file mode 100644 index 0000000..38f1d83 --- /dev/null +++ b/awesome/lain/widgets/contrib/redshift.lua @@ -0,0 +1,79 @@ + +--[[ + + Licensed under GNU General Public License v2 + * (c) 2014, blueluke + +--]] + +local os = os +local awful = require("awful") +local spawn = awful.util.spawn_with_shell + +local setmetatable = setmetatable + +-- redshift +-- lain.widgets.contrib.redshift +local redshift = {} + +local attached = false -- true if attached to a widget +local active = false -- true if redshift is active +local running = false -- true if redshift was initialized +local update_fnct = function() end -- function that is run each time redshift is toggled. See redshift:attach(). + + +local function init() + -- As there is no way to determine if redshift was previously + -- toggled off (i.e Awesome on-the-fly restart), kill redshift to make sure + os.execute("pkill redshift") + -- Remove existing color adjustment + spawn("redshift -x") + -- (Re)start redshift + spawn("redshift") + running = true + active = true +end + +function redshift:toggle() + if running then + -- Sending -USR1 toggles redshift (See project website) + os.execute("pkill -USR1 redshift") + active = not active + else + init() + end + update_fnct() +end + +function redshift:off() + if running and active then + redshift:toggle() + end +end + +function redshift:on() + if not active then + redshift:toggle() + end +end + +function redshift:is_active() + return active +end + +-- Attach to a widget +-- Provides a button which toggles redshift on/off on click +-- @ param widget: widget to attach to +-- @ param fnct: function to be run each time redshift is toggled (optional). +-- Use it to update widget text or icons on status change. +function redshift:attach(widget, fnct) + update_fnct = fnct or function() end + if not attached then + init() + attached = true + update_fnct() + end + widget:buttons(awful.util.table.join( awful.button({}, 1, function () redshift:toggle() end) )) +end + +return setmetatable(redshift, { _call = function(_, ...) return create(...) end }) diff --git a/awesome/lain/widgets/contrib/task.lua b/awesome/lain/widgets/contrib/task.lua new file mode 100644 index 0000000..2e30cdc --- /dev/null +++ b/awesome/lain/widgets/contrib/task.lua @@ -0,0 +1,133 @@ + +--[[ + + Licensed under GNU General Public License v2 + * (c) 2013, Jan Xie + +--]] + +local icons_dir = require("lain.helpers").icons_dir + +local awful = require("awful") +local beautiful = require("beautiful") +local naughty = require("naughty") + +local io = io +local string = { len = string.len } +local tonumber = tonumber + +local setmetatable = setmetatable + +-- Taskwarrior notification +-- lain.widgets.contrib.task +local task = {} + +local task_notification = nil + +function task:hide() + if task_notification ~= nil then + naughty.destroy(task_notification) + task_notification = nil + end +end + +function task:show() + task:hide() + + local f, c_text + + f = io.popen('task') + c_text = "" + .. f:read("*all"):gsub("\n*$", "") + .. "" + f:close() + + task_notification = naughty.notify({ title = "[task next]", + text = c_text, + icon = task.notify_icon, + position = task.position, + fg = task.fg, + bg = task.bg, + timeout = task.timeout, + }) +end + +function task:prompt_add() + awful.prompt.run({ prompt = "Add task: " }, + mypromptbox[mouse.screen].widget, + function (...) + local f = io.popen("task add " .. ...) + c_text = "\n" + .. f:read("*all") + .. "" + f:close() + + naughty.notify({ + text = c_text, + icon = task.notify_icon, + position = task.position, + fg = task.fg, + bg = task.bg, + timeout = task.timeout, + }) + end, + nil, + awful.util.getdir("cache") .. "/history_task_add") +end + +function task:prompt_search() + awful.prompt.run({ prompt = "Search task: " }, + mypromptbox[mouse.screen].widget, + function (...) + local f = io.popen("task " .. ...) + c_text = f:read("*all"):gsub(" \n*$", "") + f:close() + + if string.len(c_text) == 0 + then + c_text = "No results found." + else + c_text = "" + .. c_text + .. "" + end + + naughty.notify({ + title = "[task next " .. ... .. "]", + text = c_text, + icon = task.notify_icon, + position = task.position, + fg = task.fg, + bg = task.bg, + timeout = task.timeout, + }) + end, + nil, + awful.util.getdir("cache") .. "/history_task") +end + +function task:attach(widget, args) + local args = args or {} + + task.font_size = tonumber(args.font_size) or 12 + task.font = beautiful.font:sub(beautiful.font:find(""), + beautiful.font:find(" ")) + task.fg = args.fg or beautiful.fg_normal or "#FFFFFF" + task.bg = args.bg or beautiful.bg_normal or "#FFFFFF" + task.position = args.position or "top_right" + task.timeout = args.timeout or 7 + + 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() end) + widget:connect_signal("mouse::leave", function () task:hide() end) +end + +return setmetatable(task, { __call = function(_, ...) return create(...) end }) diff --git a/awesome/lain/widgets/contrib/tpbat/init.lua b/awesome/lain/widgets/contrib/tpbat/init.lua new file mode 100644 index 0000000..782bf35 --- /dev/null +++ b/awesome/lain/widgets/contrib/tpbat/init.lua @@ -0,0 +1,170 @@ + +--[[ + + tpbat.lua + Battery status widget for ThinkPad laptops that use SMAPI + lain.widgets.contrib.tpbat + + More on tp_smapi: http://www.thinkwiki.org/wiki/Tp_smapi + + Licensed under GNU General Public License v2 + * (c) 2013, Conor Heine + * (c) 2013, Luke Bonham + * (c) 2010-2012, Peter Hofmann + +--]] + +local debug = { getinfo = debug.getinfo } +local newtimer = require("lain.helpers").newtimer +local first_line = require("lain.helpers").first_line +local beautiful = require("beautiful") +local naughty = require("naughty") +local wibox = require("wibox") + +local string = { format = string.format } +local math = { floor = math.floor } +local tostring = tostring +local setmetatable = setmetatable + +package.path = debug.getinfo(1,"S").source:match[[^@?(.*[\/])[^\/]-$]] .. "?.lua;" .. package.path +local smapi = require("smapi") + +-- ThinkPad SMAPI-enabled battery info widget +-- lain.widgets.contrib.tpbat +local tpbat = { } +local tpbat_notification = nil + +function tpbat:hide() + if tpbat_notification ~= nil + then + naughty.destroy(tpbat_notification) + tpbat_notification = nil + end +end + +function tpbat:show(t_out) + tpbat:hide() + + local bat = self.bat + local t_out = t_out or 0 + + if bat == nil or not bat:installed() then return end + + local mfgr = bat:get('manufacturer') or "no_mfgr" + local model = bat:get('model') or "no_model" + local chem = bat:get('chemistry') or "no_chem" + local status = bat:get('state') or "nil" + local time = bat:remaining_time() + local msg = "\t" + + 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") + end + else + msg = "On AC Power" + end + + local str = string.format("%s : %s %s (%s)\n", bat.name, mfgr, model, chem) + .. string.format("\n%s \t\t\t %s", status:upper(), msg) + + tpbat_notification = naughty.notify({ + preset = { fg = beautiful.fg_normal }, + text = str, + timeout = t_out, + screen = client.focus and client.focus.screen or 1 + }) +end + +function tpbat.register(args) + local args = args or {} + local timeout = args.timeout or 30 + local battery = args.battery or "BAT0" + local settings = args.settings or function() end + + tpbat.bat = smapi:battery(battery) -- Create a new battery + local bat = tpbat.bat + + tpbat.widget = wibox.widget.textbox('') + + bat_notification_low_preset = { + title = "Battery low", + text = "Plug the cable!", + timeout = 15, + fg = "#202020", + bg = "#CDCDCD" + } + + bat_notification_critical_preset = { + title = "Battery exhausted", + text = "Shutdown imminent", + timeout = 15, + fg = "#000000", + bg = "#FFFFFF" + } + + if bat:get('state') == nil + then + local n = naughty.notify({ + preset = bat_notification_low_preset, + title = "SMAPI Battery Warning: Unable to read battery state!", + text = "This widget is intended for ThinkPads. Is tp_smapi installed? Check your configs & paths.", + screen = client.focus and client.focus.screen or 1 + }) + end + + function update() + bat_now = { + status = "Not present", + perc = "N/A", + time = "N/A", + watt = "N/A" + } + + if bat:installed() + then + bat_now.status = bat:status() or "N/A" + bat_now.perc = bat:percent() + bat_now.time = bat:remaining_time() + -- bat_now.watt = string.format("%.2fW", (VOLTS * AMPS) / 1e12) + + -- notifications for low and critical states (when discharging) + if bat_now.status == "discharging" + then + if bat_now.perc <= 5 + then + tpbat.id = naughty.notify({ + preset = bat_notification_critical_preset, + replaces_id = tpbat.id, + screen = client.focus and client.focus.screen or 1 + }).id + elseif bat_now.perc <= 15 + then + tpbat.id = naughty.notify({ + preset = bat_notification_low_preset, + replaces_id = tpbat.id, + screen = client.focus and client.focus.screen or 1 + }).id + end + end + + bat_now.perc = tostring(bat_now.perc) + end + + widget = tpbat.widget + settings() + end + + newtimer("tpbat", timeout, update) + + widget:connect_signal('mouse::enter', function () tpbat:show() end) + widget:connect_signal('mouse::leave', function () tpbat:hide() end) + + return tpbat.widget +end + +return setmetatable(tpbat, { __call = function(_, ...) return tpbat.register(...) end }) diff --git a/awesome/lain/widgets/contrib/tpbat/smapi.lua b/awesome/lain/widgets/contrib/tpbat/smapi.lua new file mode 100644 index 0000000..862d4cd --- /dev/null +++ b/awesome/lain/widgets/contrib/tpbat/smapi.lua @@ -0,0 +1,102 @@ + +--[[ + + smapi.lua + Interface with thinkpad battery information + + Licensed under GNU General Public License v2 + * (c) 2013, Conor Heine + +--]] + +local first_line = require("lain.helpers").first_line + +local string = { format = string.format } +local tonumber = tonumber +local setmetatable = setmetatable + +local smapi = {} + +local apipath = "/sys/devices/platform/smapi" + +-- Most are readable values, but some can be written to (not implemented, yet?) +local readable = { + barcoding = true, + charging_max_current = true, + charging_max_voltage = true, + chemistry = true, + current_avg = true, + current_now = true, + cycle_count = true, + design_capacity = true, + design_voltage = true, + dump = true, + first_use_date = true, + force_discharge = false, + group0_voltage = true, + group1_voltage = true, + group2_voltage = true, + group3_voltage = true, + inhibit_charge_minutes = false, + installed = true, + last_full_capacity = true, + manufacture_date = true, + manufacturer = true, + model = true, + power_avg = true, + power_now = true, + remaining_capacity = true, + remaining_charging_time = true, + remaining_percent = true, + remaining_percent_error = true, + remaining_running_time = true, + remaining_running_time_now = true, + serial = true, + start_charge_thresh = false, + state = true, + stop_charge_thresh = false, + temperature = true, + voltage = true, +} + +function smapi:battery(name) + local bat = {} + + bat.name = name + bat.path = apipath .. "/" .. name + + function bat:get(item) + return self.path ~= nil and readable[item] and first_line(self.path .. "/" .. item) or nil + end + + function bat:installed() + return self:get("installed") == "1" + end + + function bat:status() + return self:get('state') + end + + -- Remaining time can either be time until battery dies or time until charging completes + function bat:remaining_time() + local time_val = bat_now.status == 'discharging' and 'remaining_running_time' or 'remaining_charging_time' + local mins_left = self:get(time_val) + + if mins_left:find("^%d+") == nil + then + return "N/A" + end + + local hrs = mins_left / 60 + local min = mins_left % 60 + return string.format("%02d:%02d", hrs, min) + end + + function bat:percent() + return tonumber(self:get("remaining_percent")) + end + + return setmetatable(bat, {__metatable = false, __newindex = false}) +end + +return smapi diff --git a/awesome/lain/widgets/cpu.lua b/awesome/lain/widgets/cpu.lua new file mode 100644 index 0000000..7c1ecb0 --- /dev/null +++ b/awesome/lain/widgets/cpu.lua @@ -0,0 +1,77 @@ + +--[[ + + Licensed under GNU General Public License v2 + * (c) 2013, Luke Bonham + * (c) 2010-2012, Peter Hofmann + +--]] + +local first_line = require("lain.helpers").first_line +local newtimer = require("lain.helpers").newtimer + +local wibox = require("wibox") + +local math = { ceil = math.ceil } +local string = { format = string.format, + gmatch = string.gmatch } +local tostring = tostring + +local setmetatable = setmetatable + +-- CPU usage +-- lain.widgets.cpu +local cpu = { + last_total = 0, + last_active = 0 +} + +local function worker(args) + local args = args or {} + local timeout = args.timeout or 5 + local settings = args.settings or function() end + + cpu.widget = wibox.widget.textbox('') + + function update() + -- Read the amount of time the CPUs have spent performing + -- different kinds of work. Read the first line of /proc/stat + -- which is the sum of all CPUs. + local times = first_line("/proc/stat") + local at = 1 + local idle = 0 + local total = 0 + for field in string.gmatch(times, "[%s]+([^%s]+)") + do + -- 4 = idle, 5 = ioWait. Essentially, the CPUs have done + -- nothing during these times. + if at == 4 or at == 5 + then + idle = idle + field + end + total = total + field + at = at + 1 + end + local active = total - idle + + -- Read current data and calculate relative values. + local dactive = active - cpu.last_active + local dtotal = total - cpu.last_total + + cpu_now = {} + cpu_now.usage = tostring(math.ceil((dactive / dtotal) * 100)) + + widget = cpu.widget + settings() + + -- Save current data for the next run. + cpu.last_active = active + cpu.last_total = total + end + + newtimer("cpu", timeout, update) + + return cpu.widget +end + +return setmetatable(cpu, { __call = function(_, ...) return worker(...) end }) diff --git a/awesome/lain/widgets/fs.lua b/awesome/lain/widgets/fs.lua new file mode 100644 index 0000000..3b99cba --- /dev/null +++ b/awesome/lain/widgets/fs.lua @@ -0,0 +1,117 @@ + +--[[ + + Licensed under GNU General Public License v2 + * (c) 2013, Luke Bonham + * (c) 2010, Adrian C. + * (c) 2009, Lucas de Vries + +--]] + +local helpers = require("lain.helpers") + +local beautiful = require("beautiful") +local wibox = require("wibox") +local naughty = require("naughty") + +local io = { popen = io.popen } +local pairs = pairs +local string = { match = string.match, + format = string.format } +local tonumber = tonumber + +local setmetatable = setmetatable + +-- File system disk space usage +-- lain.widgets.fs +local fs = {} + +local notification = nil +fs_notification_preset = { fg = beautiful.fg_normal } + +function fs:hide() + if notification ~= nil then + naughty.destroy(notification) + notification = nil + end +end + +function fs:show(t_out) + fs:hide() + + local f = io.popen(helpers.scripts_dir .. "dfs") + ws = f:read("*a"):gsub("\n*$", "") + f:close() + + notification = naughty.notify({ + preset = fs_notification_preset, + text = ws, + timeout = t_out, + }) +end + +-- Unit definitions +local unit = { ["mb"] = 1024, ["gb"] = 1024^2 } + +local function worker(args) + local args = args or {} + local timeout = args.timeout or 600 + local partition = args.partition or "/" + local settings = args.settings or function() end + + fs.widget = wibox.widget.textbox('') + + helpers.set_map("fs", false) + + function update() + fs_info = {} + fs_now = {} + local f = io.popen("LC_ALL=C df -kP " .. partition) + + for line in f:lines() do -- Match: (size) (used)(avail)(use%) (mount) + local s = string.match(line, "^.-[%s]([%d]+)") + local u,a,p = string.match(line, "([%d]+)[%D]+([%d]+)[%D]+([%d]+)%%") + local m = string.match(line, "%%[%s]([%p%w]+)") + + if u and m then -- Handle 1st line and broken regexp + fs_info[m .. " size_mb"] = string.format("%.1f", tonumber(s) / unit["mb"]) + fs_info[m .. " size_gb"] = string.format("%.1f", tonumber(s) / unit["gb"]) + fs_info[m .. " used_p"] = tonumber(p) + fs_info[m .. " avail_p"] = 100 - tonumber(p) + end + end + + f:close() + + fs_now.used = tonumber(fs_info[partition .. " used_p"]) or 0 + fs_now.available = tonumber(fs_info[partition .. " avail_p"]) or 0 + fs_now.size_mb = tonumber(fs_info[partition .. " size_mb"]) or 0 + fs_now.size_gb = tonumber(fs_info[partition .. " size_gb"]) or 0 + + widget = fs.widget + settings() + + if fs_now.used >= 99 and not helpers.get_map("fs") + then + naughty.notify({ + title = "warning", + text = partition .. " ran out!\nmake some room", + timeout = 8, + fg = "#000000", + bg = "#FFFFFF", + }) + helpers.set_map("fs", true) + else + helpers.set_map("fs", false) + end + end + + helpers.newtimer(partition, timeout, update) + + widget:connect_signal('mouse::enter', function () fs:show(0) end) + widget:connect_signal('mouse::leave', function () fs:hide() end) + + return setmetatable(fs, { __index = fs.widget }) +end + +return setmetatable(fs, { __call = function(_, ...) return worker(...) end }) diff --git a/awesome/lain/widgets/imap.lua b/awesome/lain/widgets/imap.lua new file mode 100644 index 0000000..1ebbb76 --- /dev/null +++ b/awesome/lain/widgets/imap.lua @@ -0,0 +1,93 @@ + +--[[ + + Licensed under GNU General Public License v2 + * (c) 2013, Luke Bonham + +--]] + +local helpers = require("lain.helpers") +local async = require("lain.asyncshell") + +local naughty = require("naughty") +local wibox = require("wibox") + +local string = { format = string.format, + gsub = string.gsub } +local tonumber = tonumber + +local setmetatable = setmetatable + +-- Mail IMAP check +-- lain.widgets.imap + +local function worker(args) + local imap = {} + local args = args or {} + + local server = args.server + local mail = args.mail + local password = args.password + + local port = args.port or 993 + local timeout = args.timeout or 60 + local is_plain = args.is_plain or false + local settings = args.settings or function() end + + local head_command = "curl --connect-timeout 3 -fsm 3" + local request = "-X 'SEARCH (UNSEEN)'" + + helpers.set_map(mail, 0) + + if not is_plain + then + local f = io.popen(password) + password = f:read("*a"):gsub("\n", "") + f:close() + end + + imap.widget = wibox.widget.textbox('') + + function update() + mail_notification_preset = { + icon = helpers.icons_dir .. "mail.png", + position = "top_left" + } + + curl = string.format("%s --url imaps://%s:%s/INBOX -u %s:%q %s -k", + head_command, server, port, mail, password, request) + + async.request(curl, function(f) + ws = f:read("*a") + f:close() + + _, mailcount = string.gsub(ws, "%d+", "") + _ = nil + + widget = imap.widget + settings() + + if mailcount >= 1 and mailcount > helpers.get_map(mail) + then + if mailcount == 1 then + nt = mail .. " has one new message" + else + nt = mail .. " has " .. mailcount .. " new messages" + end + naughty.notify({ + preset = mail_notification_preset, + text = nt, + }) + end + + helpers.set_map(mail, mailcount) + end) + + end + + helpers.newtimer(mail, timeout, update, true) + + return setmetatable(imap, { __index = imap.widget }) +end + +return setmetatable({}, { __call = function(_, ...) return worker(...) end }) diff --git a/awesome/lain/widgets/init.lua b/awesome/lain/widgets/init.lua new file mode 100644 index 0000000..0e863ba --- /dev/null +++ b/awesome/lain/widgets/init.lua @@ -0,0 +1,20 @@ + +--[[ + + Lain + Layouts, widgets and utilities for Awesome WM + + Widgets section + + Licensed under GNU General Public License v2 + * (c) 2013, Luke Bonham + * (c) 2010-2012, Peter Hofmann + +--]] + +local wrequire = require("lain.helpers").wrequire +local setmetatable = setmetatable + +local widgets = { _NAME = "lain.widgets" } + +return setmetatable(widgets, { __index = wrequire }) diff --git a/awesome/lain/widgets/maildir.lua b/awesome/lain/widgets/maildir.lua new file mode 100644 index 0000000..246341f --- /dev/null +++ b/awesome/lain/widgets/maildir.lua @@ -0,0 +1,98 @@ + +--[[ + + Licensed under GNU General Public License v2 + * (c) 2013, Luke Bonham + * (c) 2010-2012, Peter Hofmann + +--]] + +local newtimer = require("lain.helpers").newtimer + +local wibox = require("wibox") + +local util = require("lain.util") + +local io = { popen = io.popen } +local os = { getenv = os.getenv } +local pairs = pairs +local string = { len = string.len, + match = string.match } +local table = { sort = table.sort } + +local setmetatable = setmetatable + +-- Maildir check +-- lain.widgets.maildir +local maildir = {} + +local function worker(args) + local args = args or {} + local timeout = args.timeout or 60 + local mailpath = args.mailpath or os.getenv("HOME") .. "/Mail" + local ignore_boxes = args.ignore_boxes or {} + local settings = args.settings or function() end + + maildir.widget = wibox.widget.textbox('') + + function update() + -- Find pathes to mailboxes. + local p = io.popen("find " .. mailpath .. + " -mindepth 1 -maxdepth 1 -type d" .. + " -not -name .git") + local boxes = {} + repeat + line = p:read("*l") + if line ~= nil + then + -- Find all files in the "new" subdirectory. For each + -- file, print a single character (no newline). Don't + -- match files that begin with a dot. + -- Afterwards the length of this string is the number of + -- new mails in that box. + local np = io.popen("find " .. line .. + "/new -mindepth 1 -type f " .. + "-not -name '.*' -printf a") + local mailstring = np:read("*a") + + -- Strip off leading mailpath. + local box = string.match(line, mailpath .. "/*([^/]+)") + local nummails = string.len(mailstring) + if nummails > 0 + then + boxes[box] = nummails + end + end + until line == nil + + table.sort(boxes) + + newmail = "no mail" + --Count the total number of mails irrespective of where it was found + total = 0 + + for box, number in pairs(boxes) + do + -- Add this box only if it's not to be ignored. + if not util.element_in_table(box, ignore_boxes) + then + total = total + number + if newmail == "no mail" + then + newmail = box .. "(" .. number .. ")" + else + newmail = newmail .. ", " .. + box .. "(" .. number .. ")" + end + end + end + + widget = maildir.widget + settings() + end + + newtimer(mailpath, timeout, update, true) + return maildir.widget +end + +return setmetatable(maildir, { __call = function(_, ...) return worker(...) end }) diff --git a/awesome/lain/widgets/mem.lua b/awesome/lain/widgets/mem.lua new file mode 100644 index 0000000..986fa76 --- /dev/null +++ b/awesome/lain/widgets/mem.lua @@ -0,0 +1,61 @@ + +--[[ + + Licensed under GNU General Public License v2 + * (c) 2013, Luke Bonham + * (c) 2010-2012, Peter Hofmann + +--]] + +local newtimer = require("lain.helpers").newtimer + +local wibox = require("wibox") + +local io = { lines = io.lines } +local math = { floor = math.floor } +local string = { format = string.format, + gmatch = string.gmatch, + len = string.len } + +local setmetatable = setmetatable + +-- Memory usage (ignoring caches) +-- lain.widgets.mem +local mem = {} + +local function worker(args) + local args = args or {} + local timeout = args.timeout or 3 + local settings = args.settings or function() end + + mem.widget = wibox.widget.textbox('') + + function update() + mem_now = {} + for line in io.lines("/proc/meminfo") + do + for k, v in string.gmatch(line, "([%a]+):[%s]+([%d]+).+") + do + if k == "MemTotal" then mem_now.total = math.floor(v / 1024) + elseif k == "MemFree" then mem_now.free = math.floor(v / 1024) + elseif k == "Buffers" then mem_now.buf = math.floor(v / 1024) + elseif k == "Cached" then mem_now.cache = math.floor(v / 1024) + elseif k == "SwapTotal" then mem_now.swap = math.floor(v / 1024) + elseif k == "SwapFree" then mem_now.swapf = math.floor(v / 1024) + end + end + end + + mem_now.used = mem_now.total - (mem_now.free + mem_now.buf + mem_now.cache) + mem_now.swapused = mem_now.swap - mem_now.swapf + + widget = mem.widget + settings() + end + + newtimer("mem", timeout, update) + + return mem.widget +end + +return setmetatable(mem, { __call = function(_, ...) return worker(...) end }) diff --git a/awesome/lain/widgets/mpd.lua b/awesome/lain/widgets/mpd.lua new file mode 100644 index 0000000..7fd611d --- /dev/null +++ b/awesome/lain/widgets/mpd.lua @@ -0,0 +1,108 @@ + +--[[ + + Licensed under GNU General Public License v2 + * (c) 2013, Luke Bonham + * (c) 2010, Adrian C. + +--]] + +local helpers = require("lain.helpers") +local async = require("lain.asyncshell") + +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 setmetatable = setmetatable + +-- MPD infos +-- lain.widgets.mpd +local mpd = {} + +local function worker(args) + local args = args or {} + local timeout = args.timeout or 2 + local password = args.password or "" + local host = args.host or "127.0.0.1" + local port = args.port or "6600" + 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 settings = args.settings or function() end + + local mpdcover = helpers.scripts_dir .. "mpdcover" + local mpdh = "telnet://" .. host .. ":" .. port + local echo = "echo 'password " .. password .. "\nstatus\ncurrentsong\nclose'" + + mpd.widget = wibox.widget.textbox('') + + mpd_notification_preset = { + title = "Now playing", + timeout = 6 + } + + helpers.set_map("current mpd track", nil) + + function mpd.update() + async.request(echo .. " | curl --connect-timeout 1 -fsm 3 " .. mpdh, function (f) + mpd_now = { + state = "N/A", + file = "N/A", + artist = "N/A", + title = "N/A", + album = "N/A", + date = "N/A" + } + + for line in f:lines() do + for k, v in string.gmatch(line, "([%w]+):[%s](.*)$") do + if k == "state" then mpd_now.state = v + elseif k == "file" then mpd_now.file = v + elseif k == "Artist" then mpd_now.artist = escape_f(v) + elseif k == "Title" then mpd_now.title = escape_f(v) + elseif k == "Album" then mpd_now.album = escape_f(v) + elseif k == "Date" then mpd_now.date = escape_f(v) + end + end + end + + mpd_notification_preset.text = string.format("%s (%s) - %s\n%s", mpd_now.artist, + mpd_now.album, mpd_now.date, mpd_now.title) + widget = mpd.widget + settings() + + if mpd_now.state == "play" + then + if mpd_now.title ~= helpers.get_map("current mpd track") + then + helpers.set_map("current mpd track", mpd_now.title) + + os.execute(string.format("%s %q %q %d %q", mpdcover, music_dir, + mpd_now.file, cover_size, default_art)) + + mpd.id = naughty.notify({ + preset = mpd_notification_preset, + icon = "/tmp/mpdcover.png", + replaces_id = mpd.id, + }).id + end + elseif mpd_now.state ~= "pause" + then + helpers.set_map("current mpd track", nil) + end + end) + end + + helpers.newtimer("mpd", timeout, mpd.update) + + return setmetatable(mpd, { __index = mpd.widget }) +end + +return setmetatable(mpd, { __call = function(_, ...) return worker(...) end }) diff --git a/awesome/lain/widgets/net.lua b/awesome/lain/widgets/net.lua new file mode 100644 index 0000000..2b06622 --- /dev/null +++ b/awesome/lain/widgets/net.lua @@ -0,0 +1,110 @@ + +--[[ + + Licensed under GNU General Public License v2 + * (c) 2013, Luke Bonham + * (c) 2010-2012, Peter Hofmann + +--]] + +local helpers = require("lain.helpers") + +local notify_fg = require("beautiful").fg_focus +local naughty = require("naughty") +local wibox = require("wibox") + +local io = { popen = io.popen } +local tostring = tostring +local string = { format = string.format, + gsub = string.gsub, + match = string.match } + +local setmetatable = setmetatable + +-- Network infos +-- lain.widgets.net +local net = { + last_t = 0, + last_r = 0 +} + +function net.get_device() + f = io.popen("ip link show | cut -d' ' -f2,9") + ws = f:read("*a") + f:close() + ws = ws:match("%w+: UP") or ws:match("ppp%w+: UNKNOWN") + if ws ~= nil then + return ws:match("(%w+):") + else + return "network off" + end +end + +local function worker(args) + local args = args or {} + local timeout = args.timeout or 2 + local units = args.units or 1024 --kb + local notify = args.notify or "on" + local screen = args.screen or 1 + local settings = args.settings or function() end + + iface = args.iface or net.get_device() + + net.widget = wibox.widget.textbox('') + + helpers.set_map(iface, true) + + function update() + net_now = {} + + if iface == "" or string.match(iface, "network off") + then + iface = net.get_device() + end + + net_now.carrier = helpers.first_line('/sys/class/net/' .. iface .. + '/carrier') or "0" + net_now.state = helpers.first_line('/sys/class/net/' .. iface .. + '/operstate') or "down" + local now_t = helpers.first_line('/sys/class/net/' .. iface .. + '/statistics/tx_bytes') or 0 + local now_r = helpers.first_line('/sys/class/net/' .. iface .. + '/statistics/rx_bytes') or 0 + + net_now.sent = tostring((now_t - net.last_t) / timeout / units) + net_now.sent = string.gsub(string.format('%.1f', net_now.sent), ",", ".") + + net_now.received = tostring((now_r - net.last_r) / timeout / units) + net_now.received = string.gsub(string.format('%.1f', net_now.received), ",", ".") + + widget = net.widget + settings() + + net.last_t = now_t + net.last_r = now_r + + if net_now.carrier ~= "1" and notify == "on" + then + if helpers.get_map(iface) + then + naughty.notify({ + title = iface, + text = "no carrier", + timeout = 7, + position = "top_left", + icon = helpers.icons_dir .. "no_net.png", + fg = notify_fg or "#FFFFFF", + screen = screen + }) + helpers.set_map(iface, false) + end + else + helpers.set_map(iface, true) + end + end + + helpers.newtimer(iface, timeout, update) + return net.widget +end + +return setmetatable(net, { __call = function(_, ...) return worker(...) end }) diff --git a/awesome/lain/widgets/sysload.lua b/awesome/lain/widgets/sysload.lua new file mode 100644 index 0000000..b15b1bf --- /dev/null +++ b/awesome/lain/widgets/sysload.lua @@ -0,0 +1,46 @@ + +--[[ + + Licensed under GNU General Public License v2 + * (c) 2013, Luke Bonham + * (c) 2010-2012, Peter Hofmann + +--]] + +local newtimer = require("lain.helpers").newtimer + +local wibox = require("wibox") + +local io = { open = io.open } +local string = { format = string.format, + match = string.match } + +local setmetatable = setmetatable + +-- System load +-- lain.widgets.sysload +local sysload = {} + +local function worker(args) + local args = args or {} + local timeout = args.timeout or 5 + local settings = args.settings or function() end + + sysload.widget = wibox.widget.textbox('') + + function update() + local f = io.open("/proc/loadavg") + local ret = f:read("*a") + f:close() + + load_1, load_5, load_15 = string.match(ret, "([^%s]+) ([^%s]+) ([^%s]+)") + + widget = sysload.widget + settings() + end + + newtimer("sysload", timeout, update) + return sysload.widget +end + +return setmetatable(sysload, { __call = function(_, ...) return worker(...) end }) diff --git a/awesome/lain/widgets/temp.lua b/awesome/lain/widgets/temp.lua new file mode 100644 index 0000000..5994f59 --- /dev/null +++ b/awesome/lain/widgets/temp.lua @@ -0,0 +1,48 @@ + +--[[ + + Licensed under GNU General Public License v2 + * (c) 2013, Luke Bonham + +--]] + +local newtimer = require("lain.helpers").newtimer + +local wibox = require("wibox") + +local io = { open = io.open } +local tonumber = tonumber + +local setmetatable = setmetatable + +-- coretemp +-- lain.widgets.temp +local temp = {} + +local function worker(args) + local args = args or {} + local timeout = args.timeout or 5 + local tempfile = args.tempfile or "/sys/class/thermal/thermal_zone0/temp" + local settings = args.settings or function() end + + temp.widget = wibox.widget.textbox('') + + function update() + local f = io.open(tempfile) + if f ~= nil + then + coretemp_now = tonumber(f:read("*a")) / 1000 + f:close() + else + coretemp_now = "N/A" + end + + widget = temp.widget + settings() + end + + newtimer("coretemp", timeout, update) + return temp.widget +end + +return setmetatable(temp, { __call = function(_, ...) return worker(...) end }) diff --git a/awesome/lain/widgets/yawn/icons/BlowingSnow.png b/awesome/lain/widgets/yawn/icons/BlowingSnow.png new file mode 100755 index 0000000..6223f8f Binary files /dev/null and b/awesome/lain/widgets/yawn/icons/BlowingSnow.png differ diff --git a/awesome/lain/widgets/yawn/icons/Cloudy.png b/awesome/lain/widgets/yawn/icons/Cloudy.png new file mode 100755 index 0000000..bac1e7e Binary files /dev/null and b/awesome/lain/widgets/yawn/icons/Cloudy.png differ diff --git a/awesome/lain/widgets/yawn/icons/DayClear.png b/awesome/lain/widgets/yawn/icons/DayClear.png new file mode 100755 index 0000000..d9e2745 Binary files /dev/null and b/awesome/lain/widgets/yawn/icons/DayClear.png differ diff --git a/awesome/lain/widgets/yawn/icons/DayFair.png b/awesome/lain/widgets/yawn/icons/DayFair.png new file mode 120000 index 0000000..8ee94d1 --- /dev/null +++ b/awesome/lain/widgets/yawn/icons/DayFair.png @@ -0,0 +1 @@ +DayClear.png \ No newline at end of file diff --git a/awesome/lain/widgets/yawn/icons/DayMostlyCloudy.png b/awesome/lain/widgets/yawn/icons/DayMostlyCloudy.png new file mode 100755 index 0000000..22b929c Binary files /dev/null and b/awesome/lain/widgets/yawn/icons/DayMostlyCloudy.png differ diff --git a/awesome/lain/widgets/yawn/icons/DayPartlyCloudy.png b/awesome/lain/widgets/yawn/icons/DayPartlyCloudy.png new file mode 100755 index 0000000..8fd0a5b Binary files /dev/null and b/awesome/lain/widgets/yawn/icons/DayPartlyCloudy.png differ diff --git a/awesome/lain/widgets/yawn/icons/Drizzle.png b/awesome/lain/widgets/yawn/icons/Drizzle.png new file mode 120000 index 0000000..df34463 --- /dev/null +++ b/awesome/lain/widgets/yawn/icons/Drizzle.png @@ -0,0 +1 @@ +Rain.png \ No newline at end of file diff --git a/awesome/lain/widgets/yawn/icons/Fog.png b/awesome/lain/widgets/yawn/icons/Fog.png new file mode 120000 index 0000000..b615645 --- /dev/null +++ b/awesome/lain/widgets/yawn/icons/Fog.png @@ -0,0 +1 @@ +Foggy.png \ No newline at end of file diff --git a/awesome/lain/widgets/yawn/icons/Foggy.png b/awesome/lain/widgets/yawn/icons/Foggy.png new file mode 100755 index 0000000..009039f Binary files /dev/null and b/awesome/lain/widgets/yawn/icons/Foggy.png differ diff --git a/awesome/lain/widgets/yawn/icons/FreezingDrizzle.png b/awesome/lain/widgets/yawn/icons/FreezingDrizzle.png new file mode 100755 index 0000000..6a66140 Binary files /dev/null and b/awesome/lain/widgets/yawn/icons/FreezingDrizzle.png differ diff --git a/awesome/lain/widgets/yawn/icons/FreezingRain.png b/awesome/lain/widgets/yawn/icons/FreezingRain.png new file mode 100755 index 0000000..c924fac Binary files /dev/null and b/awesome/lain/widgets/yawn/icons/FreezingRain.png differ diff --git a/awesome/lain/widgets/yawn/icons/Hail.png b/awesome/lain/widgets/yawn/icons/Hail.png new file mode 100755 index 0000000..009039f Binary files /dev/null and b/awesome/lain/widgets/yawn/icons/Hail.png differ diff --git a/awesome/lain/widgets/yawn/icons/Haze.png b/awesome/lain/widgets/yawn/icons/Haze.png new file mode 120000 index 0000000..0874a83 --- /dev/null +++ b/awesome/lain/widgets/yawn/icons/Haze.png @@ -0,0 +1 @@ +Hail.png \ No newline at end of file diff --git a/awesome/lain/widgets/yawn/icons/HeavyRain.png b/awesome/lain/widgets/yawn/icons/HeavyRain.png new file mode 120000 index 0000000..ace2a94 --- /dev/null +++ b/awesome/lain/widgets/yawn/icons/HeavyRain.png @@ -0,0 +1 @@ +Showers.png \ No newline at end of file diff --git a/awesome/lain/widgets/yawn/icons/HeavySnow.png b/awesome/lain/widgets/yawn/icons/HeavySnow.png new file mode 100755 index 0000000..ddcb8f3 Binary files /dev/null and b/awesome/lain/widgets/yawn/icons/HeavySnow.png differ diff --git a/awesome/lain/widgets/yawn/icons/LightRain.png b/awesome/lain/widgets/yawn/icons/LightRain.png new file mode 120000 index 0000000..df34463 --- /dev/null +++ b/awesome/lain/widgets/yawn/icons/LightRain.png @@ -0,0 +1 @@ +Rain.png \ No newline at end of file diff --git a/awesome/lain/widgets/yawn/icons/LightSnow.png b/awesome/lain/widgets/yawn/icons/LightSnow.png new file mode 120000 index 0000000..aa8b28e --- /dev/null +++ b/awesome/lain/widgets/yawn/icons/LightSnow.png @@ -0,0 +1 @@ +LightSnowShowers.png \ No newline at end of file diff --git a/awesome/lain/widgets/yawn/icons/LightSnowShowers.png b/awesome/lain/widgets/yawn/icons/LightSnowShowers.png new file mode 100755 index 0000000..d797ee9 Binary files /dev/null and b/awesome/lain/widgets/yawn/icons/LightSnowShowers.png differ diff --git a/awesome/lain/widgets/yawn/icons/Mist.png b/awesome/lain/widgets/yawn/icons/Mist.png new file mode 120000 index 0000000..b615645 --- /dev/null +++ b/awesome/lain/widgets/yawn/icons/Mist.png @@ -0,0 +1 @@ +Foggy.png \ No newline at end of file diff --git a/awesome/lain/widgets/yawn/icons/MixedRainAndHail.png b/awesome/lain/widgets/yawn/icons/MixedRainAndHail.png new file mode 100755 index 0000000..758b01e Binary files /dev/null and b/awesome/lain/widgets/yawn/icons/MixedRainAndHail.png differ diff --git a/awesome/lain/widgets/yawn/icons/MixedRainAndSleet.png b/awesome/lain/widgets/yawn/icons/MixedRainAndSleet.png new file mode 100755 index 0000000..7f0d252 Binary files /dev/null and b/awesome/lain/widgets/yawn/icons/MixedRainAndSleet.png differ diff --git a/awesome/lain/widgets/yawn/icons/MixedRainAndSnow.png b/awesome/lain/widgets/yawn/icons/MixedRainAndSnow.png new file mode 100755 index 0000000..0a07b7b Binary files /dev/null and b/awesome/lain/widgets/yawn/icons/MixedRainAndSnow.png differ diff --git a/awesome/lain/widgets/yawn/icons/NightClear.png b/awesome/lain/widgets/yawn/icons/NightClear.png new file mode 100755 index 0000000..84ea140 Binary files /dev/null and b/awesome/lain/widgets/yawn/icons/NightClear.png differ diff --git a/awesome/lain/widgets/yawn/icons/NightFair.png b/awesome/lain/widgets/yawn/icons/NightFair.png new file mode 120000 index 0000000..23df45a --- /dev/null +++ b/awesome/lain/widgets/yawn/icons/NightFair.png @@ -0,0 +1 @@ +NightClear.png \ No newline at end of file diff --git a/awesome/lain/widgets/yawn/icons/NightMostlyCloudy.png b/awesome/lain/widgets/yawn/icons/NightMostlyCloudy.png new file mode 100755 index 0000000..d8b3673 Binary files /dev/null and b/awesome/lain/widgets/yawn/icons/NightMostlyCloudy.png differ diff --git a/awesome/lain/widgets/yawn/icons/NightPartlyCloudy.png b/awesome/lain/widgets/yawn/icons/NightPartlyCloudy.png new file mode 100755 index 0000000..9e4404d Binary files /dev/null and b/awesome/lain/widgets/yawn/icons/NightPartlyCloudy.png differ diff --git a/awesome/lain/widgets/yawn/icons/README.md b/awesome/lain/widgets/yawn/icons/README.md new file mode 100644 index 0000000..e4dc111 --- /dev/null +++ b/awesome/lain/widgets/yawn/icons/README.md @@ -0,0 +1,6 @@ +Yawn icons +========== + +These are [Plain Weather Icons](http://merlinthered.deviantart.com/art/plain-weather-icons-157162192), created by [MerlinTheRed](http://merlinthered.deviantart.com/). + + diff --git a/awesome/lain/widgets/yawn/icons/Rain.png b/awesome/lain/widgets/yawn/icons/Rain.png new file mode 100755 index 0000000..d00552a Binary files /dev/null and b/awesome/lain/widgets/yawn/icons/Rain.png differ diff --git a/awesome/lain/widgets/yawn/icons/RainThunder.png b/awesome/lain/widgets/yawn/icons/RainThunder.png new file mode 100755 index 0000000..d30e120 Binary files /dev/null and b/awesome/lain/widgets/yawn/icons/RainThunder.png differ diff --git a/awesome/lain/widgets/yawn/icons/Showers.png b/awesome/lain/widgets/yawn/icons/Showers.png new file mode 100755 index 0000000..3cc6665 Binary files /dev/null and b/awesome/lain/widgets/yawn/icons/Showers.png differ diff --git a/awesome/lain/widgets/yawn/icons/Sleet.png b/awesome/lain/widgets/yawn/icons/Sleet.png new file mode 120000 index 0000000..f8f9693 --- /dev/null +++ b/awesome/lain/widgets/yawn/icons/Sleet.png @@ -0,0 +1 @@ +SnowShowers.png \ No newline at end of file diff --git a/awesome/lain/widgets/yawn/icons/Snow.png b/awesome/lain/widgets/yawn/icons/Snow.png new file mode 120000 index 0000000..f8f9693 --- /dev/null +++ b/awesome/lain/widgets/yawn/icons/Snow.png @@ -0,0 +1 @@ +SnowShowers.png \ No newline at end of file diff --git a/awesome/lain/widgets/yawn/icons/SnowFlurries.png b/awesome/lain/widgets/yawn/icons/SnowFlurries.png new file mode 120000 index 0000000..2e090cd --- /dev/null +++ b/awesome/lain/widgets/yawn/icons/SnowFlurries.png @@ -0,0 +1 @@ +BlowingSnow.png \ No newline at end of file diff --git a/awesome/lain/widgets/yawn/icons/SnowShowers.png b/awesome/lain/widgets/yawn/icons/SnowShowers.png new file mode 100755 index 0000000..30534a2 Binary files /dev/null and b/awesome/lain/widgets/yawn/icons/SnowShowers.png differ diff --git a/awesome/lain/widgets/yawn/icons/Sunny.png b/awesome/lain/widgets/yawn/icons/Sunny.png new file mode 100755 index 0000000..cf08c5c Binary files /dev/null and b/awesome/lain/widgets/yawn/icons/Sunny.png differ diff --git a/awesome/lain/widgets/yawn/icons/ThunderintheVicinity.png b/awesome/lain/widgets/yawn/icons/ThunderintheVicinity.png new file mode 120000 index 0000000..1fb3b9c --- /dev/null +++ b/awesome/lain/widgets/yawn/icons/ThunderintheVicinity.png @@ -0,0 +1 @@ +Cloudy.png \ No newline at end of file diff --git a/awesome/lain/widgets/yawn/icons/Wind.png b/awesome/lain/widgets/yawn/icons/Wind.png new file mode 100755 index 0000000..5dc1356 Binary files /dev/null and b/awesome/lain/widgets/yawn/icons/Wind.png differ diff --git a/awesome/lain/widgets/yawn/icons/na.png b/awesome/lain/widgets/yawn/icons/na.png new file mode 100755 index 0000000..62a5350 Binary files /dev/null and b/awesome/lain/widgets/yawn/icons/na.png differ diff --git a/awesome/lain/widgets/yawn/init.lua b/awesome/lain/widgets/yawn/init.lua new file mode 100644 index 0000000..be3e614 --- /dev/null +++ b/awesome/lain/widgets/yawn/init.lua @@ -0,0 +1,206 @@ + +--[[ + + Licensed under GNU General Public License v2 + * (c) 2013, Luke Bonham + +--]] + +local newtimer = require("lain.helpers").newtimer +local async = require("lain.asyncshell") + +local naughty = require("naughty") +local wibox = require("wibox") + +local debug = { getinfo = debug.getinfo } +local io = { lines = io.lines, + open = io.open } +local os = { date = os.date, + getenv = os.getenv } +local string = { find = string.find, + match = string.match, + gsub = string.gsub, + sub = string.sub } +local tonumber = tonumber + +local setmetatable = setmetatable + +-- YAhoo! Weather Notification +-- lain.widgets.yawn +local yawn = +{ + icon = wibox.widget.imagebox(), + widget = wibox.widget.textbox('') +} + +local project_path = debug.getinfo(1, 'S').source:match[[^@(.*/).*$]] +local localizations_path = project_path .. 'localizations/' +local icon_path = project_path .. 'icons/' +local api_url = 'http://weather.yahooapis.com/forecastrss' +local units_set = '?u=c&w=' -- Default is Celsius +local language = string.match(os.getenv("LANG"), "(%S*$*)[.]") or "en_US" -- if LANG is not set +local weather_data = nil +local notification = nil +local city_id = nil +local sky = nil +local settings = function() end + +yawn_notification_preset = {} + +function yawn.fetch_weather() + local url = api_url .. units_set .. city_id + local cmd = "curl --connect-timeout 1 -fsm 3 '" .. url .. "'" + + async.request(cmd, function(f) + local text = f:read("*a") + f:close() + + -- In case of no connection or invalid city ID + -- widgets won't display + if text == "" or text:match("City not found") + then + yawn.icon:set_image(icon_path .. "na.png") + if text == "" then + weather_data = "Service not available at the moment." + yawn.widget:set_text(" N/A ") + else + weather_data = "City not found!\n" .. + "Are you sure " .. city_id .. + " is your Yahoo city ID?" + yawn.widget:set_text(" ? ") + end + return + end + + -- Processing raw data + weather_data = text:gsub("<.->", "") + weather_data = weather_data:match("Current Conditions:.-Full") or "" + + -- may still happens in case of bad connectivity + if weather_data == "" then + yawn.icon:set_image(icon_path .. "na.png") + yawn.widget:set_text(" ? ") + return + end + + weather_data = weather_data:gsub("Current Conditions:.-\n", "Now: ") + weather_data = weather_data:gsub("Forecast:.-\n", "") + weather_data = weather_data:gsub("\nFull", "") + weather_data = weather_data:gsub("[\n]$", "") + weather_data = weather_data:gsub(" [-] " , ": ") + weather_data = weather_data:gsub("[.]", ",") + weather_data = weather_data:gsub("High: ", "") + weather_data = weather_data:gsub(" Low: ", " - ") + + -- Getting info for text widget + local now = weather_data:sub(weather_data:find("Now:")+5, + weather_data:find("\n")-1) + forecast = now:sub(1, now:find(",")-1) + units = now:sub(now:find(",")+2, -2) + + -- Day/Night icon change + local hour = tonumber(os.date("%H")) + sky = icon_path + + if forecast == "Clear" or + forecast == "Fair" or + forecast == "Partly Cloudy" or + forecast == "Mostly Cloudy" + then + if hour >= 6 and hour <= 18 + then + sky = sky .. "Day" + else + sky = sky .. "Night" + end + end + + sky = sky .. forecast:gsub(" ", ""):gsub("/", "") .. ".png" + + -- In case there's no defined icon for current forecast + if io.open(sky) == nil then + sky = icon_path .. "na.png" + end + + -- Localization + local f = io.open(localizations_path .. language, "r") + if language:find("en_") == nil and f ~= nil + then + f:close() + for line in io.lines(localizations_path .. language) + do + word = string.sub(line, 1, line:find("|")-1) + translation = string.sub(line, line:find("|")+1) + weather_data = string.gsub(weather_data, word, translation) + end + end + + -- Finally setting infos + yawn.icon:set_image(sky) + widget = yawn.widget + + _data = weather_data:match(": %S.-,") or weather_data + forecast = _data:gsub(": ", ""):gsub(",", "") + units = units:gsub(" ", "") + + settings() + end) +end + +function yawn.hide() + if notification ~= nil then + naughty.destroy(notification) + notification = nil + end +end + +function yawn.show(t_out) + if yawn.widget._layout.text:match("?") + then + yawn.fetch_weather() + end + + yawn.hide() + + notification = naughty.notify({ + preset = yawn_notification_preset, + text = weather_data, + icon = sky, + timeout = t_out, + }) +end + +function yawn.register(id, args) + local args = args or {} + local timeout = args.timeout or 600 + settings = args.settings or function() end + + if args.u == "f" then units_set = '?u=f&w=' end + + city_id = id + + newtimer("yawn", timeout, yawn.fetch_weather) + + yawn.icon:connect_signal("mouse::enter", function() + yawn.show(0) + end) + yawn.icon:connect_signal("mouse::leave", function() + yawn.hide() + end) + + return yawn +end + +function yawn.attach(widget, id, args) + yawn.register(id, args) + + widget:connect_signal("mouse::enter", function() + yawn.show(0) + end) + + widget:connect_signal("mouse::leave", function() + yawn.hide() + end) +end + +return setmetatable(yawn, { __call = function(_, ...) return yawn.register(...) end }) diff --git a/awesome/lain/widgets/yawn/localizations/fr_FR b/awesome/lain/widgets/yawn/localizations/fr_FR new file mode 100644 index 0000000..18a35bb --- /dev/null +++ b/awesome/lain/widgets/yawn/localizations/fr_FR @@ -0,0 +1,61 @@ +Now:|Auj: +Sun:|Dim: +Mon:|Lun: +Tue:|Mar: +Wed:|Mer: +Thu:|Jeu: +Fri:|Ven: +Sat:|Sam: +Mostly Sunny|Partiellement ensoleillé +Sunny|Ensoleillé +Sun|Soleil +Rain/Thunder|Pluie/Orage +Isolated Thunderstorms|Orages localisés +Scattered Thunderstorms|Orages épars +Thundershowers|Tempête +Thunderstorms|Orages +Thunder in the Vicinity|Orage aux alentours +Thunder|Orages +AM|Matinée +PM|Après-midi +Early|Tôt +Late|Tard +Few|Quelques +Severe|Sévère +Clear|Clair +Fair|Clair +Partly|Partiellement +Mostly|Très +Cloudy|Nuageux +Clouds|Nuages +Scattered Showers|Nuages épars +Light Snow Showers|Légères averses de neige +Snow Showers|Averses de neige +Heavy Snow|Neige +Scattered Snow Showers|Averses de neige localisées +Mixed Rain And Snow|Alternance de neige et de pluie +Mixed Rain And Sleet|Alternance de pluie et de neige fondue +Mixed Snow And Sleet|Alternance de neige et de neige fondue +Mixed Rain And Hail|Alternance de pluie et de grêle +Snow Flurries|Averses de neige +Blowing Snow|Neige +Blowing Rain|Pluie +Heavy Rain|Pluie forte +Freezing Rain|Pluie verglaçante +Showers|Averses +Light Rain|Pluie légère +Heavy|Forte +Rain|Pluie +Windy|Venteux +Wind|Vent +Snow|Neige +Sleet|Neige fondue +Freezing Drizzle|Bruine verglaçante +Light Drizzle|Légère bruine +Drizzle|Bruine +Hail|Grêle +Fog|Brouillard +Foggy|Brumeux +Haze|Brume +Light|Clair +With|Avec diff --git a/awesome/lain/widgets/yawn/localizations/it_IT b/awesome/lain/widgets/yawn/localizations/it_IT new file mode 100644 index 0000000..44d010e --- /dev/null +++ b/awesome/lain/widgets/yawn/localizations/it_IT @@ -0,0 +1,61 @@ +Now:|Ora: +Sun:|Dom: +Mon:|Lun: +Tue:|Mar: +Wed:|Mer: +Thu:|Gio: +Fri:|Ven: +Sat:|Sab: +Mostly Sunny|Abbastanza Soleggiato +Sunny|Soleggiato +Sun|Soleggiato +Rain/Thunder|Temporali +Isolated Thunderstorms|Temporali Isolati +Scattered Thunderstorms|Temporali Sparsi +Thundershowers|Rovesci Temporaleschi +Thunderstorms|Temporali +Thunder in the Vicinity|Tuoni in prossimità +Thunder|Temporale +AM|In Mattinata +PM|Nel Pomeriggio +Early|In Mattinata +Late|In Serata +Few|Sporadiche +Severe|Forti +Clear|Sereno +Fair|Sereno +Partly|Parzialmente +Mostly|Molto +Cloudy|Nuvoloso +Clouds|Nuvoloso +Scattered Showers|Temporali Sparsi +Light Snow Showers|Nevicate Leggere +Snow Showers|Nevicate +aeavy Snow|Forti Nevicate +Scattered Snow Showers|Nevicate Sparse +Mixed Rain And Snow|Pioggia E Neve +Mixed Rain And Sleet|Pioggia E Nevischio +Mixed Snow And Sleet|Neve E Nevischio +Mixed Rain And Hail|Pioggia E Grandine +Snow Flurries|Folate Di Neve +Blowing Snow|Neve Battente +Blowing Rain|Pioggia Battente +Heavy Rain|Forti Piogge +Freezing Rain|Pioggia Congelantesi +Showers|Piogge +Light Rain|Pioggia Leggera +Heavy|Forti +Rain|Piovoso +Windy|Ventoso +Wind|Ventoso +Snow|Neve +Sleet|Nevischio +Light Drizzle|Pioggia Leggera +Drizzle|Pioggia Leggera +Freezing Drizzle|Pioggerella Congelantesi +Hail|Grandine +Fog|Nebbia +Foggy|Nebbioso +Haze|Nebbia +Light|Leggere +With|Con diff --git a/awesome/lain/widgets/yawn/localizations/localization_template b/awesome/lain/widgets/yawn/localizations/localization_template new file mode 100644 index 0000000..2fbf066 --- /dev/null +++ b/awesome/lain/widgets/yawn/localizations/localization_template @@ -0,0 +1,61 @@ +Now:| +Sun:| +Mon:| +Tue:| +Wed:| +Thu:| +Fri:| +Sat:| +Mostly Sunny| +Sunny| +Sun| +Rain/Thunder| +Isolated Thunderstorms| +Scattered Thunderstorms| +Thundershowers| +Thunderstorms| +Thunder in the Vicinity| +Thunder| +AM| +PM| +Early| +Late| +Few| +Severe| +Clear| +Fair| +Partly| +Mostly| +Cloudy| +Clouds| +Scattered Showers| +Light Snow Showers| +Snow Showers| +Heavy Snow| +Scattered Snow Showers| +Mixed Rain And Snow| +Mixed Rain And Sleet| +Mixed Snow And Sleet| +Mixed Rain And Hail| +Snow Flurries| +Blowing Snow| +Blowing Rain| +Heavy Rain| +Freezing Rain| +Showers| +Light Rain| +Heavy| +Rain| +Windy| +Wind| +Snow| +Sleet| +Freezing Drizzle| +Light Drizzle| +Drizzle| +Hail| +Fog| +Foggy| +Haze| +Light| +With| diff --git a/awesome/lain/widgets/yawn/localizations/ru_RU b/awesome/lain/widgets/yawn/localizations/ru_RU new file mode 100644 index 0000000..0b9b9e9 --- /dev/null +++ b/awesome/lain/widgets/yawn/localizations/ru_RU @@ -0,0 +1,61 @@ +Now:|Cейчас: +Sun:|Воскресенье: +Mon:|понедельник: +Tue:|Вторник: +Wed:|Среда: +Thu:|Четверг: +Fri:|Пятница: +Sat:|Суббота: +Mostly Sunny|Премушественно солнечно +Sunny|Солнечно +Sun|Солнце +Rain/Thunder|Дождь/Гром +Isolated Thunderstorms|Изолированные грозы +Scattered Thunderstorms|Рассеянные грозы +Thundershowers|Ливни +Thunderstorms|Грозы +Thunder in the Vicinity|Гром в окрестностях +Thunder|Гром +AM|Утро +PM|Вечер +Early|Рано +Late|Поздно +Few|Мало +Severe|Тяжелый +Clear|Ясно +Fair|Светлый +Partly|Частично +Mostly|По большй части +Cloudy|Облочно +Clouds|Облока +Scattered Showers|Рассеянные ливни +Light Snow Showers|Небольшой снег +Snow Showers|Ливневый Снег +Heavy Snow|Сильный снегопад +Scattered Snow Showers|Рассеянный ливневый снег +Mixed Rain And Snow|Снег с дождём +Mixed Rain And Sleet|Дождь и мокрый снег +Mixed Snow And Sleet|Снег и мокрый снег +Mixed Rain And Hail|Дождь с градом +Snow Flurries|Снежные порывы +Blowing Snow|Снег и ветер +Blowing Rain|Дождь и ветер +Heavy Rain|Сильный дождь +Freezing Rain|Ледяной дождь +Showers|Ливени +Light Rain|Небольшой дождь +Heavy|Сильный +Rain|Дождь +Windy|Ветреный +Wind|Ветер +Snow|Снег +Sleet|Мокрый снег +Freezing Drizzle|Изморозь +Light Drizzle|Лёгкая изморось +Drizzle|Моросящий дождь +Hail|Град +Fog|Туман +Foggy|Туманно +Haze|Дымка +Light|Лёгкий +With|С diff --git a/awesome/lain/widgets/yawn/localizations/zh_CN b/awesome/lain/widgets/yawn/localizations/zh_CN new file mode 100644 index 0000000..61e98a4 --- /dev/null +++ b/awesome/lain/widgets/yawn/localizations/zh_CN @@ -0,0 +1,61 @@ +Now:|当前: +Sun:|周日: +Mon:|周一: +Tue:|周二: +Wed:|周三: +Thu:|周四: +Fri:|周五: +Sat:|周六: +Mostly Sunny|晴时多云 +Sunny|晴朗 +Sun|太阳 +Rain/Thunder|雨/雷 +Isolated Thunderstorms|局部雷雨 +Scattered Thunderstorms|零星雷雨 +Thundershowers|雷阵雨 +Thunderstorms|雷雨 +Thunder in the Vicinity|周围有雷雨 +Thunder|雷鸣 +AM|上午 +PM|下午 +Early|早 +Late|晚 +Few|短暂 +Severe|恶劣 +Clear|晴朗 +Fair|晴 +Partly|局部 +Mostly|大部 +Cloudy|多云 +Clouds|有云 +Scattered Showers|零星阵雨 +Light Snow Showers|小阵雪 +Snow Showers|阵雪 +Heavy Snow|大雪 +Scattered Snow Showers|零星阵雪 +Mixed Rain And Snow|雨夹雪 +Mixed Rain And Sleet|雨转雨夹雪 +Mixed Snow And Sleet|雪转雨夹雪 +Mixed Rain And Hail|雨夹冰雹 +Snow Flurries|阵雪 +Blowing Snow|风吹雪 +Blowing Rain|风吹雨 +Heavy Rain|大雨 +Freezing Rain|冻雨 +Showers|阵雨 +Light Rain|小雨 +Heavy|大 +Rain|雨 +Windy|有风 +Wind|风 +Snow|雪 +Sleet|冻雨 +Freezing Drizzle|冻毛毛雨 +Light Drizzle|细雨 +Drizzle|毛毛雨 +Hail|冰雹 +Fog|雾 +Foggy|有雾 +Haze|霾 +Light|小 +With|與 diff --git a/awesome/lain/widgets/yawn/localizations/zh_TW b/awesome/lain/widgets/yawn/localizations/zh_TW new file mode 100644 index 0000000..03644c1 --- /dev/null +++ b/awesome/lain/widgets/yawn/localizations/zh_TW @@ -0,0 +1,61 @@ +Now:|現在: +Sun:|週日: +Mon:|週一: +Tue:|週二: +Wed:|週三: +Thu:|週四: +Fri:|週五: +Sat:|週六: +Mostly Sunny|晴時多雲 +Sunny|大太陽 +Sun|太陽 +Rain/Thunder|雨時有雷 +Isolated Thunderstorms|局部雷雨 +Scattered Thunderstorms|零星雷雨 +Thundershowers|雷陣雨 +Thunderstorms|雷雨 +Thunder in the Vicinity|局部性雷雨 +Thunder|雷嗚 +AM|上午 +PM|下午 +Early|早 +Late|晚有 +Few|短暫 +Severe|惡劣 +Clear|晴朗 +Fair|晴 +Partly|局部 +Mostly|大部 +Cloudy|多雲 +Clouds|有雲 +Scattered Showers|零星陣雨 +Light Snow Showers|小陣雪 +Snow Showers|陣雪 +Heavy Snow|大雪 +Scattered Snow Showers|零星陣雪 +Mixed Rain And Snow|雨夾雪 +Mixed Rain And Sleet|雨時雨夾雪 +Mixed Snow And Sleet|雪時雨夾雪 +Mixed Rain And Hail|雨夾冰雹 +Snow Flurries|陣雪 +Blowing Snow|風吹雪 +Blowing Rain|風吹雨 +Heavy Rain|大雨 +Freezing Rain|凍雨 +Showers|陣雨 +Light Rain|小雨 +Heavy|大 +Rain|雨 +Windy|有風 +Wind|風 +Snow|雪 +Sleet|冰珠 +Freezing Drizzle|凍毛毛雨 +Light Drizzle|細雨 +Drizzle|毛毛雨 +Hail|冰雹 +Fog|霧 +Foggy|有霧 +Haze|霾 +Light|小 +With|與 diff --git a/awesome/menugen/init.lua b/awesome/menugen/init.lua new file mode 100644 index 0000000..4c57c81 --- /dev/null +++ b/awesome/menugen/init.lua @@ -0,0 +1,62 @@ +--------------------------------------------------------------------------- +-- @author Harvey Mittens +-- @copyright 2014 Harvey Mittens +-- @email teknocratdefunct@riseup.net +-- @release v3.5.5 +--------------------------------------------------------------------------- + +local menu_gen = require("menubar.menu_gen") +local menu_utils = require("menubar.utils") +local pairs = pairs +local ipairs = ipairs +local table = table +local string = string +local next = next + +module("menugen") + +--Built in menubar should be checking local applications directory +menu_gen.all_menu_dirs = { '/usr/share/applications/', '/usr/local/share/applications/', '~/.local/share/applications' } + +--Expecting an wm_name of awesome omits too many applications and tools +menu_utils.wm_name = "" + +-- Use MenuBar Parsing Utils to build StartMenu for Awesome +-- @return awful.menu compliant menu items tree +function build_menu() + local result = {} + local menulist = menu_gen.generate() + + for k,v in pairs(menu_gen.all_categories) do + table.insert(result, {k, {}, v["icon"] } ) + end + + for k, v in ipairs(menulist) do + for _, cat in ipairs(result) do + if cat[1] == v["category"] then + table.insert( cat[2] , { v["name"], v["cmdline"], v["icon"] } ) + break + end + end + end + + -- Cleanup Things a Bit + for k,v in ipairs(result) do + -- Remove Unused Categories + if not next(v[2]) then + table.remove(result, k) + else + --Sort entries Alphabetically (by Name) + table.sort(v[2], function (a,b) return string.byte(a[1]) < string.byte(b[1]) end) + -- Replace Catagory Name with nice name + v[1] = menu_gen.all_categories[v[1]].name + end + end + + --Sort Categories Alphabetically Also + table.sort(result, function(a,b) return string.byte(a[1]) < string.byte(b[1]) end) + + return result +end + + diff --git a/awesome/rc.lua b/awesome/rc.lua new file mode 100644 index 0000000..13782dc --- /dev/null +++ b/awesome/rc.lua @@ -0,0 +1,783 @@ +--[[ + + Multicolor Awesome WM config 2.0 + github.com/copycat-killer + +--]] + +-- {{{ Required libraries +local gears = require("gears") +local awful = require("awful") +awful.rules = require("awful.rules") + require("awful.autofocus") +local wibox = require("wibox") +local beautiful = require("beautiful") +local naughty = require("naughty") +local drop = require("scratchdrop") +local lain = require("lain") +-- }}} + +-- {{{ Error handling +if awesome.startup_errors then + naughty.notify({ preset = naughty.config.presets.critical, + title = "Oops, there were errors during startup!", + text = awesome.startup_errors }) +end + +do + local in_error = false + awesome.connect_signal("debug::error", function (err) + if in_error then return end + in_error = true + + naughty.notify({ preset = naughty.config.presets.critical, + title = "Oops, an error happened!", + text = err }) + in_error = false + end) +end +-- }}} + +-- {{{ Autostart applications +function run_once(cmd) + findme = cmd + firstspace = cmd:find(" ") + if firstspace then + findme = cmd:sub(0, firstspace-1) + end + awful.util.spawn_with_shell("pgrep -u $USER -x " .. findme .. " > /dev/null || (" .. cmd .. ")") +end + +run_once("urxvtd") +run_once("unclutter") +-- }}} + +-- {{{ Variable definitions +-- localization +os.setlocale(os.getenv("LANG")) + +-- beautiful init +beautiful.init(os.getenv("HOME") .. "/.config/awesome/themes/multicolor/theme.lua") + +-- common +modkey = "Mod4" +altkey = "Mod1" +terminal = "urxvtc" or "xterm" +editor = os.getenv("EDITOR") or "vim" or "vi" +editor_cmd = terminal .. " -e " .. editor + +-- user defined +browser = "dwb" +browser2 = "iron" +gui_editor = "gvim" +graphics = "gimp" +mail = terminal .. " -e mutt " + +local layouts = { + awful.layout.suit.floating, + awful.layout.suit.tile, + awful.layout.suit.tile.left, + awful.layout.suit.tile.bottom, + awful.layout.suit.tile.top, + awful.layout.suit.fair, + awful.layout.suit.fair.horizontal, + awful.layout.suit.spiral, + awful.layout.suit.spiral.dwindle, + awful.layout.suit.max, +} +-- }}} + +-- {{{ Tags +tags = { + names = { "1", "2", "3", "4", "5", "6", "7", "8", "9" }, + layout = { layouts[3], layouts[3], layouts[3], layouts[3], layouts[3], layouts[3], layouts[3], layouts[3], layouts[3] } +} +for s = 1, screen.count() do +-- Each screen has its own tag table. + tags[s] = awful.tag(tags.names, s, tags.layout) +end +-- }}} + +-- {{{ Wallpaper +if beautiful.wallpaper then + for s = 1, screen.count() do + gears.wallpaper.maximized(beautiful.wallpaper, s, true) + end +end +-- }}} + +-- {{{ Freedesktop Menu +mymainmenu = awful.menu.new({ items = require("menugen").build_menu(), + theme = { height = 16, width = 130 }}) +-- }}} + +-- {{{ Wibox +markup = lain.util.markup + +-- Textclock +clockicon = wibox.widget.imagebox(beautiful.widget_clock) +mytextclock = awful.widget.textclock(markup("#7788af", "%a %d.%m. ") .. markup("#343639", ">") .. markup("#de5e1e", " %H:%M ")) + +-- Calendar +lain.widgets.calendar:attach(mytextclock, { font_size = 10 }) + +-- Weather +weathericon = wibox.widget.imagebox(beautiful.widget_weather) +yawn = lain.widgets.yawn(123456, { + settings = function() + widget:set_markup(markup("#eca4c4", forecast:lower() .. " @ " .. units .. "°C ")) + end +}) + +-- / fs +fsicon = wibox.widget.imagebox(beautiful.widget_fs) +fswidget = lain.widgets.fs({ + settings = function() + widget:set_markup(markup("#80d9d8", fs_now.used .. "% ")) + end +}) + +--[[ Mail IMAP check +-- commented because it needs to be set before use +mailicon = wibox.widget.imagebox() +mailicon:buttons(awful.util.table.join(awful.button({ }, 1, function () awful.util.spawn(mail) end))) +mailwidget = lain.widgets.imap({ + timeout = 180, + server = "server", + mail = "mail", + password = "keyring get mail", + settings = function() + if mailcount > 0 then + mailicon:set_image(beautiful.widget_mail) + widget:set_markup(markup("#cccccc", mailcount .. " ")) + else + widget:set_text("") + mailicon:set_image(nil) + end + end +}) +]] + +-- CPU +cpuicon = wibox.widget.imagebox() +cpuicon:set_image(beautiful.widget_cpu) +cpuwidget = lain.widgets.cpu({ + settings = function() + widget:set_markup(markup("#e33a6e", cpu_now.usage .. "% ")) + end +}) + +-- Coretemp +tempicon = wibox.widget.imagebox(beautiful.widget_temp) +tempwidget = lain.widgets.temp({ + settings = function() + widget:set_markup(markup("#f1af5f", coretemp_now .. "°C ")) + end +}) + +-- Battery +baticon = wibox.widget.imagebox(beautiful.widget_batt) +batwidget = lain.widgets.bat({ + settings = function() + if bat_now.perc == "N/A" then + bat_now.perc = "AC " + else + bat_now.perc = bat_now.perc .. "% " + end + widget:set_text(bat_now.perc) + end +}) + +-- ALSA volume +volicon = wibox.widget.imagebox(beautiful.widget_vol) + +volume = lain.widgets.alsabar({width = 55, ticks = true, ticks_size = 6, +settings = function() + if volume_now.status == "off" then + volicon:set_image(beautiful.vol_mute) + elseif volume_now.level == 0 then + volicon:set_image(beautiful.vol_no) + elseif volume_now.level <= 50 then + volicon:set_image(beautiful.vol_low) + else + volicon:set_image(beautiful.vol) + end +end, +colors = +{ + --background = beautiful.bg_normal, + background = "#111111", + mute = red, + unmute = "#003785" +}}) +volmargin = wibox.layout.margin(volume.bar, 2, 7) +volmargin:set_top(6) +volmargin:set_bottom(6) +volumewidget = wibox.widget.background(volmargin) +volumewidget:set_bgimage(beautiful.widget_bg) + +-- Net +netdownicon = wibox.widget.imagebox(beautiful.widget_netdown) +--netdownicon.align = "middle" +netdowninfo = wibox.widget.textbox() +netupicon = wibox.widget.imagebox(beautiful.widget_netup) +--netupicon.align = "middle" +netupinfo = lain.widgets.net({ + settings = function() + if iface ~= "network off" and + string.match(yawn.widget._layout.text, "N/A") + then + yawn.fetch_weather() + end + + net = net_now.sent + if string.len(net) > 7 then net = "0.0" end + widget:set_markup(markup("#e54c62", net .. " ")) + + net = net_now.received + if string.len(net) > 7 then net = "0.0" end + netdowninfo:set_markup(markup("#87af5f", net .. " ")) + end +}) + +-- MEM +memicon = wibox.widget.imagebox(beautiful.widget_mem) +memwidget = lain.widgets.mem({ + settings = function() + widget:set_markup(markup("#e0da37", mem_now.used .. "M ")) + end +}) + +-- MPD +mpdicon = wibox.widget.imagebox() +mpdwidget = lain.widgets.mpd({ + settings = function() + mpd_notification_preset = { + text = string.format("%s [%s] - %s\n%s", mpd_now.artist, + mpd_now.album, mpd_now.date, mpd_now.title) + } + + if mpd_now.state == "play" then + artist = mpd_now.artist .. " > " + title = mpd_now.title .. " " + mpdicon:set_image(beautiful.widget_note_on) + elseif mpd_now.state == "pause" then + artist = "mpd " + title = "paused " + else + artist = "" + title = "" + mpdicon:set_image(nil) + end + widget:set_markup(markup("#e54c62", artist) .. markup("#b2b2b2", title)) + end +}) + +-- Spacer +spacer = wibox.widget.textbox(" ") + +-- }}} + +-- {{{ Layout + +-- Create a wibox for each screen and add it +mywibox = {} +mybottomwibox = {} +mypromptbox = {} +mylayoutbox = {} +mytaglist = {} +mytaglist.buttons = awful.util.table.join( + awful.button({ }, 1, awful.tag.viewonly), + awful.button({ modkey }, 1, awful.client.movetotag), + awful.button({ }, 3, awful.tag.viewtoggle), + awful.button({ modkey }, 3, awful.client.toggletag), + awful.button({ }, 4, function(t) awful.tag.viewnext(awful.tag.getscreen(t)) end), + awful.button({ }, 5, function(t) awful.tag.viewprev(awful.tag.getscreen(t)) end) + ) +mytasklist = {} +mytasklist.buttons = awful.util.table.join( + awful.button({ }, 1, function (c) + if c == client.focus then + c.minimized = true + else + -- Without this, the following + -- :isvisible() makes no sense + c.minimized = false + if not c:isvisible() then + awful.tag.viewonly(c:tags()[1]) + end + -- This will also un-minimize + -- the client, if needed + client.focus = c + c:raise() + end + end), + awful.button({ }, 3, function () + if instance then + instance:hide() + instance = nil + else + instance = awful.menu.clients({ width=250 }) + end + end), + awful.button({ }, 4, function () + awful.client.focus.byidx(1) + if client.focus then client.focus:raise() end + end), + awful.button({ }, 5, function () + awful.client.focus.byidx(-1) + if client.focus then client.focus:raise() end + end)) + +for s = 1, screen.count() do + + -- Create a promptbox for each screen + mypromptbox[s] = awful.widget.prompt() + + + -- We need one layoutbox per screen. + mylayoutbox[s] = awful.widget.layoutbox(s) + mylayoutbox[s]:buttons(awful.util.table.join( + awful.button({ }, 1, function () awful.layout.inc(layouts, 1) end), + awful.button({ }, 3, function () awful.layout.inc(layouts, -1) end), + awful.button({ }, 4, function () awful.layout.inc(layouts, 1) end), + awful.button({ }, 5, function () awful.layout.inc(layouts, -1) end))) + + -- Create a taglist widget + mytaglist[s] = awful.widget.taglist(s, awful.widget.taglist.filter.all, mytaglist.buttons) + + -- Create a tasklist widget + mytasklist[s] = awful.widget.tasklist(s, awful.widget.tasklist.filter.currenttags, mytasklist.buttons) + + -- Create the upper wibox + mywibox[s] = awful.wibox({ position = "top", screen = s, height = 20 }) + --border_width = 0, height = 20 }) + + -- Widgets that are aligned to the upper left + local left_layout = wibox.layout.fixed.horizontal() + left_layout:add(mytaglist[s]) + left_layout:add(mypromptbox[s]) + left_layout:add(mpdicon) + left_layout:add(mpdwidget) + + -- Widgets that are aligned to the upper right + local right_layout = wibox.layout.fixed.horizontal() + if s == 1 then right_layout:add(wibox.widget.systray()) end + --right_layout:add(mailicon) + --right_layout:add(mailwidget) + right_layout:add(volicon) + right_layout:add(volumewidget) + right_layout:add(netdownicon) + right_layout:add(netdowninfo) + right_layout:add(netupicon) + right_layout:add(netupinfo) + right_layout:add(memicon) + right_layout:add(memwidget) +-- right_layout:add(cpuicon) +-- right_layout:add(cpuwidget) + right_layout:add(fsicon) + right_layout:add(fswidget) +-- right_layout:add(weathericon) +-- right_layout:add(yawn.widget) +-- right_layout:add(tempicon) +-- right_layout:add(tempwidget) + right_layout:add(baticon) + right_layout:add(batwidget) + right_layout:add(clockicon) + right_layout:add(mytextclock) + + -- Now bring it all together (with the tasklist in the middle) + local layout = wibox.layout.align.horizontal() + layout:set_left(left_layout) + --layout:set_middle(mytasklist[s]) + layout:set_right(right_layout) + + mywibox[s]:set_widget(layout) + + -- Create the bottom wibox + mybottomwibox[s] = awful.wibox({ position = "bottom", screen = s, border_width = 0, height = 20 }) + --mybottomwibox[s].visible = false + + -- Widgets that are aligned to the bottom left + bottom_left_layout = wibox.layout.fixed.horizontal() + + -- Widgets that are aligned to the bottom right + bottom_right_layout = wibox.layout.fixed.horizontal() + bottom_right_layout:add(mylayoutbox[s]) + + -- Now bring it all together (with the tasklist in the middle) + bottom_layout = wibox.layout.align.horizontal() + bottom_layout:set_left(bottom_left_layout) + bottom_layout:set_middle(mytasklist[s]) + bottom_layout:set_right(bottom_right_layout) + mybottomwibox[s]:set_widget(bottom_layout) +end +-- }}} + +-- {{{ Mouse Bindings +root.buttons(awful.util.table.join( + awful.button({ }, 3, function () mymainmenu:toggle() end), + awful.button({ }, 4, awful.tag.viewnext), + awful.button({ }, 5, awful.tag.viewprev) +)) +-- }}} + +-- {{{ Key bindings +globalkeys = awful.util.table.join( + -- Take a screenshot + -- https://github.com/copycat-killer/dots/blob/master/bin/screenshot + awful.key({ altkey }, "p", function() os.execute("screenshot") end), + + -- Lock Screen + awful.key({ modkey }, "l", function() awful.util.spawn("python3 /home/sqozz/programming/python3/BackgroundChanger/bgchanger.py") end), + + -- Tag browsing + awful.key({ modkey }, "Left", awful.tag.viewprev ), + awful.key({ modkey }, "Right", awful.tag.viewnext ), + awful.key({ modkey }, "Escape", awful.tag.history.restore), + + -- Non-empty tag browsing + awful.key({ altkey }, "Left", function () lain.util.tag_view_nonempty(-1) end), + awful.key({ altkey }, "Right", function () lain.util.tag_view_nonempty(1) end), + + -- Default client focus + awful.key({ altkey }, "k", + function () + awful.client.focus.byidx( 1) + if client.focus then client.focus:raise() end + end), + awful.key({ altkey }, "j", + function () + awful.client.focus.byidx(-1) + if client.focus then client.focus:raise() end + end), + + -- By direction client focus + awful.key({ modkey }, "j", + function() + awful.client.focus.bydirection("down") + if client.focus then client.focus:raise() end + end), + awful.key({ modkey }, "k", + function() + awful.client.focus.bydirection("up") + if client.focus then client.focus:raise() end + end), + awful.key({ modkey }, "h", + function() + awful.client.focus.bydirection("left") + if client.focus then client.focus:raise() end + end), + awful.key({ modkey }, "l", + function() + awful.client.focus.bydirection("right") + if client.focus then client.focus:raise() end + end), + + -- Show Menu + awful.key({ modkey }, "w", + function () + mymainmenu:show({ keygrabber = true }) + end), + + -- Show/Hide Wibox + awful.key({ modkey }, "b", function () + mywibox[mouse.screen].visible = not mywibox[mouse.screen].visible + mybottomwibox[mouse.screen].visible = not mybottomwibox[mouse.screen].visible + end), + + -- Layout manipulation + awful.key({ modkey, "Shift" }, "j", function () awful.client.swap.byidx( 1) end), + awful.key({ modkey, "Shift" }, "k", function () awful.client.swap.byidx( -1) end), + awful.key({ modkey, "Control" }, "j", function () awful.screen.focus_relative( 1) end), + awful.key({ modkey, "Control" }, "k", function () awful.screen.focus_relative(-1) end), + awful.key({ modkey, }, "u", awful.client.urgent.jumpto), + awful.key({ modkey, }, "Tab", + function () + awful.client.focus.history.previous() + if client.focus then + client.focus:raise() + end + end), + awful.key({ altkey, "Shift" }, "l", function () awful.tag.incmwfact( 0.05) end), + awful.key({ altkey, "Shift" }, "h", function () awful.tag.incmwfact(-0.05) end), + awful.key({ modkey, "Shift" }, "l", function () awful.tag.incnmaster(-1) end), + awful.key({ modkey, "Shift" }, "h", function () awful.tag.incnmaster( 1) end), + awful.key({ modkey, "Control" }, "l", function () awful.tag.incncol(-1) end), + awful.key({ modkey, "Control" }, "h", function () awful.tag.incncol( 1) end), + awful.key({ modkey, }, "space", function () awful.layout.inc(layouts, 1) end), + awful.key({ modkey, "Shift" }, "space", function () awful.layout.inc(layouts, -1) end), + awful.key({ modkey, "Control" }, "n", awful.client.restore), + + -- Standard program + awful.key({ modkey, }, "Return", function () awful.util.spawn(terminal) end), + awful.key({ modkey, "Control" }, "r", awesome.restart), + awful.key({ modkey, "Shift" }, "q", awesome.quit), + + -- Dropdown terminal + awful.key({ modkey, }, "z", function () drop(terminal) end), + + -- Widgets popups + awful.key({ altkey, }, "c", function () lain.widgets.calendar:show(7) end), + awful.key({ altkey, }, "h", function () fswidget.show(7) end), + awful.key({ altkey, }, "w", function () yawn.show(7) end), + + -- ALSA volume control + + awful.key({ altkey }, "m" , + function () + awful.util.spawn("amixer -q set " .. volume.channel .. " playback toggle") + volume.update() + end), + awful.key({ altkey }, "Up", + function () + awful.util.spawn("amixer -q set Master 1%+") + volume.update() + end), + awful.key({ altkey }, "Down", + function () + awful.util.spawn("amixer -q set Master 1%-") + volume.update() + end), + awful.key({ altkey, "Control" }, "m", + function () + awful.util.spawn("amixer -q set Master playback 100%") + volume.update() + end), + + -- MPD control + awful.key({ altkey, "Control" }, "Up", + function () + awful.util.spawn_with_shell("mpc toggle || ncmpc toggle || pms toggle") + mpdwidget.update() + end), + awful.key({ altkey, "Control" }, "Down", + function () + awful.util.spawn_with_shell("mpc stop || ncmpc stop || pms stop") + mpdwidget.update() + end), + awful.key({ altkey, "Control" }, "Left", + function () + awful.util.spawn_with_shell("mpc prev || ncmpc prev || pms prev") + mpdwidget.update() + end), + awful.key({ altkey, "Control" }, "Right", + function () + awful.util.spawn_with_shell("mpc next || ncmpc next || pms next") + mpdwidget.update() + end), + + -- Copy to clipboard + awful.key({ modkey }, "c", function () os.execute("xsel -p -o | xsel -i -b") end), + + -- User programs + awful.key({ modkey }, "q", function () awful.util.spawn(browser) end), + awful.key({ modkey }, "i", function () awful.util.spawn(browser2) end), + awful.key({ modkey }, "s", function () awful.util.spawn(gui_editor) end), + awful.key({ modkey }, "g", function () awful.util.spawn(graphics) end), + + -- Prompt + awful.key({ modkey }, "r", function () mypromptbox[mouse.screen]:run() end), + awful.key({ modkey }, "x", + function () + awful.prompt.run({ prompt = "Run Lua code: " }, + mypromptbox[mouse.screen].widget, + awful.util.eval, nil, + awful.util.getdir("cache") .. "/history_eval") + end) +) + +clientkeys = awful.util.table.join( + awful.key({ modkey, }, "f", function (c) c.fullscreen = not c.fullscreen end), + awful.key({ modkey, "Shift" }, "c", function (c) c:kill() end), + awful.key({ modkey, "Control" }, "space", awful.client.floating.toggle ), + awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end), + awful.key({ modkey, }, "o", awful.client.movetoscreen ), + awful.key({ modkey, }, "t", function (c) c.ontop = not c.ontop end), + awful.key({ modkey, }, "n", + function (c) + -- The client currently has the input focus, so it cannot be + -- minimized, since minimized clients can't have the focus. + c.minimized = true + end), + awful.key({ modkey, }, "m", + function (c) + c.maximized_horizontal = not c.maximized_horizontal + c.maximized_vertical = not c.maximized_vertical + end) +) + +-- Bind all key numbers to tags. +-- Be careful: we use keycodes to make it works on any keyboard layout. +-- This should map on the top row of your keyboard, usually 1 to 9. +for i = 1, 9 do + globalkeys = awful.util.table.join(globalkeys, + awful.key({ modkey }, "#" .. i + 9, + function () + local screen = mouse.screen + local tag = awful.tag.gettags(screen)[i] + if tag then + awful.tag.viewonly(tag) + end + end), + awful.key({ modkey, "Control" }, "#" .. i + 9, + function () + local screen = mouse.screen + local tag = awful.tag.gettags(screen)[i] + if tag then + awful.tag.viewtoggle(tag) + end + end), + awful.key({ modkey, "Shift" }, "#" .. i + 9, + function () + local tag = awful.tag.gettags(client.focus.screen)[i] + if client.focus and tag then + awful.client.movetotag(tag) + end + end), + awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9, + function () + local tag = awful.tag.gettags(client.focus.screen)[i] + if client.focus and tag then + awful.client.toggletag(tag) + end + end)) +end + +clientbuttons = awful.util.table.join( + awful.button({ }, 1, function (c) client.focus = c; c:raise() end), + awful.button({ modkey }, 1, awful.mouse.client.move), + awful.button({ modkey }, 3, awful.mouse.client.resize)) + +-- Set keys +root.keys(globalkeys) +-- }}} + +-- {{{ Rules +awful.rules.rules = { + -- All clients will match this rule. + { rule = { }, + properties = { border_width = beautiful.border_width, + border_color = beautiful.border_normal, + focus = awful.client.focus.filter, + keys = clientkeys, + buttons = clientbuttons, + size_hints_honor = false } }, + { rule = { class = "URxvt" }, + properties = { opacity = 0.99 } }, + + { rule = { class = "MPlayer" }, + properties = { floating = true } }, + + { rule = { class = "Dwb" }, + properties = { tag = tags[1][1] } }, + + { rule = { class = "Iron" }, + properties = { tag = tags[1][1] } }, + + { rule = { instance = "plugin-container" }, + properties = { tag = tags[1][1] } }, + + { rule = { class = "Gimp" }, + properties = { tag = tags[1][4] } }, + + { rule = { class = "Gimp", role = "gimp-image-window" }, + properties = { maximized_horizontal = true, + maximized_vertical = true } }, +} +-- }}} + +-- {{{ Signals +-- signal function to execute when a new client appears. +client.connect_signal("manage", function (c, startup) + -- enable sloppy focus + c:connect_signal("mouse::enter", function(c) + if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier + and awful.client.focus.filter(c) then + client.focus = c + end + end) + + if not startup and not c.size_hints.user_position + and not c.size_hints.program_position then + awful.placement.no_overlap(c) + awful.placement.no_offscreen(c) + end + + local titlebars_enabled = false + if titlebars_enabled and (c.type == "normal" or c.type == "dialog") then + -- buttons for the titlebar + local buttons = awful.util.table.join( + awful.button({ }, 1, function() + client.focus = c + c:raise() + awful.mouse.client.move(c) + end), + awful.button({ }, 3, function() + client.focus = c + c:raise() + awful.mouse.client.resize(c) + end) + ) + + -- widgets that are aligned to the right + local right_layout = wibox.layout.fixed.horizontal() + right_layout:add(awful.titlebar.widget.floatingbutton(c)) + right_layout:add(awful.titlebar.widget.maximizedbutton(c)) + right_layout:add(awful.titlebar.widget.stickybutton(c)) + right_layout:add(awful.titlebar.widget.ontopbutton(c)) + right_layout:add(awful.titlebar.widget.closebutton(c)) + + -- the title goes in the middle + local middle_layout = wibox.layout.flex.horizontal() + local title = awful.titlebar.widget.titlewidget(c) + title:set_align("center") + middle_layout:add(title) + middle_layout:buttons(buttons) + + -- now bring it all together + local layout = wibox.layout.align.horizontal() + layout:set_right(right_layout) + layout:set_middle(middle_layout) + + awful.titlebar(c,{size=16}):set_widget(layout) + end +end) + +-- No border for maximized clients +client.connect_signal("focus", + function(c) + if c.maximized_horizontal == true and c.maximized_vertical == true then + c.border_color = beautiful.border_normal + else + c.border_color = beautiful.border_focus + end + end) +client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end) +-- }}} + +-- {{{ Arrange signal handler +for s = 1, screen.count() do screen[s]:connect_signal("arrange", function () + local clients = awful.client.visible(s) + local layout = awful.layout.getname(awful.layout.get(s)) + + if #clients > 0 then -- Fine grained borders and floaters control + for _, c in pairs(clients) do -- Floaters always have borders + -- No borders with only one humanly visible client + if layout == "max" then + c.border_width = 0 + elseif awful.client.floating.get(c) or layout == "floating" then + c.border_width = beautiful.border_width + elseif #clients == 1 then + clients[1].border_width = 0 + if layout ~= "max" then + awful.client.moveresize(0, 0, 2, 0, clients[1]) + end + else + c.border_width = beautiful.border_width + end + end + end + end) +end +-- }}} diff --git a/awesome/scratchdrop/README.md b/awesome/scratchdrop/README.md new file mode 100644 index 0000000..8eec9c6 --- /dev/null +++ b/awesome/scratchdrop/README.md @@ -0,0 +1,3 @@ +This is the `drop` section of [scratchpad](http://awesome.naquadah.org/wiki/Scratchpad_manager). + +I cutted out the rest because I don't use it. diff --git a/awesome/scratchdrop/init.lua b/awesome/scratchdrop/init.lua new file mode 100644 index 0000000..e5b8293 --- /dev/null +++ b/awesome/scratchdrop/init.lua @@ -0,0 +1,133 @@ +------------------------------------------------------------------- +-- Drop-down applications manager for the awesome window manager +------------------------------------------------------------------- +-- Coded by: * Lucas de Vries +-- Hacked by: * Adrian C. (anrxc) +-- Licensed under the WTFPL version 2 +-- * http://sam.zoy.org/wtfpl/COPYING +------------------------------------------------------------------- +-- To use this module add: +-- local scratchdrop = require("scratchdrop") +-- to the top of your rc.lua, and call it from a keybinding: +-- scratchdrop(prog, vert, horiz, width, height, sticky, screen) +-- +-- Parameters: +-- prog - Program to run; "urxvt", "gmrun", "thunderbird" +-- vert - Vertical; "bottom", "center" or "top" (default) +-- horiz - Horizontal; "left", "right" or "center" (default) +-- width - Width in absolute pixels, or width percentage +-- when <= 1 (1 (100% of the screen) by default) +-- height - Height in absolute pixels, or height percentage +-- when <= 1 (0.25 (25% of the screen) by default) +-- sticky - Visible on all tags, false by default +-- screen - Screen (optional), mouse.screen by default +------------------------------------------------------------------- + +-- Grab environment +local pairs = pairs +local awful = require("awful") +local setmetatable = setmetatable +local capi = { + mouse = mouse, + client = client, + screen = screen +} + +-- Scratchdrop: drop-down applications manager for the awesome window manager +local scratchdrop = {} -- module scratch.drop + +local dropdown = {} + +-- Create a new window for the drop-down application when it doesn't +-- exist, or toggle between hidden and visible states when it does +function toggle(prog, vert, horiz, width, height, sticky, screen) + vert = vert or "top" + horiz = horiz or "center" + width = width or 1 + height = height or 0.25 + sticky = sticky or false + screen = screen or capi.mouse.screen + + -- Determine signal usage in this version of awesome + local attach_signal = capi.client.connect_signal or capi.client.add_signal + local detach_signal = capi.client.disconnect_signal or capi.client.remove_signal + + if not dropdown[prog] then + dropdown[prog] = {} + + -- Add unmanage signal for scratchdrop programs + attach_signal("unmanage", function (c) + for scr, cl in pairs(dropdown[prog]) do + if cl == c then + dropdown[prog][scr] = nil + end + end + end) + end + + if not dropdown[prog][screen] then + spawnw = function (c) + dropdown[prog][screen] = c + + -- Scratchdrop clients are floaters + awful.client.floating.set(c, true) + + -- Client geometry and placement + local screengeom = capi.screen[screen].workarea + + if width <= 1 then width = screengeom.width * width end + if height <= 1 then height = screengeom.height * height end + + if horiz == "left" then x = screengeom.x + elseif horiz == "right" then x = screengeom.width - width + else x = screengeom.x+(screengeom.width-width)/2 end + + if vert == "bottom" then y = screengeom.height + screengeom.y - height + elseif vert == "center" then y = screengeom.y+(screengeom.height-height)/2 + else y = screengeom.y - screengeom.y end + + -- Client properties + c:geometry({ x = x, y = y + mywibox[mouse.screen].height, width = width - 2, height = height }) + c.ontop = true + c.above = true + c.skip_taskbar = true + if sticky then c.sticky = true end + if c.titlebar then awful.titlebar.remove(c) end + + c:raise() + capi.client.focus = c + detach_signal("manage", spawnw) + end + + -- Add manage signal and spawn the program + attach_signal("manage", spawnw) + awful.util.spawn(prog, false) + else + -- Get a running client + c = dropdown[prog][screen] + + -- Switch the client to the current workspace + if c:isvisible() == false then c.hidden = true + awful.client.movetotag(awful.tag.selected(screen), c) + end + + -- Focus and raise if hidden + if c.hidden then + -- Make sure it is centered + --if vert == "center" then awful.placement.center_vertical(c) end + --if horiz == "center" then awful.placement.center_horizontal(c) end + c.hidden = false + c:raise() + capi.client.focus = c + else -- Hide and detach tags if not + c.hidden = true + local ctags = c:tags() + for i, t in pairs(ctags) do + ctags[i] = nil + end + c:tags(ctags) + end + end +end + +return setmetatable(scratchdrop, { __call = function(_, ...) return toggle(...) end }) diff --git a/awesome/themes/blackburn/icons/arrl_lr_post.png b/awesome/themes/blackburn/icons/arrl_lr_post.png new file mode 100644 index 0000000..4b93707 Binary files /dev/null and b/awesome/themes/blackburn/icons/arrl_lr_post.png differ diff --git a/awesome/themes/blackburn/icons/arrl_lr_pre.png b/awesome/themes/blackburn/icons/arrl_lr_pre.png new file mode 100644 index 0000000..9412659 Binary files /dev/null and b/awesome/themes/blackburn/icons/arrl_lr_pre.png differ diff --git a/awesome/themes/blackburn/icons/dwindle.png b/awesome/themes/blackburn/icons/dwindle.png new file mode 100644 index 0000000..b911f94 Binary files /dev/null and b/awesome/themes/blackburn/icons/dwindle.png differ diff --git a/awesome/themes/blackburn/icons/fairh.png b/awesome/themes/blackburn/icons/fairh.png new file mode 100644 index 0000000..67656a3 Binary files /dev/null and b/awesome/themes/blackburn/icons/fairh.png differ diff --git a/awesome/themes/blackburn/icons/fairv.png b/awesome/themes/blackburn/icons/fairv.png new file mode 100644 index 0000000..274ed38 Binary files /dev/null and b/awesome/themes/blackburn/icons/fairv.png differ diff --git a/awesome/themes/blackburn/icons/floating.png b/awesome/themes/blackburn/icons/floating.png new file mode 100644 index 0000000..9394df9 Binary files /dev/null and b/awesome/themes/blackburn/icons/floating.png differ diff --git a/awesome/themes/blackburn/icons/magnifier.png b/awesome/themes/blackburn/icons/magnifier.png new file mode 100644 index 0000000..61e2867 Binary files /dev/null and b/awesome/themes/blackburn/icons/magnifier.png differ diff --git a/awesome/themes/blackburn/icons/max.png b/awesome/themes/blackburn/icons/max.png new file mode 100644 index 0000000..27905b6 Binary files /dev/null and b/awesome/themes/blackburn/icons/max.png differ diff --git a/awesome/themes/blackburn/icons/spiral.png b/awesome/themes/blackburn/icons/spiral.png new file mode 100644 index 0000000..85c1b99 Binary files /dev/null and b/awesome/themes/blackburn/icons/spiral.png differ diff --git a/awesome/themes/blackburn/icons/square_sel.png b/awesome/themes/blackburn/icons/square_sel.png new file mode 100644 index 0000000..6938cca Binary files /dev/null and b/awesome/themes/blackburn/icons/square_sel.png differ diff --git a/awesome/themes/blackburn/icons/square_unsel.png b/awesome/themes/blackburn/icons/square_unsel.png new file mode 100644 index 0000000..dd8064d Binary files /dev/null and b/awesome/themes/blackburn/icons/square_unsel.png differ diff --git a/awesome/themes/blackburn/icons/submenu.png b/awesome/themes/blackburn/icons/submenu.png new file mode 100644 index 0000000..10ca014 Binary files /dev/null and b/awesome/themes/blackburn/icons/submenu.png differ diff --git a/awesome/themes/blackburn/icons/tile.png b/awesome/themes/blackburn/icons/tile.png new file mode 100644 index 0000000..045eafa Binary files /dev/null and b/awesome/themes/blackburn/icons/tile.png differ diff --git a/awesome/themes/blackburn/icons/tilebottom.png b/awesome/themes/blackburn/icons/tilebottom.png new file mode 100644 index 0000000..556b465 Binary files /dev/null and b/awesome/themes/blackburn/icons/tilebottom.png differ diff --git a/awesome/themes/blackburn/icons/tileleft.png b/awesome/themes/blackburn/icons/tileleft.png new file mode 100644 index 0000000..7a5d3d4 Binary files /dev/null and b/awesome/themes/blackburn/icons/tileleft.png differ diff --git a/awesome/themes/blackburn/icons/tiletop.png b/awesome/themes/blackburn/icons/tiletop.png new file mode 100644 index 0000000..11cab1a Binary files /dev/null and b/awesome/themes/blackburn/icons/tiletop.png differ diff --git a/awesome/themes/blackburn/icons/topbar/1024.png b/awesome/themes/blackburn/icons/topbar/1024.png new file mode 100644 index 0000000..2ab0650 Binary files /dev/null and b/awesome/themes/blackburn/icons/topbar/1024.png differ diff --git a/awesome/themes/blackburn/icons/topbar/1152.png b/awesome/themes/blackburn/icons/topbar/1152.png new file mode 100644 index 0000000..a16ba53 Binary files /dev/null and b/awesome/themes/blackburn/icons/topbar/1152.png differ diff --git a/awesome/themes/blackburn/icons/topbar/1280.png b/awesome/themes/blackburn/icons/topbar/1280.png new file mode 100644 index 0000000..163e95d Binary files /dev/null and b/awesome/themes/blackburn/icons/topbar/1280.png differ diff --git a/awesome/themes/blackburn/icons/topbar/1366.png b/awesome/themes/blackburn/icons/topbar/1366.png new file mode 100644 index 0000000..82897e2 Binary files /dev/null and b/awesome/themes/blackburn/icons/topbar/1366.png differ diff --git a/awesome/themes/blackburn/icons/topbar/1440.png b/awesome/themes/blackburn/icons/topbar/1440.png new file mode 100644 index 0000000..d07889c Binary files /dev/null and b/awesome/themes/blackburn/icons/topbar/1440.png differ diff --git a/awesome/themes/blackburn/icons/topbar/1600.png b/awesome/themes/blackburn/icons/topbar/1600.png new file mode 100644 index 0000000..a8a9dd9 Binary files /dev/null and b/awesome/themes/blackburn/icons/topbar/1600.png differ diff --git a/awesome/themes/blackburn/icons/topbar/1680.png b/awesome/themes/blackburn/icons/topbar/1680.png new file mode 100644 index 0000000..30158a2 Binary files /dev/null and b/awesome/themes/blackburn/icons/topbar/1680.png differ diff --git a/awesome/themes/blackburn/icons/topbar/1920.png b/awesome/themes/blackburn/icons/topbar/1920.png new file mode 100644 index 0000000..1d4d9b3 Binary files /dev/null and b/awesome/themes/blackburn/icons/topbar/1920.png differ diff --git a/awesome/themes/blackburn/icons/topbar/2560.png b/awesome/themes/blackburn/icons/topbar/2560.png new file mode 100644 index 0000000..d4f8b1a Binary files /dev/null and b/awesome/themes/blackburn/icons/topbar/2560.png differ diff --git a/awesome/themes/blackburn/icons/uselesstile.png b/awesome/themes/blackburn/icons/uselesstile.png new file mode 100644 index 0000000..69fed1a Binary files /dev/null and b/awesome/themes/blackburn/icons/uselesstile.png differ diff --git a/awesome/themes/blackburn/icons/uselesstileleft.png b/awesome/themes/blackburn/icons/uselesstileleft.png new file mode 100644 index 0000000..a77c177 Binary files /dev/null and b/awesome/themes/blackburn/icons/uselesstileleft.png differ diff --git a/awesome/themes/blackburn/icons/uselesstiletop.png b/awesome/themes/blackburn/icons/uselesstiletop.png new file mode 100644 index 0000000..8f5afa9 Binary files /dev/null and b/awesome/themes/blackburn/icons/uselesstiletop.png differ diff --git a/awesome/themes/blackburn/theme.lua b/awesome/themes/blackburn/theme.lua new file mode 100644 index 0000000..ac68569 --- /dev/null +++ b/awesome/themes/blackburn/theme.lua @@ -0,0 +1,63 @@ +--[[ + + Blackburn Awesome WM config 2.0 + github.com/copycat-killer + +--]] + +theme = {} + +theme.dir = os.getenv("HOME") .. "/.config/awesome/themes/blackburn" +theme.wallpaper = theme.dir .. "/wall.png" +theme.topbar_path = "png:" .. theme.dir .. "/icons/topbar/" + +theme.font = "Tamsyn 10.5" +theme.taglist_font = "Icons 10" +theme.fg_normal = "#D7D7D7" +theme.fg_focus = "#F6784F" +theme.bg_normal = "#060606" +theme.bg_focus = "#060606" +theme.fg_urgent = "#CC9393" +theme.bg_urgent = "#2A1F1E" +theme.border_width = "1" +theme.border_normal = "#0E0E0E" +theme.border_focus = "#F79372" + +theme.taglist_fg_focus = "#F6784F" +theme.taglist_bg_focus = "#060606" +theme.tasklist_fg_focus = "#F6784F" +theme.tasklist_bg_focus = "#060606" +theme.menu_height = "16" +theme.menu_width = "140" + +theme.submenu_icon = theme.dir .. "/icons/submenu.png" +theme.taglist_squares_sel = theme.dir .. "/icons/square_sel.png" +theme.taglist_squares_unsel = theme.dir .. "/icons/square_unsel.png" +theme.arrl_lr_pre = theme.dir .. "/icons/arrl_lr_pre.png" +theme.arrl_lr_post = theme.dir .. "/icons/arrl_lr_post.png" + +theme.layout_tile = theme.dir .. "/icons/tile.png" +theme.layout_tileleft = theme.dir .. "/icons/tileleft.png" +theme.layout_tilebottom = theme.dir .. "/icons/tilebottom.png" +theme.layout_tiletop = theme.dir .. "/icons/tiletop.png" +theme.layout_fairv = theme.dir .. "/icons/fairv.png" +theme.layout_fairh = theme.dir .. "/icons/fairh.png" +theme.layout_spiral = theme.dir .. "/icons/spiral.png" +theme.layout_dwindle = theme.dir .. "/icons/dwindle.png" +theme.layout_max = theme.dir .. "/icons/max.png" +theme.layout_fullscreen = theme.dir .. "/icons/fullscreen.png" +theme.layout_magnifier = theme.dir .. "/icons/magnifier.png" +theme.layout_floating = theme.dir .. "/icons/floating.png" + +theme.tasklist_disable_icon = true +theme.tasklist_floating = "" +theme.tasklist_maximized_horizontal = "" +theme.tasklist_maximized_vertical = "" + +-- lain related +theme.useless_gap_width = 10 +theme.layout_uselesstile = theme.dir .. "/icons/uselesstile.png" +theme.layout_uselesstileleft = theme.dir .. "/icons/uselesstileleft.png" +theme.layout_uselesstiletop = theme.dir .. "/icons/uselesstiletop.png" + +return theme diff --git a/awesome/themes/blackburn/wall.png b/awesome/themes/blackburn/wall.png new file mode 100644 index 0000000..c3b0e2e Binary files /dev/null and b/awesome/themes/blackburn/wall.png differ diff --git a/awesome/themes/copland/icons/ac.png b/awesome/themes/copland/icons/ac.png new file mode 100644 index 0000000..b103ac9 Binary files /dev/null and b/awesome/themes/copland/icons/ac.png differ diff --git a/awesome/themes/copland/icons/awesome.png b/awesome/themes/copland/icons/awesome.png new file mode 100644 index 0000000..1441881 Binary files /dev/null and b/awesome/themes/copland/icons/awesome.png differ diff --git a/awesome/themes/copland/icons/bat.png b/awesome/themes/copland/icons/bat.png new file mode 100644 index 0000000..ad16256 Binary files /dev/null and b/awesome/themes/copland/icons/bat.png differ diff --git a/awesome/themes/copland/icons/bat_low.png b/awesome/themes/copland/icons/bat_low.png new file mode 100644 index 0000000..c198675 Binary files /dev/null and b/awesome/themes/copland/icons/bat_low.png differ diff --git a/awesome/themes/copland/icons/bat_no.png b/awesome/themes/copland/icons/bat_no.png new file mode 100644 index 0000000..4110543 Binary files /dev/null and b/awesome/themes/copland/icons/bat_no.png differ diff --git a/awesome/themes/copland/icons/centerfair.png b/awesome/themes/copland/icons/centerfair.png new file mode 100644 index 0000000..178e24d Binary files /dev/null and b/awesome/themes/copland/icons/centerfair.png differ diff --git a/awesome/themes/copland/icons/centerwork.png b/awesome/themes/copland/icons/centerwork.png new file mode 100644 index 0000000..b8b728b Binary files /dev/null and b/awesome/themes/copland/icons/centerwork.png differ diff --git a/awesome/themes/copland/icons/disk.png b/awesome/themes/copland/icons/disk.png new file mode 100644 index 0000000..8ecee6b Binary files /dev/null and b/awesome/themes/copland/icons/disk.png differ diff --git a/awesome/themes/copland/icons/dwindle.png b/awesome/themes/copland/icons/dwindle.png new file mode 100644 index 0000000..b576f7b Binary files /dev/null and b/awesome/themes/copland/icons/dwindle.png differ diff --git a/awesome/themes/copland/icons/fairh.png b/awesome/themes/copland/icons/fairh.png new file mode 100644 index 0000000..3ec0abd Binary files /dev/null and b/awesome/themes/copland/icons/fairh.png differ diff --git a/awesome/themes/copland/icons/fairv.png b/awesome/themes/copland/icons/fairv.png new file mode 100644 index 0000000..e1d543c Binary files /dev/null and b/awesome/themes/copland/icons/fairv.png differ diff --git a/awesome/themes/copland/icons/floating.png b/awesome/themes/copland/icons/floating.png new file mode 100644 index 0000000..fe4a801 Binary files /dev/null and b/awesome/themes/copland/icons/floating.png differ diff --git a/awesome/themes/copland/icons/pause.png b/awesome/themes/copland/icons/pause.png new file mode 100644 index 0000000..381e532 Binary files /dev/null and b/awesome/themes/copland/icons/pause.png differ diff --git a/awesome/themes/copland/icons/play.png b/awesome/themes/copland/icons/play.png new file mode 100644 index 0000000..897f027 Binary files /dev/null and b/awesome/themes/copland/icons/play.png differ diff --git a/awesome/themes/copland/icons/spiral.png b/awesome/themes/copland/icons/spiral.png new file mode 100644 index 0000000..10c9f99 Binary files /dev/null and b/awesome/themes/copland/icons/spiral.png differ diff --git a/awesome/themes/copland/icons/square_sel.png b/awesome/themes/copland/icons/square_sel.png new file mode 100644 index 0000000..d89011a Binary files /dev/null and b/awesome/themes/copland/icons/square_sel.png differ diff --git a/awesome/themes/copland/icons/square_unsel.png b/awesome/themes/copland/icons/square_unsel.png new file mode 100644 index 0000000..ef7469c Binary files /dev/null and b/awesome/themes/copland/icons/square_unsel.png differ diff --git a/awesome/themes/copland/icons/submenu.png b/awesome/themes/copland/icons/submenu.png new file mode 100644 index 0000000..10ed739 Binary files /dev/null and b/awesome/themes/copland/icons/submenu.png differ diff --git a/awesome/themes/copland/icons/termfair.png b/awesome/themes/copland/icons/termfair.png new file mode 100644 index 0000000..4f437b3 Binary files /dev/null and b/awesome/themes/copland/icons/termfair.png differ diff --git a/awesome/themes/copland/icons/tile.png b/awesome/themes/copland/icons/tile.png new file mode 100644 index 0000000..ec8e4d3 Binary files /dev/null and b/awesome/themes/copland/icons/tile.png differ diff --git a/awesome/themes/copland/icons/tilebottom.png b/awesome/themes/copland/icons/tilebottom.png new file mode 100644 index 0000000..6eda28d Binary files /dev/null and b/awesome/themes/copland/icons/tilebottom.png differ diff --git a/awesome/themes/copland/icons/tileleft.png b/awesome/themes/copland/icons/tileleft.png new file mode 100644 index 0000000..c87a32f Binary files /dev/null and b/awesome/themes/copland/icons/tileleft.png differ diff --git a/awesome/themes/copland/icons/tiletop.png b/awesome/themes/copland/icons/tiletop.png new file mode 100644 index 0000000..a09ed3b Binary files /dev/null and b/awesome/themes/copland/icons/tiletop.png differ diff --git a/awesome/themes/copland/icons/titlebar/close_focus.png b/awesome/themes/copland/icons/titlebar/close_focus.png new file mode 100644 index 0000000..e56b280 Binary files /dev/null and b/awesome/themes/copland/icons/titlebar/close_focus.png differ diff --git a/awesome/themes/copland/icons/titlebar/close_normal.png b/awesome/themes/copland/icons/titlebar/close_normal.png new file mode 100644 index 0000000..5a99f56 Binary files /dev/null and b/awesome/themes/copland/icons/titlebar/close_normal.png differ diff --git a/awesome/themes/copland/icons/titlebar/floating_focus_active.png b/awesome/themes/copland/icons/titlebar/floating_focus_active.png new file mode 100644 index 0000000..b0bdf86 Binary files /dev/null and b/awesome/themes/copland/icons/titlebar/floating_focus_active.png differ diff --git a/awesome/themes/copland/icons/titlebar/floating_focus_inactive.png b/awesome/themes/copland/icons/titlebar/floating_focus_inactive.png new file mode 100644 index 0000000..47f19f6 Binary files /dev/null and b/awesome/themes/copland/icons/titlebar/floating_focus_inactive.png differ diff --git a/awesome/themes/copland/icons/titlebar/floating_normal_active.png b/awesome/themes/copland/icons/titlebar/floating_normal_active.png new file mode 100644 index 0000000..df17970 Binary files /dev/null and b/awesome/themes/copland/icons/titlebar/floating_normal_active.png differ diff --git a/awesome/themes/copland/icons/titlebar/floating_normal_inactive.png b/awesome/themes/copland/icons/titlebar/floating_normal_inactive.png new file mode 100644 index 0000000..98f7f1d Binary files /dev/null and b/awesome/themes/copland/icons/titlebar/floating_normal_inactive.png differ diff --git a/awesome/themes/copland/icons/titlebar/maximized_focus_active.png b/awesome/themes/copland/icons/titlebar/maximized_focus_active.png new file mode 100644 index 0000000..f94d40c Binary files /dev/null and b/awesome/themes/copland/icons/titlebar/maximized_focus_active.png differ diff --git a/awesome/themes/copland/icons/titlebar/maximized_focus_inactive.png b/awesome/themes/copland/icons/titlebar/maximized_focus_inactive.png new file mode 100644 index 0000000..bce1d00 Binary files /dev/null and b/awesome/themes/copland/icons/titlebar/maximized_focus_inactive.png differ diff --git a/awesome/themes/copland/icons/titlebar/maximized_normal_active.png b/awesome/themes/copland/icons/titlebar/maximized_normal_active.png new file mode 100644 index 0000000..9e87af5 Binary files /dev/null and b/awesome/themes/copland/icons/titlebar/maximized_normal_active.png differ diff --git a/awesome/themes/copland/icons/titlebar/maximized_normal_inactive.png b/awesome/themes/copland/icons/titlebar/maximized_normal_inactive.png new file mode 100644 index 0000000..2e56d32 Binary files /dev/null and b/awesome/themes/copland/icons/titlebar/maximized_normal_inactive.png differ diff --git a/awesome/themes/copland/icons/titlebar/ontop_focus_active.png b/awesome/themes/copland/icons/titlebar/ontop_focus_active.png new file mode 100644 index 0000000..c5821a6 Binary files /dev/null and b/awesome/themes/copland/icons/titlebar/ontop_focus_active.png differ diff --git a/awesome/themes/copland/icons/titlebar/ontop_focus_inactive.png b/awesome/themes/copland/icons/titlebar/ontop_focus_inactive.png new file mode 100644 index 0000000..2f3a2be Binary files /dev/null and b/awesome/themes/copland/icons/titlebar/ontop_focus_inactive.png differ diff --git a/awesome/themes/copland/icons/titlebar/ontop_normal_active.png b/awesome/themes/copland/icons/titlebar/ontop_normal_active.png new file mode 100644 index 0000000..9a26d34 Binary files /dev/null and b/awesome/themes/copland/icons/titlebar/ontop_normal_active.png differ diff --git a/awesome/themes/copland/icons/titlebar/ontop_normal_inactive.png b/awesome/themes/copland/icons/titlebar/ontop_normal_inactive.png new file mode 100644 index 0000000..a9a3206 Binary files /dev/null and b/awesome/themes/copland/icons/titlebar/ontop_normal_inactive.png differ diff --git a/awesome/themes/copland/icons/titlebar/sticky_focus_active.png b/awesome/themes/copland/icons/titlebar/sticky_focus_active.png new file mode 100644 index 0000000..2cf0bd0 Binary files /dev/null and b/awesome/themes/copland/icons/titlebar/sticky_focus_active.png differ diff --git a/awesome/themes/copland/icons/titlebar/sticky_focus_inactive.png b/awesome/themes/copland/icons/titlebar/sticky_focus_inactive.png new file mode 100644 index 0000000..5493d8e Binary files /dev/null and b/awesome/themes/copland/icons/titlebar/sticky_focus_inactive.png differ diff --git a/awesome/themes/copland/icons/titlebar/sticky_normal_active.png b/awesome/themes/copland/icons/titlebar/sticky_normal_active.png new file mode 100644 index 0000000..a06138d Binary files /dev/null and b/awesome/themes/copland/icons/titlebar/sticky_normal_active.png differ diff --git a/awesome/themes/copland/icons/titlebar/sticky_normal_inactive.png b/awesome/themes/copland/icons/titlebar/sticky_normal_inactive.png new file mode 100644 index 0000000..7e6c99b Binary files /dev/null and b/awesome/themes/copland/icons/titlebar/sticky_normal_inactive.png differ diff --git a/awesome/themes/copland/icons/vol.png b/awesome/themes/copland/icons/vol.png new file mode 100644 index 0000000..281dddb Binary files /dev/null and b/awesome/themes/copland/icons/vol.png differ diff --git a/awesome/themes/copland/icons/vol_low.png b/awesome/themes/copland/icons/vol_low.png new file mode 100644 index 0000000..63c2293 Binary files /dev/null and b/awesome/themes/copland/icons/vol_low.png differ diff --git a/awesome/themes/copland/icons/vol_mute.png b/awesome/themes/copland/icons/vol_mute.png new file mode 100644 index 0000000..68d0de7 Binary files /dev/null and b/awesome/themes/copland/icons/vol_mute.png differ diff --git a/awesome/themes/copland/icons/vol_no.png b/awesome/themes/copland/icons/vol_no.png new file mode 100644 index 0000000..e801344 Binary files /dev/null and b/awesome/themes/copland/icons/vol_no.png differ diff --git a/awesome/themes/copland/icons/widget_bg.png b/awesome/themes/copland/icons/widget_bg.png new file mode 100644 index 0000000..e04f495 Binary files /dev/null and b/awesome/themes/copland/icons/widget_bg.png differ diff --git a/awesome/themes/copland/theme.lua b/awesome/themes/copland/theme.lua new file mode 100644 index 0000000..f8a8774 --- /dev/null +++ b/awesome/themes/copland/theme.lua @@ -0,0 +1,105 @@ +--[[ + + Copland Awesome WM config + github.com/copycat-killer + +--]] + +theme = {} + +theme.dir = os.getenv("HOME") .. "/.config/awesome/themes/copland" +theme.wallpaper = theme.dir .. "/wall.png" + +theme.font = "Tamsyn 10.5" +theme.fg_normal = "#BBBBBB" +theme.fg_focus = "#78A4FF" +theme.bg_normal = "#111111" +theme.bg_focus = "#111111" +theme.fg_urgent = "#000000" +theme.bg_urgent = "#FFFFFF" +theme.border_width = 1 +theme.border_normal = "#141414" +theme.border_focus = "#93B6FF" +theme.taglist_fg_focus = "#FFFFEF" +theme.taglist_bg_focus = "#111111" +theme.taglist_bg_normal = "#111111" +theme.titlebar_bg_normal = "#191919" +theme.titlebar_bg_focus = "#262626" +theme.menu_height = "15" +theme.menu_width = "150" + +theme.tasklist_sticky = "" +theme.tasklist_ontop = "" +theme.tasklist_floating = "" +theme.tasklist_maximized_horizontal = "" +theme.tasklist_maximized_vertical = "" +theme.tasklist_disable_icon = true + +theme.awesome_icon = theme.dir .."/icons/awesome.png" +theme.submenu_icon = theme.dir .."/icons/submenu.png" +theme.taglist_squares_sel = theme.dir .. "/icons/square_unsel.png" +theme.taglist_squares_unsel = theme.dir .. "/icons/square_unsel.png" +theme.widget_bg = theme.dir .. "/icons/widget_bg.png" +theme.vol = theme.dir .. "/icons/vol.png" +theme.vol_low = theme.dir .. "/icons/vol_low.png" +theme.vol_no = theme.dir .. "/icons/vol_no.png" +theme.vol_mute = theme.dir .. "/icons/vol_mute.png" +theme.disk = theme.dir .. "/icons/disk.png" +theme.ac = theme.dir .. "/icons/ac.png" +theme.bat = theme.dir .. "/icons/bat.png" +theme.bat_low = theme.dir .. "/icons/bat_low.png" +theme.bat_no = theme.dir .. "/icons/bat_no.png" +theme.play = theme.dir .. "/icons/play.png" +theme.pause = theme.dir .. "/icons/pause.png" + +theme.layout_tile = theme.dir .. "/icons/tile.png" +theme.layout_tileleft = theme.dir .. "/icons/tileleft.png" +theme.layout_tilebottom = theme.dir .. "/icons/tilebottom.png" +theme.layout_tiletop = theme.dir .. "/icons/tiletop.png" +theme.layout_fairv = theme.dir .. "/icons/fairv.png" +theme.layout_fairh = theme.dir .. "/icons/fairh.png" +theme.layout_spiral = theme.dir .. "/icons/spiral.png" +theme.layout_dwindle = theme.dir .. "/icons/dwindle.png" +theme.layout_max = theme.dir .. "/icons/max.png" +theme.layout_fullscreen = theme.dir .. "/icons/fullscreen.png" +theme.layout_magnifier = theme.dir .. "/icons/magnifier.png" +theme.layout_floating = theme.dir .. "/icons/floating.png" + +theme.titlebar_close_button_focus = theme.dir .. "/icons/titlebar/close_focus.png" +theme.titlebar_close_button_normal = theme.dir .. "/icons/titlebar/close_normal.png" + +theme.titlebar_ontop_button_focus_active = theme.dir .. "/icons/titlebar/ontop_focus_active.png" +theme.titlebar_ontop_button_normal_active = theme.dir .. "/icons/titlebar/ontop_normal_active.png" +theme.titlebar_ontop_button_focus_inactive = theme.dir .. "/icons/titlebar/ontop_focus_inactive.png" +theme.titlebar_ontop_button_normal_inactive = theme.dir .. "/icons/titlebar/ontop_normal_inactive.png" + +theme.titlebar_sticky_button_focus_active = theme.dir .. "/icons/titlebar/sticky_focus_active.png" +theme.titlebar_sticky_button_normal_active = theme.dir .. "/icons/titlebar/sticky_normal_active.png" +theme.titlebar_sticky_button_focus_inactive = theme.dir .. "/icons/titlebar/sticky_focus_inactive.png" +theme.titlebar_sticky_button_normal_inactive = theme.dir .. "/icons/titlebar/sticky_normal_inactive.png" + +theme.titlebar_floating_button_focus_active = theme.dir .. "/icons/titlebar/floating_focus_active.png" +theme.titlebar_floating_button_normal_active = theme.dir .. "/icons/titlebar/floating_normal_active.png" +theme.titlebar_floating_button_focus_inactive = theme.dir .. "/icons/titlebar/floating_focus_inactive.png" +theme.titlebar_floating_button_normal_inactive = theme.dir .. "/icons/titlebar/floating_normal_inactive.png" + +theme.titlebar_maximized_button_focus_active = theme.dir .. "/icons/titlebar/maximized_focus_active.png" +theme.titlebar_maximized_button_normal_active = theme.dir .. "/icons/titlebar/maximized_normal_active.png" +theme.titlebar_maximized_button_focus_inactive = theme.dir .. "/icons/titlebar/maximized_focus_inactive.png" +theme.titlebar_maximized_button_normal_inactive = theme.dir .. "/icons/titlebar/maximized_normal_inactive.png" + +-- lain related +theme.useless_gap_width = 10 +theme.layout_centerfair = theme.dir .. "/icons/centerfair.png" +theme.layout_termfair = theme.dir .. "/icons/termfair.png" +theme.layout_centerwork = theme.dir .. "/icons/centerwork.png" +theme.layout_uselessfair = theme.dir .. "/icons/fairv.png" +theme.layout_uselessfairh = theme.dir .. "/icons/fairh.png" +theme.layout_uselessdwindle = theme.dir .. "/icons/dwindle.png" +theme.layout_uselesstile = theme.dir .. "/icons/tile.png" +theme.layout_uselesstiletop = theme.dir .. "/icons/tiletop.png" +theme.layout_uselesstileleft = theme.dir .. "/icons/tileleft.png" +theme.layout_uselesstilebottom = theme.dir .. "/icons/tilebottom.png" +theme.layout_uselesspiral = theme.dir .. "/icons/spiral.png" + +return theme diff --git a/awesome/themes/copland/wall.png b/awesome/themes/copland/wall.png new file mode 100644 index 0000000..5eec751 Binary files /dev/null and b/awesome/themes/copland/wall.png differ diff --git a/awesome/themes/dremora/icons/arrl_lr_post.png b/awesome/themes/dremora/icons/arrl_lr_post.png new file mode 100644 index 0000000..031cc63 Binary files /dev/null and b/awesome/themes/dremora/icons/arrl_lr_post.png differ diff --git a/awesome/themes/dremora/icons/arrl_lr_pre.png b/awesome/themes/dremora/icons/arrl_lr_pre.png new file mode 100644 index 0000000..3c3a7d7 Binary files /dev/null and b/awesome/themes/dremora/icons/arrl_lr_pre.png differ diff --git a/awesome/themes/dremora/icons/dwindle.png b/awesome/themes/dremora/icons/dwindle.png new file mode 100644 index 0000000..2547a17 Binary files /dev/null and b/awesome/themes/dremora/icons/dwindle.png differ diff --git a/awesome/themes/dremora/icons/fairh.png b/awesome/themes/dremora/icons/fairh.png new file mode 100644 index 0000000..578417c Binary files /dev/null and b/awesome/themes/dremora/icons/fairh.png differ diff --git a/awesome/themes/dremora/icons/fairv.png b/awesome/themes/dremora/icons/fairv.png new file mode 100644 index 0000000..e308555 Binary files /dev/null and b/awesome/themes/dremora/icons/fairv.png differ diff --git a/awesome/themes/dremora/icons/floating.png b/awesome/themes/dremora/icons/floating.png new file mode 100755 index 0000000..55be201 Binary files /dev/null and b/awesome/themes/dremora/icons/floating.png differ diff --git a/awesome/themes/dremora/icons/magnifier.png b/awesome/themes/dremora/icons/magnifier.png new file mode 100644 index 0000000..1678b83 Binary files /dev/null and b/awesome/themes/dremora/icons/magnifier.png differ diff --git a/awesome/themes/dremora/icons/max.png b/awesome/themes/dremora/icons/max.png new file mode 100644 index 0000000..bda3c6a Binary files /dev/null and b/awesome/themes/dremora/icons/max.png differ diff --git a/awesome/themes/dremora/icons/spiral.png b/awesome/themes/dremora/icons/spiral.png new file mode 100644 index 0000000..60c2583 Binary files /dev/null and b/awesome/themes/dremora/icons/spiral.png differ diff --git a/awesome/themes/dremora/icons/square_sel.png b/awesome/themes/dremora/icons/square_sel.png new file mode 100644 index 0000000..85cc605 Binary files /dev/null and b/awesome/themes/dremora/icons/square_sel.png differ diff --git a/awesome/themes/dremora/icons/square_unsel.png b/awesome/themes/dremora/icons/square_unsel.png new file mode 100644 index 0000000..1c58e4b Binary files /dev/null and b/awesome/themes/dremora/icons/square_unsel.png differ diff --git a/awesome/themes/dremora/icons/submenu.png b/awesome/themes/dremora/icons/submenu.png new file mode 100644 index 0000000..988ef9e Binary files /dev/null and b/awesome/themes/dremora/icons/submenu.png differ diff --git a/awesome/themes/dremora/icons/tile.png b/awesome/themes/dremora/icons/tile.png new file mode 100755 index 0000000..02047e8 Binary files /dev/null and b/awesome/themes/dremora/icons/tile.png differ diff --git a/awesome/themes/dremora/icons/tilebottom.png b/awesome/themes/dremora/icons/tilebottom.png new file mode 100755 index 0000000..5f5ab79 Binary files /dev/null and b/awesome/themes/dremora/icons/tilebottom.png differ diff --git a/awesome/themes/dremora/icons/tileleft.png b/awesome/themes/dremora/icons/tileleft.png new file mode 100755 index 0000000..7ed1c5e Binary files /dev/null and b/awesome/themes/dremora/icons/tileleft.png differ diff --git a/awesome/themes/dremora/icons/tiletop.png b/awesome/themes/dremora/icons/tiletop.png new file mode 100755 index 0000000..dc83550 Binary files /dev/null and b/awesome/themes/dremora/icons/tiletop.png differ diff --git a/awesome/themes/dremora/icons/uselesstile.png b/awesome/themes/dremora/icons/uselesstile.png new file mode 100644 index 0000000..cab4c7e Binary files /dev/null and b/awesome/themes/dremora/icons/uselesstile.png differ diff --git a/awesome/themes/dremora/icons/uselesstileleft.png b/awesome/themes/dremora/icons/uselesstileleft.png new file mode 100644 index 0000000..987dcc2 Binary files /dev/null and b/awesome/themes/dremora/icons/uselesstileleft.png differ diff --git a/awesome/themes/dremora/icons/uselesstiletop.png b/awesome/themes/dremora/icons/uselesstiletop.png new file mode 100644 index 0000000..1eabd27 Binary files /dev/null and b/awesome/themes/dremora/icons/uselesstiletop.png differ diff --git a/awesome/themes/dremora/theme.lua b/awesome/themes/dremora/theme.lua new file mode 100644 index 0000000..4c04ab7 --- /dev/null +++ b/awesome/themes/dremora/theme.lua @@ -0,0 +1,62 @@ +--[[ + + Dremora Awesome WM config 2.0 + github.com/copycat-killer + +--]] + +theme = {} + +theme.dir = os.getenv("HOME") .. "/.config/awesome/themes/dremora" +theme.wallpaper = theme.dir .. "/wall.png" + +theme.font = "Tamsyn 10.5" +theme.taglist_font = "Icons 10" +theme.fg_normal = "#747474" +theme.fg_focus = "#DDDCFF" +theme.bg_normal = "#121212" +theme.bg_focus = "#121212" +theme.fg_urgent = "#CC9393" +theme.bg_urgent = "#2A1F1E" +theme.border_width = "0" +theme.border_normal = "#121212" +theme.border_focus = "#292929" +theme.titlebar_bg_focus = "#292929" + +theme.taglist_fg_focus = "#dddcff" +theme.taglist_bg_focus = "#121212" +theme.menu_height = "16" +theme.menu_width = "140" + +theme.submenu_icon = theme.dir .. "/icons/submenu.png" +theme.taglist_squares_sel = theme.dir .. "/icons/square_sel.png" +theme.taglist_squares_unsel = theme.dir .. "/icons/square_unsel.png" +theme.arrl_lr_pre = theme.dir .. "/icons/arrl_lr_pre.png" +theme.arrl_lr_post = theme.dir .. "/icons/arrl_lr_post.png" + +theme.layout_tile = theme.dir .. "/icons/tile.png" +theme.layout_tilegaps = theme.dir .. "/icons/tilegaps.png" +theme.layout_tileleft = theme.dir .. "/icons/tileleft.png" +theme.layout_tilebottom = theme.dir .. "/icons/tilebottom.png" +theme.layout_tiletop = theme.dir .. "/icons/tiletop.png" +theme.layout_fairv = theme.dir .. "/icons/fairv.png" +theme.layout_fairh = theme.dir .. "/icons/fairh.png" +theme.layout_spiral = theme.dir .. "/icons/spiral.png" +theme.layout_dwindle = theme.dir .. "/icons/dwindle.png" +theme.layout_max = theme.dir .. "/icons/max.png" +theme.layout_fullscreen = theme.dir .. "/icons/fullscreen.png" +theme.layout_magnifier = theme.dir .. "/icons/magnifier.png" +theme.layout_floating = theme.dir .. "/icons/floating.png" + +theme.tasklist_disable_icon = true +theme.tasklist_floating = "" +theme.tasklist_maximized_horizontal = "" +theme.tasklist_maximized_vertical = "" + +-- lain related +theme.useless_gap_width = 10 +theme.layout_uselesstile = theme.dir .. "/icons/uselesstile.png" +theme.layout_uselesstileleft = theme.dir .. "/icons/uselesstileleft.png" +theme.layout_uselesstiletop = theme.dir .. "/icons/uselesstiletop.png" + +return theme diff --git a/awesome/themes/dremora/wall.png b/awesome/themes/dremora/wall.png new file mode 100755 index 0000000..b9e4c51 Binary files /dev/null and b/awesome/themes/dremora/wall.png differ diff --git a/awesome/themes/holo/icons/awesome_icon.png b/awesome/themes/holo/icons/awesome_icon.png new file mode 100644 index 0000000..596cc4a Binary files /dev/null and b/awesome/themes/holo/icons/awesome_icon.png differ diff --git a/awesome/themes/holo/icons/bar.png b/awesome/themes/holo/icons/bar.png new file mode 100644 index 0000000..023f198 Binary files /dev/null and b/awesome/themes/holo/icons/bar.png differ diff --git a/awesome/themes/holo/icons/base_widget.png b/awesome/themes/holo/icons/base_widget.png new file mode 100644 index 0000000..059f9c0 Binary files /dev/null and b/awesome/themes/holo/icons/base_widget.png differ diff --git a/awesome/themes/holo/icons/bg_focus.png b/awesome/themes/holo/icons/bg_focus.png new file mode 100644 index 0000000..28673a1 Binary files /dev/null and b/awesome/themes/holo/icons/bg_focus.png differ diff --git a/awesome/themes/holo/icons/bg_focus_noline.png b/awesome/themes/holo/icons/bg_focus_noline.png new file mode 100644 index 0000000..a867946 Binary files /dev/null and b/awesome/themes/holo/icons/bg_focus_noline.png differ diff --git a/awesome/themes/holo/icons/bottom_bar.png b/awesome/themes/holo/icons/bottom_bar.png new file mode 100644 index 0000000..0f6b809 Binary files /dev/null and b/awesome/themes/holo/icons/bottom_bar.png differ diff --git a/awesome/themes/holo/icons/cal.png b/awesome/themes/holo/icons/cal.png new file mode 100644 index 0000000..909d5a4 Binary files /dev/null and b/awesome/themes/holo/icons/cal.png differ diff --git a/awesome/themes/holo/icons/clock.png b/awesome/themes/holo/icons/clock.png new file mode 100644 index 0000000..ea33cc1 Binary files /dev/null and b/awesome/themes/holo/icons/clock.png differ diff --git a/awesome/themes/holo/icons/cpu.png b/awesome/themes/holo/icons/cpu.png new file mode 100644 index 0000000..51e86dc Binary files /dev/null and b/awesome/themes/holo/icons/cpu.png differ diff --git a/awesome/themes/holo/icons/dwindle.png b/awesome/themes/holo/icons/dwindle.png new file mode 100644 index 0000000..bc86db8 Binary files /dev/null and b/awesome/themes/holo/icons/dwindle.png differ diff --git a/awesome/themes/holo/icons/fairh.png b/awesome/themes/holo/icons/fairh.png new file mode 100644 index 0000000..43ed1d5 Binary files /dev/null and b/awesome/themes/holo/icons/fairh.png differ diff --git a/awesome/themes/holo/icons/fairv.png b/awesome/themes/holo/icons/fairv.png new file mode 100644 index 0000000..d58319b Binary files /dev/null and b/awesome/themes/holo/icons/fairv.png differ diff --git a/awesome/themes/holo/icons/floating.png b/awesome/themes/holo/icons/floating.png new file mode 100644 index 0000000..626136f Binary files /dev/null and b/awesome/themes/holo/icons/floating.png differ diff --git a/awesome/themes/holo/icons/last.png b/awesome/themes/holo/icons/last.png new file mode 100644 index 0000000..33a4b96 Binary files /dev/null and b/awesome/themes/holo/icons/last.png differ diff --git a/awesome/themes/holo/icons/magnifier.png b/awesome/themes/holo/icons/magnifier.png new file mode 100644 index 0000000..616a366 Binary files /dev/null and b/awesome/themes/holo/icons/magnifier.png differ diff --git a/awesome/themes/holo/icons/mail_notify.png b/awesome/themes/holo/icons/mail_notify.png new file mode 100644 index 0000000..3816f53 Binary files /dev/null and b/awesome/themes/holo/icons/mail_notify.png differ diff --git a/awesome/themes/holo/icons/max.png b/awesome/themes/holo/icons/max.png new file mode 100644 index 0000000..f809ea1 Binary files /dev/null and b/awesome/themes/holo/icons/max.png differ diff --git a/awesome/themes/holo/icons/mpd.png b/awesome/themes/holo/icons/mpd.png new file mode 100644 index 0000000..6a96cee Binary files /dev/null and b/awesome/themes/holo/icons/mpd.png differ diff --git a/awesome/themes/holo/icons/net_down.png b/awesome/themes/holo/icons/net_down.png new file mode 100644 index 0000000..168201c Binary files /dev/null and b/awesome/themes/holo/icons/net_down.png differ diff --git a/awesome/themes/holo/icons/net_up.png b/awesome/themes/holo/icons/net_up.png new file mode 100644 index 0000000..45b29a6 Binary files /dev/null and b/awesome/themes/holo/icons/net_up.png differ diff --git a/awesome/themes/holo/icons/next.png b/awesome/themes/holo/icons/next.png new file mode 100644 index 0000000..9de2da8 Binary files /dev/null and b/awesome/themes/holo/icons/next.png differ diff --git a/awesome/themes/holo/icons/pause.png b/awesome/themes/holo/icons/pause.png new file mode 100644 index 0000000..2a443dd Binary files /dev/null and b/awesome/themes/holo/icons/pause.png differ diff --git a/awesome/themes/holo/icons/play.png b/awesome/themes/holo/icons/play.png new file mode 100644 index 0000000..9567b8a Binary files /dev/null and b/awesome/themes/holo/icons/play.png differ diff --git a/awesome/themes/holo/icons/prev.png b/awesome/themes/holo/icons/prev.png new file mode 100644 index 0000000..3cd3efb Binary files /dev/null and b/awesome/themes/holo/icons/prev.png differ diff --git a/awesome/themes/holo/icons/spiral.png b/awesome/themes/holo/icons/spiral.png new file mode 100644 index 0000000..e5afd83 Binary files /dev/null and b/awesome/themes/holo/icons/spiral.png differ diff --git a/awesome/themes/holo/icons/spr.png b/awesome/themes/holo/icons/spr.png new file mode 100644 index 0000000..148aa80 Binary files /dev/null and b/awesome/themes/holo/icons/spr.png differ diff --git a/awesome/themes/holo/icons/spr_bottom_right.png b/awesome/themes/holo/icons/spr_bottom_right.png new file mode 100644 index 0000000..b7038a0 Binary files /dev/null and b/awesome/themes/holo/icons/spr_bottom_right.png differ diff --git a/awesome/themes/holo/icons/spr_left.png b/awesome/themes/holo/icons/spr_left.png new file mode 100644 index 0000000..a74db86 Binary files /dev/null and b/awesome/themes/holo/icons/spr_left.png differ diff --git a/awesome/themes/holo/icons/spr_right.png b/awesome/themes/holo/icons/spr_right.png new file mode 100644 index 0000000..f1953b3 Binary files /dev/null and b/awesome/themes/holo/icons/spr_right.png differ diff --git a/awesome/themes/holo/icons/spr_small.png b/awesome/themes/holo/icons/spr_small.png new file mode 100644 index 0000000..235410a Binary files /dev/null and b/awesome/themes/holo/icons/spr_small.png differ diff --git a/awesome/themes/holo/icons/spr_very_small.png b/awesome/themes/holo/icons/spr_very_small.png new file mode 100644 index 0000000..0db6077 Binary files /dev/null and b/awesome/themes/holo/icons/spr_very_small.png differ diff --git a/awesome/themes/holo/icons/square_sel.png b/awesome/themes/holo/icons/square_sel.png new file mode 100644 index 0000000..cd9bf0a Binary files /dev/null and b/awesome/themes/holo/icons/square_sel.png differ diff --git a/awesome/themes/holo/icons/square_unsel.png b/awesome/themes/holo/icons/square_unsel.png new file mode 100644 index 0000000..c77f1f8 Binary files /dev/null and b/awesome/themes/holo/icons/square_unsel.png differ diff --git a/awesome/themes/holo/icons/stop.png b/awesome/themes/holo/icons/stop.png new file mode 100644 index 0000000..95d8116 Binary files /dev/null and b/awesome/themes/holo/icons/stop.png differ diff --git a/awesome/themes/holo/icons/submenu.png b/awesome/themes/holo/icons/submenu.png new file mode 100644 index 0000000..10ca014 Binary files /dev/null and b/awesome/themes/holo/icons/submenu.png differ diff --git a/awesome/themes/holo/icons/taglist_bg_focus.png b/awesome/themes/holo/icons/taglist_bg_focus.png new file mode 100644 index 0000000..d911dfe Binary files /dev/null and b/awesome/themes/holo/icons/taglist_bg_focus.png differ diff --git a/awesome/themes/holo/icons/tile.png b/awesome/themes/holo/icons/tile.png new file mode 100644 index 0000000..31884f6 Binary files /dev/null and b/awesome/themes/holo/icons/tile.png differ diff --git a/awesome/themes/holo/icons/tilebottom.png b/awesome/themes/holo/icons/tilebottom.png new file mode 100644 index 0000000..e289816 Binary files /dev/null and b/awesome/themes/holo/icons/tilebottom.png differ diff --git a/awesome/themes/holo/icons/tileleft.png b/awesome/themes/holo/icons/tileleft.png new file mode 100644 index 0000000..687d247 Binary files /dev/null and b/awesome/themes/holo/icons/tileleft.png differ diff --git a/awesome/themes/holo/icons/tiletop.png b/awesome/themes/holo/icons/tiletop.png new file mode 100644 index 0000000..17cd06b Binary files /dev/null and b/awesome/themes/holo/icons/tiletop.png differ diff --git a/awesome/themes/holo/icons/topbar/1024.png b/awesome/themes/holo/icons/topbar/1024.png new file mode 100644 index 0000000..bc1449b Binary files /dev/null and b/awesome/themes/holo/icons/topbar/1024.png differ diff --git a/awesome/themes/holo/icons/topbar/1152.png b/awesome/themes/holo/icons/topbar/1152.png new file mode 100644 index 0000000..8f16c02 Binary files /dev/null and b/awesome/themes/holo/icons/topbar/1152.png differ diff --git a/awesome/themes/holo/icons/topbar/1280.png b/awesome/themes/holo/icons/topbar/1280.png new file mode 100644 index 0000000..c4f7637 Binary files /dev/null and b/awesome/themes/holo/icons/topbar/1280.png differ diff --git a/awesome/themes/holo/icons/topbar/1366.png b/awesome/themes/holo/icons/topbar/1366.png new file mode 100644 index 0000000..8a5ac44 Binary files /dev/null and b/awesome/themes/holo/icons/topbar/1366.png differ diff --git a/awesome/themes/holo/icons/topbar/1440.png b/awesome/themes/holo/icons/topbar/1440.png new file mode 100644 index 0000000..4fb7c7f Binary files /dev/null and b/awesome/themes/holo/icons/topbar/1440.png differ diff --git a/awesome/themes/holo/icons/topbar/1600.png b/awesome/themes/holo/icons/topbar/1600.png new file mode 100644 index 0000000..f58f733 Binary files /dev/null and b/awesome/themes/holo/icons/topbar/1600.png differ diff --git a/awesome/themes/holo/icons/topbar/1680.png b/awesome/themes/holo/icons/topbar/1680.png new file mode 100644 index 0000000..2abea88 Binary files /dev/null and b/awesome/themes/holo/icons/topbar/1680.png differ diff --git a/awesome/themes/holo/icons/topbar/1920.png b/awesome/themes/holo/icons/topbar/1920.png new file mode 100644 index 0000000..c9adc46 Binary files /dev/null and b/awesome/themes/holo/icons/topbar/1920.png differ diff --git a/awesome/themes/holo/icons/topbar/2560.png b/awesome/themes/holo/icons/topbar/2560.png new file mode 100644 index 0000000..6b496ac Binary files /dev/null and b/awesome/themes/holo/icons/topbar/2560.png differ diff --git a/awesome/themes/holo/icons/uselesstile.png b/awesome/themes/holo/icons/uselesstile.png new file mode 100644 index 0000000..f482b10 Binary files /dev/null and b/awesome/themes/holo/icons/uselesstile.png differ diff --git a/awesome/themes/holo/icons/uselesstileleft.png b/awesome/themes/holo/icons/uselesstileleft.png new file mode 100644 index 0000000..caf6366 Binary files /dev/null and b/awesome/themes/holo/icons/uselesstileleft.png differ diff --git a/awesome/themes/holo/icons/uselesstiletop.png b/awesome/themes/holo/icons/uselesstiletop.png new file mode 100644 index 0000000..8cddfb6 Binary files /dev/null and b/awesome/themes/holo/icons/uselesstiletop.png differ diff --git a/awesome/themes/holo/theme.lua b/awesome/themes/holo/theme.lua new file mode 100644 index 0000000..96a117d --- /dev/null +++ b/awesome/themes/holo/theme.lua @@ -0,0 +1,91 @@ +--[[ + + Holo Awesome WM config 2.0 + github.com/copycat-killer + +--]] + +theme = {} + +theme.icon_dir = os.getenv("HOME") .. "/.config/awesome/themes/holo/icons" + +theme.wallpaper = os.getenv("HOME") .. "/.config/awesome/themes/holo/wall.png" + +theme.topbar_path = "png:" .. theme.icon_dir .. "/topbar/" + +theme.font = "Tamsyn 10.5" +theme.taglist_font = "Tamsyn 8" +theme.fg_normal = "#FFFFFF" +theme.fg_focus = "#0099CC" +theme.bg_normal = "#242424" +theme.fg_urgent = "#CC9393" +theme.bg_urgent = "#2A1F1E" +theme.border_width = "1" +theme.border_normal = "#252525" +theme.border_focus = "#0099CC" +theme.taglist_fg_focus = "#FFFFFF" +theme.taglist_bg_focus = "png:" .. theme.icon_dir .. "/taglist_bg_focus.png" +theme.tasklist_bg_normal = "#222222" +theme.tasklist_fg_focus = "#4CB7DB" +theme.tasklist_bg_focus = "png:" .. theme.icon_dir .. "/bg_focus_noline.png" +theme.textbox_widget_margin_top = 1 +theme.awful_widget_height = 14 +theme.awful_widget_margin_top = 2 +theme.menu_height = "20" +theme.menu_width = "400" + +theme.widget_bg = theme.icon_dir .. "/bg_focus_noline.png" +theme.awesome_icon = theme.icon_dir .. "/awesome_icon.png" +theme.vol_bg = theme.icon_dir .. "/vol_bg.png" +theme.submenu_icon = theme.icon_dir .. "/submenu.png" +theme.taglist_squares_sel = theme.icon_dir .. "/square_sel.png" +theme.taglist_squares_unsel = theme.icon_dir .. "/square_unsel.png" +theme.last = theme.icon_dir .. "/last.png" +theme.spr = theme.icon_dir .. "/spr.png" +theme.spr_small = theme.icon_dir .. "/spr_small.png" +theme.spr_very_small = theme.icon_dir .. "/spr_very_small.png" +theme.spr_right = theme.icon_dir .. "/spr_right.png" +theme.spr_bottom_right = theme.icon_dir .. "/spr_bottom_right.png" +theme.spr_left = theme.icon_dir .. "/spr_left.png" +theme.bar = theme.icon_dir .. "/bar.png" +theme.bottom_bar = theme.icon_dir .. "/bottom_bar.png" +theme.mpd = theme.icon_dir .. "/mpd.png" +theme.mpd_on = theme.icon_dir .. "/mpd_on.png" +theme.prev = theme.icon_dir .. "/prev.png" +theme.nex = theme.icon_dir .. "/next.png" +theme.stop = theme.icon_dir .. "/stop.png" +theme.pause = theme.icon_dir .. "/pause.png" +theme.play = theme.icon_dir .. "/play.png" +theme.clock = theme.icon_dir .. "/clock.png" +theme.calendar = theme.icon_dir .. "/cal.png" +theme.cpu = theme.icon_dir .. "/cpu.png" +theme.net_up = theme.icon_dir .. "/net_up.png" +theme.net_down = theme.icon_dir .. "/net_down.png" +theme.widget_mail_notify = theme.icon_dir .. "/mail_notify.png" + +theme.layout_tile = theme.icon_dir .. "/tile.png" +theme.layout_tilegaps = theme.icon_dir .. "/tilegaps.png" +theme.layout_tileleft = theme.icon_dir .. "/tileleft.png" +theme.layout_tilebottom = theme.icon_dir .. "/tilebottom.png" +theme.layout_tiletop = theme.icon_dir .. "/tiletop.png" +theme.layout_fairv = theme.icon_dir .. "/fairv.png" +theme.layout_fairh = theme.icon_dir .. "/fairh.png" +theme.layout_spiral = theme.icon_dir .. "/spiral.png" +theme.layout_dwindle = theme.icon_dir .. "/dwindle.png" +theme.layout_max = theme.icon_dir .. "/max.png" +theme.layout_fullscreen = theme.icon_dir .. "/fullscreen.png" +theme.layout_magnifier = theme.icon_dir .. "/magnifier.png" +theme.layout_floating = theme.icon_dir .. "/floating.png" + +theme.tasklist_disable_icon = true +theme.tasklist_floating = "" +theme.tasklist_maximized_horizontal = "" +theme.tasklist_maximized_vertical = "" + +-- lain related +theme.useless_gap_width = 10 +theme.layout_uselesstile = theme.icon_dir .. "/uselesstile.png" +theme.layout_uselesstileleft = theme.icon_dir .. "/uselesstileleft.png" +theme.layout_uselesstiletop = theme.icon_dir .. "/uselesstiletop.png" + +return theme diff --git a/awesome/themes/holo/wall.png b/awesome/themes/holo/wall.png new file mode 100644 index 0000000..511e095 Binary files /dev/null and b/awesome/themes/holo/wall.png differ diff --git a/awesome/themes/multicolor/icons/ac.png b/awesome/themes/multicolor/icons/ac.png new file mode 100644 index 0000000..41f49c5 Binary files /dev/null and b/awesome/themes/multicolor/icons/ac.png differ diff --git a/awesome/themes/multicolor/icons/bat.png b/awesome/themes/multicolor/icons/bat.png new file mode 100755 index 0000000..454f053 Binary files /dev/null and b/awesome/themes/multicolor/icons/bat.png differ diff --git a/awesome/themes/multicolor/icons/clock.png b/awesome/themes/multicolor/icons/clock.png new file mode 100644 index 0000000..22aef71 Binary files /dev/null and b/awesome/themes/multicolor/icons/clock.png differ diff --git a/awesome/themes/multicolor/icons/cpu.png b/awesome/themes/multicolor/icons/cpu.png new file mode 100644 index 0000000..1e3cba5 Binary files /dev/null and b/awesome/themes/multicolor/icons/cpu.png differ diff --git a/awesome/themes/multicolor/icons/dish.png b/awesome/themes/multicolor/icons/dish.png new file mode 100644 index 0000000..6ae19fd Binary files /dev/null and b/awesome/themes/multicolor/icons/dish.png differ diff --git a/awesome/themes/multicolor/icons/dwindle.png b/awesome/themes/multicolor/icons/dwindle.png new file mode 100755 index 0000000..81bf3e9 Binary files /dev/null and b/awesome/themes/multicolor/icons/dwindle.png differ diff --git a/awesome/themes/multicolor/icons/fairh.png b/awesome/themes/multicolor/icons/fairh.png new file mode 100755 index 0000000..89712e2 Binary files /dev/null and b/awesome/themes/multicolor/icons/fairh.png differ diff --git a/awesome/themes/multicolor/icons/fairv.png b/awesome/themes/multicolor/icons/fairv.png new file mode 100755 index 0000000..e1ac18b Binary files /dev/null and b/awesome/themes/multicolor/icons/fairv.png differ diff --git a/awesome/themes/multicolor/icons/floating.png b/awesome/themes/multicolor/icons/floating.png new file mode 100755 index 0000000..e0a3c39 Binary files /dev/null and b/awesome/themes/multicolor/icons/floating.png differ diff --git a/awesome/themes/multicolor/icons/fs.png b/awesome/themes/multicolor/icons/fs.png new file mode 100644 index 0000000..f869349 Binary files /dev/null and b/awesome/themes/multicolor/icons/fs.png differ diff --git a/awesome/themes/multicolor/icons/fullscreen.png b/awesome/themes/multicolor/icons/fullscreen.png new file mode 100755 index 0000000..84b7c27 Binary files /dev/null and b/awesome/themes/multicolor/icons/fullscreen.png differ diff --git a/awesome/themes/multicolor/icons/magnifier.png b/awesome/themes/multicolor/icons/magnifier.png new file mode 100755 index 0000000..1188d50 Binary files /dev/null and b/awesome/themes/multicolor/icons/magnifier.png differ diff --git a/awesome/themes/multicolor/icons/mail.png b/awesome/themes/multicolor/icons/mail.png new file mode 100755 index 0000000..e8cf11e Binary files /dev/null and b/awesome/themes/multicolor/icons/mail.png differ diff --git a/awesome/themes/multicolor/icons/max.png b/awesome/themes/multicolor/icons/max.png new file mode 100755 index 0000000..f0979c9 Binary files /dev/null and b/awesome/themes/multicolor/icons/max.png differ diff --git a/awesome/themes/multicolor/icons/mem.png b/awesome/themes/multicolor/icons/mem.png new file mode 100644 index 0000000..a71c2d5 Binary files /dev/null and b/awesome/themes/multicolor/icons/mem.png differ diff --git a/awesome/themes/multicolor/icons/net_down.png b/awesome/themes/multicolor/icons/net_down.png new file mode 100644 index 0000000..09433b1 Binary files /dev/null and b/awesome/themes/multicolor/icons/net_down.png differ diff --git a/awesome/themes/multicolor/icons/net_up.png b/awesome/themes/multicolor/icons/net_up.png new file mode 100644 index 0000000..395d014 Binary files /dev/null and b/awesome/themes/multicolor/icons/net_up.png differ diff --git a/awesome/themes/multicolor/icons/note.png b/awesome/themes/multicolor/icons/note.png new file mode 100644 index 0000000..78f85bf Binary files /dev/null and b/awesome/themes/multicolor/icons/note.png differ diff --git a/awesome/themes/multicolor/icons/note_on.png b/awesome/themes/multicolor/icons/note_on.png new file mode 100755 index 0000000..264d2c8 Binary files /dev/null and b/awesome/themes/multicolor/icons/note_on.png differ diff --git a/awesome/themes/multicolor/icons/spiral.png b/awesome/themes/multicolor/icons/spiral.png new file mode 100755 index 0000000..ec32ff3 Binary files /dev/null and b/awesome/themes/multicolor/icons/spiral.png differ diff --git a/awesome/themes/multicolor/icons/spkr.png b/awesome/themes/multicolor/icons/spkr.png new file mode 100644 index 0000000..80c20b0 Binary files /dev/null and b/awesome/themes/multicolor/icons/spkr.png differ diff --git a/awesome/themes/multicolor/icons/square_a.png b/awesome/themes/multicolor/icons/square_a.png new file mode 100755 index 0000000..1774d95 Binary files /dev/null and b/awesome/themes/multicolor/icons/square_a.png differ diff --git a/awesome/themes/multicolor/icons/square_b.png b/awesome/themes/multicolor/icons/square_b.png new file mode 100755 index 0000000..b47e9f3 Binary files /dev/null and b/awesome/themes/multicolor/icons/square_b.png differ diff --git a/awesome/themes/multicolor/icons/submenu.png b/awesome/themes/multicolor/icons/submenu.png new file mode 100644 index 0000000..7c81cab Binary files /dev/null and b/awesome/themes/multicolor/icons/submenu.png differ diff --git a/awesome/themes/multicolor/icons/temp.png b/awesome/themes/multicolor/icons/temp.png new file mode 100755 index 0000000..6c8f8bd Binary files /dev/null and b/awesome/themes/multicolor/icons/temp.png differ diff --git a/awesome/themes/multicolor/icons/tile.png b/awesome/themes/multicolor/icons/tile.png new file mode 100755 index 0000000..9bbf2fa Binary files /dev/null and b/awesome/themes/multicolor/icons/tile.png differ diff --git a/awesome/themes/multicolor/icons/tilebottom.png b/awesome/themes/multicolor/icons/tilebottom.png new file mode 100755 index 0000000..ea85f92 Binary files /dev/null and b/awesome/themes/multicolor/icons/tilebottom.png differ diff --git a/awesome/themes/multicolor/icons/tileleft.png b/awesome/themes/multicolor/icons/tileleft.png new file mode 100755 index 0000000..1b8e3c0 Binary files /dev/null and b/awesome/themes/multicolor/icons/tileleft.png differ diff --git a/awesome/themes/multicolor/icons/tiletop.png b/awesome/themes/multicolor/icons/tiletop.png new file mode 100755 index 0000000..a2d0f6a Binary files /dev/null and b/awesome/themes/multicolor/icons/tiletop.png differ diff --git a/awesome/themes/multicolor/icons/vol.png b/awesome/themes/multicolor/icons/vol.png new file mode 100644 index 0000000..281dddb Binary files /dev/null and b/awesome/themes/multicolor/icons/vol.png differ diff --git a/awesome/themes/multicolor/icons/vol_low.png b/awesome/themes/multicolor/icons/vol_low.png new file mode 100644 index 0000000..63c2293 Binary files /dev/null and b/awesome/themes/multicolor/icons/vol_low.png differ diff --git a/awesome/themes/multicolor/icons/vol_mute.png b/awesome/themes/multicolor/icons/vol_mute.png new file mode 100644 index 0000000..68d0de7 Binary files /dev/null and b/awesome/themes/multicolor/icons/vol_mute.png differ diff --git a/awesome/themes/multicolor/icons/vol_no.png b/awesome/themes/multicolor/icons/vol_no.png new file mode 100644 index 0000000..e801344 Binary files /dev/null and b/awesome/themes/multicolor/icons/vol_no.png differ diff --git a/awesome/themes/multicolor/theme.lua b/awesome/themes/multicolor/theme.lua new file mode 100644 index 0000000..76d3075 --- /dev/null +++ b/awesome/themes/multicolor/theme.lua @@ -0,0 +1,91 @@ +--[[ + + Multicolor Awesome WM config 2.0 + github.com/copycat-killer + +--]] + + +theme = {} + +theme.confdir = os.getenv("HOME") .. "/.config/awesome/themes/multicolor" +--theme.wallpaper = theme.confdir .. "/wall.png" +wallpaper_cmd = feh --randomize --bg-fill ~/media/backgrounds/* + +theme.font = "Terminus 8" +--theme.taglist_font = +theme.menu_bg_normal = "#000000" +theme.menu_bg_focus = "#000000" +theme.bg_normal = "#000000" +theme.bg_focus = "#000000" +theme.bg_urgent = "#000000" +theme.fg_normal = "#aaaaaa" +theme.fg_focus = "#ff8c00" +theme.fg_urgent = "#af1d18" +theme.fg_minimize = "#ffffff" +theme.fg_black = "#424242" +theme.fg_red = "#ce5666" +theme.fg_green = "#80a673" +theme.fg_yellow = "#ffaf5f" +theme.fg_blue = "#7788af" +theme.fg_magenta = "#94738c" +theme.fg_cyan = "#778baf" +theme.fg_white = "#aaaaaa" +theme.fg_blu = "#8ebdde" +theme.border_width = "1" +theme.border_normal = "#1c2022" +theme.border_focus = "#606060" +theme.border_marked = "#3ca4d8" +theme.menu_width = "110" +theme.menu_border_width = "0" +theme.menu_fg_normal = "#aaaaaa" +theme.menu_fg_focus = "#ff8c00" +theme.menu_bg_normal = "#050505dd" +theme.menu_bg_focus = "#050505dd" + +theme.submenu_icon = theme.confdir .. "/icons/submenu.png" +theme.widget_temp = theme.confdir .. "/icons/temp.png" +theme.widget_uptime = theme.confdir .. "/icons/ac.png" +theme.widget_cpu = theme.confdir .. "/icons/cpu.png" +theme.widget_weather = theme.confdir .. "/icons/dish.png" +theme.widget_fs = theme.confdir .. "/icons/fs.png" +theme.widget_mem = theme.confdir .. "/icons/mem.png" +theme.widget_fs = theme.confdir .. "/icons/fs.png" +theme.widget_note = theme.confdir .. "/icons/note.png" +theme.widget_note_on = theme.confdir .. "/icons/note_on.png" +theme.widget_netdown = theme.confdir .. "/icons/net_down.png" +theme.widget_netup = theme.confdir .. "/icons/net_up.png" +theme.widget_mail = theme.confdir .. "/icons/mail.png" +theme.widget_batt = theme.confdir .. "/icons/bat.png" +theme.widget_clock = theme.confdir .. "/icons/clock.png" +theme.widget_vol = theme.confdir .. "/icons/spkr.png" + +theme.vol = theme.confdir .. "/icons/vol.png" +theme.vol_low = theme.confdir .. "/icons/vol_low.png" +theme.vol_no = theme.confdir .. "/icons/vol_no.png" +theme.vol_mute = theme.confdir .. "/icons/vol_mute.png" + +theme.taglist_squares_sel = theme.confdir .. "/icons/square_a.png" +theme.taglist_squares_unsel = theme.confdir .. "/icons/square_b.png" + +theme.tasklist_disable_icon = true +theme.tasklist_floating = "" +theme.tasklist_maximized_horizontal = "" +theme.tasklist_maximized_vertical = "" + +theme.layout_tile = theme.confdir .. "/icons/tile.png" +theme.layout_tilegaps = theme.confdir .. "/icons/tilegaps.png" +theme.layout_tileleft = theme.confdir .. "/icons/tileleft.png" +theme.layout_tilebottom = theme.confdir .. "/icons/tilebottom.png" +theme.layout_tiletop = theme.confdir .. "/icons/tiletop.png" +theme.layout_fairv = theme.confdir .. "/icons/fairv.png" +theme.layout_fairh = theme.confdir .. "/icons/fairh.png" +theme.layout_spiral = theme.confdir .. "/icons/spiral.png" +theme.layout_dwindle = theme.confdir .. "/icons/dwindle.png" +theme.layout_max = theme.confdir .. "/icons/max.png" +theme.layout_fullscreen = theme.confdir .. "/icons/fullscreen.png" +theme.layout_magnifier = theme.confdir .. "/icons/magnifier.png" +theme.layout_floating = theme.confdir .. "/icons/floating.png" + + +return theme diff --git a/awesome/themes/multicolor/wall.png b/awesome/themes/multicolor/wall.png new file mode 100644 index 0000000..6eac193 Binary files /dev/null and b/awesome/themes/multicolor/wall.png differ diff --git a/awesome/themes/powerarrow-darker/alticons/ac.png b/awesome/themes/powerarrow-darker/alticons/ac.png new file mode 100644 index 0000000..7037bc0 Binary files /dev/null and b/awesome/themes/powerarrow-darker/alticons/ac.png differ diff --git a/awesome/themes/powerarrow-darker/alticons/battery.png b/awesome/themes/powerarrow-darker/alticons/battery.png new file mode 100644 index 0000000..612f8f6 Binary files /dev/null and b/awesome/themes/powerarrow-darker/alticons/battery.png differ diff --git a/awesome/themes/powerarrow-darker/alticons/battery_empty.png b/awesome/themes/powerarrow-darker/alticons/battery_empty.png new file mode 100644 index 0000000..b079938 Binary files /dev/null and b/awesome/themes/powerarrow-darker/alticons/battery_empty.png differ diff --git a/awesome/themes/powerarrow-darker/alticons/battery_low.png b/awesome/themes/powerarrow-darker/alticons/battery_low.png new file mode 100644 index 0000000..227efdd Binary files /dev/null and b/awesome/themes/powerarrow-darker/alticons/battery_low.png differ diff --git a/awesome/themes/powerarrow-darker/alticons/cpu.png b/awesome/themes/powerarrow-darker/alticons/cpu.png new file mode 100644 index 0000000..d74c1dc Binary files /dev/null and b/awesome/themes/powerarrow-darker/alticons/cpu.png differ diff --git a/awesome/themes/powerarrow-darker/alticons/dwindle.png b/awesome/themes/powerarrow-darker/alticons/dwindle.png new file mode 100644 index 0000000..3e36565 Binary files /dev/null and b/awesome/themes/powerarrow-darker/alticons/dwindle.png differ diff --git a/awesome/themes/powerarrow-darker/alticons/fairh.png b/awesome/themes/powerarrow-darker/alticons/fairh.png new file mode 100644 index 0000000..82f8190 Binary files /dev/null and b/awesome/themes/powerarrow-darker/alticons/fairh.png differ diff --git a/awesome/themes/powerarrow-darker/alticons/fairv.png b/awesome/themes/powerarrow-darker/alticons/fairv.png new file mode 100644 index 0000000..84a3f9f Binary files /dev/null and b/awesome/themes/powerarrow-darker/alticons/fairv.png differ diff --git a/awesome/themes/powerarrow-darker/alticons/floating.png b/awesome/themes/powerarrow-darker/alticons/floating.png new file mode 100644 index 0000000..3303d3e Binary files /dev/null and b/awesome/themes/powerarrow-darker/alticons/floating.png differ diff --git a/awesome/themes/powerarrow-darker/alticons/hdd.png b/awesome/themes/powerarrow-darker/alticons/hdd.png new file mode 100644 index 0000000..87b0966 Binary files /dev/null and b/awesome/themes/powerarrow-darker/alticons/hdd.png differ diff --git a/awesome/themes/powerarrow-darker/alticons/magnifier.png b/awesome/themes/powerarrow-darker/alticons/magnifier.png new file mode 100644 index 0000000..2d3783f Binary files /dev/null and b/awesome/themes/powerarrow-darker/alticons/magnifier.png differ diff --git a/awesome/themes/powerarrow-darker/alticons/mail.png b/awesome/themes/powerarrow-darker/alticons/mail.png new file mode 100644 index 0000000..942f2a5 Binary files /dev/null and b/awesome/themes/powerarrow-darker/alticons/mail.png differ diff --git a/awesome/themes/powerarrow-darker/alticons/mail_on.png b/awesome/themes/powerarrow-darker/alticons/mail_on.png new file mode 100644 index 0000000..fa646f0 Binary files /dev/null and b/awesome/themes/powerarrow-darker/alticons/mail_on.png differ diff --git a/awesome/themes/powerarrow-darker/alticons/max.png b/awesome/themes/powerarrow-darker/alticons/max.png new file mode 100644 index 0000000..1e668f4 Binary files /dev/null and b/awesome/themes/powerarrow-darker/alticons/max.png differ diff --git a/awesome/themes/powerarrow-darker/alticons/mem.png b/awesome/themes/powerarrow-darker/alticons/mem.png new file mode 100644 index 0000000..568921e Binary files /dev/null and b/awesome/themes/powerarrow-darker/alticons/mem.png differ diff --git a/awesome/themes/powerarrow-darker/alticons/net.png b/awesome/themes/powerarrow-darker/alticons/net.png new file mode 100644 index 0000000..35efd2b Binary files /dev/null and b/awesome/themes/powerarrow-darker/alticons/net.png differ diff --git a/awesome/themes/powerarrow-darker/alticons/net_wired.png b/awesome/themes/powerarrow-darker/alticons/net_wired.png new file mode 100644 index 0000000..98b9089 Binary files /dev/null and b/awesome/themes/powerarrow-darker/alticons/net_wired.png differ diff --git a/awesome/themes/powerarrow-darker/alticons/note.png b/awesome/themes/powerarrow-darker/alticons/note.png new file mode 100644 index 0000000..302da90 Binary files /dev/null and b/awesome/themes/powerarrow-darker/alticons/note.png differ diff --git a/awesome/themes/powerarrow-darker/alticons/note_on.png b/awesome/themes/powerarrow-darker/alticons/note_on.png new file mode 100644 index 0000000..4fc3b45 Binary files /dev/null and b/awesome/themes/powerarrow-darker/alticons/note_on.png differ diff --git a/awesome/themes/powerarrow-darker/alticons/scissors.png b/awesome/themes/powerarrow-darker/alticons/scissors.png new file mode 100644 index 0000000..630043f Binary files /dev/null and b/awesome/themes/powerarrow-darker/alticons/scissors.png differ diff --git a/awesome/themes/powerarrow-darker/alticons/spiral.png b/awesome/themes/powerarrow-darker/alticons/spiral.png new file mode 100644 index 0000000..c492b9f Binary files /dev/null and b/awesome/themes/powerarrow-darker/alticons/spiral.png differ diff --git a/awesome/themes/powerarrow-darker/alticons/task.png b/awesome/themes/powerarrow-darker/alticons/task.png new file mode 100644 index 0000000..85a97c2 Binary files /dev/null and b/awesome/themes/powerarrow-darker/alticons/task.png differ diff --git a/awesome/themes/powerarrow-darker/alticons/temp.png b/awesome/themes/powerarrow-darker/alticons/temp.png new file mode 100644 index 0000000..9000a12 Binary files /dev/null and b/awesome/themes/powerarrow-darker/alticons/temp.png differ diff --git a/awesome/themes/powerarrow-darker/alticons/tile.png b/awesome/themes/powerarrow-darker/alticons/tile.png new file mode 100644 index 0000000..d164bab Binary files /dev/null and b/awesome/themes/powerarrow-darker/alticons/tile.png differ diff --git a/awesome/themes/powerarrow-darker/alticons/tilebottom.png b/awesome/themes/powerarrow-darker/alticons/tilebottom.png new file mode 100644 index 0000000..53a0475 Binary files /dev/null and b/awesome/themes/powerarrow-darker/alticons/tilebottom.png differ diff --git a/awesome/themes/powerarrow-darker/alticons/tileleft.png b/awesome/themes/powerarrow-darker/alticons/tileleft.png new file mode 100644 index 0000000..790de38 Binary files /dev/null and b/awesome/themes/powerarrow-darker/alticons/tileleft.png differ diff --git a/awesome/themes/powerarrow-darker/alticons/tiletop.png b/awesome/themes/powerarrow-darker/alticons/tiletop.png new file mode 100644 index 0000000..af10bc2 Binary files /dev/null and b/awesome/themes/powerarrow-darker/alticons/tiletop.png differ diff --git a/awesome/themes/powerarrow-darker/alticons/vol.png b/awesome/themes/powerarrow-darker/alticons/vol.png new file mode 100644 index 0000000..7ab6551 Binary files /dev/null and b/awesome/themes/powerarrow-darker/alticons/vol.png differ diff --git a/awesome/themes/powerarrow-darker/alticons/vol_low.png b/awesome/themes/powerarrow-darker/alticons/vol_low.png new file mode 100644 index 0000000..ade5019 Binary files /dev/null and b/awesome/themes/powerarrow-darker/alticons/vol_low.png differ diff --git a/awesome/themes/powerarrow-darker/alticons/vol_mute.png b/awesome/themes/powerarrow-darker/alticons/vol_mute.png new file mode 100644 index 0000000..d173f53 Binary files /dev/null and b/awesome/themes/powerarrow-darker/alticons/vol_mute.png differ diff --git a/awesome/themes/powerarrow-darker/alticons/vol_no.png b/awesome/themes/powerarrow-darker/alticons/vol_no.png new file mode 100644 index 0000000..41fb23e Binary files /dev/null and b/awesome/themes/powerarrow-darker/alticons/vol_no.png differ diff --git a/awesome/themes/powerarrow-darker/icons/ac.png b/awesome/themes/powerarrow-darker/icons/ac.png new file mode 100644 index 0000000..96efcb4 Binary files /dev/null and b/awesome/themes/powerarrow-darker/icons/ac.png differ diff --git a/awesome/themes/powerarrow-darker/icons/arrl.png b/awesome/themes/powerarrow-darker/icons/arrl.png new file mode 100644 index 0000000..4e26795 Binary files /dev/null and b/awesome/themes/powerarrow-darker/icons/arrl.png differ diff --git a/awesome/themes/powerarrow-darker/icons/arrl_dl.png b/awesome/themes/powerarrow-darker/icons/arrl_dl.png new file mode 100644 index 0000000..fa0c4ea Binary files /dev/null and b/awesome/themes/powerarrow-darker/icons/arrl_dl.png differ diff --git a/awesome/themes/powerarrow-darker/icons/arrl_dl_sf.png b/awesome/themes/powerarrow-darker/icons/arrl_dl_sf.png new file mode 100644 index 0000000..eb2b11e Binary files /dev/null and b/awesome/themes/powerarrow-darker/icons/arrl_dl_sf.png differ diff --git a/awesome/themes/powerarrow-darker/icons/arrl_ld.png b/awesome/themes/powerarrow-darker/icons/arrl_ld.png new file mode 100644 index 0000000..cf98c8e Binary files /dev/null and b/awesome/themes/powerarrow-darker/icons/arrl_ld.png differ diff --git a/awesome/themes/powerarrow-darker/icons/arrl_ld_sf.png b/awesome/themes/powerarrow-darker/icons/arrl_ld_sf.png new file mode 100644 index 0000000..1d3a326 Binary files /dev/null and b/awesome/themes/powerarrow-darker/icons/arrl_ld_sf.png differ diff --git a/awesome/themes/powerarrow-darker/icons/arrl_sf.png b/awesome/themes/powerarrow-darker/icons/arrl_sf.png new file mode 100644 index 0000000..5d30369 Binary files /dev/null and b/awesome/themes/powerarrow-darker/icons/arrl_sf.png differ diff --git a/awesome/themes/powerarrow-darker/icons/battery.png b/awesome/themes/powerarrow-darker/icons/battery.png new file mode 100644 index 0000000..8c85596 Binary files /dev/null and b/awesome/themes/powerarrow-darker/icons/battery.png differ diff --git a/awesome/themes/powerarrow-darker/icons/battery_empty.png b/awesome/themes/powerarrow-darker/icons/battery_empty.png new file mode 100644 index 0000000..00821c9 Binary files /dev/null and b/awesome/themes/powerarrow-darker/icons/battery_empty.png differ diff --git a/awesome/themes/powerarrow-darker/icons/battery_low.png b/awesome/themes/powerarrow-darker/icons/battery_low.png new file mode 100644 index 0000000..29f3fc5 Binary files /dev/null and b/awesome/themes/powerarrow-darker/icons/battery_low.png differ diff --git a/awesome/themes/powerarrow-darker/icons/cpu.png b/awesome/themes/powerarrow-darker/icons/cpu.png new file mode 100644 index 0000000..ea8bfef Binary files /dev/null and b/awesome/themes/powerarrow-darker/icons/cpu.png differ diff --git a/awesome/themes/powerarrow-darker/icons/dwindle.png b/awesome/themes/powerarrow-darker/icons/dwindle.png new file mode 100644 index 0000000..6bf6508 Binary files /dev/null and b/awesome/themes/powerarrow-darker/icons/dwindle.png differ diff --git a/awesome/themes/powerarrow-darker/icons/fairh.png b/awesome/themes/powerarrow-darker/icons/fairh.png new file mode 100644 index 0000000..54a2f04 Binary files /dev/null and b/awesome/themes/powerarrow-darker/icons/fairh.png differ diff --git a/awesome/themes/powerarrow-darker/icons/fairv.png b/awesome/themes/powerarrow-darker/icons/fairv.png new file mode 100644 index 0000000..60dc36b Binary files /dev/null and b/awesome/themes/powerarrow-darker/icons/fairv.png differ diff --git a/awesome/themes/powerarrow-darker/icons/floating.png b/awesome/themes/powerarrow-darker/icons/floating.png new file mode 100644 index 0000000..a527fef Binary files /dev/null and b/awesome/themes/powerarrow-darker/icons/floating.png differ diff --git a/awesome/themes/powerarrow-darker/icons/hdd.png b/awesome/themes/powerarrow-darker/icons/hdd.png new file mode 100644 index 0000000..ad7eca5 Binary files /dev/null and b/awesome/themes/powerarrow-darker/icons/hdd.png differ diff --git a/awesome/themes/powerarrow-darker/icons/magnifier.png b/awesome/themes/powerarrow-darker/icons/magnifier.png new file mode 100644 index 0000000..fde2d74 Binary files /dev/null and b/awesome/themes/powerarrow-darker/icons/magnifier.png differ diff --git a/awesome/themes/powerarrow-darker/icons/mail.png b/awesome/themes/powerarrow-darker/icons/mail.png new file mode 100644 index 0000000..61abd6a Binary files /dev/null and b/awesome/themes/powerarrow-darker/icons/mail.png differ diff --git a/awesome/themes/powerarrow-darker/icons/mail_on.png b/awesome/themes/powerarrow-darker/icons/mail_on.png new file mode 100644 index 0000000..c2b70ff Binary files /dev/null and b/awesome/themes/powerarrow-darker/icons/mail_on.png differ diff --git a/awesome/themes/powerarrow-darker/icons/max.png b/awesome/themes/powerarrow-darker/icons/max.png new file mode 100644 index 0000000..fde2d74 Binary files /dev/null and b/awesome/themes/powerarrow-darker/icons/max.png differ diff --git a/awesome/themes/powerarrow-darker/icons/mem.png b/awesome/themes/powerarrow-darker/icons/mem.png new file mode 100644 index 0000000..7860a1a Binary files /dev/null and b/awesome/themes/powerarrow-darker/icons/mem.png differ diff --git a/awesome/themes/powerarrow-darker/icons/net.png b/awesome/themes/powerarrow-darker/icons/net.png new file mode 100644 index 0000000..4c1b24e Binary files /dev/null and b/awesome/themes/powerarrow-darker/icons/net.png differ diff --git a/awesome/themes/powerarrow-darker/icons/net_wired.png b/awesome/themes/powerarrow-darker/icons/net_wired.png new file mode 100644 index 0000000..a40d7f0 Binary files /dev/null and b/awesome/themes/powerarrow-darker/icons/net_wired.png differ diff --git a/awesome/themes/powerarrow-darker/icons/note.png b/awesome/themes/powerarrow-darker/icons/note.png new file mode 100644 index 0000000..9163f32 Binary files /dev/null and b/awesome/themes/powerarrow-darker/icons/note.png differ diff --git a/awesome/themes/powerarrow-darker/icons/note_on.png b/awesome/themes/powerarrow-darker/icons/note_on.png new file mode 100644 index 0000000..790b7b4 Binary files /dev/null and b/awesome/themes/powerarrow-darker/icons/note_on.png differ diff --git a/awesome/themes/powerarrow-darker/icons/scissors.png b/awesome/themes/powerarrow-darker/icons/scissors.png new file mode 100644 index 0000000..f8c700d Binary files /dev/null and b/awesome/themes/powerarrow-darker/icons/scissors.png differ diff --git a/awesome/themes/powerarrow-darker/icons/spiral.png b/awesome/themes/powerarrow-darker/icons/spiral.png new file mode 100644 index 0000000..69d68b6 Binary files /dev/null and b/awesome/themes/powerarrow-darker/icons/spiral.png differ diff --git a/awesome/themes/powerarrow-darker/icons/square_sel.png b/awesome/themes/powerarrow-darker/icons/square_sel.png new file mode 100644 index 0000000..1102a9f Binary files /dev/null and b/awesome/themes/powerarrow-darker/icons/square_sel.png differ diff --git a/awesome/themes/powerarrow-darker/icons/square_unsel.png b/awesome/themes/powerarrow-darker/icons/square_unsel.png new file mode 100644 index 0000000..7386b85 Binary files /dev/null and b/awesome/themes/powerarrow-darker/icons/square_unsel.png differ diff --git a/awesome/themes/powerarrow-darker/icons/submenu.png b/awesome/themes/powerarrow-darker/icons/submenu.png new file mode 100644 index 0000000..b55ebce Binary files /dev/null and b/awesome/themes/powerarrow-darker/icons/submenu.png differ diff --git a/awesome/themes/powerarrow-darker/icons/task.png b/awesome/themes/powerarrow-darker/icons/task.png new file mode 100644 index 0000000..0376e42 Binary files /dev/null and b/awesome/themes/powerarrow-darker/icons/task.png differ diff --git a/awesome/themes/powerarrow-darker/icons/temp.png b/awesome/themes/powerarrow-darker/icons/temp.png new file mode 100644 index 0000000..6793a9f Binary files /dev/null and b/awesome/themes/powerarrow-darker/icons/temp.png differ diff --git a/awesome/themes/powerarrow-darker/icons/tile.png b/awesome/themes/powerarrow-darker/icons/tile.png new file mode 100644 index 0000000..94a7410 Binary files /dev/null and b/awesome/themes/powerarrow-darker/icons/tile.png differ diff --git a/awesome/themes/powerarrow-darker/icons/tilebottom.png b/awesome/themes/powerarrow-darker/icons/tilebottom.png new file mode 100644 index 0000000..d1d123f Binary files /dev/null and b/awesome/themes/powerarrow-darker/icons/tilebottom.png differ diff --git a/awesome/themes/powerarrow-darker/icons/tileleft.png b/awesome/themes/powerarrow-darker/icons/tileleft.png new file mode 100644 index 0000000..b988004 Binary files /dev/null and b/awesome/themes/powerarrow-darker/icons/tileleft.png differ diff --git a/awesome/themes/powerarrow-darker/icons/tiletop.png b/awesome/themes/powerarrow-darker/icons/tiletop.png new file mode 100644 index 0000000..f7e25b6 Binary files /dev/null and b/awesome/themes/powerarrow-darker/icons/tiletop.png differ diff --git a/awesome/themes/powerarrow-darker/icons/vol.png b/awesome/themes/powerarrow-darker/icons/vol.png new file mode 100644 index 0000000..bbf33d4 Binary files /dev/null and b/awesome/themes/powerarrow-darker/icons/vol.png differ diff --git a/awesome/themes/powerarrow-darker/icons/vol_low.png b/awesome/themes/powerarrow-darker/icons/vol_low.png new file mode 100644 index 0000000..aa3ce4d Binary files /dev/null and b/awesome/themes/powerarrow-darker/icons/vol_low.png differ diff --git a/awesome/themes/powerarrow-darker/icons/vol_mute.png b/awesome/themes/powerarrow-darker/icons/vol_mute.png new file mode 100644 index 0000000..e855fd2 Binary files /dev/null and b/awesome/themes/powerarrow-darker/icons/vol_mute.png differ diff --git a/awesome/themes/powerarrow-darker/icons/vol_no.png b/awesome/themes/powerarrow-darker/icons/vol_no.png new file mode 100644 index 0000000..bbe917b Binary files /dev/null and b/awesome/themes/powerarrow-darker/icons/vol_no.png differ diff --git a/awesome/themes/powerarrow-darker/theme.lua b/awesome/themes/powerarrow-darker/theme.lua new file mode 100644 index 0000000..a5cd23b --- /dev/null +++ b/awesome/themes/powerarrow-darker/theme.lua @@ -0,0 +1,84 @@ +--[[ + + Powerarrow Darker Awesome WM config 2.0 + github.com/copycat-killer + +--]] + +theme = {} + +themes_dir = os.getenv("HOME") .. "/.config/awesome/themes/powerarrow-darker" +theme.wallpaper = themes_dir .. "/wall.png" + +theme.font = "Terminus 9" +theme.fg_normal = "#DDDDFF" +theme.fg_focus = "#F0DFAF" +theme.fg_urgent = "#CC9393" +theme.bg_normal = "#1A1A1A" +theme.bg_focus = "#313131" +theme.bg_urgent = "#1A1A1A" +theme.border_width = "1" +theme.border_normal = "#3F3F3F" +theme.border_focus = "#7F7F7F" +theme.border_marked = "#CC9393" +theme.titlebar_bg_focus = "#FFFFFF" +theme.titlebar_bg_normal = "#FFFFFF" +theme.taglist_fg_focus = "#D8D782" +theme.tasklist_bg_focus = "#1A1A1A" +theme.tasklist_fg_focus = "#D8D782" +theme.textbox_widget_margin_top = 1 +theme.notify_fg = theme.fg_normal +theme.notify_bg = theme.bg_normal +theme.notify_border = theme.border_focus +theme.awful_widget_height = 14 +theme.awful_widget_margin_top = 2 +theme.mouse_finder_color = "#CC9393" +theme.menu_height = "16" +theme.menu_width = "140" + +theme.submenu_icon = themes_dir .. "/icons/submenu.png" +theme.taglist_squares_sel = themes_dir .. "/icons/square_sel.png" +theme.taglist_squares_unsel = themes_dir .. "/icons/square_unsel.png" + +theme.layout_tile = themes_dir .. "/icons/tile.png" +theme.layout_tilegaps = themes_dir .. "/icons/tilegaps.png" +theme.layout_tileleft = themes_dir .. "/icons/tileleft.png" +theme.layout_tilebottom = themes_dir .. "/icons/tilebottom.png" +theme.layout_tiletop = themes_dir .. "/icons/tiletop.png" +theme.layout_fairv = themes_dir .. "/icons/fairv.png" +theme.layout_fairh = themes_dir .. "/icons/fairh.png" +theme.layout_spiral = themes_dir .. "/icons/spiral.png" +theme.layout_dwindle = themes_dir .. "/icons/dwindle.png" +theme.layout_max = themes_dir .. "/icons/max.png" +theme.layout_fullscreen = themes_dir .. "/icons/fullscreen.png" +theme.layout_magnifier = themes_dir .. "/icons/magnifier.png" +theme.layout_floating = themes_dir .. "/icons/floating.png" + +theme.arrl = themes_dir .. "/icons/arrl.png" +theme.arrl_dl = themes_dir .. "/icons/arrl_dl.png" +theme.arrl_ld = themes_dir .. "/icons/arrl_ld.png" + +theme.widget_ac = themes_dir .. "/icons/ac.png" +theme.widget_battery = themes_dir .. "/icons/battery.png" +theme.widget_battery_low = themes_dir .. "/icons/battery_low.png" +theme.widget_battery_empty = themes_dir .. "/icons/battery_empty.png" +theme.widget_mem = themes_dir .. "/icons/mem.png" +theme.widget_cpu = themes_dir .. "/icons/cpu.png" +theme.widget_temp = themes_dir .. "/icons/temp.png" +theme.widget_net = themes_dir .. "/icons/net.png" +theme.widget_hdd = themes_dir .. "/icons/hdd.png" +theme.widget_music = themes_dir .. "/icons/note.png" +theme.widget_music_on = themes_dir .. "/icons/note_on.png" +theme.widget_vol = themes_dir .. "/icons/vol.png" +theme.widget_vol_low = themes_dir .. "/icons/vol_low.png" +theme.widget_vol_no = themes_dir .. "/icons/vol_no.png" +theme.widget_vol_mute = themes_dir .. "/icons/vol_mute.png" +theme.widget_mail = themes_dir .. "/icons/mail.png" +theme.widget_mail_on = themes_dir .. "/icons/mail_on.png" + +theme.tasklist_disable_icon = true +theme.tasklist_floating = "" +theme.tasklist_maximized_horizontal = "" +theme.tasklist_maximized_vertical = "" + +return theme diff --git a/awesome/themes/powerarrow-darker/wall.png b/awesome/themes/powerarrow-darker/wall.png new file mode 100755 index 0000000..794eae2 Binary files /dev/null and b/awesome/themes/powerarrow-darker/wall.png differ diff --git a/awesome/themes/rainbow/icons/awesome.png b/awesome/themes/rainbow/icons/awesome.png new file mode 100644 index 0000000..bd2bff1 Binary files /dev/null and b/awesome/themes/rainbow/icons/awesome.png differ diff --git a/awesome/themes/rainbow/icons/square_sel.png b/awesome/themes/rainbow/icons/square_sel.png new file mode 100644 index 0000000..532719f Binary files /dev/null and b/awesome/themes/rainbow/icons/square_sel.png differ diff --git a/awesome/themes/rainbow/icons/square_unsel.png b/awesome/themes/rainbow/icons/square_unsel.png new file mode 100644 index 0000000..72dea5b Binary files /dev/null and b/awesome/themes/rainbow/icons/square_unsel.png differ diff --git a/awesome/themes/rainbow/icons/submenu.png b/awesome/themes/rainbow/icons/submenu.png new file mode 100644 index 0000000..26ab82a Binary files /dev/null and b/awesome/themes/rainbow/icons/submenu.png differ diff --git a/awesome/themes/rainbow/icons/vol_bg.png b/awesome/themes/rainbow/icons/vol_bg.png new file mode 100644 index 0000000..7778d33 Binary files /dev/null and b/awesome/themes/rainbow/icons/vol_bg.png differ diff --git a/awesome/themes/rainbow/theme.lua b/awesome/themes/rainbow/theme.lua new file mode 100644 index 0000000..a30567f --- /dev/null +++ b/awesome/themes/rainbow/theme.lua @@ -0,0 +1,72 @@ +--[[ + + Rainbow Awesome WM config 2.0 + github.com/copycat-killer + +--]] + +theme = {} + +theme.dir = os.getenv("HOME") .. "/.config/awesome/themes/rainbow" +theme.wallpaper = theme.dir .. "/wall.png" + +theme.font = "Tamsyn 10.5" +theme.fg_normal = "#9E9E9E" +theme.fg_focus = "#EBEBFF" +theme.bg_normal = "#242424" +theme.bg_focus = "#242424" +theme.fg_urgent = "#000000" +theme.bg_urgent = "#FFFFFF" +theme.border_width = 1 +theme.border_normal = "#242424" +theme.border_focus = "#EBEBFF" +theme.taglist_fg_focus = "#EDEFFF" +theme.taglist_bg_focus = "#242424" +theme.menu_height = "16" +theme.menu_width = "150" + +theme.ocol = "" +theme.ccol = "" +theme.tasklist_sticky = theme.ocol .. "[S]" .. theme.ccol +theme.tasklist_ontop = theme.ocol .. "[T]" .. theme.ccol +theme.tasklist_floating = theme.ocol .. "[F]" .. theme.ccol +theme.tasklist_maximized_horizontal = theme.ocol .. "[M] " .. theme.ccol +theme.tasklist_maximized_vertical = "" +theme.tasklist_disable_icon = true + +theme.menu_awesome_icon = theme.dir .."/icons/awesome.png" +theme.submenu_icon = theme.dir .."/icons/submenu.png" +theme.taglist_squares_sel = theme.dir .. "/icons/square_sel.png" +theme.taglist_squares_unsel = theme.dir .. "/icons/square_unsel.png" +theme.vol_bg = theme.dir .. "/icons/vol_bg.png" + +theme.layout_txt_tile = "[t]" +theme.layout_txt_tileleft = "[l]" +theme.layout_txt_tilebottom = "[b]" +theme.layout_txt_tiletop = "[tt]" +theme.layout_txt_fairv = "[fv]" +theme.layout_txt_fairh = "[fh]" +theme.layout_txt_spiral = "[s]" +theme.layout_txt_dwindle = "[d]" +theme.layout_txt_max = "[m]" +theme.layout_txt_fullscreen = "[F]" +theme.layout_txt_magnifier = "[M]" +theme.layout_txt_floating = "[*]" + +-- lain related +theme.useless_gap_width = 10 +theme.layout_txt_cascade = "[cascade]" +theme.layout_txt_cascadetile = "[cascadetile]" +theme.layout_txt_centerwork = "[centerwork]" +theme.layout_txt_termfair = "[termfair]" +theme.layout_txt_centerfair = "[centerfair]" +theme.layout_txt_uselessfair = "[uf]" +theme.layout_txt_uselessfairh = "[ufh]" +theme.layout_txt_uselesspiral = "[us]" +theme.layout_txt_uselessdwindle = "[ud]" +theme.layout_txt_uselesstile = "[ut]" +theme.layout_txt_uselesstileleft = "[utl]" +theme.layout_txt_uselesstiletop = "[utt]" +theme.layout_txt_uselesstilebottom = "[utb]" + +return theme diff --git a/awesome/themes/rainbow/wall.png b/awesome/themes/rainbow/wall.png new file mode 100755 index 0000000..3576ff2 Binary files /dev/null and b/awesome/themes/rainbow/wall.png differ diff --git a/awesome/themes/steamburn/icons/square_sel.png b/awesome/themes/steamburn/icons/square_sel.png new file mode 100644 index 0000000..2bcabb8 Binary files /dev/null and b/awesome/themes/steamburn/icons/square_sel.png differ diff --git a/awesome/themes/steamburn/icons/square_unsel.png b/awesome/themes/steamburn/icons/square_unsel.png new file mode 100644 index 0000000..604d68b Binary files /dev/null and b/awesome/themes/steamburn/icons/square_unsel.png differ diff --git a/awesome/themes/steamburn/icons/submenu.png b/awesome/themes/steamburn/icons/submenu.png new file mode 100644 index 0000000..12b97c6 Binary files /dev/null and b/awesome/themes/steamburn/icons/submenu.png differ diff --git a/awesome/themes/steamburn/theme.lua b/awesome/themes/steamburn/theme.lua new file mode 100644 index 0000000..17d8fda --- /dev/null +++ b/awesome/themes/steamburn/theme.lua @@ -0,0 +1,60 @@ + +--[[ + + Steamburn Awesome WM config 3.0 + github.com/copycat-killer + +--]] + +theme = {} + +themes_dir = os.getenv("HOME") .. "/.config/awesome/themes/steamburn" +theme.wallpaper = themes_dir .. "/wall.png" + +theme.font = "Tamsyn 10.5" +theme.fg_normal = "#e2ccb0" +theme.fg_focus = "#d88166" +theme.fg_urgent = "#CC9393" +theme.bg_normal = "#140c0b" +theme.bg_focus = "#140c0b" +theme.bg_urgent = "#2a1f1e" +theme.border_width = 1 +theme.border_normal = "#302627" +theme.border_focus = "#c2745b" +theme.border_marked = "#CC9393" +theme.taglist_fg_focus = "#d88166" +theme.tasklist_bg_focus = "#140c0b" +theme.tasklist_fg_focus = "#d88166" +theme.menu_height = "16" +theme.menu_width = "140" + +theme.layout_txt_tile = "[t]" +theme.layout_txt_tileleft = "[l]" +theme.layout_txt_tilebottom = "[b]" +theme.layout_txt_tiletop = "[tt]" +theme.layout_txt_fairv = "[fv]" +theme.layout_txt_fairh = "[fh]" +theme.layout_txt_spiral = "[s]" +theme.layout_txt_dwindle = "[d]" +theme.layout_txt_max = "[m]" +theme.layout_txt_fullscreen = "[F]" +theme.layout_txt_magnifier = "[M]" +theme.layout_txt_floating = "[|]" + +theme.submenu_icon = themes_dir .. "/icons/submenu.png" +theme.taglist_squares_sel = themes_dir .. "/icons/square_sel.png" +theme.taglist_squares_unsel = themes_dir .. "/icons/square_unsel.png" + +theme.tasklist_disable_icon = true +theme.tasklist_floating = "" +theme.tasklist_maximized_horizontal = "" +theme.tasklist_maximized_vertical = "" + +-- lain related +theme.layout_txt_termfair = "[termfair]" +theme.layout_txt_uselessfair = "[ufv]" +theme.layout_txt_uselessfairh = "[ufh]" +theme.layout_txt_uselessdwindle = "[ud]" +theme.layout_txt_uselesstile = "[ut]" + +return theme diff --git a/awesome/themes/steamburn/wall.png b/awesome/themes/steamburn/wall.png new file mode 100644 index 0000000..21efa45 Binary files /dev/null and b/awesome/themes/steamburn/wall.png differ