diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..359b3c7 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "lain"] + path = lain + url = git://github.com/copycat-killer/lain.git diff --git a/README.rst b/README.rst index 99b4536..23ebb5f 100644 --- a/README.rst +++ b/README.rst @@ -1,15 +1,14 @@ =================== Awesome WM Copycats -=================== +=================== -------------------------------- -Power themes for Awesome WM 3.5+ +Power themes for Awesome WM 3.5+ -------------------------------- :Author: Luke Bonham :License: BY-NC-SA_ -:Version: 1.6.5 -:Status: **resuming shortly**, this time powered by lain_ +:Version: 2.0-git Description ========== @@ -22,102 +21,81 @@ Notable features - Shadow widgets (*tell me only when you have to*) - Autostart functionality - Fast mpd and volume shortcuts (first time you see this trick in Awesome) -- Other fancy shortcuts for copying to the clipboard (goodbye clipboard managers!), toggle wiboxes, widgets popups, screenshots capture, moving clients +- Other shortcuts for copying to the clipboard (goodbye clipboard managers!), toggle wiboxes, widgets popups, screenshots capture, moving clients - Quake style dropdown terminal -- Calendar with current day highlighted and previous/next month switch with a click +- Calendar with current day highlighted and months switch with a click - Elegant notifications for new mails, current song, volume level, hdd critical state, low battery -- Yahoo Weather integration -- Net carrier status notifier +- Yahoo! Weather integration +- Net carrier status notifier - Colorful autoupdating icons - Symbolic tag names -- TXT layoutbox option -- PNG taskbar +- TXT layoutbox +- PNG wibox bar - Custom layouts - No borders when there's only one visible client - Powerful volume bar - Freedesktop menu - Vi-like client focus - Nice client border (colors change along with process status) - -They're scattered all over the set, so try each theme and choose the one you enjoy the most. +- Non-empty tag browsing Gallery ======= -**Multicolor** copycatted from tip_ [liked so much --> compulsory personal version] +**Multicolor** copycatted from tip_ .. image:: http://i.imgur.com/vBMn8C8.jpg -**Powerarrow Darker** copycatted from romockee_ [his one was stuck at v3.4] +**Powerarrow Darker** copycatted from romockee_ [port from v3.4] -.. image:: http://i.imgur.com/inRoOrg.png +.. image:: http://s22.postimg.org/xhjc4p8mn/20130913174810.png -**Steamburn** copycatted from ok100_ [it was so cool, but only for dwm] +**Steamburn** copycatted from ok100_ [port from dwm] -.. image:: http://i.imgur.com/esHcVzj.jpg +.. image:: http://s16.postimg.org/cdbf9h79f/20130913000339.png -**Blackburn** +**Blackburn** -.. image:: http://dotshare.it/public/images/uploads/553.png +.. image:: http://dotshare.it/public/images/uploads/553.png -**Dremora** +**Dremora** .. image:: http://dotshare.it/public/images/uploads/589.png -**Rainbow** +**Rainbow** -.. image:: http://i.imgur.com/Ae7hAsK.png +.. image:: http://s24.postimg.org/cwbbhb78j/w_DECBp_P.png **Holo** suggested by amouly_ .. image:: http://dotshare.it/public/images/uploads/621.png +Installation +============ + Notes ===== -**Do not** use without reading and modifying according to your preferences and system specs. +**Do not use** without setting your preferences and system specs first. -If you happen to get any problem (startup, ``surface.lua``, ...), **be sure** to have ``lua`` and ``lua-lgi`` up to date. +Complements are provided by lain_. -Widgets are provided by vicious_. +Fonts are Terminus_ (Multicolor, Powerarrow Darker) and Tamsyn_ (other ones). -Fonts are Terminus (Multicolor, Powerarrow Darker) and Tamsyn (other ones). +Every theme has a colorscheme_. -Blackburn and Dremora use Icons_: **if you're running Debian/Ubuntu**, be sure to have bitmaps enabled (1_ 2_). - -Except Multicolor and Powerarrow Darker, every theme has a colorscheme_ and uses Yawn_. - -Blackburn and Holo use png topbars, supported screen widths are: - - 1024 - 1152 - 1280 - 1366 - 1440 - 1600 - 1680 - 1920 - 2560 - -if your screen is unsupported, you have to create a proper topbar and put it into ``themes/$THEME/icons/topbar``. You can send me your custom sized bar, I'll add it. - -Freedesktop menu in use is just an example: feel free to modify ``freedesktop/freedesktop.lua``. - -If you happen to get an error involving ``/home fs widget``, replace every occurrence of ``/home`` with ``/``, or some other argument defined in vicious readme_, section ``vicious.widgets.fs``. - -Also be sure to set your music dir in ``scripts/mpdinfo``, and to have ``imagemagick`` and ``notify-send`` installed. +Blackburn and Dremora use Icons_, be sure to have bitmaps enabled if running under Debian_ or Ubuntu_. +.. _BY-NC-SA: http://creativecommons.org/licenses/by-nc-sa/3.0/ .. _Awesome: http://awesome.naquadah.org/ -.. _lain: https://github.com/copycat-killer/vain .. _tip: http://theimmortalphoenix.deviantart.com/art/Full-Color-Awesome-340997258 .. _romockee: https://github.com/romockee/powerarrow-dark .. _ok100: http://ok100.deviantart.com/art/DWM-January-2013-348656846 .. _amouly: https://bbs.archlinux.org/viewtopic.php?pid=1307158#p1307158 -.. _vicious: http://git.sysphere.org/vicious/about/ -.. _Icons: https://github.com/copycat-killer/dots/tree/master/.fonts -.. _Yawn: https://github.com/copycat-killer/yawn -.. _1: http://weiwu.sdf.org/100921.html -.. _2: https://wiki.ubuntu.com/Fonts#Enabling_Bitmapped_Fonts +.. _lain: https://github.com/copycat-killer/vain +.. _Terminus: http://terminus-font.sourceforge.net/ +.. _Tamsyn: http://www.fial.com/~scott/tamsyn-font/ .. _colorscheme: https://github.com/copycat-killer/dots/tree/master/.colors -.. _readme: http://git.sysphere.org/vicious/tree/README -.. _BY-NC-SA: http://creativecommons.org/licenses/by-nc-sa/3.0/ +.. _Icons: https://github.com/copycat-killer/dots/tree/master/.fonts +.. _Debian: http://weiwu.sdf.org/100921.html +.. _Ubuntu: https://wiki.ubuntu.com/Fonts#Enabling_Bitmapped_Fonts diff --git a/freedesktop/freedesktop.lua b/freedesktop/freedesktop.lua index 8ca2c0a..03fe439 100644 --- a/freedesktop/freedesktop.lua +++ b/freedesktop/freedesktop.lua @@ -2,14 +2,12 @@ -- Modify according to your preferences -- If you are a Debian user, you can also uncomment the two lines that insert --- the Debian menu together with the rest of the items. +-- the Debian menu together with the rest of the items (11 and 33). -local awful = require("awful") +local awful = require("awful") local beautiful = require("beautiful") -require('freedesktop.utils') -require('freedesktop.desktop') -require('freedesktop.menu') +require('freedesktop') -- require("debian.menu") freedesktop.utils.terminal = terminal -- defined in rc.lua, otherwise define it here (default: "xterm") diff --git a/icons/xbm/How to change color of icons and resize them b/icons/xbm/How to change color of icons and resize them index 18c94b5..b532607 100755 --- a/icons/xbm/How to change color of icons and resize them +++ b/icons/xbm/How to change color of icons and resize them @@ -1,4 +1,6 @@ -HOW TO CHANGE COLOR OF ICONS +HOW TO CHANGE COLOR OF ICONS AND RESIZE THEM + +Dependencies: imagemagick for x in *.xbm; do convert -transparent white -fill "#FFFFFF" -opaque "#000000" -bordercolor transparent -border 8x8 -gravity center -crop 15x15+0+0 "${x}" "${x%.*}.png"; done diff --git a/lain b/lain new file mode 160000 index 0000000..db1fb61 --- /dev/null +++ b/lain @@ -0,0 +1 @@ +Subproject commit db1fb613b32c3ae3d7ea3e41bf16bedb58552d27 diff --git a/rc.lua.blackburn b/rc.lua.blackburn index 5f9402b..b6e8b01 100755 --- a/rc.lua.blackburn +++ b/rc.lua.blackburn @@ -1,28 +1,44 @@ ---[[ ]]-- --- - --- Blackburn Awesome WM 3.5.+ config -- --- github.com/copycat-killer -- --- - ---[[ ]]-- - - --- {{{ Required Libraries +--[[ + + Blackburn Awesome WM config 2.0 + github.com/copycat-killer + +--]] +-- {{{ Required libraries local gears = require("gears") local awful = require("awful") awful.rules = require("awful.rules") -awful.autofocus = require("awful.autofocus") +require("awful.autofocus") local wibox = require("wibox") local beautiful = require("beautiful") local naughty = require("naughty") -local vicious = require("vicious") -local scratch = require("scratch") -local yawn = require("yawn") +local drop = require("scratch.drop") +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(" ") @@ -33,501 +49,177 @@ function run_once(cmd) end run_once("urxvtd") -run_once("unclutter -idle 10") +run_once("unclutter") run_once("compton") - -- }}} --- {{{ Localization - +-- {{{ Variable definitions +-- localization os.setlocale(os.getenv("LANG")) --- }}} +-- home path +homedir = os.getenv("HOME") .. "/.config/awesome/" --- {{{ Error Handling +-- beautiful init +confdir = homedir .. "themes/blackburn/" +beautiful.init(confdir .. "theme.lua") --- Check if awesome encountered an error during startup and fell back to --- another config (This code will only ever execute for the fallback config) -if awesome.startup_errors then - naughty.notify({ preset = naughty.config.presets.critical, - title = "Oops, there were errors during startup!", - text = awesome.startup_errors }) -end - --- Handle runtime errors after startup -do - local in_error = false - awesome.connect_signal("debug::error", function (err) - -- Make sure we don't go into an endless error loop - if in_error then return end - in_error = true - - naughty.notify({ preset = naughty.config.presets.critical, - title = "Oops, an error happened!", - text = err }) - local in_error = false - end) -end - --- }}} - --- {{{ Global variables - -home = os.getenv("HOME") -confdir = home .. "/.config/awesome" -scriptdir = confdir .. "/scripts/" -themes = confdir .. "/themes" -active_theme = themes .. "/blackburn" -language = string.gsub(os.getenv("LANG"), ".utf8", "") - -beautiful.init(active_theme .. "/theme.lua") - -terminal = "urxvtc" -editor = os.getenv("EDITOR") or "vim" +-- common +modkey = "Mod4" +altkey = "Mod1" +terminal = "urxvtc" or "xterm" +editor = os.getenv("EDITOR") or "nano" or "vi" editor_cmd = terminal .. " -e " .. editor + +-- user defined +browser = "dwb" +browser2 = "iron" gui_editor = "gvim" -browser = "dwb" -mail = terminal .. " -e mutt " -wifi = terminal .. " -e sudo wifi-menu " -musicplr = terminal .. " -g 130x34-320+16 -e ncmpcpp " +graphics = "gimp" -modkey = "Mod4" -altkey = "Mod1" - -layouts = -{ - awful.layout.suit.floating, -- 1 - awful.layout.suit.tile, -- 2 - awful.layout.suit.fair, -- 3 - awful.layout.suit.tile.left, -- 4 - awful.layout.suit.tile.top, -- 5 +local layouts = { + awful.layout.suit.floating, + lain.layout.uselesstile, + awful.layout.suit.fair, + lain.layout.uselesstile.left, + lain.layout.uselesstile.top } +-- }}} +-- {{{ Tags +tags = { + names = { "ƀ", "Ƅ", "Ɗ", "ƈ", "ƙ" }, + layout = { layouts[1], layouts[3], layouts[2], layouts[1], layouts[5] } +} +for s = 1, screen.count() do + 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 - -- }}} --- {{{ Tags - -tags = { - names = { "ƀ", "Ƅ", "Ɗ", "ƈ", "ƙ" }, - layout = { layouts[1], layouts[3], layouts[2], layouts[1], layouts[5] } - } -for s = 1, screen.count() do - tags[s] = awful.tag(tags.names, s, tags.layout) -end - --- }}} - --- {{{ Freedesktop Menu - +-- {{{ Menu require("freedesktop/freedesktop") - --- }}} - -- }}} -- {{{ Wibox +markup = lain.util.markup +gray = "#9E9C9A" --- Colours -coldef = "" -white = "" -gray = "" +-- Textclock +mytextclock = awful.widget.textclock(" %H:%M ") --- Textclock widget -mytextclock = awful.widget.textclock(white .. "%H:%M" .. coldef) +-- Calendar +lain.widgets.calendar:attach(mytextclock) --- attached calendar -local os = os -local string = string -local table = table -local util = awful.util +--[[ Mail IMAP check +-- commented because it needs to be set before use +mailwidget = lain.widgets.imap({ + timeout = 180, + server = "server", + mail = "mail", + password = "keyring get mail", + settings = function() + mail = "" + count = "" -char_width = nil -text_color = theme.fg_normal or "#FFFFFF" -today_color = theme.taglist_fg_focus or "#FF7100" -calendar_width = 21 + if mailcount > 0 then + mail = "Arch " + count = mailcount .. " " + end -local calendar = nil -local offset = 0 - -local data = nil - -local function pop_spaces(s1, s2, maxsize) - local sps = "" - for i = 1, maxsize - string.len(s1) - string.len(s2) do - sps = sps .. " " - end - return s1 .. sps .. s2 -end - -local function create_calendar() - offset = offset or 0 - - local now = os.date("*t") - local cal_month = now.month + offset - local cal_year = now.year - if cal_month > 12 then - cal_month = (cal_month % 12) - cal_year = cal_year + 1 - elseif cal_month < 1 then - cal_month = (cal_month + 12) - cal_year = cal_year - 1 - end - - local last_day = os.date("%d", os.time({ day = 1, year = cal_year, - month = cal_month + 1}) - 86400) - - local first_day = os.time({ day = 1, month = cal_month, year = cal_year}) - local first_day_in_week = os.date("%w", first_day) - - local result = "do lu ma me gi ve sa\n" -- days of the week - - -- Italian localization - -- can be a stub for your own localization - if language:find("it_IT") == nil - then - result = "su mo tu we th fr sa\n" - else - result = "do lu ma me gi ve sa\n" - end - - for i = 1, first_day_in_week do - result = result .. " " - end - - local this_month = false - for day = 1, last_day do - local last_in_week = (day + first_day_in_week) % 7 == 0 - local day_str = pop_spaces("", day, 2) .. (last_in_week and "" or " ") - if cal_month == now.month and cal_year == now.year and day == now.day then - this_month = true - result = result .. - string.format('%s', - today_color, day_str) - else - result = result .. day_str - end - if last_in_week and day ~= last_day then - result = result .. "\n" - end - end - - local header - if this_month then - header = os.date("%a, %d %b %Y") - else - header = os.date("%B %Y", first_day) - end - return header, string.format('%s', - theme.font, text_color, result) -end - -local function calculate_char_width() - return beautiful.get_font_height(theme.font) * 0.555 -end - -function remove_calendar() - if calendar ~= nil then - naughty.destroy(calendar) - calendar = nil - offset = 0 - end -end - -function add_calendar(inc_offset) - inc_offset = inc_offset or 0 - - local save_offset = offset - remove_calendar() - offset = save_offset + inc_offset - - local char_width = char_width or calculate_char_width() - local header, cal_text = create_calendar() - calendar = naughty.notify({ title = header, - text = cal_text, - timeout = 0, hover_timeout = 0.5, - bg = "#060606" - }) -end - -function show_calendar(t_out) - remove_calendar() - local char_width = char_width or calculate_char_width() - local header, cal_text = create_calendar() - calendar = naughty.notify({ title = header, - text = cal_text, - timeout = t_out, - bg = "#060606" - }) -end - -mytextclock:connect_signal("mouse::enter", function() add_calendar(0) end) -mytextclock:connect_signal("mouse::leave", remove_calendar) -mytextclock:buttons(util.table.join( awful.button({ }, 1, function() add_calendar(-1) end), - awful.button({ }, 3, function() add_calendar(1) end))) - --- GMail widget -mygmail = wibox.widget.textbox() -gmail_t = awful.tooltip({ objects = { mygmail },}) -notify_shown = false -mailcount = 0 -vicious.register(mygmail, vicious.widgets.gmail, - function (widget, args) - gmail_t:set_text(args["{subject}"]) - gmail_t:add_to_object(mygmail) - notify_title = "" - notify_text = "" - mailcount = args["{count}"] - if (args["{count}"] > 0 ) then - if (notify_shown == false) then - -- Italian localization - -- can be a stub for your own localization - if (args["{count}"] == 1) then - if language:find("it_IT") ~= nil - then - notify_title = "Hai un nuovo messaggio" - else - notify_title = "You got a new mail" - end - notify_text = '"' .. args["{subject}"] .. '"' - else - if language:find("it_IT") ~= nil - then - notify_title = "Hai " .. args["{count}"] .. " nuovi messaggi" - notify_text = 'Ultimo: "' .. args["{subject}"] .. '"' - else - notify_title = "You got " .. args["{count}"] .. " new mails" - notify_text = 'Last one: "' .. args["{subject}"] .. '"' - end - end - naughty.notify({ - title = notify_title, - text = notify_text, - timeout = 7, - position = "top_left", - icon = beautiful.widget_mail_notify, - fg = beautiful.taglist_fg_focus, - bg = "#060606" - }) - notify_shown = true + widget:set_markup(markup(gray, mail) .. count) end - if yawn.icon == yawn.sky_na then return gray .. " Mail " .. coldef .. white .. args["{count}"] .. " " .. coldef - else return gray .. " Mail " .. coldef .. white .. args["{count}"] .. coldef .. " " +}) +]] + +-- MPD +mpdwidget = lain.widgets.mpd({ + settings = function() + artist = mpd_now.artist .. " " + title = mpd_now.title .. " " + + if mpd_now.state == "pause" then + artist = "mpd " + title = "paused " + elseif mpd_now.state == "stop" then + artist = "" + title = "" + end + + widget:set_markup(markup(gray, artist) .. title) end - else - notify_shown = false - return '' - end -end, 60) -mygmail:buttons(awful.util.table.join(awful.button({ }, 1, function () awful.util.spawn(mail, false) end))) +}) --- Mpd widget -mpdwidget = wibox.widget.textbox() -mpdwidget:buttons(awful.util.table.join(awful.button({ }, 1, function () awful.util.spawn_with_shell(musicplr) end))) -curr_track = nil -vicious.register(mpdwidget, vicious.widgets.mpd, -function(widget, args) - if args["{state}"] == "Play" then - if args["{Title}"] ~= curr_track - then - curr_track = args["{Title}"] - os.execute(scriptdir .. "mpdinfo") - old_id = naughty.notify({ - title = "Now playing", - text = args["{Artist}"] .. " (" .. args["{Album}"] .. ")\n" .. args["{Title}"], - icon = "/tmp/mpdnotify_cover.png", - bg = "#060606", - timeout = 5, - replaces_id = old_id - }).id +-- /home fs +fshome = lain.widgets.fs({ + partition = "/home", + settings = function() + fs_header = "" + fs_p = "" + + if used >= 90 then + fs_header = " Hdd " + fs_p = used + end + + widget:set_markup(markup(gray, fs_header) .. fs_p) end - if yawn.icon == yawn.sky_na then return gray .. args["{Artist}"] .. coldef .. white .. " " .. args["{Title}"] .. " " .. coldef - elseif mailcount == 0 then return gray .. args["{Artist}"] .. coldef .. white .. " " .. args["{Title}"] .. " " .. coldef - else return gray .. args["{Artist}"] .. coldef .. white .. " " .. args["{Title}"] .. coldef .. " " +}) + +-- Battery +batwidget = lain.widgets.bat({ + settings = function() + bat_header = " Bat " + bat_p = bat_now.perc .. " " + + if bat_now.status == "Not present" then + bat_header = "" + bat_p = "" + end + + widget:set_markup(markup(gray, bat_header) .. bat_p) end - elseif args["{state}"] == "Pause" then - if mailcount == 0 then return gray .. "mpd " .. coldef .. white .. "paused " .. coldef - else return gray .. "mpd " .. coldef .. white .. "paused " .. coldef +}) + + +-- ALSA volume +volumewidget = lain.widgets.alsa({ + settings = function() + header = " Vol " + level = volume_now.level + + if volume_now.status == "off" then + level = level .. "M " + else + level = level .. " " + end + + widget:set_markup(markup(gray, header) .. level) end - else - curr_track = nil - return '' - end -end, 1) +}) --- /home fs widget -fshwidget = wibox.widget.textbox() -too_much = false -vicious.register(fshwidget, vicious.widgets.fs, -function (widget, args) - if ( args["{/home used_p}"] >= 90 ) then - if ( args["{/home used_p}"] >= 99 and too_much == false ) then - naughty.notify({ title = "Warning", text = "/home partition ran out!\nmake some room", - timeout = 7, - position = "top_right", - fg = beautiful.fg_urgent, - bg = beautiful.bg_urgent }) - too_much = true - end - return gray .. " Hdd " .. coldef .. white .. args["{/home used_p}"] .. coldef .. " " - else - return "" - end -end, 600) - --- hhd status notification -local infos = nil - -function remove_info() - if infos ~= nil then - naughty.destroy(infos) - infos = nil +-- Weather +yawn = lain.widgets.yawn(123456, +{ + settings = function() + widget:set_markup(" " .. units .. " ") end -end - -function show_info(t_out) - remove_info() - local capi = { - mouse = mouse, - screen = screen - } - local hdd = awful.util.pread(scriptdir .. "dfs") - hdd = string.gsub(hdd, " ^%s*(.-)%s*$", "%1") - - -- Italian localization - -- can be a stub for your own localization - if language:find("it_IT") ~= nil - then - hdd = string.gsub(hdd, "Used ", "Usato") - hdd = string.gsub(hdd, "Free ", "Libero") - hdd = string.gsub(hdd, "Total ", "Totale") - end - - infos = naughty.notify({ - text = hdd, - timeout = t_out, - position = "top_right", - margin = 10, - height = 210, - width = 680, - bg = "#060606", - screen = capi.mouse.screen - }) -end - -fshwidget:connect_signal('mouse::enter', function () show_info(0) end) -fshwidget:connect_signal('mouse::leave', function () remove_info() end) - --- Battery widget -batwidget = wibox.widget.textbox() -function batstate() - - local file = io.open("/sys/class/power_supply/BAT0/status", "r") - - if (file == nil) then - return "Cable plugged" - end - - local batstate = file:read("*line") - file:close() - - if (batstate == 'Discharging' or batstate == 'Charging') then - return batstate - else - return "Fully charged" - end -end -vicious.register(batwidget, vicious.widgets.bat, -function (widget, args) - -- plugged - if (batstate() == 'Cable plugged' or batstate() == 'Unknown') then - return '' - -- critical - elseif (args[2] <= 5 and batstate() == 'Discharging') then - naughty.notify{ - text = "sto per spegnermi...", - title = "Carica quasi esaurita!", - position = "top_right", - timeout = 0, - fg="#000000", - bg="#ffffff", - screen = 1, - ontop = true, - } - -- low - elseif (args[2] <= 10 and batstate() == 'Discharging') then - naughty.notify({ - text = "attacca il cavo!", - title = "Carica bassa", - position = "top_right", - timeout = 0, - fg="#ffffff", - bg="#262729", - screen = 1, - ontop = true, - }) - end - return gray .. "Bat " .. coldef .. white .. args[2] .. " " .. coldef -end, 1, 'BAT0') - --- Volume widget -volumewidget = wibox.widget.textbox() -vicious.register(volumewidget, vicious.widgets.volume, -function (widget, args) - if (args[2] ~= "♩" ) then - return gray .. "Vol " .. coldef .. white .. args[1] .. " " .. coldef - else - return gray .. "Vol " .. coldef .. white .. "mute " .. coldef - end -end, 1, "Master") - --- Net checker widget -no_net_shown = true -netwidget = wibox.widget.textbox() -vicious.register(netwidget, vicious.widgets.net, -function (widget, args) - if args["{wlp3s0 carrier}"] == 0 then - if no_net_shown == true then - naughty.notify({ title = "wlp3s0", text = "No carrier", - timeout = 7, - position = "top_left", - icon = beautiful.widget_no_net_notify, - fg = "#ff5e5e", - bg = "#060606" }) - no_net_shown = false - end - return gray .. " Net " .. coldef .. "Off " .. coldef - else - no_net_shown = true - return '' - end -end, 10) -netwidget:buttons(awful.util.table.join(awful.button({ }, 1, function () awful.util.spawn_with_shell(wifi) end))) - --- Weather widget -yawn.register(123456) -- https//github.com/copycat-killer/yawn +}) -- Separators -spr = wibox.widget.textbox(' ') first = wibox.widget.textbox(' ') arrl_pre = wibox.widget.imagebox() arrl_pre:set_image(beautiful.arrl_lr_pre) arrl_post = wibox.widget.imagebox() arrl_post:set_image(beautiful.arrl_lr_post) --- }}} - --- {{{ Layout - -- Create a wibox for each screen and add it mywibox = {} mypromptbox = {} @@ -592,11 +284,11 @@ for s = 1, screen.count() do -- Create a tasklist widget mytasklist[s] = awful.widget.tasklist(s, awful.widget.tasklist.filter.currenttags, mytasklist.buttons) - + -- Create the wibox mywibox[s] = awful.wibox({ position = "top", screen = s, height = 18 }) - -- Widgets that are aligned to the upper left + -- Widgets that are aligned to the left local left_layout = wibox.layout.fixed.horizontal() left_layout:add(first) left_layout:add(mytaglist[s]) @@ -606,22 +298,18 @@ for s = 1, screen.count() do left_layout:add(mypromptbox[s]) left_layout:add(first) - -- Widgets that are aligned to the upper right + -- Widgets that are aligned to the right local right_layout = wibox.layout.fixed.horizontal() if s == 1 then right_layout:add(wibox.widget.systray()) end right_layout:add(first) right_layout:add(mpdwidget) - right_layout:add(mygmail) + --right_layout:add(mailwidget) right_layout:add(yawn.icon) right_layout:add(yawn.widget) - right_layout:add(fshwidget) + right_layout:add(fshome) right_layout:add(batwidget) - right_layout:add(netwidget) - right_layout:add(spr) right_layout:add(volumewidget) - right_layout:add(spr) right_layout:add(mytextclock) - right_layout:add(spr) -- Now bring it all together (with the tasklist in the middle) local layout = wibox.layout.align.horizontal() @@ -630,51 +318,77 @@ for s = 1, screen.count() do layout:set_right(right_layout) mywibox[s]:set_widget(layout) - - -- Set proper backgrounds, instead of beautiful.bg_normal - beautiful.screen_width = screen[1].workarea.width .. ".png" - mywibox[s]:set_bg(beautiful.topbar_path .. beautiful.screen_width) end - -- }}} --- {{{ Mouse Bindings - +-- {{{ 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), - -- Capture a screenshot - awful.key({ altkey }, "p", function() awful.util.spawn("screenshot",false) 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), - -- Move clients - --awful.key({ altkey }, "Next", function () awful.client.moveresize( 1, 1, -2, -2) end), - --awful.key({ altkey }, "Prior", function () awful.client.moveresize(-1, -1, 2, 2) end), - --awful.key({ altkey }, "Down", function () awful.client.moveresize( 0, 1, 0, 0) end), - --awful.key({ altkey }, "Up", function () awful.client.moveresize( 0, -1, 0, 0) end), - --awful.key({ altkey }, "Left", function () awful.client.moveresize(-1, 0, 0, 0) end), - --awful.key({ altkey }, "Right", function () awful.client.moveresize( 1, 0, 0, 0) end), - awful.key({ modkey, }, "Left", awful.tag.viewprev ), - awful.key({ modkey, }, "Right", awful.tag.viewnext ), - awful.key({ modkey, }, "Escape", awful.tag.history.restore), - awful.key({ modkey, }, "k", + -- 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), + + -- Dynamic tag renaming + awful.key({ altkey, "Shift" }, "r", + function () + lain.util.prompt_rename_tag(mypromptbox) + 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({ modkey, }, "j", + awful.key({ altkey }, "j", function () awful.client.focus.byidx(-1) if client.focus then client.focus:raise() end end), - awful.key({ modkey, }, "w", function () mymainmenu:show({keygrabber=true}) 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 () @@ -694,75 +408,81 @@ globalkeys = awful.util.table.join( 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), - awful.key({ modkey, }, "l", function () awful.tag.incmwfact( 0.05) end), - awful.key({ modkey, }, "h", function () awful.tag.incmwfact(-0.05) end), - awful.key({ modkey, "Shift" }, "h", function () awful.tag.incnmaster( 1) end), - awful.key({ modkey, "Shift" }, "l", function () awful.tag.incnmaster(-1) end), - awful.key({ modkey, "Control" }, "h", function () awful.tag.incncol( 1) end), - awful.key({ modkey, "Control" }, "l", 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), + awful.key({ modkey, "Control" }, "r", awesome.restart), + awful.key({ modkey, "Shift" }, "q", awesome.quit), -- Dropdown terminal - awful.key({ modkey, }, "z", function () scratch.drop(terminal) end), + awful.key({ modkey, }, "z", function () drop(terminal) end), -- Widgets popups - awful.key({ altkey, }, "c", function () show_calendar(7) end), - awful.key({ altkey, }, "h", function () - vicious.force({ fshwidget }) - show_info(7) - end), - awful.key({ altkey, }, "w", function () yawn.show_weather(5) end), + awful.key({ altkey, }, "c", function () lain.widgets.calendar:show(7) end), + awful.key({ altkey, }, "h", function () fshome.show(7) end), + awful.key({ altkey, }, "w", function () yawn.show(7) end), - -- Volume control - awful.key({ altkey }, "Up", function () - awful.util.spawn("amixer set Master playback 1%+", false ) - vicious.force({ volumewidget }) - end), - awful.key({ altkey }, "Down", function () - awful.util.spawn("amixer set Master playback 1%-", false ) - vicious.force({ volumewidget }) - end), - awful.key({ altkey }, "m", function () - awful.util.spawn("amixer set Master playback toggle", false ) - vicious.force({ volumewidget }) - end), + -- ALSA volume control + awful.key({ altkey }, "Up", + function () + awful.util.spawn("amixer -q set Master 1%+") + volumewidget.update() + end), + awful.key({ altkey }, "Down", + function () + awful.util.spawn("amixer -q set Master 1%-") + volumewidget.update() + end), + awful.key({ altkey }, "m", + function () + awful.util.spawn("amixer -q set Master playback toggle") + volumewidget.update() + end), awful.key({ altkey, "Control" }, "m", - function () - awful.util.spawn("amixer set Master playback 100%", false ) - vicious.force({ volumewidget }) - end), + function () + awful.util.spawn("amixer -q set Master playback 100%") + volumewidget.update() + end), - -- Music control - awful.key({ altkey, "Control" }, "Up", function () - awful.util.spawn_with_shell( "mpc toggle || ncmpcpp toggle || ncmpc toggle || pms toggle", false ) - vicious.force({ mpdwidget } ) - end), - awful.key({ altkey, "Control" }, "Down", function () - awful.util.spawn_with_shell( "mpc stop || ncmpcpp stop || ncmpc stop || pms stop", false ) - vicious.force({ mpdwidget } ) - end ), - awful.key({ altkey, "Control" }, "Left", function () - awful.util.spawn_with_shell( "mpc prev || ncmpcpp prev || ncmpc prev || pms prev", false ) - vicious.force({ mpdwidget } ) - end ), - awful.key({ altkey, "Control" }, "Right", function () - awful.util.spawn_with_shell( "mpc next || ncmpcpp next || ncmpc next || pms next", false ) - vicious.force({ mpdwidget } ) - end ), + -- MPD control + awful.key({ altkey, "Control" }, "Up", + function () + awful.util.spawn_with_shell("mpc toggle || ncmpcpp toggle || ncmpc toggle || pms toggle") + mpdwidget.update() + end), + awful.key({ altkey, "Control" }, "Down", + function () + awful.util.spawn_with_shell("mpc stop || ncmpcpp stop || ncmpc stop || pms stop") + mpdwidget.update() + end), + awful.key({ altkey, "Control" }, "Left", + function () + awful.util.spawn_with_shell("mpc prev || ncmpcpp prev || ncmpc prev || pms prev") + mpdwidget.update() + end), + awful.key({ altkey, "Control" }, "Right", + function () + awful.util.spawn_with_shell("mpc next || ncmpcpp 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( "dwb", false ) end), + 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), @@ -795,42 +515,39 @@ clientkeys = awful.util.table.join( end) ) - --- Compute the maximum number of digit we need, limited to 9 -keynumber = 0 -for s = 1, screen.count() do - keynumber = math.min(9, math.max(#tags[s], keynumber)); -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, keynumber do +for i = 1, 9 do globalkeys = awful.util.table.join(globalkeys, awful.key({ modkey }, "#" .. i + 9, function () - screen = mouse.screen - if tags[screen][i] then - awful.tag.viewonly(tags[screen][i]) + 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 () - screen = mouse.screen - if tags[screen][i] then - awful.tag.viewtoggle(tags[screen][i]) + 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 () - if client.focus and tags[client.focus.screen][i] then - awful.client.movetotag(tags[client.focus.screen][i]) - end + 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 () - if client.focus and tags[client.focus.screen][i] then - awful.client.toggletag(tags[client.focus.screen][i]) + local tag = awful.tag.gettags(client.focus.screen)[i] + if client.focus and tag then + awful.client.toggletag(tag) end end)) end @@ -842,50 +559,43 @@ clientbuttons = awful.util.table.join( -- 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 - } - }, - + -- 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.95 } }, + properties = { opacity = 0.99 } }, { rule = { class = "MPlayer" }, - properties = { floating = true } }, + 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] } }, + properties = { tag = tags[1][4] } }, { rule = { class = "Gimp", role = "gimp-image-window" }, properties = { maximized_horizontal = true, maximized_vertical = true } }, - - { rule = { class = "Transmission-gtk" }, - properties = { tag = tags[1][5] } }, - - { rule = { class = "Torrent-search" }, - properties = { tag = tags[1][5] } }, } - -- }}} -- {{{ Signals - -- Signal function to execute when a new client appears. client.connect_signal("manage", function (c, startup) -- Enable sloppy focus @@ -896,65 +606,46 @@ client.connect_signal("manage", function (c, startup) end end) - if not startup then - -- Set the windows at the slave, - -- i.e. put it at the end of others instead of setting it master. - -- awful.client.setslave(c) - - -- Put windows in a smart way, only if they does not set an initial position. - if 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 - 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 left - local left_layout = wibox.layout.fixed.horizontal() - left_layout:add(awful.titlebar.widget.iconwidget(c)) - left_layout:buttons(buttons) - - -- 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_left(left_layout) - layout:set_right(right_layout) - layout:set_middle(middle_layout) - - awful.titlebar(c):set_widget(layout) + 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 end) -client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus 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_width = "0" + c.border_color = beautiful.border_normal + else + c.border_width = beautiful.border_width + 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 + if awful.client.floating.get(c) or layout == "floating" then + c.border_width = beautiful.border_width + + -- No borders with only one visible client + elseif #clients == 1 or layout == "max" then + clients[1].border_width = 0 + awful.client.moveresize(0, 0, 2, 2, clients[1]) + else + c.border_width = beautiful.border_width + end + end + end + end) +end -- }}} diff --git a/rc.lua.dremora b/rc.lua.dremora index eb23c65..7c6ebdf 100755 --- a/rc.lua.dremora +++ b/rc.lua.dremora @@ -1,28 +1,44 @@ ---[[ ]]-- --- - --- Dremora Awesome WM 3.5.+ config -- --- github.com/copycat-killer -- --- - ---[[ ]]-- - - --- {{{ Required Libraries +--[[ + + Dremora Awesome WM config 2.0 + github.com/copycat-killer + +--]] +-- {{{ Required libraries local gears = require("gears") local awful = require("awful") awful.rules = require("awful.rules") -awful.autofocus = require("awful.autofocus") +require("awful.autofocus") local wibox = require("wibox") local beautiful = require("beautiful") local naughty = require("naughty") -local vicious = require("vicious") -local scratch = require("scratch") -local yawn = require("yawn") - +local drop = require("scratch.drop") +local lain = require("lain") -- }}} --- {{{ Autostart applications +-- {{{ 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(" ") @@ -33,428 +49,181 @@ function run_once(cmd) end run_once("urxvtd") -run_once("unclutter -idle 10") +run_once("unclutter") run_once("compton") - -- }}} --- {{{ Localization +-- {{{ Variable definitions +-- localization +--os.setlocale(os.getenv("LANG")) -os.setlocale(os.getenv("LANG")) +-- home path +homedir = os.getenv("HOME") .. "/.config/awesome/" --- }}} +-- beautiful init +confdir = homedir .. "themes/dremora/" +beautiful.init(confdir .. "theme.lua") --- {{{ Error Handling - --- Check if awesome encountered an error during startup and fell back to --- another config (This code will only ever execute for the fallback config) -if awesome.startup_errors then - naughty.notify({ preset = naughty.config.presets.critical, - title = "Oops, there were errors during startup!", - text = awesome.startup_errors }) -end - --- Handle runtime errors after startup -do - local in_error = false - awesome.connect_signal("debug::error", function (err) - -- Make sure we don't go into an endless error loop - if in_error then return end - in_error = true - - naughty.notify({ preset = naughty.config.presets.critical, - title = "Oops, an error happened!", - text = err }) - local in_error = false - end) -end - --- }}} - --- {{{ Global variables - -home = os.getenv("HOME") -confdir = home .. "/.config/awesome" -scriptdir = confdir .. "/scripts/" -themes = confdir .. "/themes" -active_theme = themes .. "/dremora" -language = string.gsub(os.getenv("LANG"), ".utf8", "") -red_c = "#E36352" - -beautiful.init(active_theme .. "/theme.lua") - -terminal = "urxvtc" -editor = os.getenv("EDITOR") or "vim" +-- common +modkey = "Mod4" +altkey = "Mod1" +terminal = "urxvtc" or "xterm" +editor = os.getenv("EDITOR") or "nano" or "vi" editor_cmd = terminal .. " -e " .. editor + +-- user defined +browser = "dwb" +browser2 = "iron" gui_editor = "gvim" -browser = "dwb" -graphics = "gimp" -mail = terminal .. " -e mutt " -wifi = terminal .. " -e sudo wifi-menu " -musicplr = terminal .. " -g 130x34-320+16 -e ncmpcpp " +graphics = "gimp" -modkey = "Mod4" -altkey = "Mod1" - -layouts = -{ - awful.layout.suit.floating, -- 1 - awful.layout.suit.tile, -- 2 - awful.layout.suit.fair, -- 3 - awful.layout.suit.tile.left, -- 4 - awful.layout.suit.tile.top, -- 5 +local layouts = { + awful.layout.suit.floating, + lain.layout.uselesstile, + awful.layout.suit.fair, + lain.layout.uselesstile.left, + lain.layout.uselesstile.top } +-- }}} +-- {{{ Tags +tags = { + names = { "ƀ", "Ƅ", "Ɗ", "ƈ", "ƙ" }, + layout = { layouts[1], layouts[3], layouts[2], layouts[1], layouts[5] } +} +for s = 1, screen.count() do + 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 - -- }}} --- {{{ Tags - -tags = { - names = { "ƀ", "Ƅ", "Ɗ", "ƈ", "ƙ" }, - layout = { layouts[1], layouts[2], layouts[3], layouts[4], layouts[5] } - } -for s = 1, screen.count() do - tags[s] = awful.tag(tags.names, s, tags.layout) -end - --- }}} - --- {{{ Freedesktop menu - +-- {{{ Menu require("freedesktop/freedesktop") - -- }}} -- {{{ Wibox +markup = lain.util.markup +white = beautiful.fg_focus +gray = "#858585" --- awful.util -local util = awful.util +-- Textclock +mytextclock = awful.widget.textclock(markup(gray, " %a") +.. markup(white, " %d ") .. markup(gray, "%b ") .. markup(white, "%H:%M ")) --- Colours -coldef = "" -white = "" -gray = "" +-- Calendar +lain.widgets.calendar:attach(mytextclock, { fg = white }) --- Textclock widget -mytextclock = awful.widget.textclock(white .. "%H:%M" .. coldef) +--[[ Mail IMAP check +-- commented because it needs to be set before use +mailwidget = lain.widgets.imap({ + timeout = 180, + server = "server", + mail = "mail", + password = "keyring get mail", + settings = function() + mail_notification_preset.fg = white + mail = "" + count = "" --- attached calendar -local tonumber = tonumber -local calendar = nil -local offset = 0 + if mailcount > 0 then + mail = "Arch " + count = mailcount .. " " + end -function remove_calendar() - if calendar ~= nil then - naughty.destroy(calendar) - calendar = nil - end -end - -function show_calendar(inc_offset, t_out) - remove_calendar() - - local f, c_text - local today = tonumber(os.date('%d')) - - if inc_offset == 0 then - if today < 10 then - f = io.popen('/usr/bin/cal | sed -r -e "s/(^| )( ' .. today .. ')($| )/\\1\\2<\\/span><\\/b>\\3/"',"r") - else - f = io.popen('/usr/bin/cal | sed -r -e "s/(^| )(' .. today .. ')($| )/\\1\\2<\\/span><\\/b>\\3/"',"r") - end - c_text = "" .. f:read() .. "\n\n" .. f:read() .. "\n" .. f:read("*all") .. "" - f:close() - offset = 0 - else - local month = tonumber(os.date('%m')) - local year = tonumber(os.date('%Y')) - - offset = offset + inc_offset - month = month + offset - - if month > 12 then - month = 12 - offset = 12 - tonumber(os.date('%m')) - elseif month < 1 then - month = 1 - offset = 1 - tonumber(os.date('%m')) - end - - f = io.popen('/usr/bin/cal ' .. month .. ' ' .. year ,"r") - c_text = "" .. f:read() .. "\n\n" .. f:read() .. "\n" .. f:read("*all") .. "" - f:close() - end - - calendar = naughty.notify({ text = c_text, - fg = "#D0D0D0", - bg = "#121212", - timeout = t_out - }) -end - -mytextclock:connect_signal("mouse::enter", function() show_calendar(0, 0) end) -mytextclock:connect_signal("mouse::leave", function() remove_calendar() end) -mytextclock:buttons(util.table.join( awful.button({ }, 1, function() show_calendar(-1, 0) end), - awful.button({ }, 3, function() show_calendar(1, 0) end))) - --- GMail widget -mygmail = wibox.widget.textbox() -gmail_t = awful.tooltip({ objects = { mygmail },}) -notify_shown = false -mailcount = 0 -vicious.register(mygmail, vicious.widgets.gmail, - function (widget, args) - gmail_t:set_text(args["{subject}"]) - gmail_t:add_to_object(mygmail) - notify_title = "" - notify_text = "" - mailcount = args["{count}"] - if (args["{count}"] > 0 ) then - if (notify_shown == false) then - -- Italian localization - -- can be a stub for your own localization - if (args["{count}"] == 1) then - if language:find("it_IT") ~= nil - then - notify_title = "Hai un nuovo messaggio" - else - notify_title = "You got a new mail" - end - notify_text = '"' .. args["{subject}"] .. '"' - else - if language:find("it_IT") ~= nil - then - notify_title = "Hai " .. args["{count}"] .. " nuovi messaggi" - notify_text = 'Ultimo: "' .. args["{subject}"] .. '"' - else - notify_title = "You got " .. args["{count}"] .. " new mails" - notify_text = 'Last one: "' .. args["{subject}"] .. '"' - end - end - naughty.notify({ - title = notify_title, - text = notify_text, - timeout = 7, - position = "top_left", - icon = beautiful.widget_mail_notify, - fg = red_c, bg = "#121212" - }) - notify_shown = true + widget:set_markup(markup(gray, mail) .. markup(white, count)) end - return gray .. " Mail " .. coldef .. white .. args["{count}"] .. " " .. coldef - else - notify_shown = false - return '' - end -end, 60) -mygmail:buttons(awful.util.table.join(awful.button({ }, 1, function () awful.util.spawn(mail, false) end))) +}) +]] --- Mpd widget -mpdwidget = wibox.widget.textbox() -mpdwidget:buttons(awful.util.table.join(awful.button({ }, 1, function () awful.util.spawn_with_shell(musicplr) end))) -curr_track = nil -vicious.register(mpdwidget, vicious.widgets.mpd, -function(widget, args) - if args["{state}"] == "Play" then - if args["{Title}"] ~= curr_track - then - curr_track = args["{Title}"] - os.execute(scriptdir .. "mpdinfo") - old_id = naughty.notify({ - title = "Now playing", - text = args["{Artist}"] .. " (" .. args["{Album}"] .. ")\n" .. args["{Title}"], - icon = "/tmp/mpdnotify_cover.png", - fg = "#D0D0D0", - bg = "#121212", - timeout = 5, - replaces_id = old_id - }).id +-- MPD +mpdwidget = lain.widgets.mpd({ + settings = function() + mpd_notification_preset.fg = white + artist = mpd_now.artist .. " " + title = mpd_now.title .. " " + + if mpd_now.state == "pause" then + artist = "mpd " + title = "paused " + elseif mpd_now.state == "stop" then + artist = "" + title = "" + end + + widget:set_markup(markup(gray, artist) .. markup(white, title)) end - return gray .. args["{Artist}"] .. coldef .. white .. " " .. args["{Title}"] .. " " .. coldef - elseif args["{state}"] == "Pause" then - -- 'in pausa' means 'paused' - return gray .. "mpd " .. coldef .. white .. "in pausa " .. coldef - else - curr_track = nil - return '' - end -end, 1) +}) --- /home fs widget -fshwidget = wibox.widget.textbox() -too_much = false -vicious.register(fshwidget, vicious.widgets.fs, -function (widget, args) - if ( args["{/home used_p}"] >= 90 ) then - if ( args["{/home used_p}"] >= 99 and too_much == false ) then - naughty.notify({ title = "warning", text = "/home partition ran out!\nmake some room", - timeout = 7, - position = "top_right", - fg = beautiful.fg_urgent, - bg = beautiful.bg_urgent }) - too_much = true - end - return gray .. " Hdd " .. coldef .. white .. args["{/home used_p}"] .. coldef .. " " - else - return "" - end -end, 600) +-- /home fs +fshome = lain.widgets.fs({ + partition = "/home", + settings = function() + fs_notification_preset.fg = white + fs_header = "" + fs_p = "" --- hhd status notification -local infos = nil + if used >= 90 then + fs_header = " Hdd " + fs_p = used + end -function remove_info() - if infos ~= nil then - naughty.destroy(infos) - infos = nil + widget:set_markup(markup(gray, fs_header) .. markup(white, fs_p)) end -end +}) -function show_info(t_out) - remove_info() - local capi = { - mouse = mouse, - screen = screen - } - local hdd = awful.util.pread(scriptdir .. "dfs") - hdd = string.gsub(hdd, " ^%s*(.-)%s*$", "%1") +-- Battery +batwidget = lain.widgets.bat({ + settings = function() + bat_header = " Bat " + bat_p = bat_now.perc .. " " - -- Italian localization - -- can be a stub for your own localization - if language:find("it_IT") ~= nil - then - hdd = string.gsub(hdd, "Used ", "Usato") - hdd = string.gsub(hdd, "Free ", "Libero") - hdd = string.gsub(hdd, "Total ", "Totale") + if bat_now.status == "Not present" then + bat_header = "" + bat_p = "" + end + + widget:set_markup(markup(gray, bat_header) .. markup(white, bat_p)) end +}) - infos = naughty.notify({ - text = hdd, - timeout = t_out, - position = "top_right", - margin = 10, - height = 210, - width = 680, - fg = "#D4D4D4", - bg = "#121212", - screen = capi.mouse.screen - }) -end +-- ALSA volume +volumewidget = lain.widgets.alsa({ + settings = function() + header = " Vol " + vlevel = volume_now.level -fshwidget:connect_signal('mouse::enter', function () show_info(0) end) -fshwidget:connect_signal('mouse::leave', function () remove_info() end) + if volume_now.status == "off" then + vlevel = vlevel .. "M " + else + vlevel = vlevel .. " " + end --- Battery widget -batwidget = wibox.widget.textbox() -function batstate() - - local file = io.open("/sys/class/power_supply/BAT0/status", "r") - - if (file == nil) then - return "Cable plugged" - end - - local batstate = file:read("*line") - file:close() - - if (batstate == 'Discharging' or batstate == 'Charging') then - return batstate - else - return "Fully charged" - end -end -vicious.register(batwidget, vicious.widgets.bat, -function (widget, args) - -- plugged - if (batstate() == 'Cable plugged' or batstate() == 'Unknown') then - return '' - -- critical - elseif (args[2] <= 5 and batstate() == 'Discharging') then - naughty.notify{ - text = "sto per spegnermi...", - title = "Carica quasi esaurita!", - position = "top_right", - timeout = 0, - fg="#000000", - bg="#ffffff", - screen = 1, - ontop = true, - } - -- low - elseif (args[2] <= 10 and batstate() == 'Discharging') then - naughty.notify({ - text = "attacca il cavo!", - title = "Carica bassa", - position = "top_right", - timeout = 0, - fg="#ffffff", - bg="#262729", - screen = 1, - ontop = true, - }) - end - return gray .. "Bat " .. coldef .. white .. args[2] .. " " .. coldef -end, 1, 'BAT0') - --- Volume widget -volumewidget = wibox.widget.textbox() -vicious.register(volumewidget, vicious.widgets.volume, -function (widget, args) - if (args[2] ~= "♩" ) then - return gray .. "Vol " .. coldef .. white .. args[1] .. " " .. coldef - else - return gray .. "Vol " .. coldef .. white .. "mute " .. coldef - end -end, 1, "Master") - --- Net checker widget -no_net_shown = true -netwidget = wibox.widget.textbox() -vicious.register(netwidget, vicious.widgets.net, -function (widget, args) - if args["{wlp3s0 carrier}"] == 0 then - if no_net_shown == true then - naughty.notify({ title = "wlp3s0", text = "No carrier", - timeout = 7, - position = "top_left", - icon = beautiful.widget_no_net_notify, - fg = "#ff5e5e", - bg = "#121212" }) - no_net_shown = false - end - return gray .. " Net " .. coldef .. "Off " .. coldef - else - no_net_shown = true - return '' + widget:set_markup(markup(gray, header) .. markup(white, vlevel)) end -end, 10) -netwidget:buttons(awful.util.table.join(awful.button({ }, 1, function () awful.util.spawn_with_shell(wifi) end))) +}) --- Weather widget -yawn.register(123456) -- https//github.com/copycat-killer/yawn +-- Weather +yawn = lain.widgets.yawn(123456, +{ + settings = function() + yawn_notification_preset.fg = white + end +}) -- Separators -spr = wibox.widget.textbox(' ') first = wibox.widget.textbox(' ') arrl_pre = wibox.widget.imagebox() arrl_pre:set_image(beautiful.arrl_lr_pre) arrl_post = wibox.widget.imagebox() arrl_post:set_image(beautiful.arrl_lr_post) --- }}} - --- {{{ Layout - -- Create a wibox for each screen and add it mywibox = {} mypromptbox = {} @@ -519,11 +288,11 @@ for s = 1, screen.count() do -- Create a tasklist widget mytasklist[s] = awful.widget.tasklist(s, awful.widget.tasklist.filter.currenttags, mytasklist.buttons) - + -- Create the wibox mywibox[s] = awful.wibox({ position = "top", screen = s, height = 18 }) - -- Widgets that are aligned to the upper left + -- Widgets that are aligned to the left local left_layout = wibox.layout.fixed.horizontal() left_layout:add(first) left_layout:add(mytaglist[s]) @@ -533,22 +302,16 @@ for s = 1, screen.count() do left_layout:add(mypromptbox[s]) left_layout:add(first) - -- Widgets that are aligned to the upper right + -- Widgets that are aligned to the right local right_layout = wibox.layout.fixed.horizontal() if s == 1 then right_layout:add(wibox.widget.systray()) end right_layout:add(first) right_layout:add(mpdwidget) - right_layout:add(mygmail) - --right_layout:add(yawn.icon) - --right_layout:add(yawn.widget) - right_layout:add(fshwidget) + --right_layout:add(mailwidget) + right_layout:add(fshome) right_layout:add(batwidget) - right_layout:add(netwidget) - right_layout:add(spr) right_layout:add(volumewidget) - right_layout:add(spr) right_layout:add(mytextclock) - right_layout:add(spr) -- Now bring it all together (with the tasklist in the middle) local layout = wibox.layout.align.horizontal() @@ -557,48 +320,77 @@ for s = 1, screen.count() do layout:set_right(right_layout) mywibox[s]:set_widget(layout) - end - -- }}} --- {{{ Mouse Bindings - +-- {{{ 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), - -- Capture a screenshot - awful.key({ altkey }, "p", function() awful.util.spawn("screenshot",false) 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), - -- Move clients - --awful.key({ altkey }, "Next", function () awful.client.moveresize( 1, 1, -2, -2) end), - --awful.key({ altkey }, "Prior", function () awful.client.moveresize(-1, -1, 2, 2) end), - --awful.key({ altkey }, "Down", function () awful.client.moveresize( 0, 1, 0, 0) end), - --awful.key({ altkey }, "Up", function () awful.client.moveresize( 0, -1, 0, 0) end), - --awful.key({ altkey }, "Left", function () awful.client.moveresize(-1, 0, 0, 0) end), - --awful.key({ altkey }, "Right", function () awful.client.moveresize( 1, 0, 0, 0) end), - awful.key({ modkey, }, "Left", awful.tag.viewprev ), - awful.key({ modkey, }, "Right", awful.tag.viewnext ), - awful.key({ modkey, }, "Escape", awful.tag.history.restore), - awful.key({ modkey, }, "k", + -- 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), + + -- Dynamic tag renaming + awful.key({ altkey, "Shift" }, "r", + function () + lain.util.prompt_rename_tag(mypromptbox) + 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({ modkey, }, "j", + awful.key({ altkey }, "j", function () awful.client.focus.byidx(-1) if client.focus then client.focus:raise() end end), - awful.key({ modkey, }, "w", function () mymainmenu:show({keygrabber=true}) 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 () @@ -618,74 +410,79 @@ globalkeys = awful.util.table.join( 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), - awful.key({ modkey, }, "l", function () awful.tag.incmwfact( 0.05) end), - awful.key({ modkey, }, "h", function () awful.tag.incmwfact(-0.05) end), - awful.key({ modkey, "Shift" }, "h", function () awful.tag.incnmaster( 1) end), - awful.key({ modkey, "Shift" }, "l", function () awful.tag.incnmaster(-1) end), - awful.key({ modkey, "Control" }, "h", function () awful.tag.incncol( 1) end), - awful.key({ modkey, "Control" }, "l", 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), + awful.key({ modkey, "Control" }, "r", awesome.restart), + awful.key({ modkey, "Shift" }, "q", awesome.quit), -- Dropdown terminal - awful.key({ modkey, }, "z", function () scratch.drop(terminal) end), + awful.key({ modkey, }, "z", function () drop(terminal) end), -- Widgets popups - awful.key({ altkey, }, "c", function () show_calendar(0, 7) end), - awful.key({ altkey, }, "h", function () - vicious.force({ fshwidget }) - show_info(7) - end), - awful.key({ altkey, }, "w", function () yawn.show_weather(7) end), + awful.key({ altkey, }, "c", function () lain.widgets.calendar:show(7) end), + awful.key({ altkey, }, "h", function () fshome.show(7) end), + awful.key({ altkey, }, "w", function () yawn.show(7) end), - -- Volume control - awful.key({ altkey }, "Up", function () - awful.util.spawn("amixer set Master playback 1%+", false ) - vicious.force({ volumewidget }) - end), - awful.key({ altkey }, "Down", function () - awful.util.spawn("amixer set Master playback 1%-", false ) - vicious.force({ volumewidget }) - end), - awful.key({ altkey }, "m", function () - awful.util.spawn("amixer set Master playback toggle", false ) - vicious.force({ volumewidget }) - end), + -- ALSA volume control + awful.key({ altkey }, "Up", + function () + awful.util.spawn("amixer -q set Master 1%+") + volumewidget.update() + end), + awful.key({ altkey }, "Down", + function () + awful.util.spawn("amixer -q set Master 1%-") + volumewidget.update() + end), + awful.key({ altkey }, "m", + function () + awful.util.spawn("amixer -q set Master playback toggle") + volumewidget.update() + end), awful.key({ altkey, "Control" }, "m", - function () - awful.util.spawn("amixer set Master playback 100%", false ) - vicious.force({ volumewidget }) - end), + function () + awful.util.spawn("amixer -q set Master playback 100%") + volumewidget.update() + end), - -- Music control - awful.key({ altkey, "Control" }, "Up", function () - awful.util.spawn_with_shell( "mpc toggle || ncmpcpp toggle || ncmpc toggle || pms toggle", false ) - vicious.force({ mpdwidget } ) - end), - awful.key({ altkey, "Control" }, "Down", function () - awful.util.spawn_with_shell( "mpc stop || ncmpcpp stop || ncmpc stop || pms stop", false ) - vicious.force({ mpdwidget } ) - end ), - awful.key({ altkey, "Control" }, "Left", function () - awful.util.spawn_with_shell( "mpc prev || ncmpcpp prev || ncmpc prev || pms prev", false ) - vicious.force({ mpdwidget } ) - end ), - awful.key({ altkey, "Control" }, "Right", function () - awful.util.spawn_with_shell( "mpc next || ncmpcpp next || ncmpc next || pms next", false ) - vicious.force({ mpdwidget } ) - end ), + -- MPD control + awful.key({ altkey, "Control" }, "Up", + function () + awful.util.spawn_with_shell("mpc toggle || ncmpcpp toggle || ncmpc toggle || pms toggle") + mpdwidget.update() + end), + awful.key({ altkey, "Control" }, "Down", + function () + awful.util.spawn_with_shell("mpc stop || ncmpcpp stop || ncmpc stop || pms stop") + mpdwidget.update() + end), + awful.key({ altkey, "Control" }, "Left", + function () + awful.util.spawn_with_shell("mpc prev || ncmpcpp prev || ncmpc prev || pms prev") + mpdwidget.update() + end), + awful.key({ altkey, "Control" }, "Right", + function () + awful.util.spawn_with_shell("mpc next || ncmpcpp 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), @@ -720,41 +517,39 @@ clientkeys = awful.util.table.join( end) ) --- Compute the maximum number of digit we need, limited to 9 -keynumber = 0 -for s = 1, screen.count() do - keynumber = math.min(9, math.max(#tags[s], keynumber)); -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, keynumber do +for i = 1, 9 do globalkeys = awful.util.table.join(globalkeys, awful.key({ modkey }, "#" .. i + 9, function () - screen = mouse.screen - if tags[screen][i] then - awful.tag.viewonly(tags[screen][i]) + 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 () - screen = mouse.screen - if tags[screen][i] then - awful.tag.viewtoggle(tags[screen][i]) + 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 () - if client.focus and tags[client.focus.screen][i] then - awful.client.movetotag(tags[client.focus.screen][i]) - end + 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 () - if client.focus and tags[client.focus.screen][i] then - awful.client.toggletag(tags[client.focus.screen][i]) + local tag = awful.tag.gettags(client.focus.screen)[i] + if client.focus and tag then + awful.client.toggletag(tag) end end)) end @@ -766,50 +561,43 @@ clientbuttons = awful.util.table.join( -- 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 - } - }, - + -- 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 } }, + properties = { opacity = 0.99 } }, { rule = { class = "MPlayer" }, - properties = { floating = true } }, + 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] } }, + properties = { tag = tags[1][4] } }, { rule = { class = "Gimp", role = "gimp-image-window" }, properties = { maximized_horizontal = true, maximized_vertical = true } }, - - { rule = { class = "Transmission-gtk" }, - properties = { tag = tags[1][5] } }, - - { rule = { class = "Torrent-search" }, - properties = { tag = tags[1][5] } }, } - -- }}} -- {{{ Signals - -- Signal function to execute when a new client appears. client.connect_signal("manage", function (c, startup) -- Enable sloppy focus @@ -820,16 +608,10 @@ client.connect_signal("manage", function (c, startup) end end) - if not startup then - -- Set the windows at the slave, - -- i.e. put it at the end of others instead of setting it master. - awful.client.setslave(c) - - -- Put windows in a smart way, only if they does not set an initial position. - if 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 + 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 = true @@ -848,37 +630,53 @@ client.connect_signal("manage", function (c, startup) end) ) - -- Widgets that are aligned to the left - local left_layout = wibox.layout.fixed.horizontal() - --left_layout:add(awful.titlebar.widget.iconwidget(c)) - left_layout:buttons(buttons) - - -- 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 + -- Title 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_left(left_layout) - layout:set_right(right_layout) layout:set_middle(middle_layout) awful.titlebar(c,{size=18}):set_widget(layout) end end) -client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus 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_width = "0" + c.border_color = beautiful.border_normal + else + c.border_width = beautiful.border_width + 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 + if awful.client.floating.get(c) or layout == "floating" then + c.border_width = beautiful.border_width + + -- No borders with only one visible client + elseif #clients == 1 or layout == "max" then + clients[1].border_width = 0 + awful.client.moveresize(0, 0, 2, 2, clients[1]) + else + c.border_width = beautiful.border_width + end + end + end + end) +end -- }}} diff --git a/rc.lua.holo b/rc.lua.holo index bec36a9..1827808 100755 --- a/rc.lua.holo +++ b/rc.lua.holo @@ -1,28 +1,44 @@ ---[[ ]]-- --- - --- Holo Awesome WM 3.5.+ config -- --- github.com/copycat-killer -- --- - ---[[ ]]-- - - --- {{{ Required Libraries +--[[ + + Holo Awesome WM config 2.0 + github.com/copycat-killer + +--]] +-- {{{ Required libraries local gears = require("gears") local awful = require("awful") awful.rules = require("awful.rules") -awful.autofocus = require("awful.autofocus") +require("awful.autofocus") local wibox = require("wibox") local beautiful = require("beautiful") local naughty = require("naughty") -local vicious = require("vicious") -local scratch = require("scratch") -local yawn = require("yawn") +local drop = require("scratch.drop") +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(" ") @@ -33,251 +49,117 @@ function run_once(cmd) end run_once("urxvtd") -run_once("unclutter -idle 10") +run_once("unclutter") run_once("compton") - -- }}} --- {{{ Localization +-- {{{ Variable definitions +-- localization +--os.setlocale(os.getenv("LANG")) -os.setlocale(os.getenv("LANG")) +-- home path +homedir = os.getenv("HOME") .. "/.config/awesome/" --- }}} +-- beautiful init +confdir = homedir .. "themes/holo/" +beautiful.init(confdir .. "theme.lua") --- {{{ Error Handling - --- Check if awesome encountered an error during startup and fell back to --- another config (This code will only ever execute for the fallback config) -if awesome.startup_errors then - naughty.notify({ preset = naughty.config.presets.critical, - title = "Oops, there were errors during startup!", - text = awesome.startup_errors }) -end - --- Handle runtime errors after startup -do - local in_error = false - awesome.connect_signal("debug::error", function (err) - -- Make sure we don't go into an endless error loop - if in_error then return end - in_error = true - - naughty.notify({ preset = naughty.config.presets.critical, - title = "Oops, an error happened!", - text = err }) - local in_error = false - end) -end - --- }}} - --- {{{ Global variables - -home = os.getenv("HOME") -confdir = home .. "/.config/awesome" -scriptdir = confdir .. "/scripts/" -themes = confdir .. "/themes" -active_theme = themes .. "/holo" -language = string.gsub(os.getenv("LANG"), ".utf8", "") - -beautiful.init(active_theme .. "/theme.lua") - -terminal = "urxvtc" -editor = os.getenv("EDITOR") +-- common +modkey = "Mod4" +altkey = "Mod1" +terminal = "urxvtc" or "xterm" +editor = os.getenv("EDITOR") or "nano" or "vi" editor_cmd = terminal .. " -e " .. editor + +-- user defined +browser = "dwb" +browser2 = "iron" gui_editor = "gvim" -browser = "dwb" -mail = terminal .. " -e mutt " -wifi = terminal .. " -e sudo wifi-menu " -musicplr = terminal .. " -g 130x34-320+16 -e ncmpcpp " +graphics = "gimp" +musicplr = terminal .. " -e ncmpcpp " -modkey = "Mod4" -altkey = "Mod1" - -layouts = -{ - awful.layout.suit.floating, -- 1 - awful.layout.suit.tile, -- 2 - awful.layout.suit.fair, -- 3 - awful.layout.suit.tile.left, -- 4 - awful.layout.suit.tile.top, -- 5 +local layouts = { + awful.layout.suit.floating, + lain.layout.uselesstile, + awful.layout.suit.fair, + lain.layout.uselesstile.left, + lain.layout.uselesstile.top } +-- }}} +-- {{{ Tags +tags = { + names = { " WEB ", " TERMINAL ", " FILES ", " OTHER " }, + layout = { layouts[1], layouts[3], layouts[2], layouts[4] } +} +for s = 1, screen.count() do + 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 - -- }}} --- {{{ Tags - -tags = { - names = { " WEB ", " TERMINAL ", " FILES ", " OTHER " }, - layout = { layouts[1], layouts[3], layouts[2], layouts[4] } - } -for s = 1, screen.count() do - tags[s] = awful.tag(tags.names, s, tags.layout) -end - --- }}} - --- {{{ Freedesktop menu - +-- {{{ Menu require("freedesktop/freedesktop") - -- }}} -- {{{ Wibox +markup = lain.util.markup +blue = "#80CCE6" +space3 = markup.font("Tamsyn 3", " ") +space2 = markup.font("Tamsyn 2", " ") -local util = awful.util - --- Colours -coldef = "" -white = "" -blue = "" -space = " " - --- Menu widget +-- Menu icon awesome_icon = wibox.widget.imagebox() awesome_icon:set_image(beautiful.awesome_icon) -awesome_icon:buttons(util.table.join( awful.button({ }, 1, function() mymainmenu:toggle() end))) +awesome_icon:buttons(awful.util.table.join( awful.button({ }, 1, function() mymainmenu:toggle() end))) --- Clock widget -mytextclock = awful.widget.textclock(white .. space .. "%H:%M " .. coldef) +-- Clock +mytextclock = awful.widget.textclock(markup("#FFFFFF", space3 .. "%H:%M" .. space2)) clock_icon = wibox.widget.imagebox() clock_icon:set_image(beautiful.clock) clockwidget = wibox.widget.background() clockwidget:set_widget(mytextclock) clockwidget:set_bgimage(beautiful.widget_bg) --- Calendar widget -mytextcalendar = awful.widget.textclock(white .. space .. "%A %d %B " .. coldef) +-- Calendar +mytextcalendar = awful.widget.textclock(markup("#FFFFFF", space3 .. "%d %b ")) calendar_icon = wibox.widget.imagebox() calendar_icon:set_image(beautiful.calendar) calendarwidget = wibox.widget.background() calendarwidget:set_widget(mytextcalendar) calendarwidget:set_bgimage(beautiful.widget_bg) +lain.widgets.calendar:attach(calendarwidget, { fg = "#FFFFFF", position = "bottom_right" }) --- Calendar notification -local tonumber = tonumber -local calendar = nil -local offset = 0 +--[[ Mail IMAP check +-- commented because it needs to be set before use +mailwidget = lain.widgets.imap({ + timeout = 180, + server = "server", + mail = "mail", + password = "keyring get mail", + settings = function() + mail_notification_preset.fg = white + mail = "" + count = "" -function remove_calendar() - if calendar ~= nil then - naughty.destroy(calendar) - calendar = nil - end -end + if mailcount > 0 then + mail = "Arch " + count = mailcount .. " " + end -function show_calendar(inc_offset, t_out) - remove_calendar() - local f, c_text - local today = tonumber(os.date('%d')) - - if inc_offset == 0 then - if today < 10 then - f = io.popen('/usr/bin/cal | sed -r -e "s/(^| )( ' .. today .. ')($| )/\\1\\2<\\/span><\\/b>\\3/"',"r") - else - f = io.popen('/usr/bin/cal | sed -r -e "s/(^| )(' .. today .. ')($| )/\\1\\2<\\/span><\\/b>\\3/"',"r") - end - c_text = "" .. f:read() .. "\n\n" .. f:read() .. "\n" .. f:read("*all") .. "" - f:close() - offset = 0 - else - local month = tonumber(os.date('%m')) - local year = tonumber(os.date('%Y')) - - offset = offset + inc_offset - month = month + offset - - if month > 12 then - month = 12 - offset = 12 - tonumber(os.date('%m')) - elseif month < 1 then - month = 1 - offset = 1 - tonumber(os.date('%m')) - end - - f = io.popen('/usr/bin/cal ' .. month .. ' ' .. year ,"r") - c_text = "" .. f:read() .. "\n\n" .. f:read() .. "\n" .. f:read("*all") .. "" - f:close() - end - - calendar = naughty.notify({ text = c_text, - position = "bottom_right", - fg = beautiful.fg_normal, - bg = beautiful.bg_normal, - timeout = t_out - }) -end - -calendarwidget:connect_signal("mouse::enter", function() show_calendar(0, 0) end) -calendarwidget:connect_signal("mouse::leave", function() remove_calendar() end) -calendarwidget:buttons(util.table.join( awful.button({ }, 1, function() show_calendar(-1, 0) end), - awful.button({ }, 3, function() show_calendar(1, 0) end))) - --- GMail widget -mygmail = wibox.widget.textbox() -gmail_t = awful.tooltip({ objects = { mygmail },}) -notify_shown = false -mailcount = 0 -vicious.register(mygmail, vicious.widgets.gmail, - function (widget, args) - gmail_t:set_text(args["{subject}"]) - gmail_t:add_to_object(mygmail) - notify_title = "" - notify_text = "" - mailcount = args["{count}"] - if (args["{count}"] > 0 ) then - if (notify_shown == false) then - -- Italian localization - -- can be a stub for your own localization - if (args["{count}"] == 1) then - if language:find("it_IT") ~= nil - then - notify_title = "Hai un nuovo messaggio" - else - notify_title = "You got a new mail" - end - notify_text = '"' .. args["{subject}"] .. '"' - else - if language:find("it_IT") ~= nil - then - notify_title = "Hai " .. args["{count}"] .. " nuovi messaggi" - notify_text = 'Ultimo: "' .. args["{subject}"] .. '"' - else - notify_title = "You got " .. args["{count}"] .. " new mails" - notify_text = 'Last one: "' .. args["{subject}"] .. '"' - end - end - naughty.notify({ - title = notify_title, - text = notify_text, - timeout = 7, - position = "top_left", - icon = beautiful.widget_mail_notify, - fg = fg_normal, - bg = bg_normal - }) - notify_shown = true + widget:set_markup(markup(gray, mail) .. markup(white, count)) end - return white .. " Mail " .. coldef .. blue .. args["{count}"] .. " " .. coldef - else - notify_shown = false - return '' - end -end, 60) -mygmail:buttons(awful.util.table.join(awful.button({ }, 1, function () awful.util.spawn(mail, false) end))) +}) +]] --- Mpd widget -mpdwidget = wibox.widget.textbox() +-- MPD mpd_icon = wibox.widget.imagebox() mpd_icon:set_image(beautiful.mpd) prev_icon = wibox.widget.imagebox() @@ -290,342 +172,126 @@ pause_icon = wibox.widget.imagebox() pause_icon:set_image(beautiful.pause) play_pause_icon = wibox.widget.imagebox() play_pause_icon:set_image(beautiful.play) -curr_track = nil -vicious.register(mpdwidget, vicious.widgets.mpd, -function(widget, args) - if args["{state}"] == "Play" then - if args["{Title}"] ~= curr_track - then - curr_track = args["{Title}"] - os.execute(scriptdir .. "mpdinfo") - old_id = naughty.notify({ - title = "Now playing", - text = args["{Artist}"] .. " (" .. args["{Album}"] .. ")\n" .. args["{Title}"], - icon = "/tmp/mpdnotify_cover.png", - fg = beautiful.fg_normal, - bg = beautiful.bg_normal, - timeout = 5, - replaces_id = old_id - }).id - end - mpd_icon:set_image(beautiful.mpd_on) - play_pause_icon:set_image(beautiful.pause) - return blue .. " " .. args["{Title}"] .. coldef .. white .. " " .. args["{Artist}"] .. coldef .. " " - elseif args["{state}"] == "Pause" then - mpd_icon:set_image(beautiful.mpd) - play_pause_icon:set_image(beautiful.play) - -- Italian localization - -- can be a stub for your own localization - if language:find("it_IT") ~= nil then - return blue .. " mpd " .. coldef .. white .. "in pausa " .. coldef - else - return blue .. " mpd " .. coldef .. white .. "paused " .. coldef +mpdwidget = lain.widgets.mpd({ + settings = function () + if mpd_now.state == "play" then + mpd_now.artist = mpd_now.artist:gsub('"', '"'):upper() + mpd_now.title = mpd_now.title:gsub('"', '"'):upper() + widget:set_markup(markup.font("Tamsyn 4", " ") + .. markup.font("Tamsyn 8", mpd_now.artist .. + " - " .. + mpd_now.title) + .. markup.font("Tamsyn 10", " ")) + play_pause_icon:set_image(beautiful.pause) + elseif mpd_now.state == "pause" then + widget:set_markup(markup.font("Tamsyn 4", " ") .. + markup.font("Tamsyn 8", "MPD PAUSED") .. + markup.font("Tamsyn 10", " ")) + play_pause_icon:set_image(beautiful.play) + else + widget:set_text("") + play_pause_icon:set_image(beautiful.play) + end end - else - mpd_icon:set_image(beautiful.mpd) - curr_track = nil - return " " - end -end, 1) +}) musicwidget = wibox.widget.background() musicwidget:set_widget(mpdwidget) musicwidget:set_bgimage(beautiful.widget_bg) -musicwidget:buttons(awful.util.table.join(awful.button({ }, 1, function () awful.util.spawn_with_shell(musicplr) end))) -mpd_icon:buttons(awful.util.table.join(awful.button({ }, 1, function () awful.util.spawn_with_shell(musicplr) end))) -prev_icon:buttons(awful.util.table.join(awful.button({}, 1, function () - awful.util.spawn_with_shell( "mpc prev || ncmpcpp prev || ncmpc prev || pms prev", false ) - vicious.force({ mpdwidget } ) - end))) -next_icon:buttons(awful.util.table.join(awful.button({}, 1, function () - awful.util.spawn_with_shell( "mpc next || ncmpcpp next || ncmpc next || pms next", false ) - vicious.force({ mpdwidget } ) - end))) -stop_icon:buttons(awful.util.table.join(awful.button({}, 1, function () - play_pause_icon:set_image(beautiful.play) - awful.util.spawn_with_shell( "mpc stop || ncmpcpp stop || ncmpc stop || pms stop", false ) - vicious.force({ mpdwidget } ) - end))) -play_pause_icon:buttons(awful.util.table.join(awful.button({}, 1, function () - awful.util.spawn_with_shell( "mpc toggle || ncmpcpp toggle || ncmpc toggle || pms toggle", false ) - vicious.force({ mpdwidget } ) - end))) --- /home fs widget -fshwidget = wibox.widget.textbox() -too_much = false -vicious.register(fshwidget, vicious.widgets.fs, -function (widget, args) - if ( args["{/home used_p}"] >= 90 ) then - if ( args["{/home used_p}"] >= 99 and too_much == false ) then - naughty.notify({ title = "warning", text = "/home partition ran out!\nmake some room", - timeout = 7, - position = "top_right", - fg = beautiful.fg_urgent, - bg = beautiful.bg_urgent }) - too_much = true - end - return white .. " Hdd " .. coldef .. blue .. args["{/home used_p}"] .. coldef .. " " - else - return "" - end -end, 600) +musicwidget:buttons(awful.util.table.join(awful.button({ }, 1, +function () awful.util.spawn_with_shell(musicplr) end))) +mpd_icon:buttons(awful.util.table.join(awful.button({ }, 1, +function () awful.util.spawn_with_shell(musicplr) end))) +prev_icon:buttons(awful.util.table.join(awful.button({}, 1, +function () + awful.util.spawn_with_shell("mpc prev || ncmpcpp prev || ncmpc prev || pms prev") + mpdwidget.notify() +end))) +next_icon:buttons(awful.util.table.join(awful.button({}, 1, +function () + awful.util.spawn_with_shell("mpc next || ncmpcpp next || ncmpc next || pms next") + mpdwidget.notify() +end))) +stop_icon:buttons(awful.util.table.join(awful.button({}, 1, +function () + play_pause_icon:set_image(beautiful.play) + awful.util.spawn_with_shell("mpc stop || ncmpcpp stop || ncmpc stop || pms stop") + mpdwidget.notify() +end))) +play_pause_icon:buttons(awful.util.table.join(awful.button({}, 1, +function () + awful.util.spawn_with_shell("mpc toggle || ncmpcpp toggle || ncmpc toggle || pms toggle") + mpdwidget.notify() +end))) --- hhd status notification -local infos = nil +-- Battery +batwidget = lain.widgets.bat({ + settings = function() + bat_header = " Bat " + bat_p = bat_now.perc .. " " -function remove_info() - if infos ~= nil then - naughty.destroy(infos) - infos = nil + if bat_now.status == "Not present" then + bat_header = "" + bat_p = "" + end + + widget:set_markup(markup(blue, bat_header) .. bat_p) end -end +}) -function show_info(t_out) - remove_info() - local capi = { - mouse = mouse, - screen = screen - } - local hdd = awful.util.pread(scriptdir .. "dfs") - hdd = string.gsub(hdd, " ^%s*(.-)%s*$", "%1") - - -- Italian localization - -- can be a stub for your own localization - if language:find("it_IT") ~= nil - then - hdd = string.gsub(hdd, "Used ", "Usato") - hdd = string.gsub(hdd, "Free ", "Libero") - hdd = string.gsub(hdd, "Total ", "Totale") - end - - infos = naughty.notify({ - text = hdd, - timeout = t_out, - position = "top_right", - margin = 10, - height = 210, - width = 680, - fg = beautiful.fg_normal, - bg = beautiful.bg_normal, - screen = capi.mouse.screen - }) -end - -fshwidget:connect_signal('mouse::enter', function () show_info(0) end) -fshwidget:connect_signal('mouse::leave', function () remove_info() end) - --- Battery widget -batwidget = wibox.widget.textbox() -function batstate() - - local file = io.open("/sys/class/power_supply/BAT0/status", "r") - - if (file == nil) then - return "Cable plugged" - end - - local batstate = file:read("*line") - file:close() - - if (batstate == 'Discharging' or batstate == 'Charging') then - return batstate - else - return "Fully charged" - end -end -vicious.register(batwidget, vicious.widgets.bat, -function (widget, args) - -- plugged - if (batstate() == 'Cable plugged' or batstate() == 'Unknown') then - return '' - -- critical - elseif (args[2] <= 5 and batstate() == 'Discharging') then - naughty.notify{ - text = "Shutdown imminent...", - title = "Battery almost off!", - position = "top_right", - timeout = 0, - fg="#000000", - bg="#ffffff", - screen = 1, - ontop = true, +-- ALSA volume bar +myvolumebar = lain.widgets.alsabar({ + width = 80, + height = 10, + colors = { + background = "#383838", + unmute = "#80CCE6", + mute = "#FF9F9F" + }, + notifications = { + font = "Tamsyn", + font_size = "12", + bar_size = 32 } - -- low - elseif (args[2] <= 10 and batstate() == 'Discharging') then - naughty.notify({ - text = "Plug the cable!", - title = "Low battery", - position = "top_right", - timeout = 0, - fg="#ffffff", - bg="#262729", - screen = 1, - ontop = true, - }) - end - return blue .. "Bat " .. coldef .. white .. args[2] .. " " .. coldef -end, 1, 'BAT0') - --- {{{ Volume widget --- --- original version: http://awesome.naquadah.org/wiki/Rman%27s_Simple_Volume_Widget - -local alsawidget = -{ - channel = "Master", - step = "5%", - colors = - { - unmute = "#80CCE6", - mute = "#FF9F9F" - }, - mixer = terminal .. " -e alsamixer", -- or whatever your preferred sound mixer is - notifications = - { - font = "Tamsyn 12", - bar_size = 32 - } -} - -alsawidget.bar = awful.widget.progressbar () -alsawidget.bar:set_width (80) -alsawidget.bar:set_height (10) -awful.widget.progressbar.set_ticks (alsawidget.bar, true) -alsamargin = wibox.layout.margin (alsawidget.bar, 5, 8, 80) -wibox.layout.margin.set_top (alsamargin, 12) -wibox.layout.margin.set_bottom (alsamargin, 12) +}) +alsamargin = wibox.layout.margin(myvolumebar.bar, 5, 8, 80) +wibox.layout.margin.set_top(alsamargin, 12) +wibox.layout.margin.set_bottom(alsamargin, 12) volumewidget = wibox.widget.background() volumewidget:set_widget(alsamargin) volumewidget:set_bgimage(beautiful.widget_bg) - -alsawidget.bar:set_background_color ("#595959") -alsawidget.bar:set_color (alsawidget.colors.unmute) -alsawidget.bar:buttons (awful.util.table.join ( - awful.button ({}, 1, function() - awful.util.spawn (alsawidget.mixer) - end), - awful.button ({}, 3, function() - awful.util.spawn ("amixer sset " .. alsawidget.channel .. " toggle") - vicious.force ({ alsawidget.bar }) - end), - awful.button ({}, 4, function() - awful.util.spawn ("amixer sset " .. alsawidget.channel .. " " .. alsawidget.step .. "+") - vicious.force ({ alsawidget.bar }) - end), - awful.button ({}, 5, function() - awful.util.spawn ("amixer sset " .. alsawidget.channel .. " " .. alsawidget.step .. "-") - vicious.force ({ alsawidget.bar }) - end) -)) - --- tooltip -alsawidget.tooltip = awful.tooltip ({ objects = { alsawidget.bar } }) - --- naughty notifications -alsawidget._current_level = 0 -alsawidget._muted = false - -function alsawidget:notify () - local preset = - { - -- title = "", text = "", - timeout = 3, - height = 40, - width = 285, - font = alsawidget.notifications.font, - fg = "#EEE5E5", - bg = "#222222" - } - - if alsawidget._muted - then - preset.title = alsawidget.channel .. " - Muted" - else - preset.title = alsawidget.channel .. " - " .. alsawidget._current_level .. "%" - end - - local int = math.modf (alsawidget._current_level / 100 * alsawidget.notifications.bar_size) - preset.text = "[" .. string.rep ("|", int) .. string.rep (" ", alsawidget.notifications.bar_size - int) .. "]" - - if alsawidget._notify ~= nil - then - alsawidget._notify = naughty.notify ( - { - replaces_id = alsawidget._notify.id, - preset = preset - }) - else - alsawidget._notify = naughty.notify ({ preset = preset }) - end -end - --- register the widget through vicious -vicious.register (alsawidget.bar, vicious.widgets.volume, function (widget, args) - alsawidget._current_level = args[1] - if args[2] ~= "♩" - then - alsawidget._muted = false - alsawidget.tooltip:set_text (" " .. alsawidget.channel .. ": " .. args[1] .. "% ") - widget:set_color (alsawidget.colors.unmute) - else - alsawidget._muted = true - alsawidget.tooltip:set_text (" [Muted] ") - widget:set_color (alsawidget.colors.mute) - end - return args[1] -end, 5, alsawidget.channel) -- relatively high update time, use of keys/mouse will force update - --- }}} - --- CPU widget -cpu_widget = wibox.widget.textbox() -vicious.register(cpu_widget, vicious.widgets.cpu, white .. space .. "CPU $1% " .. coldef, 3) +-- CPU +cpu_widget = lain.widgets.cpu({ + settings = function() + widget:set_markup(space3 .. "CPU " .. cpu_now.usage + .. "%" .. markup.font("Tamsyn 5", " ")) + end +}) cpuwidget = wibox.widget.background() cpuwidget:set_widget(cpu_widget) cpuwidget:set_bgimage(beautiful.widget_bg) cpu_icon = wibox.widget.imagebox() cpu_icon:set_image(beautiful.cpu) --- Wifi widget +-- Net netdown_icon = wibox.widget.imagebox() netdown_icon:set_image(beautiful.net_down) netup_icon = wibox.widget.imagebox() netup_icon:set_image(beautiful.net_up) -no_net_shown = true -netwidget = wibox.widget.textbox() -vicious.register(netwidget, vicious.widgets.net, -function (widget, args) - if args["{wlp3s0 carrier}"] == 0 then - if no_net_shown == true then - naughty.notify({ title = "wlan0", text = "No carrier", - timeout = 7, - position = "top_left", - icon = beautiful.widget_no_net_notify, - fg = "#FF1919", - bg = beautiful.bg_normal }) - no_net_shown = false - netdown_icon:set_image() - netup_icon:set_image() - end - return white .. " Net " .. coldef .. "Off " .. coldef - else - if no_net_shown ~= true then - netdown_icon:set_image(beautiful.net_down) - netup_icon:set_image(beautiful.net_up) - no_net_shown = true - end - return white .. " " .. args["{wlp3s0 down_kb}"] .. " - " .. args["{wlp3s0 up_kb}"] .. " " .. coldef +netwidget = lain.widgets.net({ + settings = function() + widget:set_markup(markup.font("Tamsyn 1", " ") .. net_now.received .. " - " + .. net_now.sent .. space2) end -end, 3) +}) networkwidget = wibox.widget.background() networkwidget:set_widget(netwidget) networkwidget:set_bgimage(beautiful.widget_bg) -networkwidget:buttons(awful.util.table.join(awful.button({ }, 1, function () awful.util.spawn_with_shell(wifi) end))) --- Weather widget -yawn.register(123456) -- https//github.com/copycat-killer/yawn +-- Weather +yawn = lain.widgets.yawn(123456) -- Separators first = wibox.widget.textbox(' ') @@ -648,10 +314,6 @@ bar:set_image(beautiful.bar) bottom_bar = wibox.widget.imagebox() bottom_bar:set_image(beautiful.bottom_bar) --- }}} - --- {{{ Layout - -- Create a wibox for each screen and add it mywibox = {} mybottomwibox = {} @@ -717,7 +379,7 @@ for s = 1, screen.count() do -- Create a tasklist widget mytasklist[s] = awful.widget.tasklist(s, awful.widget.tasklist.filter.currenttags, mytasklist.buttons) - + -- Create the wibox mywibox[s] = awful.wibox({ position = "top", screen = s, height = 32 }) @@ -731,8 +393,7 @@ for s = 1, screen.count() do -- 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(mygmail) - right_layout:add(fshwidget) + --right_layout:add(mailwidget) right_layout:add(batwidget) right_layout:add(spr_right) right_layout:add(prev_icon) @@ -756,11 +417,11 @@ for s = 1, screen.count() do -- Create the bottom wibox mybottomwibox[s] = awful.wibox({ position = "bottom", screen = s, border_width = 0, height = 32 }) - + -- Widgets that are aligned to the bottom left bottom_left_layout = wibox.layout.fixed.horizontal() bottom_left_layout:add(awesome_icon) - + -- Widgets that are aligned to the bottom right bottom_right_layout = wibox.layout.fixed.horizontal() bottom_right_layout:add(spr_bottom_right) @@ -777,7 +438,7 @@ for s = 1, screen.count() do bottom_right_layout:add(clock_icon) bottom_right_layout:add(clockwidget) bottom_right_layout:add(last) - + -- Now bring it all together (with the tasklist in the middle) bottom_layout = wibox.layout.align.horizontal() bottom_layout:set_left(bottom_left_layout) @@ -788,48 +449,81 @@ for s = 1, screen.count() do -- Set proper backgrounds, instead of beautiful.bg_normal mywibox[s]:set_bg(beautiful.topbar_path .. screen[1].workarea.width .. ".png") mybottomwibox[s]:set_bg("#242424") -end + -- Create a borderbox above the bottomwibox + awful.screen.padding(screen[s], { bottom = 1 }) + lain.widgets.borderbox(mybottomwibox[s], s, { position = "above", color = "#0099CC" } ) +end -- }}} --- {{{ Mouse Bindings - +-- {{{ 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), - -- Capture a screenshot - awful.key({ altkey }, "p", function() awful.util.spawn("screenshot", false) 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), - -- Move clients - --awful.key({ altkey }, "Next", function () awful.client.moveresize( 1, 1, -2, -2) end), - --awful.key({ altkey }, "Prior", function () awful.client.moveresize(-1, -1, 2, 2) end), - --awful.key({ altkey }, "Down", function () awful.client.moveresize( 0, 1, 0, 0) end), - --awful.key({ altkey }, "Up", function () awful.client.moveresize( 0, -1, 0, 0) end), - --awful.key({ altkey }, "Left", function () awful.client.moveresize(-1, 0, 0, 0) end), - --awful.key({ altkey }, "Right", function () awful.client.moveresize( 1, 0, 0, 0) end), - awful.key({ modkey, }, "Left", awful.tag.viewprev ), - awful.key({ modkey, }, "Right", awful.tag.viewnext ), - awful.key({ modkey, }, "Escape", awful.tag.history.restore), - awful.key({ modkey, }, "k", + -- 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), + + -- Dynamic tag renaming + awful.key({ altkey, "Shift" }, "r", + function () + lain.util.prompt_rename_tag(mypromptbox) + 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({ modkey, }, "j", + awful.key({ altkey }, "j", function () awful.client.focus.byidx(-1) if client.focus then client.focus:raise() end end), - awful.key({ modkey, }, "w", function () mymainmenu:show({keygrabber=true}) 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 () @@ -850,81 +544,80 @@ globalkeys = awful.util.table.join( 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), - awful.key({ modkey, }, "l", function () awful.tag.incmwfact( 0.05) end), - awful.key({ modkey, }, "h", function () awful.tag.incmwfact(-0.05) end), - awful.key({ modkey, "Shift" }, "h", function () awful.tag.incnmaster( 1) end), - awful.key({ modkey, "Shift" }, "l", function () awful.tag.incnmaster(-1) end), - awful.key({ modkey, "Control" }, "h", function () awful.tag.incncol( 1) end), - awful.key({ modkey, "Control" }, "l", 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), -- Dropdown terminal - awful.key({ modkey, }, "z", function () scratch.drop(terminal) end), + awful.key({ modkey, }, "z", function () drop(terminal) end), -- Widgets popups - awful.key({ altkey, }, "c", function () show_calendar(0, 7) end), - awful.key({ altkey, }, "h", function () - vicious.force({ fshwidget }) - show_info(7) - end), - awful.key({ altkey, }, "w", function () yawn.show_weather(5) end), + awful.key({ altkey, }, "c", function () lain.widgets.calendar:show(7) end), + awful.key({ altkey, }, "w", function () yawn.show(7) end), - -- Volume control - awful.key({ altkey }, "Up", function () - awful.util.spawn("amixer sset " .. alsawidget.channel .. " " .. alsawidget.step .. "+") - vicious.force({ alsawidget.bar }) - alsawidget.notify() - end), - awful.key({ altkey }, "Down", function () - awful.util.spawn("amixer sset " .. alsawidget.channel .. " " .. alsawidget.step .. "-") - vicious.force({ alsawidget.bar }) - alsawidget.notify() - end), - awful.key({ altkey }, "m", function () - awful.util.spawn("amixer set Master playback toggle") - vicious.force({ alsawidget.bar }) - --alsawidget._muted = not alsawidget._muted - alsawidget.notify() - end), - awful.key({ altkey, "Control" }, "m", function () - awful.util.spawn("amixer set Master playback 100%", false ) - vicious.force({ alsawidget.bar }) - alsawidget.notify() - end), + -- ALSA volume control + awful.key({ altkey }, "Up", + function () + awful.util.spawn("amixer -q set " .. myvolumebar.channel .. " " .. myvolumebar.step .. "+") + myvolumebar.notify() + end), + awful.key({ altkey }, "Down", + function () + awful.util.spawn("amixer -q set " .. myvolumebar.channel .. " " .. myvolumebar.step .. "-") + myvolumebar.notify() + end), + awful.key({ altkey }, "m", + function () + awful.util.spawn("amixer -q set " .. myvolumebar.channel .. " playback toggle") + myvolumebar.notify() + end), + awful.key({ altkey, "Control" }, "m", + function () + awful.util.spawn("amixer -q set " .. myvolumebar.channel .. " playback 100%") + myvolumebar.notify() + end), - -- Music control - awful.key({ altkey, "Control" }, "Up", function () - awful.util.spawn( "mpc toggle", false ) - vicious.force({ mpdwidget } ) - end), - awful.key({ altkey, "Control" }, "Down", function () - play_pause_icon:set_image(beautiful.play) - awful.util.spawn( "mpc stop", false ) - vicious.force({ mpdwidget } ) - end ), - awful.key({ altkey, "Control" }, "Left", function () - awful.util.spawn( "mpc prev", false ) - vicious.force({ mpdwidget } ) - end ), - awful.key({ altkey, "Control" }, "Right", function () - awful.util.spawn( "mpc next", false ) - vicious.force({ mpdwidget } ) - end ), + -- MPD control + awful.key({ altkey, "Control" }, "Up", + function () + awful.util.spawn_with_shell("mpc toggle || ncmpcpp toggle || ncmpc toggle || pms toggle") + mpdwidget.update() + end), + awful.key({ altkey, "Control" }, "Down", + function () + awful.util.spawn_with_shell("mpc stop || ncmpcpp stop || ncmpc stop || pms stop") + mpdwidget.update() + end), + awful.key({ altkey, "Control" }, "Left", + function () + awful.util.spawn_with_shell("mpc prev || ncmpcpp prev || ncmpc prev || pms prev") + mpdwidget.update() + end), + awful.key({ altkey, "Control" }, "Right", + function () + awful.util.spawn_with_shell("mpc next || ncmpcpp 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( "dwb", false ) end), - awful.key({ modkey }, "g", function () awful.util.spawn( "gimp", false ) end), + 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), @@ -957,41 +650,39 @@ clientkeys = awful.util.table.join( end) ) --- Compute the maximum number of digit we need, limited to 9 -keynumber = 0 -for s = 1, screen.count() do - keynumber = math.min(9, math.max(#tags[s], keynumber)); -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, keynumber do +for i = 1, 9 do globalkeys = awful.util.table.join(globalkeys, awful.key({ modkey }, "#" .. i + 9, function () - screen = mouse.screen - if tags[screen][i] then - awful.tag.viewonly(tags[screen][i]) + 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 () - screen = mouse.screen - if tags[screen][i] then - awful.tag.viewtoggle(tags[screen][i]) + 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 () - if client.focus and tags[client.focus.screen][i] then - awful.client.movetotag(tags[client.focus.screen][i]) - end + 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 () - if client.focus and tags[client.focus.screen][i] then - awful.client.toggletag(tags[client.focus.screen][i]) + local tag = awful.tag.gettags(client.focus.screen)[i] + if client.focus and tag then + awful.client.toggletag(tag) end end)) end @@ -1003,50 +694,43 @@ clientbuttons = awful.util.table.join( -- 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 - } - }, - + -- 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 } }, + properties = { opacity = 0.99 } }, { rule = { class = "MPlayer" }, - properties = { floating = true } }, + 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] } }, + properties = { tag = tags[1][4] } }, { rule = { class = "Gimp", role = "gimp-image-window" }, properties = { maximized_horizontal = true, maximized_vertical = true } }, - - { rule = { class = "Transmission-gtk" }, - properties = { tag = tags[1][4] } }, - - { rule = { class = "Torrent-search" }, - properties = { tag = tags[1][4] } }, } - -- }}} -- {{{ Signals - -- Signal function to execute when a new client appears. client.connect_signal("manage", function (c, startup) -- Enable sloppy focus @@ -1057,61 +741,10 @@ client.connect_signal("manage", function (c, startup) end end) - if not startup then - -- Set the windows at the slave, - -- i.e. put it at the end of others instead of setting it master. - -- awful.client.setslave(c) - - -- Put windows in a smart way, only if they does not set an initial position. - if 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 - 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 left - local left_layout = wibox.layout.fixed.horizontal() - left_layout:add(awful.titlebar.widget.iconwidget(c)) - left_layout:buttons(buttons) - - -- 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_left(left_layout) - layout:set_right(right_layout) - layout:set_middle(middle_layout) - - awful.titlebar(c):set_widget(layout) + 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 end) @@ -1127,20 +760,18 @@ client.connect_signal("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 if awful.client.floating.get(c) or layout == "floating" then c.border_width = beautiful.border_width - + -- No borders with only one visible client elseif #clients == 1 or layout == "max" then clients[1].border_width = 0 @@ -1152,3 +783,4 @@ for s = 1, screen.count() do screen[s]:connect_signal("arrange", function () end end) end +-- }}} diff --git a/rc.lua.multicolor b/rc.lua.multicolor index 7a454f7..4b90157 100755 --- a/rc.lua.multicolor +++ b/rc.lua.multicolor @@ -1,61 +1,33 @@ ---[[ ]]-- --- - --- Multicolor Awesome WM 3.5.+ config -- --- github.com/copycat-killer -- --- - ---[[ ]]-- +--[[ + + Multicolor Awesome WM config 2.0 + github.com/copycat-killer + +--]] --- {{{ Required Libraries - +-- {{{ Required libraries local gears = require("gears") local awful = require("awful") awful.rules = require("awful.rules") -awful.autofocus = require("awful.autofocus") +require("awful.autofocus") local wibox = require("wibox") local beautiful = require("beautiful") local naughty = require("naughty") -local vicious = require("vicious") -local scratch = require("scratch") - +local drop = require("scratch.drop") +local lain = require("lain") -- }}} --- {{{ 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("unclutter -idle 10") - --- }}} - --- {{{ Localization - -os.setlocale(os.getenv("LANG")) - --- }}} - --- {{{ Error Handling - --- Check if awesome encountered an error during startup and fell back to --- another config (This code will only ever execute for the fallback config) +-- {{{ 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 --- Handle runtime errors after startup do - in_error = false + local in_error = false awesome.connect_signal("debug::error", function (err) - -- Make sure we don't go into an endless error loop if in_error then return end in_error = true @@ -65,424 +37,217 @@ do in_error = false end) end - -- }}} --- {{{ Variable Definitions +-- {{{ 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 --- Useful Paths -home = os.getenv("HOME") -confdir = home .. "/.config/awesome" -scriptdir = confdir .. "/scripts/" -themes = confdir .. "/themes" -active_theme = themes .. "/multicolor" +run_once("urxvtd") +run_once("unclutter") +-- }}} --- Themes define colours, icons, and wallpapers -beautiful.init(active_theme .. "/theme.lua") +-- {{{ Variable definitions +-- localization +os.setlocale(os.getenv("LANG")) -terminal = "xterm" -editor = os.getenv("EDITOR") or "vim" +-- home path +homedir = os.getenv("HOME") .. "/.config/awesome/" + +-- beautiful init +confdir = homedir .. "themes/multicolor/" +beautiful.init(confdir .. "theme.lua") + +-- common +modkey = "Mod4" +altkey = "Mod1" +terminal = "urxvtc" or "xterm" +editor = os.getenv("EDITOR") or "nano" or "vi" editor_cmd = terminal .. " -e " .. editor -gui_editor = "geany -ps" -browser = "dwb" -mail = terminal .. " -e mutt " -chat = terminal .. " -e irssi " -tasks = terminal .. " -e htop " --- Default modkey. --- Usually, Mod4 is the key with a logo between Control and Alt. --- If you do not like this or do not have such a key, --- I suggest you to remap Mod4 to another key using xmodmap or other tools. --- However, you can use another modifier like Mod1, but it may interact with others. -modkey = "Mod4" -altkey = "Mod1" +-- user defined +browser = "dwb" +browser2 = "iron" +gui_editor = "gvim" +graphics = "gimp" +mail = terminal .. " -e mutt " --- Table of layouts to cover with awful.layout.inc, order matters. -layouts = -{ - awful.layout.suit.floating, -- 1 - awful.layout.suit.tile, -- 2 - awful.layout.suit.tile.left, -- 3 - awful.layout.suit.tile.bottom, -- 4 - awful.layout.suit.tile.top, -- 5 - awful.layout.suit.fair, -- 6 - awful.layout.suit.fair.horizontal, -- 7 - awful.layout.suit.spiral, -- 8 - awful.layout.suit.spiral.dwindle, -- 9 - awful.layout.suit.max, -- 10 - --awful.layout.suit.max.fullscreen, -- 11 - --awful.layout.suit.magnifier -- 12 +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 = { "web", "term", "docs", "media", "files", "other" }, + layout = { layouts[1], layouts[3], layouts[4], layouts[1], layouts[7], layouts[1] } +} +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 - -- }}} - --- {{{ Tags --- Define a tag table which hold all screen tags. -tags = { - names = { "web", "term", "docs", "media", "files", "other" }, - layout = { layouts[1], layouts[3], layouts[4], layouts[1], layouts[7], layouts[1] } - } -for s = 1, screen.count() do --- Each screen has its own tag table. - tags[s] = awful.tag(tags.names, s, tags.layout) -end - --- }}} - -- {{{ Freedesktop Menu - require("freedesktop/freedesktop") - -- }}} -- {{{ Wibox +markup = lain.util.markup --- Colours -coldef = "" -colwhi = "" -colbwhi = "" -blue = "" -yellow = "" -purple = "" -lightpurple = "" -azure = "" -green = "" -lightgreen = "" -red = "" -orange = "" -brown = "" -fuchsia = "" -gold = "" +-- Textclock +clockicon = wibox.widget.imagebox(beautiful.widget_clock) +mytextclock = awful.widget.textclock(markup("#7788af", "%A %d %B ") .. markup("#343639", ">") .. markup("#de5e1e", " %H:%M ")) --- Textclock widget -clockicon = wibox.widget.imagebox() -clockicon:set_image(beautiful.widget_clock) -mytextclock = awful.widget.textclock("%A %d %B " .. blue .. "> %H:%M ") +-- Calendar +lain.widgets.calendar:attach(mytextclock, { font_size = 10 }) --- Calendar attached to the textclock -local os = os -local string = string -local table = table -local util = awful.util - -char_width = nil -text_color = theme.fg_normal or "#FFFFFF" -today_color = theme.fg_focus or "#00FF00" -calendar_width = 21 - -local calendar = nil -local offset = 0 - -local function pop_spaces(s1, s2, maxsize) - local sps = "" - for i = 1, maxsize - string.len(s1) - string.len(s2) do - sps = sps .. " " - end - return s1 .. sps .. s2 -end - -local function create_calendar() - offset = offset or 0 - - local now = os.date("*t") - local cal_month = now.month + offset - local cal_year = now.year - if cal_month > 12 then - cal_month = (cal_month % 12) - cal_year = cal_year + 1 - elseif cal_month < 1 then - cal_month = (cal_month + 12) - cal_year = cal_year - 1 - end - - local last_day = os.date("%d", os.time({ day = 1, year = cal_year, - month = cal_month + 1}) - 86400) - local first_day = os.time({ day = 1, month = cal_month, year = cal_year}) - local first_day_in_week = - os.date("%w", first_day) - local result = "do lu ma me gi ve sa\n" - for i = 1, first_day_in_week do - result = result .. " " - end - - local this_month = false - for day = 1, last_day do - local last_in_week = (day + first_day_in_week) % 7 == 0 - local day_str = pop_spaces("", day, 2) .. (last_in_week and "" or " ") - if cal_month == now.month and cal_year == now.year and day == now.day then - this_month = true - result = result .. - string.format('%s', - today_color, day_str) - else - result = result .. day_str - end - if last_in_week and day ~= last_day then - result = result .. "\n" - end - end - - local header - if this_month then - header = os.date("%a, %d %b %Y") - else - header = os.date("%B %Y", first_day) - end - return header, string.format('%s', - theme.font, text_color, result) -end - -local function calculate_char_width() - return beautiful.get_font_height(theme.font) * 0.555 -end - -function hide() - if calendar ~= nil then - naughty.destroy(calendar) - calendar = nil - offset = 0 - end -end - -function show(inc_offset) - inc_offset = inc_offset or 0 - - local save_offset = offset - hide() - offset = save_offset + inc_offset - - local char_width = char_width or calculate_char_width() - local header, cal_text = create_calendar() - calendar = naughty.notify({ title = header, - text = cal_text, - timeout = 0, hover_timeout = 0.5, - }) -end - -mytextclock:connect_signal("mouse::enter", function() show(0) end) -mytextclock:connect_signal("mouse::leave", hide) -mytextclock:buttons(util.table.join( awful.button({ }, 1, function() show(-1) end), - awful.button({ }, 3, function() show(1) end))) - --- Vicious weather widget -weathericon = wibox.widget.imagebox() -weathericon:set_image(theme.confdir .. "/widgets/dish.png") -weatherwidget = wibox.widget.textbox() -vicious.register(weatherwidget, vicious.widgets.weather, - function (widget, args) - if args["{tempf}"] == "N/A" then - return "No Info" - else - -- Italian localization - -- work in progress - if( args["{sky}"] == "N/A" ) then args["{sky}"] = "sereno" - elseif( args["{sky}"] == "Clear" ) then args["{sky}"] = "sereno" - elseif( args["{sky}"] == "Cloudy" ) then args["{sky}"] = "nuvoloso" - elseif( args["{sky}"] == "Mostly Cloudy" ) then args["{sky}"] = "molto nuvoloso" - end - return "" .. lightpurple .. args["{sky}"] .. " @ " .. args["{tempc}"] .. "°C" .. coldef .. "" - end - end, 1800, "ICAO-CODE-GOES-HERE" ) - --- /home fs widget -fshicon = wibox.widget.imagebox() -fshicon:set_image(theme.confdir .. "/widgets/fs.png") -fshwidget = wibox.widget.textbox() - vicious.register(fshwidget, vicious.widgets.fs, - function (widget, args) - if args["{/home used_p}"] >= 95 and args["{/home used_p}"] < 99 then - return colwhi .. args["{/home used_p}"] .. "%" .. coldef - elseif args["{/home used_p}"] >= 99 and args["{/home used_p}"] <= 100 then - naughty.notify({ title = "warning", text = "/home partition ran out!\nmake some room", - timeout = 10, - position = "top_right", - fg = beautiful.fg_urgent, - bg = beautiful.bg_urgent }) - return colwhi .. args["{/home used_p}"] .. "%" .. coldef - else - return azure .. args["{/home used_p}"] .. "%" .. coldef - end - end, 620) - -local infos = nil - -function remove_info() - if infos ~= nil then - naughty.destroy(infos) - infos = nil +-- 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 -end +}) -function add_info() - remove_info() - local capi = { - mouse = mouse, - screen = screen - } - local cal = awful.util.pread(scriptdir .. "dfs") - cal = string.gsub(cal, " ^%s*(.-)%s*$", "%1") - infos = naughty.notify({ - text = string.format('%s', "Terminus", cal), - timeout = 0, - position = "top_right", - margin = 10, - height = 170, - width = 585, - screen = capi.mouse.screen - }) -end +-- / fs +fsicon = wibox.widget.imagebox(beautiful.widget_fs) +fswidget = lain.widgets.fs({ + settings = function() + widget:set_markup(markup("#80d9d8", used .. "% ")) + end +}) -fshwidget:connect_signal('mouse::enter', function () add_info() end) -fshwidget:connect_signal('mouse::leave', function () remove_info() 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 +}) +]] --- Uptime -uptimeicon = wibox.widget.imagebox() -uptimeicon:set_image(beautiful.widget_uptime) -uptimewidget = wibox.widget.textbox() -vicious.register(uptimewidget, vicious.widgets.uptime, brown .. "$2.$3" .. coldef) - --- Gmail widget -mygmail = wibox.widget.textbox() -gmail_t = awful.tooltip({ objects = { mygmail },}) -mygmailimg = wibox.widget.imagebox(beautiful.widget_gmail) -vicious.register(mygmail, vicious.widgets.gmail, - function (widget, args) - gmail_t:set_text(args["{subject}"]) - gmail_t:add_to_object(mygmailimg) - return args["{count}"] - end, 60) -mygmail:buttons(awful.util.table.join(awful.button({ }, 1, function () awful.util.spawn(mail, false) end))) - --- CPU widget +-- CPU cpuicon = wibox.widget.imagebox() cpuicon:set_image(beautiful.widget_cpu) -cpuwidget = wibox.widget.textbox() -vicious.register(cpuwidget, vicious.widgets.cpu, purple .. "$1%" .. coldef, 3) -cpuicon:buttons(awful.util.table.join(awful.button({ }, 1, function () awful.util.spawn(tasks, false) end))) +cpuwidget = lain.widgets.cpu({ + settings = function() + widget:set_markup(markup("#e33a6e", cpu_now.usage .. "% ")) + end +}) --- Temp widget -tempicon = wibox.widget.imagebox() -tempicon:set_image(beautiful.widget_temp) -tempicon:buttons(awful.util.table.join( - awful.button({ }, 1, function () awful.util.spawn(terminal .. " -e sudo powertop ", false) end) - )) - tempwidget = wibox.widget.textbox() - vicious.register(tempwidget, vicious.widgets.thermal, "$1°C", 9, {"coretemp.0", "core"} ) +-- Coretemp +tempicon = wibox.widget.imagebox(beautiful.widget_temp) +tempwidget = lain.widgets.temp({ + settings = function() + widget:set_markup(markup("#f1af5f", coretemp_now .. "°C ")) + end +}) --- Battery widget -baticon = wibox.widget.imagebox() -baticon:set_image(beautiful.widget_batt) -batwidget = wibox.widget.textbox() -vicious.register( batwidget, vicious.widgets.bat, "$2", 1, "BAT0") +-- 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 +}) -function batstate() +-- ALSA volume +volicon = wibox.widget.imagebox(beautiful.widget_vol) +volumewidget = lain.widgets.alsa({ + settings = function() + if volume_now.status == "off" then + volume_now.level = volume_now.level .. "M" + end + widget:set_markup(markup("#7493d2", volume_now.level .. "% ")) + end +}) - local file = io.open("/sys/class/power_supply/BAT0/status", "r") - - if (file == nil) then - return "Cable plugged" - end - - local batstate = file:read("*line") - file:close() - - if (batstate == 'Discharging' or batstate == 'Charging') then - return batstate - else - return "Fully charged" - end -end - -batwidget = wibox.widget.textbox() -vicious.register(batwidget, vicious.widgets.bat, - function (widget, args) - -- plugged - if (batstate() == 'Cable plugged' or batstate() == 'Unknown') then return "AC " - -- critical - elseif (args[2] <= 5 and batstate() == 'Discharging') then - naughty.notify({ - text = "sto per spegnermi...", - title = "Carica quasi esaurita!", - position = "top_right", - timeout = 1, - fg="#000000", - bg="#ffffff", - screen = 1, - ontop = true, - }) - -- low - elseif (args[2] <= 10 and batstate() == 'Discharging') then - naughty.notify({ - text = "attacca il cavo!", - title = "Carica bassa", - position = "top_right", - timeout = 1, - fg="#ffffff", - bg="#262729", - screen = 1, - ontop = true, - }) - end - return " " .. args[2] .. "% " - end, 1, 'BAT0') - --- Volume widget -volicon = wibox.widget.imagebox() -volicon:set_image(beautiful.widget_vol) -volumewidget = wibox.widget.textbox() -vicious.register(volumewidget, vicious.widgets.volume, blue .. "$1%" .. coldef, 1, "Master") - --- Net widget -netdownicon = wibox.widget.imagebox() -netdownicon:set_image(beautiful.widget_netdown) -netdownicon.align = "middle" +-- Net +netdownicon = wibox.widget.imagebox(beautiful.widget_netdown) +--netdownicon.align = "middle" netdowninfo = wibox.widget.textbox() -vicious.register(netdowninfo, vicious.widgets.net, green .. "${wlp3s0 down_kb}" .. coldef, 1) -netupicon = wibox.widget.imagebox() -netupicon:set_image(beautiful.widget_netup) -netupicon.align = "middle" -netupinfo = wibox.widget.textbox() -vicious.register(netupinfo, vicious.widgets.net, red .. "${wlp3s0 up_kb}" .. coldef, 1) +netupicon = wibox.widget.imagebox(beautiful.widget_netup) +--netupicon.align = "middle" +netupinfo = lain.widgets.net({ + settings = function() + widget:set_markup(markup("#e54c62", net_now.sent .. " ")) + netdowninfo:set_markup(markup("#87af5f", net_now.received .. " ")) + end +}) --- Memory widget -memicon = wibox.widget.imagebox() -memicon:set_image(beautiful.widget_mem) -memwidget = wibox.widget.textbox() -vicious.register(memwidget, vicious.widgets.mem, yellow .. "$2M" .. coldef, 1) +-- 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 Widget -mpdwidget = wibox.widget.textbox() +-- MPD mpdicon = wibox.widget.imagebox() -mpdicon:set_image(theme.confdir .. "/widgets/note.png") +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) + } -vicious.register(mpdwidget, vicious.widgets.mpd, -function(widget, args) - -- play - if (args["{state}"] == "Play") then - return red .. args["{Title}"] .. coldef .. colwhi .. " - " .. coldef .. colwhi .. - args["{Artist}"] .. coldef - -- pause - elseif (args["{state}"] == "Pause") then - return red .. "mpd" .. colwhi .." paused" - -- stop - elseif (args["{state}"] == "Stop") then - return red .. "mpd" .. colwhi .." stopped" - -- not running - else - return red .. "mpd" .. colwhi .." off" - end - end, 1) + 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(" ") @@ -566,55 +331,36 @@ for s = 1, screen.count() do -- Widgets that are aligned to the upper left local left_layout = wibox.layout.fixed.horizontal() - --left_layout:add(spacer) - --left_layout:add(mylauncher) - --left_layout:add(spacer) left_layout:add(mytaglist[s]) left_layout:add(mypromptbox[s]) - --left_layout:add(spacer) left_layout:add(mpdicon) left_layout:add(mpdwidget) - --left_layout:add(spacer) -- 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(netdownicon) right_layout:add(netdowninfo) - right_layout:add(spacer) right_layout:add(netupicon) right_layout:add(netupinfo) - right_layout:add(spacer) right_layout:add(volicon) right_layout:add(volumewidget) - right_layout:add(spacer) right_layout:add(memicon) right_layout:add(memwidget) - right_layout:add(spacer) right_layout:add(cpuicon) right_layout:add(cpuwidget) - right_layout:add(spacer) - right_layout:add(fshicon) - right_layout:add(fshwidget) - right_layout:add(spacer) - right_layout:add(uptimeicon) - right_layout:add(uptimewidget) - right_layout:add(spacer) + right_layout:add(fsicon) + right_layout:add(fswidget) right_layout:add(weathericon) - right_layout:add(weatherwidget) - right_layout:add(spacer) + right_layout:add(yawn.widget) right_layout:add(tempicon) right_layout:add(tempwidget) - right_layout:add(spacer) - right_layout:add(mygmailimg) - right_layout:add(mygmail) - right_layout:add(spacer) right_layout:add(baticon) right_layout:add(batwidget) - --right_layout:add(spacer) right_layout:add(clockicon) right_layout:add(mytextclock) - --right_layout:add(mylayoutbox[s]) -- Now bring it all together (with the tasklist in the middle) local layout = wibox.layout.align.horizontal() @@ -630,11 +376,9 @@ for s = 1, screen.count() do -- Widgets that are aligned to the bottom left bottom_left_layout = wibox.layout.fixed.horizontal() - bottom_left_layout:add(spacer) -- Widgets that are aligned to the bottom right bottom_right_layout = wibox.layout.fixed.horizontal() - bottom_right_layout:add(spacer) bottom_right_layout:add(mylayoutbox[s]) -- Now bring it all together (with the tasklist in the middle) @@ -643,53 +387,81 @@ for s = 1, screen.count() do 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), - -- Capture a screenshot - awful.key({ altkey }, "p", function() awful.util.spawn("screenshot",false) 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), - -- Move clients - awful.key({ altkey }, "Next", function () awful.client.moveresize( 1, 1, -2, -2) end), - awful.key({ altkey }, "Prior", function () awful.client.moveresize(-1, -1, 2, 2) end), - awful.key({ altkey }, "Down", function () awful.client.moveresize( 0, 1, 0, 0) end), - awful.key({ altkey }, "Up", function () awful.client.moveresize( 0, -1, 0, 0) end), - awful.key({ altkey }, "Left", function () awful.client.moveresize(-1, 0, 0, 0) end), - awful.key({ altkey }, "Right", function () awful.client.moveresize( 1, 0, 0, 0) end), - awful.key({ modkey, }, "Left", awful.tag.viewprev ), - awful.key({ modkey, }, "Right", awful.tag.viewnext ), - awful.key({ modkey, }, "Escape", awful.tag.history.restore), - awful.key({ modkey, }, "k", + -- 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), + + -- Dynamic tag renaming + awful.key({ altkey, "Shift" }, "r", + function () + lain.util.prompt_rename_tag(mypromptbox) + 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({ modkey, }, "j", + awful.key({ altkey }, "j", function () awful.client.focus.byidx(-1) if client.focus then client.focus:raise() end end), - awful.key({ modkey, }, "w", function () mymainmenu:show({keygrabber=true}) 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 + mywibox[mouse.screen].visible = not mywibox[mouse.screen].visible end), -- Layout manipulation @@ -705,73 +477,84 @@ globalkeys = awful.util.table.join( 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), - awful.key({ modkey, }, "l", function () awful.tag.incmwfact( 0.05) end), - awful.key({ modkey, }, "h", function () awful.tag.incmwfact(-0.05) end), - awful.key({ modkey, "Shift" }, "h", function () awful.tag.incnmaster( 1) end), - awful.key({ modkey, "Shift" }, "l", function () awful.tag.incnmaster(-1) end), - awful.key({ modkey, "Control" }, "h", function () awful.tag.incncol( 1) end), - awful.key({ modkey, "Control" }, "l", 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), + awful.key({ modkey, "Control" }, "r", awesome.restart), + awful.key({ modkey, "Shift" }, "q", awesome.quit), -- Dropdown terminal - awful.key({ modkey, }, "z", function () scratch.drop(terminal) end), - - -- Volume control - awful.key({ "Control" }, "Up", function () - awful.util.spawn("amixer set Master playback 1%+", false ) - vicious.force({ volumewidget }) - end), - awful.key({ "Control" }, "Down", function () - awful.util.spawn("amixer set Master playback 1%-", false ) - vicious.force({ volumewidget }) - end), - awful.key({ "Control" }, "m", function () - awful.util.spawn("amixer set Master playback toggle", false ) - vicious.force({ volumewidget }) - end), - awful.key({ altkey, "Control" }, "m", function () - awful.util.spawn("amixer set Master playback 100%", false ) - vicious.force({ volumewidget }) - end), + awful.key({ modkey, }, "z", function () drop(terminal) end), - -- Music control - awful.key({ altkey, "Control" }, "Up", function () - awful.util.spawn_with_shell( "mpc toggle || ncmpcpp toggle || ncmpc toggle || pms toggle", false ) - vicious.force({ mpdwidget } ) - end), - awful.key({ altkey, "Control" }, "Down", function () - awful.util.spawn_with_shell( "mpc stop || ncmpcpp stop || ncmpc stop || pms stop", false ) - vicious.force({ mpdwidget } ) - end ), - awful.key({ altkey, "Control" }, "Left", function () - awful.util.spawn_with_shell( "mpc prev || ncmpcpp prev || ncmpc prev || pms prev", false ) - vicious.force({ mpdwidget } ) - end ), - awful.key({ altkey, "Control" }, "Right", function () - awful.util.spawn_with_shell( "mpc next || ncmpcpp next || ncmpc next || pms next", false ) - vicious.force({ mpdwidget } ) - 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 }, "Up", + function () + awful.util.spawn("amixer -q set Master 1%+") + volumewidget.update() + end), + awful.key({ altkey }, "Down", + function () + awful.util.spawn("amixer -q set Master 1%-") + volumewidget.update() + end), + awful.key({ altkey }, "m", + function () + awful.util.spawn("amixer -q set Master playback toggle") + volumewidget.update() + end), + awful.key({ altkey, "Control" }, "m", + function () + awful.util.spawn("amixer -q set Master playback 100%") + volumewidget.update() + end), + + -- MPD control + awful.key({ altkey, "Control" }, "Up", + function () + awful.util.spawn_with_shell("mpc toggle || ncmpcpp toggle || ncmpc toggle || pms toggle") + mpdwidget.update() + end), + awful.key({ altkey, "Control" }, "Down", + function () + awful.util.spawn_with_shell("mpc stop || ncmpcpp stop || ncmpc stop || pms stop") + mpdwidget.update() + end), + awful.key({ altkey, "Control" }, "Left", + function () + awful.util.spawn_with_shell("mpc prev || ncmpcpp prev || ncmpc prev || pms prev") + mpdwidget.update() + end), + awful.key({ altkey, "Control" }, "Right", + function () + awful.util.spawn_with_shell("mpc next || ncmpcpp 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), + awful.key({ modkey }, "c", function () os.execute("xsel -p -o | xsel -i -b") end), -- User programs - awful.key({ modkey, }, "q", function () awful.util.spawn( "dwb", false ) end), - awful.key({ modkey, }, "a", function () awful.util.spawn( "midori", false ) end), - awful.key({ modkey, }, "s", function () awful.util.spawn(gui_editor) end), - awful.key({ modkey, }, "t", function () awful.util.spawn( "thunderbird", false ) end), - awful.key({ modkey, }, "d", function () awful.util.spawn( "spacefm", false ) end), - + 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: " }, @@ -801,41 +584,39 @@ clientkeys = awful.util.table.join( end) ) --- Compute the maximum number of digit we need, limited to 9 -keynumber = 0 -for s = 1, screen.count() do - keynumber = math.min(9, math.max(#tags[s], keynumber)); -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, keynumber do +for i = 1, 9 do globalkeys = awful.util.table.join(globalkeys, awful.key({ modkey }, "#" .. i + 9, function () - screen = mouse.screen - if tags[screen][i] then - awful.tag.viewonly(tags[screen][i]) + 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 () - screen = mouse.screen - if tags[screen][i] then - awful.tag.viewtoggle(tags[screen][i]) + 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 () - if client.focus and tags[client.focus.screen][i] then - awful.client.movetotag(tags[client.focus.screen][i]) - end + 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 () - if client.focus and tags[client.focus.screen][i] then - awful.client.toggletag(tags[client.focus.screen][i]) + local tag = awful.tag.gettags(client.focus.screen)[i] + if client.focus and tag then + awful.client.toggletag(tag) end end)) end @@ -847,59 +628,43 @@ clientbuttons = awful.util.table.join( -- 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 = true, - keys = clientkeys, - buttons = clientbuttons, - size_hints_honor = false - } - }, - + -- 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 } }, + properties = { floating = true } }, { rule = { class = "Dwb" }, - properties = { tag = tags[1][1], - maximized_vertical=true, - maximized_horizontal=true } }, + properties = { tag = tags[1][1] } }, - { rule = { class = "Geany" }, - properties = { tag = tags[1][2] } }, + { rule = { class = "Iron" }, + properties = { tag = tags[1][1] } }, - { rule = { class = "Zathura" }, - properties = { tag = tags[1][3] } }, + { rule = { instance = "plugin-container" }, + properties = { tag = tags[1][1] } }, - { rule = { class = "Dia" }, - properties = { tag = tags[1][4], - floating = true } }, + { rule = { class = "Gimp" }, + properties = { tag = tags[1][4] } }, - { rule = { class = "Gimp" }, - properties = { tag = tags[1][4], - floating = true } }, - - { rule = { class = "Inkscape" }, - properties = { tag = tags[1][4] } }, - - { rule = { class = "Rtorrent" }, - properties = { tag = tags[1][6] } }, - - { rule = { class = "Torrent-search" }, - properties = { tag = tags[1][6] } }, + { 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 @@ -910,58 +675,46 @@ client.connect_signal("manage", function (c, startup) end end) - if not startup then - -- Set the windows at the slave, - -- i.e. put it at the end of others instead of setting it master. - -- awful.client.setslave(c) - - -- Put windows in a smart way, only if they does not set an initial position. - if 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 - end - - local titlebars_enabled = false - if titlebars_enabled and (c.type == "normal" or c.type == "dialog") then - -- Widgets that are aligned to the left - local left_layout = wibox.layout.fixed.horizontal() - left_layout:add(awful.titlebar.widget.iconwidget(c)) - - -- 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 title = awful.titlebar.widget.titlewidget(c) - title: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) - )) - - -- Now bring it all together - local layout = wibox.layout.align.horizontal() - layout:set_left(left_layout) - layout:set_right(right_layout) - layout:set_middle(title) - - awful.titlebar(c):set_widget(layout) + 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 end) -client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus 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_width = "0" + c.border_color = beautiful.border_normal + else + c.border_width = beautiful.border_width + 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 + if awful.client.floating.get(c) or layout == "floating" then + c.border_width = beautiful.border_width + + -- No borders with only one visible client + elseif #clients == 1 or layout == "max" then + clients[1].border_width = 0 + awful.client.moveresize(0, 0, 2, 2, clients[1]) + else + c.border_width = beautiful.border_width + end + end + end + end) +end -- }}} diff --git a/rc.lua.powerarrow-darker b/rc.lua.powerarrow-darker index 4f73621..e313c3f 100755 --- a/rc.lua.powerarrow-darker +++ b/rc.lua.powerarrow-darker @@ -1,62 +1,33 @@ ----[[ ]]-- --- - --- Powearrow Darker Awesome WM 3.5.+ config -- --- github.com/copycat-killer -- --- - ---[[ ]]-- +--[[ + + Powerarrow Darker Awesome WM config 2.0 + github.com/copycat-killer + +--]] --- {{{ Required Libraries - +-- {{{ Required libraries local gears = require("gears") local awful = require("awful") awful.rules = require("awful.rules") -awful.autofocus = require("awful.autofocus") +require("awful.autofocus") local wibox = require("wibox") local beautiful = require("beautiful") local naughty = require("naughty") -local vicious = require("vicious") -local scratch = require("scratch") - +local drop = require("scratch.drop") +local lain = require("lain") -- }}} --- {{{ 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 -idle 10") - --- }}} - --- {{{ Localization - -os.setlocale(os.getenv("LANG")) - --- }}} - --- {{{ Error Handling - --- Check if awesome encountered an error during startup and fell back to --- another config (This code will only ever execute for the fallback config) +-- {{{ 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 --- Handle runtime errors after startup do - in_error = false + local in_error = false awesome.connect_signal("debug::error", function (err) - -- Make sure we don't go into an endless error loop if in_error then return end in_error = true @@ -66,421 +37,214 @@ do in_error = false end) end - -- }}} --- {{{ Variable Definitions +-- {{{ 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 --- Useful Paths -home = os.getenv("HOME") -confdir = home .. "/.config/awesome" -scriptdir = confdir .. "/scripts/" -themes = confdir .. "/themes" -active_theme = themes .. "/powerarrow-darker" +run_once("urxvtd") +run_once("unclutter") +-- }}} --- Themes define colours, icons, and wallpapers -beautiful.init(active_theme .. "/theme.lua") +-- {{{ Variable definitions +-- localization +os.setlocale(os.getenv("LANG")) -terminal = "urxvtc" -editor = os.getenv("EDITOR") or "vim" +-- home path +homedir = os.getenv("HOME") .. "/.config/awesome/" + +-- beautiful init +confdir = homedir .. "themes/powerarrow-darker/" +beautiful.init(confdir .. "theme.lua") + +-- common +modkey = "Mod4" +altkey = "Mod1" +terminal = "urxvtc" or "xterm" +editor = os.getenv("EDITOR") or "nano" or "vi" editor_cmd = terminal .. " -e " .. editor -gui_editor = "geany -ps" -browser = "dwb" -browser2 = "midori" -mail = terminal .. " -e mutt " -chat = terminal .. " -e irssi " -tasks = terminal .. " -e htop " -iptraf = terminal .. " -g 180x54-20+34 -e sudo iptraf-ng -i all " -musicplr = terminal .. " -g 130x34-320+16 -e ncmpcpp " --- Default modkey. --- Usually, Mod4 is the key with a logo between Control and Alt. --- If you do not like this or do not have such a key, --- I suggest you to remap Mod4 to another key using xmodmap or other tools. --- However, you can use another modifier like Mod1, but it may interact with others. -modkey = "Mod4" -altkey = "Mod1" +-- user defined +browser = "dwb" +browser2 = "iron" +gui_editor = "gvim" +graphics = "gimp" +mail = terminal .. " -e mutt " +iptraf = terminal .. " -g 180x54-20+34 -e sudo iptraf-ng -i all " +musicplr = terminal .. " -g 130x34-320+16 -e ncmpcpp " --- Table of layouts to cover with awful.layout.inc, order matters. -layouts = -{ - awful.layout.suit.floating, -- 1 - awful.layout.suit.tile, -- 2 - awful.layout.suit.tile.left, -- 3 - awful.layout.suit.tile.bottom, -- 4 - awful.layout.suit.tile.top, -- 5 - awful.layout.suit.fair, -- 6 - awful.layout.suit.fair.horizontal, -- 7 - awful.layout.suit.spiral, -- 8 - awful.layout.suit.spiral.dwindle, -- 9 - awful.layout.suit.max, -- 10 - --awful.layout.suit.max.fullscreen, -- 11 - --awful.layout.suit.magnifier -- 12 +local layouts = { + awful.layout.suit.floating, + awful.layout.suit.tile, + awful.layout.suit.tile.bottom, + awful.layout.suit.fair, + awful.layout.suit.fair.horizontal, } +-- }}} +-- {{{ Tags +tags = { + names = { "1", "2", "3", "4", "5"}, + layout = { layouts[1], layouts[2], layouts[3], layouts[1], layouts[4] } +} +for s = 1, screen.count() do + 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 - -- }}} - --- {{{ Tags - --- Define a tag table which hold all screen tags. -tags = { - names = { "1", "2", "3", "4", "5"}, - layout = { layouts[1], layouts[4], layouts[3], layouts[1], layouts[7] } - } -for s = 1, screen.count() do --- Each screen has its own tag table. - tags[s] = awful.tag(tags.names, s, tags.layout) -end - --- }}} - --- {{{ Freedesktop menu +-- {{{ Menu require("freedesktop/freedesktop") - -- }}} -- {{{ Wibox +markup = lain.util.markup +red = "#EA6F81" --- Colours -coldef = "" -colwhi = "" -red = "" +-- Textclock +clockicon = wibox.widget.imagebox(beautiful.widget_clock) +mytextclock = awful.widget.textclock(" %a %d %b %H:%M") --- Textclock widget -clockicon = wibox.widget.imagebox() -clockicon:set_image(beautiful.widget_clock) -mytextclock = awful.widget.textclock(" %a %d %b %H:%M") +-- calendar +lain.widgets.calendar:attach(mytextclock, { font_size = 10 }) --- Calendar attached to the textclock -local os = os -local string = string -local table = table -local util = awful.util - -char_width = nil -text_color = theme.fg_normal or "#FFFFFF" -today_color = theme.tasklist_fg_focus or "#FF7100" -calendar_width = 21 - -local calendar = nil -local offset = 0 - -local data = nil - -local function pop_spaces(s1, s2, maxsize) - local sps = "" - for i = 1, maxsize - string.len(s1) - string.len(s2) do - sps = sps .. " " - end - return s1 .. sps .. s2 -end - -local function create_calendar() - offset = offset or 0 - - local now = os.date("*t") - local cal_month = now.month + offset - local cal_year = now.year - if cal_month > 12 then - cal_month = (cal_month % 12) - cal_year = cal_year + 1 - elseif cal_month < 1 then - cal_month = (cal_month + 12) - cal_year = cal_year - 1 - end - - local last_day = os.date("%d", os.time({ day = 1, year = cal_year, - month = cal_month + 1}) - 86400) - local first_day = os.time({ day = 1, month = cal_month, year = cal_year}) - local first_day_in_week = - os.date("%w", first_day) - local result = "do lu ma me gi ve sa\n" - for i = 1, first_day_in_week do - result = result .. " " - end - - local this_month = false - for day = 1, last_day do - local last_in_week = (day + first_day_in_week) % 7 == 0 - local day_str = pop_spaces("", day, 2) .. (last_in_week and "" or " ") - if cal_month == now.month and cal_year == now.year and day == now.day then - this_month = true - result = result .. - string.format('%s', - today_color, day_str) - else - result = result .. day_str - end - if last_in_week and day ~= last_day then - result = result .. "\n" - end - end - - local header - if this_month then - header = os.date("%a, %d %b %Y") - else - header = os.date("%B %Y", first_day) - end - return header, string.format('%s', - theme.font, text_color, result) -end - -local function calculate_char_width() - return beautiful.get_font_height(theme.font) * 0.555 -end - -function hide() - if calendar ~= nil then - naughty.destroy(calendar) - calendar = nil - offset = 0 - end -end - -function show(inc_offset) - inc_offset = inc_offset or 0 - - local save_offset = offset - hide() - offset = save_offset + inc_offset - - local char_width = char_width or calculate_char_width() - local header, cal_text = create_calendar() - calendar = naughty.notify({ title = header, - text = cal_text, - timeout = 0, hover_timeout = 0.5, - }) -end - -mytextclock:connect_signal("mouse::enter", function() show(0) end) -mytextclock:connect_signal("mouse::leave", hide) -mytextclock:buttons(util.table.join( awful.button({ }, 1, function() show(-1) end), - awful.button({ }, 3, function() show(1) end))) - --- Mail widget -mygmail = wibox.widget.textbox() -notify_shown = false -gmail_t = awful.tooltip({ objects = { mygmail },}) -mygmailimg = wibox.widget.imagebox(beautiful.widget_mail) -vicious.register(mygmail, vicious.widgets.gmail, -function (widget, args) - notify_title = "Hai un nuovo messaggio" - notify_text = '"' .. args["{subject}"] .. '"' - gmail_t:set_text(args["{subject}"]) - gmail_t:add_to_object(mygmailimg) - if (args["{count}"] > 0) then - if (notify_shown == false) then - if (args["{count}"] > 1) then - notify_title = "Hai " .. args["{count}"] .. " nuovi messaggi" - notify_text = 'Ultimo: "' .. args["{subject}"] .. '"' - else - notify_title = "Hai un nuovo messaggio" - notify_text = args["{subject}"] - end - naughty.notify({ title = notify_title, text = notify_text, - timeout = 7, - position = "top_left", - icon = beautiful.widget_mail_notify, - fg = beautiful.fg_urgent, - bg = beautiful.bg_urgent }) - notify_shown = true +-- Mail IMAP check +mailicon = wibox.widget.imagebox(beautiful.widget_mail) +mailicon:buttons(awful.util.table.join(awful.button({ }, 1, function () awful.util.spawn(mail) end))) +--[[ commented because it needs to be set before use +mailwidget = wibox.widget.background(lain.widgets.imap({ + timeout = 180, + server = "server", + mail = "mail", + password = "keyring get mail", + settings = function() + if mailcount > 0 then + widget:set_text(" " .. mailcount .. " ") + mailicon:set_image(beautiful.widget_mail_on) + else + widget:set_text("") + mailicon:set_image(beautiful.widget_mail) + end end - return ' ' .. args["{count}"] .. ' ' - else - notify_shown = false - return "" - end -end, 60) -mygmail:buttons(awful.util.table.join(awful.button({ }, 1, function () awful.util.spawn(mail, false) end))) +}), "#313131") +]] --- Music widget -mpdwidget = wibox.widget.textbox() -mpdicon = wibox.widget.imagebox() -mpdicon:set_image(beautiful.widget_music) +-- MPD +mpdicon = wibox.widget.imagebox(beautiful.widget_music) mpdicon:buttons(awful.util.table.join(awful.button({ }, 1, function () awful.util.spawn_with_shell(musicplr) end))) +mpdwidget = lain.widgets.mpd({ + settings = function() + if mpd_now.state == "play" then + artist = " " .. mpd_now.artist .. " " + title = mpd_now.title .. " " + mpdicon:set_image(beautiful.widget_music_on) + elseif mpd_now.state == "pause" then + artist = " mpd " + title = "paused " + else + artist = "" + title = "" + mpdicon:set_image(beautiful.widget_music) + end -vicious.register(mpdwidget, vicious.widgets.mpd, -function(widget, args) - -- play - if (args["{state}"] == "Play") then - mpdicon:set_image(beautiful.widget_music_on) - return " " .. red .. args["{Title}"] .. coldef .. colwhi .. " - " .. coldef .. colwhi .. args["{Artist}"] .. coldef .. " " - -- pause - elseif (args["{state}"] == "Pause") then - mpdicon:set_image(beautiful.widget_music) - return " " .. colwhi .. "mpd paused" .. coldef .. " " - else - mpdicon:set_image(beautiful.widget_music) - return "" - end -end, 1) - --- MEM widget -memicon = wibox.widget.imagebox() -memicon:set_image(beautiful.widget_mem) -memwidget = wibox.widget.textbox() -vicious.register(memwidget, vicious.widgets.mem, ' $2MB ', 13) - --- CPU widget -cpuicon = wibox.widget.imagebox() -cpuicon:set_image(beautiful.widget_cpu) -cpuwidget = wibox.widget.textbox() -vicious.register(cpuwidget, vicious.widgets.cpu, ' $1% ', 3) -cpuicon:buttons(awful.util.table.join(awful.button({ }, 1, function () awful.util.spawn(tasks, false) end))) - --- Temp widget -tempicon = wibox.widget.imagebox() -tempicon:set_image(beautiful.widget_temp) -tempicon:buttons(awful.util.table.join(awful.button({ }, 1, function () awful.util.spawn(terminal .. " -e sudo powertop ", false) end))) -tempwidget = wibox.widget.textbox() -vicious.register(tempwidget, vicious.widgets.thermal, ' $1°C ', 9, {"coretemp.0", "core"} ) - --- /home fs widget -fshicon = wibox.widget.imagebox() -fshicon:set_image(beautiful.widget_hdd) -fshwidget = wibox.widget.textbox() -vicious.register(fshwidget, vicious.widgets.fs, -function (widget, args) - if args["{/home used_p}"] >= 95 and args["{/home used_p}"] < 99 then - return ' ' .. args["{/home used_p}"] .. '% ' - elseif args["{/home used_p}"] >= 99 and args["{/home used_p}"] <= 100 then - naughty.notify({ title = "warning", text = "/home partition ran out!\nmake some room", - timeout = 10, - position = "top_right", - fg = beautiful.fg_urgent, - bg = beautiful.bg_urgent }) - return ' ' .. args["{/home used_p}"] .. '% ' - else - return ' ' .. args["{/home used_p}"] .. '% ' - end -end, 600) - - -local infos = nil - -function remove_info() - if infos ~= nil then - naughty.destroy(infos) - infos = nil + widget:set_markup(markup(red, artist) .. title) end -end +}) +mpdwidgetbg = wibox.widget.background(mpdwidget, "#313131") -function add_info() - remove_info() - local capi = { - mouse = mouse, - screen = screen - } - local cal = awful.util.pread(scriptdir .. "dfs") - cal = string.gsub(cal, " ^%s*(.-)%s*$", "%1") - infos = naughty.notify({ - text = string.format('%s', "Terminus", cal), - timeout = 0, - position = "top_right", - margin = 10, - height = 170, - width = 585, - screen = capi.mouse.screen - }) -end +-- MEM +memicon = wibox.widget.imagebox(beautiful.widget_mem) +memwidget = lain.widgets.mem({ + settings = function() + widget:set_text(" " .. mem_now.used .. "MB ") + end +}) -fshicon:connect_signal('mouse::enter', function () add_info() end) -fshicon:connect_signal('mouse::leave', function () remove_info() end) +-- CPU +cpuicon = wibox.widget.imagebox(beautiful.widget_cpu) +cpuwidget = wibox.widget.background(lain.widgets.cpu({ + settings = function() + widget:set_text(" " .. cpu_now.usage .. "% ") + end +}), "#313131") --- Battery widget -baticon = wibox.widget.imagebox() -baticon:set_image(beautiful.widget_battery) +-- Coretemp +tempicon = wibox.widget.imagebox(beautiful.widget_temp) +tempwidget = lain.widgets.temp({ + settings = function() + widget:set_text(" " .. coretemp_now .. "°C ") + end +}) -function batstate() +-- / fs +fsicon = wibox.widget.imagebox(beautiful.widget_hdd) +fswidget = lain.widgets.fs({ + settings = function() + widget:set_text(" " .. used .. "% ") + end +}) +fswidgetbg = wibox.widget.background(fswidget, "#313131") - local file = io.open("/sys/class/power_supply/BAT0/status", "r") +-- Battery +baticon = wibox.widget.imagebox(beautiful.widget_battery) +batwidget = lain.widgets.bat({ + settings = function() + if bat_now.perc == "N/A" then + bat_now.perc = "AC" + baticon:set_image(beautiful.widget_ac) + elseif tostring(bat_now.perc) <= 5 then + baticon:set_image(beautiful.widget_battery_empty) + elseif tostring(bat_now.perc) <= 15 then + baticon:set_image(beautiful.widget_battery_low) + else + baticon:set_image(beautiful.widget_battery) + end + widget:set_markup(" " .. bat_now.perc .. " ") + end +}) - if (file == nil) then - return "Cable plugged" - end +-- ALSA volume +volicon = wibox.widget.imagebox(beautiful.widget_vol) +volumewidget = lain.widgets.alsa({ + settings = function() + if volume_now.status == "off" then + volicon:set_image(beautiful.widget_vol_mute) + elseif tonumber(volume_now.level) == 0 then + volicon:set_image(beautiful.widget_vol_no) + elseif tonumber(volume_now.level) <= 50 then + volicon:set_image(beautiful.widget_vol_low) + else + volicon:set_image(beautiful.widget_vol) + end - local batstate = file:read("*line") - file:close() + widget:set_text(" " .. volume_now.level .. "% ") + end +}) - if (batstate == 'Discharging' or batstate == 'Charging') then - return batstate - else - return "Fully charged" - end -end - -batwidget = wibox.widget.textbox() -vicious.register(batwidget, vicious.widgets.bat, -function (widget, args) - -- plugged - if (batstate() == 'Cable plugged' or batstate() == 'Unknown') then - baticon:set_image(beautiful.widget_ac) - return ' AC ' - -- critical - elseif (args[2] <= 5 and batstate() == 'Discharging') then - baticon:set_image(beautiful.widget_battery_empty) - naughty.notify({ - text = "sto per spegnermi...", - title = "Carica quasi esaurita!", - position = "top_right", - timeout = 1, - fg="#000000", - bg="#ffffff", - screen = 1, - ontop = true, - }) - -- low - elseif (args[2] <= 10 and batstate() == 'Discharging') then - baticon:set_image(beautiful.widget_battery_low) - naughty.notify({ - text = "attacca il cavo!", - title = "Carica bassa", - position = "top_right", - timeout = 1, - fg="#ffffff", - bg="#262729", - screen = 1, - ontop = true, - }) - else baticon:set_image(beautiful.widget_battery) - end - return ' ' .. args[2] .. '% ' -end, 1, 'BAT0') - --- Volume widget -volicon = wibox.widget.imagebox() -volicon:set_image(beautiful.widget_vol) -volumewidget = wibox.widget.textbox() -vicious.register(volumewidget, vicious.widgets.volume, -function (widget, args) - if (args[2] ~= "♩" ) then - if (args[1] == 0) then volicon:set_image(beautiful.widget_vol_no) - elseif (args[1] <= 50) then volicon:set_image(beautiful.widget_vol_low) - else volicon:set_image(beautiful.widget_vol) - end - else volicon:set_image(beautiful.widget_vol_mute) - end - return ' ' .. args[1] .. '% ' -end, 1, "Master") - --- Net widget -netwidget = wibox.widget.textbox() -vicious.register(netwidget, vicious.widgets.net, ' ${wlp3s0 down_kb} ↓↑ ${wlp3s0 up_kb} ', 3) -neticon = wibox.widget.imagebox() -neticon:set_image(beautiful.widget_net) -netwidget:buttons(awful.util.table.join(awful.button({ }, 1, function () awful.util.spawn_with_shell(iptraf) end))) +-- Net +neticon = wibox.widget.imagebox(beautiful.widget_net) +neticon:buttons(awful.util.table.join(awful.button({ }, 1, function () awful.util.spawn_with_shell(iptraf) end))) +netwidget = wibox.widget.background(lain.widgets.net({ + settings = function() + widget:set_markup(markup("#7AC82E", " " .. net_now.received) + .. " " .. + markup("#46A8C3", " " .. net_now.sent .. " ")) + end +}), "#313131") -- Separators spr = wibox.widget.textbox(' ') @@ -491,10 +255,6 @@ arrl_dl:set_image(beautiful.arrl_dl) arrl_ld = wibox.widget.imagebox() arrl_ld:set_image(beautiful.arrl_ld) --- }}} - --- {{{ Layout - -- Create a wibox for each screen and add it mywibox = {} mypromptbox = {} @@ -544,7 +304,7 @@ mytasklist.buttons = awful.util.table.join( end)) for s = 1, screen.count() do - + -- Create a promptbox for each screen mypromptbox[s] = awful.widget.prompt() @@ -562,9 +322,9 @@ for s = 1, screen.count() do -- 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 = 18 }) - + -- Create the wibox + mywibox[s] = awful.wibox({ position = "top", screen = s, height = 18 }) + -- Widgets that are aligned to the upper left local left_layout = wibox.layout.fixed.horizontal() left_layout:add(spr) @@ -579,26 +339,26 @@ for s = 1, screen.count() do right_layout:add(arrl) right_layout:add(arrl_ld) right_layout:add(mpdicon) - right_layout:add(mpdwidget) + right_layout:add(mpdwidgetbg) right_layout:add(arrl_dl) right_layout:add(volicon) right_layout:add(volumewidget) right_layout:add(arrl_ld) - right_layout:add(mygmailimg) - right_layout:add(mygmail) + right_layout:add(mailicon) + --right_layout:add(mailwidget) right_layout:add(arrl_dl) right_layout:add(memicon) right_layout:add(memwidget) right_layout:add(arrl_ld) right_layout:add(cpuicon) - right_layout:add(cpuwidget) + right_layout:add(cpuwidget) right_layout:add(arrl_dl) right_layout:add(tempicon) right_layout:add(tempwidget) right_layout:add(arrl_ld) - right_layout:add(fshicon) - right_layout:add(fshwidget) - right_layout:add(arrl_dl) + right_layout:add(fsicon) + right_layout:add(fswidgetbg) + right_layout:add(arrl_dl) right_layout:add(baticon) right_layout:add(batwidget) right_layout:add(arrl_ld) @@ -614,55 +374,84 @@ for s = 1, screen.count() do local layout = wibox.layout.align.horizontal() layout:set_left(left_layout) layout:set_middle(mytasklist[s]) - layout:set_right(right_layout) + layout:set_right(right_layout) mywibox[s]:set_widget(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), - -- Capture a screenshot - awful.key({ altkey }, "p", function() awful.util.spawn("screenshot",false) 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), - -- Move clients - awful.key({ altkey }, "Next", function () awful.client.moveresize( 1, 1, -2, -2) end), - awful.key({ altkey }, "Prior", function () awful.client.moveresize(-1, -1, 2, 2) end), - awful.key({ altkey }, "Down", function () awful.client.moveresize( 0, 1, 0, 0) end), - awful.key({ altkey }, "Up", function () awful.client.moveresize( 0, -1, 0, 0) end), - awful.key({ altkey }, "Left", function () awful.client.moveresize(-1, 0, 0, 0) end), - awful.key({ altkey }, "Right", function () awful.client.moveresize( 1, 0, 0, 0) end), - awful.key({ modkey, }, "Left", awful.tag.viewprev ), - awful.key({ modkey, }, "Right", awful.tag.viewnext ), - awful.key({ modkey, }, "Escape", awful.tag.history.restore), - awful.key({ modkey, }, "k", + -- 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), + + -- Dynamic tag renaming + awful.key({ altkey, "Shift" }, "r", + function () + lain.util.prompt_rename_tag(mypromptbox) + 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({ modkey, }, "j", + awful.key({ altkey }, "j", function () awful.client.focus.byidx(-1) if client.focus then client.focus:raise() end end), - awful.key({ modkey, }, "w", function () mymainmenu:show({keygrabber=true}) 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 + mywibox[mouse.screen].visible = not mywibox[mouse.screen].visible end), -- Layout manipulation @@ -678,76 +467,83 @@ globalkeys = awful.util.table.join( 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), - awful.key({ modkey, }, "l", function () awful.tag.incmwfact( 0.05) end), - awful.key({ modkey, }, "h", function () awful.tag.incmwfact(-0.05) end), - awful.key({ modkey, "Shift" }, "h", function () awful.tag.incnmaster( 1) end), - awful.key({ modkey, "Shift" }, "l", function () awful.tag.incnmaster(-1) end), - awful.key({ modkey, "Control" }, "h", function () awful.tag.incncol( 1) end), - awful.key({ modkey, "Control" }, "l", 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), + awful.key({ modkey, "Control" }, "r", awesome.restart), + awful.key({ modkey, "Shift" }, "q", awesome.quit), -- Dropdown terminal - awful.key({ modkey, }, "z", function () scratch.drop(terminal) end), + awful.key({ modkey, }, "z", function () drop(terminal) end), -- Widgets popups - awful.key({ altkey, }, "c", function () add_calendar(7) end), + awful.key({ altkey, }, "c", function () lain.widgets.calendar:show(7) end), + awful.key({ altkey, }, "h", function () fswidget.show(7) end), - -- Volume control - awful.key({ "Control" }, "Up", function () - awful.util.spawn("amixer set Master playback 1%+", false ) - vicious.force({ volumewidget }) - end), - awful.key({ "Control" }, "Down", function () - awful.util.spawn("amixer set Master playback 1%-", false ) - vicious.force({ volumewidget }) - end), - awful.key({ "Control" }, "m", function () - awful.util.spawn("amixer set Master playback toggle", false ) - vicious.force({ volumewidget }) - end), - awful.key({ altkey, "Control" }, "m", function () - awful.util.spawn("amixer set Master playback 100%", false ) - vicious.force({ volumewidget }) - end), + -- ALSA volume control + awful.key({ altkey }, "Up", + function () + awful.util.spawn("amixer -q set Master 1%+") + volumewidget.update() + end), + awful.key({ altkey }, "Down", + function () + awful.util.spawn("amixer -q set Master 1%-") + volumewidget.update() + end), + awful.key({ altkey }, "m", + function () + awful.util.spawn("amixer -q set Master playback toggle") + volumewidget.update() + end), + awful.key({ altkey, "Control" }, "m", + function () + awful.util.spawn("amixer -q set Master playback 100%") + volumewidget.update() + end), - -- Music control - awful.key({ altkey, "Control" }, "Up", function () - awful.util.spawn_with_shell( "mpc toggle || ncmpcpp toggle || ncmpc toggle || pms toggle", false ) - vicious.force({ mpdwidget } ) - end), - awful.key({ altkey, "Control" }, "Down", function () - awful.util.spawn_with_shell( "mpc stop || ncmpcpp stop || ncmpc stop || pms stop", false ) - vicious.force({ mpdwidget } ) - end ), - awful.key({ altkey, "Control" }, "Left", function () - awful.util.spawn_with_shell( "mpc prev || ncmpcpp prev || ncmpc prev || pms prev", false ) - vicious.force({ mpdwidget } ) - end ), - awful.key({ altkey, "Control" }, "Right", function () - awful.util.spawn_with_shell( "mpc next || ncmpcpp next || ncmpc next || pms next", false ) - vicious.force({ mpdwidget } ) - end ), + -- MPD control + awful.key({ altkey, "Control" }, "Up", + function () + awful.util.spawn_with_shell("mpc toggle || ncmpcpp toggle || ncmpc toggle || pms toggle") + mpdwidget.update() + end), + awful.key({ altkey, "Control" }, "Down", + function () + awful.util.spawn_with_shell("mpc stop || ncmpcpp stop || ncmpc stop || pms stop") + mpdwidget.update() + end), + awful.key({ altkey, "Control" }, "Left", + function () + awful.util.spawn_with_shell("mpc prev || ncmpcpp prev || ncmpc prev || pms prev") + mpdwidget.update() + end), + awful.key({ altkey, "Control" }, "Right", + function () + awful.util.spawn_with_shell("mpc next || ncmpcpp 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), + awful.key({ modkey }, "c", function () os.execute("xsel -p -o | xsel -i -b") end), -- User programs - awful.key({ modkey, }, "q", function () awful.util.spawn( "dwb", false ) end), - awful.key({ modkey, }, "a", function () awful.util.spawn( "midori", false ) end), - awful.key({ modkey, }, "s", function () awful.util.spawn(gui_editor) end), - awful.key({ modkey, }, "t", function () awful.util.spawn( "thunderbird", false ) end), - awful.key({ modkey, }, "d", function () awful.util.spawn( "spacefm", false ) end), - + 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: " }, @@ -777,41 +573,39 @@ clientkeys = awful.util.table.join( end) ) --- Compute the maximum number of digit we need, limited to 9 -keynumber = 0 -for s = 1, screen.count() do - keynumber = math.min(9, math.max(#tags[s], keynumber)); -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, keynumber do +for i = 1, 9 do globalkeys = awful.util.table.join(globalkeys, awful.key({ modkey }, "#" .. i + 9, function () - screen = mouse.screen - if tags[screen][i] then - awful.tag.viewonly(tags[screen][i]) + 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 () - screen = mouse.screen - if tags[screen][i] then - awful.tag.viewtoggle(tags[screen][i]) + 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 () - if client.focus and tags[client.focus.screen][i] then - awful.client.movetotag(tags[client.focus.screen][i]) - end + 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 () - if client.focus and tags[client.focus.screen][i] then - awful.client.toggletag(tags[client.focus.screen][i]) + local tag = awful.tag.gettags(client.focus.screen)[i] + if client.focus and tag then + awful.client.toggletag(tag) end end)) end @@ -823,68 +617,43 @@ clientbuttons = awful.util.table.join( -- 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 = true, - keys = clientkeys, - buttons = clientbuttons, - size_hints_honor = false - } - }, - + -- 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 } }, + properties = { floating = true } }, { rule = { class = "Dwb" }, - properties = { tag = tags[1][1], - maximized_vertical=true, - maximized_horizontal=true } }, + properties = { tag = tags[1][1] } }, - { rule = { class = "Midori" }, - properties = { tag = tags[1][1], - maximized_vertical=true, - maximized_horizontal=true } }, + { rule = { class = "Iron" }, + properties = { tag = tags[1][1] } }, - { rule = { class = "Geany" }, - properties = { tag = tags[1][2] } }, + { rule = { instance = "plugin-container" }, + properties = { tag = tags[1][1] } }, - { rule = { class = "Zathura" }, - properties = { tag = tags[1][3] } }, + { rule = { class = "Gimp" }, + properties = { tag = tags[1][4] } }, - { rule = { class = "Thunderbird" }, - properties = { tag = tags[1][3] } }, - - { rule = { class = "Dia" }, - properties = { tag = tags[1][4], - floating = true } }, - - { rule = { class = "Gimp" }, - properties = { tag = tags[1][4], - floating = true } }, - - { rule = { class = "Inkscape" }, - properties = { tag = tags[1][4], - floating = true } }, - - { rule = { class = "Transmission-gtk" }, - properties = { tag = tags[1][5] } }, - - { rule = { class = "Torrent-search" }, - properties = { tag = tags[1][5] } }, + { 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 @@ -895,60 +664,46 @@ client.connect_signal("manage", function (c, startup) end end) - if not startup then - -- Set the windows at the slave, - -- i.e. put it at the end of others instead of setting it master. - -- awful.client.setslave(c) - - -- Put windows in a smart way, only if they does not set an initial position. - if 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 - end - - local titlebars_enabled = false - if titlebars_enabled and (c.type == "normal" or c.type == "dialog") then - -- Widgets that are aligned to the left - local left_layout = wibox.layout.fixed.horizontal() - left_layout:add(awful.titlebar.widget.iconwidget(c)) - - -- 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)) - right_layout:add(awful.titlebar.widget.closebutton(c)) - - -- The title goes in the middle - local title = awful.titlebar.widget.titlewidget(c) - title: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) - )) - - -- Now bring it all together - local layout = wibox.layout.align.horizontal() - layout:set_left(left_layout) - layout:set_right(right_layout) - layout:set_middle(title) - - awful.titlebar(c):set_widget(layout) + 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 end) -client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus 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_width = "0" + c.border_color = beautiful.border_normal + else + c.border_width = beautiful.border_width + 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 + if awful.client.floating.get(c) or layout == "floating" then + c.border_width = beautiful.border_width + + -- No borders with only one visible client + elseif #clients == 1 or layout == "max" then + clients[1].border_width = 0 + awful.client.moveresize(0, 0, 2, 2, clients[1]) + else + c.border_width = beautiful.border_width + end + end + end + end) +end +-- }}} diff --git a/rc.lua.rainbow b/rc.lua.rainbow index 01279d1..d188369 100755 --- a/rc.lua.rainbow +++ b/rc.lua.rainbow @@ -1,28 +1,45 @@ ---[[ ]]-- --- - --- Rainbow Awesome WM 3.5.+ config -- --- github.com/copycat-killer -- --- - ---[[ ]]-- +--[[ + + Rainbow Awesome WM config 2.0 + github.com/copycat-killer + +--]] --- {{{ Required Libraries - +-- {{{ Required libraries local gears = require("gears") local awful = require("awful") awful.rules = require("awful.rules") -awful.autofocus = require("awful.autofocus") +require("awful.autofocus") local wibox = require("wibox") local beautiful = require("beautiful") local naughty = require("naughty") -local vicious = require("vicious") -local scratch = require("scratch") -local yawn = require("yawn") +local drop = require("scratch.drop") +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(" ") @@ -33,576 +50,178 @@ function run_once(cmd) end run_once("urxvtd") -run_once("unclutter -noevents") +run_once("unclutter") run_once("compton") - -- }}} --- {{{ Localization - +-- {{{ Variable definitions +-- localization os.setlocale(os.getenv("LANG")) --- }}} +-- home path +homedir = os.getenv("HOME") .. "/.config/awesome/" --- {{{ Error Handling +-- beautiful init +confdir = homedir .. "themes/rainbow/" +beautiful.init(confdir .. "theme.lua") --- Check if awesome encountered an error during startup and fell back to --- another config (This code will only ever execute for the fallback config) -if awesome.startup_errors then - naughty.notify({ preset = naughty.config.presets.critical, - title = "Oops, there were errors during startup!", - text = awesome.startup_errors }) -end - --- Handle runtime errors after startup -do - local in_error = false - awesome.connect_signal("debug::error", function (err) - -- Make sure we don't go into an endless error loop - if in_error then return end - in_error = true - - naughty.notify({ preset = naughty.config.presets.critical, - title = "Oops, an error happened!", - text = err }) - local in_error = false - end) -end - --- }}} - --- {{{ Global variables - -home = os.getenv("HOME") -confdir = home .. "/.config/awesome" -scriptdir = confdir .. "/scripts/" -themes = confdir .. "/themes" -active_theme = themes .. "/rainbow" -language = string.gsub(os.getenv("LANG"), ".utf8", "") - -beautiful.init(active_theme .. "/theme.lua") - -terminal = "urxvtc" -editor = os.getenv("EDITOR") or "vim" +-- common +modkey = "Mod4" +altkey = "Mod1" +terminal = "urxvtc" or "xterm" +editor = os.getenv("EDITOR") or "nano" or "vi" editor_cmd = terminal .. " -e " .. editor + +-- user defined +browser = "dwb" +browser2 = "iron" gui_editor = "gvim" -browser = "dwb" -graphics = "gimp" -mail = terminal .. " -e mutt " -wifi = terminal .. " -e sudo wifi-menu " -musicplr = terminal .. " -g 130x34-320+16 -e ncmpcpp " +graphics = "gimp" -modkey = "Mod4" -altkey = "Mod1" +-- lain +lain.layout.termfair.nmaster = 3 +lain.layout.termfair.ncol = 1 -layouts = -{ - awful.layout.suit.floating, -- 1 - awful.layout.suit.tile, -- 2 - awful.layout.suit.fair, -- 3 - awful.layout.suit.fair.horizontal, -- 4 +local layouts = { + awful.layout.suit.floating, + awful.layout.suit.fair, + awful.layout.suit.tile, + lain.layout.uselessfair.horizontal, + lain.layout.uselesstile, + lain.layout.uselessfair, + lain.layout.termfair, + lain.layout.uselesspiral.dwindle } +-- }}} +-- {{{ Tags +tags = { + names = { "www", "dev", "docs", "media" }, + layout = { layouts[1], layouts[2], layouts[3], layouts[4] } +} +for s = 1, screen.count() do + 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 - --- }}} - --- {{{ Tags - -tags = { - names = { "www", "dev", "docs", "media" }, - layout = { layouts[1], layouts[2], layouts[4], layouts[3] } - } -for s = 1, screen.count() do - tags[s] = awful.tag(tags.names, s, tags.layout) -end - -- }}} -- {{{ Menu - --- my current menu -myaccessories = { - { "archives", "7zFM" }, - { "charmap", "gucharmap" }, - { "gbdfed", "gbdfed" }, - { "fontsel", "gtk2fontsel" }, - { "gimp", "gimp" }, - { "text editor", gui_editor }, -} -myinternet = { - { "torrent" , "transmission-gtk" }, - { "torrent search" , "torrent-search" } -} -myoffice = { - { "writer" , "lowriter" }, - { "impress" , "loimpress" }, -} -mysystem = { - { "appearance" , "lxappearance" }, - { "cleaning" , "bleachbit" }, - { "powertop" , terminal .. " -e sudo powertop " }, -} -mymainmenu = awful.menu({ items = { - { "accessories" , myaccessories }, - { "internet" , myinternet }, - { "office" , myoffice }, - { "system" , mysystem }, - } - }) -mylauncher = awful.widget.launcher({ menu = mymainmenu }) - --- if you prefer freedesktop, uncomment the following line ---require("freedesktop/freedesktop") - +require("freedesktop/freedesktop") -- }}} -- {{{ Wibox +markup = lain.util.markup +white = beautiful.fg_focus +gray = beautiful.fg_normal --- awful.util -local util = awful.util +-- Textclock +mytextclock = awful.widget.textclock(markup.font("Tamsyn 3", " ") .. + markup(white, " %H:%M ")) --- Colours -coldef = "" -white = "" -gray = "" +-- Calendar +lain.widgets.calendar:attach(mytextclock, { fg = beautiful.fg_focus }) --- Textclock widget -mytextclock = awful.widget.textclock(white .. "%H:%M" .. coldef) +--[[ Mail IMAP check +-- commented because it needs to be set before use +mailwidget = lain.widgets.imap({ + timeout = 180, + server = "server", + mail = "mail", + password = "keyring get mail", + settings = function() + mail_notification_preset.fg = white --- Calendar notification -local tonumber = tonumber -local calendar = nil -local offset = 0 + mail = "" + count = "" -function remove_calendar() - if calendar ~= nil then - naughty.destroy(calendar) - calendar = nil - end -end + if mailcount > 0 then + mail = "Arch " + count = mailcount .. " " + end -function show_calendar(inc_offset, t_out) - remove_calendar() - local f, c_text - local today = tonumber(os.date('%d')) - - if inc_offset == 0 then - if today < 10 then - f = io.popen('/usr/bin/cal | sed -r -e "s/(^| )( ' .. today .. ')($| )/\\1\\2<\\/span><\\/b>\\3/"',"r") - else - f = io.popen('/usr/bin/cal | sed -r -e "s/(^| )(' .. today .. ')($| )/\\1\\2<\\/span><\\/b>\\3/"',"r") - end - c_text = "" .. f:read() .. "\n\n" .. f:read() .. "\n" .. f:read("*all") .. "" - f:close() - offset = 0 - else - local month = tonumber(os.date('%m')) - local year = tonumber(os.date('%Y')) - - offset = offset + inc_offset - month = month + offset - - if month > 12 then - month = 12 - offset = 12 - tonumber(os.date('%m')) - elseif month < 1 then - month = 1 - offset = 1 - tonumber(os.date('%m')) - end - - f = io.popen('/usr/bin/cal ' .. month .. ' ' .. year ,"r") - c_text = "" .. f:read() .. "\n\n" .. f:read() .. "\n" .. f:read("*all") .. "" - f:close() - end - - calendar = naughty.notify({ text = c_text, - fg = "#D4D4D4", - bg = "#242424", - timeout = t_out - }) -end - -mytextclock:connect_signal("mouse::enter", function() show_calendar(0, 0) end) -mytextclock:connect_signal("mouse::leave", function() remove_calendar() end) -mytextclock:buttons(util.table.join( awful.button({ }, 1, function() show_calendar(-1, 0) end), - awful.button({ }, 3, function() show_calendar(1, 0) end))) - --- GMail widget -mygmail = wibox.widget.textbox() -gmail_t = awful.tooltip({ objects = { mygmail },}) -notify_shown = false -mailcount = 0 -vicious.register(mygmail, vicious.widgets.gmail, - function (widget, args) - gmail_t:set_text(args["{subject}"]) - gmail_t:add_to_object(mygmail) - notify_title = "" - notify_text = "" - mailcount = args["{count}"] - if (args["{count}"] > 0 ) then - if (notify_shown == false) then - -- Italian localization - -- can be a stub for your own localization - if (args["{count}"] == 1) then - if language:find("it_IT") ~= nil - then - notify_title = "Hai un nuovo messaggio" - else - notify_title = "You got a new mail" - end - notify_text = '"' .. args["{subject}"] .. '"' - else - if language:find("it_IT") ~= nil - then - notify_title = "Hai " .. args["{count}"] .. " nuovi messaggi" - notify_text = 'Ultimo: "' .. args["{subject}"] .. '"' - else - notify_title = "You got " .. args["{count}"] .. " new mails" - notify_text = 'Last one: "' .. args["{subject}"] .. '"' - end - end - naughty.notify({ - title = notify_title, - text = notify_text, - timeout = 7, - position = "top_left", - icon = beautiful.widget_mail_notify, - fg = "#D0D0D0", - bg = "#242424" - }) - notify_shown = true + widget:set_markup(markup(gray, mail) .. markup(white, count)) end - return gray .. " Mail " .. coldef .. white .. args["{count}"] .. " " .. coldef - else - notify_shown = false - return '' - end -end, 60) -mygmail:buttons(awful.util.table.join(awful.button({ }, 1, function () awful.util.spawn(mail, false) end))) +}) +]] --- Mpd widget -mpdwidget = wibox.widget.textbox() -mpdwidget:buttons(awful.util.table.join(awful.button({ }, 1, function () awful.util.spawn_with_shell(musicplr) end))) -curr_track = nil -vicious.register(mpdwidget, vicious.widgets.mpd, -function(widget, args) - if args["{state}"] == "Play" then - if args["{Title}"] ~= curr_track - then - curr_track = args["{Title}"] - os.execute(scriptdir .. "mpdinfo") - old_id = naughty.notify({ - title = "Now playing", - text = args["{Artist}"] .. " (" .. args["{Album}"] .. ")\n" .. args["{Title}"], - icon = "/tmp/mpdnotify_cover.png", - fg = "#D0D0D0", - bg = "#242424", - timeout = 5, - replaces_id = old_id - }).id +-- MPD +mpdwidget = lain.widgets.mpd({ + settings = function() + mpd_notification_preset.fg = white + + artist = mpd_now.artist .. " " + title = mpd_now.title .. " " + + if mpd_now.state == "pause" then + artist = "mpd " + title = "paused " + elseif mpd_now.state == "stop" then + artist = "" + title = "" + end + + widget:set_markup(markup(gray, artist) .. markup(white, title)) end - return gray .. args["{Artist}"] .. coldef .. white .. " " .. args["{Title}"] .. " " .. coldef - elseif args["{state}"] == "Pause" then - -- Italian localization - -- can be a stub for your own localization - if language:find("it_IT") ~= nil - then - return gray .. "mpd " .. coldef .. white .. "in pausa " .. coldef - else - return gray .. "mpd " .. coldef .. white .. "paused " .. coldef +}) + +-- /home fs +fshome = lain.widgets.fs({ + partition = "/home", + settings = function() + fs_notification_preset.fg = white + + hdd = "" + p = "" + + if used >= 90 then + hdd = " Hdd " + p = used + end + + widget:set_markup(markup(gray, hdd) .. markup(white, p)) end - else - curr_track = nil - return '' - end -end, 1) +}) --- /home fs widget -fshwidget = wibox.widget.textbox() -too_much = false -vicious.register(fshwidget, vicious.widgets.fs, -function (widget, args) - if ( args["{/home used_p}"] >= 90 ) then - if ( args["{/home used_p}"] >= 99 and too_much == false ) then - naughty.notify({ title = "Attenzione", text = "Partizione /home esaurita!\nFa' un po' di spazio.", - timeout = 7, - position = "top_right", - fg = beautiful.fg_urgent, - bg = beautiful.bg_urgent }) - too_much = true - end - return gray .. " Hdd " .. coldef .. white .. args["{/home used_p}"] .. coldef .. " " - else - return "" - end -end, 600) +-- ALSA volume bar +myvolumebar = lain.widgets.alsabar() +volmargin = wibox.layout.margin(myvolumebar.widget, 5, 8, 80) +volmargin:set_top(7) +volmargin:set_bottom(7) +volumewidget = wibox.widget.background(volmargin, beautiful.vol_bg) --- hhd status notification -local infos = nil - -function remove_info() - if infos ~= nil then - naughty.destroy(infos) - infos = nil - end -end - -function show_info(t_out) - remove_info() - local capi = { - mouse = mouse, - screen = screen - } - local hdd = awful.util.pread(scriptdir .. "dfs") - hdd = string.gsub(hdd, " ^%s*(.-)%s*$", "%1") - - -- Italian localization - -- can be a stub for your own localization - if language:find("it_IT") ~= nil - then - hdd = string.gsub(hdd, "Used ", "Usato") - hdd = string.gsub(hdd, "Free ", "Libero") - hdd = string.gsub(hdd, "Total ", "Totale") - end - - infos = naughty.notify({ - text = hdd, - timeout = t_out, - position = "top_right", - margin = 10, - height = 210, - width = 680, - fg = "#D4D4D4", - bg = "#242424", - screen = capi.mouse.screen - }) -end - -fshwidget:connect_signal('mouse::enter', function () show_info(0) end) -fshwidget:connect_signal('mouse::leave', function () remove_info() end) - --- Battery widget -batwidget = wibox.widget.textbox() -function batstate() - - local file = io.open("/sys/class/power_supply/BAT0/status", "r") - - if (file == nil) then - return "Cable plugged" - end - - local batstate = file:read("*line") - file:close() - - if (batstate == 'Discharging' or batstate == 'Charging') then - return batstate - else - return "Fully charged" - end -end -vicious.register(batwidget, vicious.widgets.bat, -function (widget, args) - -- plugged - if (batstate() == 'Cable plugged' or batstate() == 'Unknown') then - return '' - -- critical - elseif (args[2] <= 5 and batstate() == 'Discharging') then - naughty.notify{ - -- Italian localization - -- can be a stub for your own localization - text = "sto per spegnermi...", - title = "Carica quasi esaurita!", - position = "top_right", - timeout = 0, - fg="#000000", - bg="#ffffff", - screen = 1, - ontop = true, - } - -- low - elseif (args[2] <= 10 and batstate() == 'Discharging') then - naughty.notify({ - -- Italian localization - -- can be a stub for your own localization - text = "attacca il cavo!", - title = "Carica bassa", - position = "top_right", - timeout = 0, - fg="#ffffff", - bg="#262729", - screen = 1, - ontop = true, - }) - end - return gray .. "Bat " .. coldef .. white .. args[2] .. " " .. coldef -end, 1, 'BAT0') - --- {{{ Volume widget --- --- original version: http://awesome.naquadah.org/wiki/Rman%27s_Simple_Volume_Widget - -local alsawidget = +-- Weather +yawn = lain.widgets.yawn(123456, { - channel = "Master", - step = "5%", - colors = - { - unmute = "#a4ce8a", - mute = "#eb8f8f" - }, - mixer = terminal .. " -e alsamixer", -- or whatever your preferred sound mixer is - notifications = - { - font = "Tamsyn 11", - bar_size = 18 - } -} - -alsawidget.bar = awful.widget.progressbar () -alsawidget.bar:set_width (60) -alsawidget.bar:set_height (10) -awful.widget.progressbar.set_ticks (alsawidget.bar, true) -alsamargin = wibox.layout.margin (alsawidget.bar, 5, 8, 80) -wibox.layout.margin.set_top (alsamargin, 5) -wibox.layout.margin.set_bottom (alsamargin, 5) - -alsawidget.bar:set_background_color ("#7e7e7e") -alsawidget.bar:set_color (alsawidget.colors.unmute) -alsawidget.bar:buttons (awful.util.table.join ( - awful.button ({}, 1, function() - awful.util.spawn (alsawidget.mixer) - end), - awful.button ({}, 3, function() - awful.util.spawn ("amixer sset " .. alsawidget.channel .. " toggle") - vicious.force ({ alsawidget.bar }) - end), - awful.button ({}, 4, function() - awful.util.spawn ("amixer sset " .. alsawidget.channel .. " " .. alsawidget.step .. "+") - vicious.force ({ alsawidget.bar }) - end), - awful.button ({}, 5, function() - awful.util.spawn ("amixer sset " .. alsawidget.channel .. " " .. alsawidget.step .. "-") - vicious.force ({ alsawidget.bar }) - end) -)) - --- tooltip -alsawidget.tooltip = awful.tooltip ({ objects = { alsawidget.bar } }) - --- naughty notifications -alsawidget._current_level = 0 -alsawidget._muted = false - -function alsawidget:notify () - local preset = - { - title = "", text = "", - timeout = 3, - height = 40, - width = 170, - font = alsawidget.notifications.font, - fg = "#D4D4D4" - } - - if alsawidget._muted - then - preset.title = alsawidget.channel .. " - Muted" - else - preset.title = alsawidget.channel .. " - " .. alsawidget._current_level .. "%" - - end - - local int = math.modf (alsawidget._current_level / 100 * alsawidget.notifications.bar_size) - preset.text = "[" .. string.rep ("|", int) .. string.rep (" ", alsawidget.notifications.bar_size - int) .. "]" - - if alsawidget._notify ~= nil - then - alsawidget._notify = naughty.notify ( - { - replaces_id = alsawidget._notify.id, - preset = preset - }) - else - alsawidget._notify = naughty.notify ({ preset = preset }) - end -end - --- register the widget through vicious -vicious.register (alsawidget.bar, vicious.widgets.volume, function (widget, args) - alsawidget._current_level = args[1] - if args[2] ~= "♩" - then - alsawidget._muted = false - alsawidget.tooltip:set_text (" " .. alsawidget.channel .. ": " .. args[1] .. "% ") - widget:set_color (alsawidget.colors.unmute) - else - alsawidget._muted = true - alsawidget.tooltip:set_text (" [Muted] ") - widget:set_color (alsawidget.colors.mute) - end - return args[1] -end, 5, alsawidget.channel) -- relatively high update time, use of keys/mouse will force update - --- }}} - --- Net checker widget -no_net_shown = true -netwidget = wibox.widget.textbox() -vicious.register(netwidget, vicious.widgets.net, -function (widget, args) - if args["{wlp3s0 carrier}"] == 0 then - if no_net_shown == true then - naughty.notify({ title = "wlp3s0", text = "No carrier", - timeout = 7, - position = "top_left", - icon = beautiful.widget_no_net_notify, - fg = "#ff5e5e", - bg = "#242424" }) - no_net_shown = false - end - return gray .. " Net " .. coldef .. "Off " .. coldef - else - no_net_shown = true - return '' + settings = function() + yawn_notification_preset.fg = white end -end, 10) -netwidget:buttons(awful.util.table.join(awful.button({ }, 1, function () awful.util.spawn_with_shell(wifi) end))) - --- Weather widget -yawn.register(123456) -- https//github.com/copycat-killer/yawn +}) -- Separators spr = wibox.widget.textbox(' ') small_spr = wibox.widget.textbox(' ') - --- }}} - --- {{{ Layout +med_spr = wibox.widget.textbox(' ') -- Create a wibox for each screen and add it mywibox = {} mypromptbox = {} -mylayoutbox = {} txtlayoutbox = {} mytaglist = {} +mytasklist = {} 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 = {} + awful.button({ }, 5, function(t) awful.tag.viewprev(awful.tag.getscreen(t)) end)) mytasklist.buttons = awful.util.table.join( awful.button({ }, 1, function (c) if c == client.focus then @@ -640,7 +259,7 @@ mytasklist.buttons = awful.util.table.join( -- Writes a string representation of the current layout in a textbox widget function updatelayoutbox(layout, s) local screen = s or 1 - local txt_l = beautiful["layout_txt_" .. awful.layout.getname(awful.layout.get(screen))] or "" + local txt_l = beautiful["layout_txt_" .. awful.layout.getname(awful.layout.get(screen))] or "" layout:set_text(txt_l) end @@ -652,10 +271,10 @@ for s = 1, screen.count() do -- layout we're using. We need one layoutbox per screen. txtlayoutbox[s] = wibox.widget.textbox(beautiful["layout_txt_" .. awful.layout.getname(awful.layout.get(s))]) awful.tag.attached_connect_signal(s, "property::selected", function () - updatelayoutbox(txtlayoutbox[s], s) + updatelayoutbox(txtlayoutbox[s], s) end) awful.tag.attached_connect_signal(s, "property::layout", function () - updatelayoutbox(txtlayoutbox[s], s) + updatelayoutbox(txtlayoutbox[s], s) end) txtlayoutbox[s]:buttons(awful.util.table.join( awful.button({}, 1, function() awful.layout.inc(layouts, 1) end), @@ -668,11 +287,11 @@ for s = 1, screen.count() do -- Create a tasklist widget mytasklist[s] = awful.widget.tasklist(s, awful.widget.tasklist.filter.currenttags, mytasklist.buttons) - + -- Create the wibox mywibox[s] = awful.wibox({ position = "top", screen = s, height = 18 }) - -- Widgets that are aligned to the upper left + -- Widgets that are aligned to the left local left_layout = wibox.layout.fixed.horizontal() left_layout:add(small_spr) left_layout:add(mytaglist[s]) @@ -681,20 +300,16 @@ for s = 1, screen.count() do left_layout:add(spr) left_layout:add(mypromptbox[s]) - -- Widgets that are aligned to the upper right + -- Widgets that are aligned to the right local right_layout = wibox.layout.fixed.horizontal() if s == 1 then right_layout:add(wibox.widget.systray()) end right_layout:add(small_spr) right_layout:add(mpdwidget) - right_layout:add(mygmail) - right_layout:add(fshwidget) - right_layout:add(batwidget) - right_layout:add(netwidget) - right_layout:add(small_spr) - right_layout:add(alsamargin) - right_layout:add(spr) + --right_layout:add(mailwidget) + right_layout:add(fshome) + right_layout:add(med_spr) + right_layout:add(volumewidget) right_layout:add(mytextclock) - right_layout:add(spr) -- Now bring it all together (with the tasklist in the middle) local layout = wibox.layout.align.horizontal() @@ -703,33 +318,38 @@ for s = 1, screen.count() do layout:set_right(right_layout) mywibox[s]:set_widget(layout) - end - -- }}} --- {{{ Mouse Bindings - +-- {{{ 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 - awful.key({ altkey }, "p", function() awful.util.spawn("screenshot",false) end), + -- https://github.com/copycat-killer/dots/blob/master/bin/screenshot + awful.key({ altkey }, "p", function() os.execute("screenshot") 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), + + -- Dynamic tag renaming + awful.key({ altkey, "Shift" }, "r", + function () + lain.util.prompt_rename_tag(mypromptbox) + end ), + -- Default client focus awful.key({ altkey }, "k", function () @@ -741,7 +361,7 @@ globalkeys = awful.util.table.join( awful.client.focus.byidx(-1) if client.focus then client.focus:raise() end end), - + -- By direction client focus awful.key({ modkey }, "j", function() @@ -765,7 +385,10 @@ globalkeys = awful.util.table.join( end), -- Show Menu - awful.key({ modkey, }, "w", function () mymainmenu:show({keygrabber=true}) end), + awful.key({ modkey }, "w", + function () + mymainmenu:show({ keygrabber = true }) + end), -- Show/Hide Wibox awful.key({ modkey }, "b", function () @@ -785,78 +408,79 @@ globalkeys = awful.util.table.join( 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), + 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), + awful.key({ modkey, "Control" }, "r", awesome.restart), + awful.key({ modkey, "Shift" }, "q", awesome.quit), -- Dropdown terminal - awful.key({ modkey, }, "z", function () scratch.drop(terminal) end), + awful.key({ modkey, }, "z", function () drop(terminal) end), -- Widgets popups - awful.key({ altkey, }, "c", function () show_calendar(0, 7) end), - awful.key({ altkey, }, "h", function () - vicious.force({ fshwidget }) - show_info(7) - end), - awful.key({ altkey, }, "w", function () yawn.show_weather(7) end), + awful.key({ altkey, }, "c", function () lain.widgets.calendar:show(7) end), + awful.key({ altkey, }, "h", function () fshome.show(7) end), + awful.key({ altkey, }, "w", function () yawn.show(7) end), - -- Volume control - awful.key({ altkey }, "Up", function () - awful.util.spawn("amixer sset " .. alsawidget.channel .. " " .. alsawidget.step .. "+") - vicious.force({ alsawidget.bar }) - alsawidget.notify() - end), - awful.key({ altkey }, "Down", function () - awful.util.spawn("amixer sset " .. alsawidget.channel .. " " .. alsawidget.step .. "-") - vicious.force({ alsawidget.bar }) - alsawidget.notify() - end), - awful.key({ altkey }, "m", function () - awful.util.spawn("amixer set Master playback toggle") - vicious.force({ alsawidget.bar }) - --alsawidget._muted = not alsawidget._muted - alsawidget.notify() - end), - awful.key({ altkey, "Control" }, "m", function () - awful.util.spawn("amixer set Master playback 100%", false ) - vicious.force({ alsawidget.bar }) - alsawidget.notify() - end), + -- ALSA volume control + awful.key({ altkey }, "Up", + function () + awful.util.spawn("amixer -q set " .. volume.channel .. " " .. volume.step .. "+") + myvolumebar.notify() + end), + awful.key({ altkey }, "Down", + function () + awful.util.spawn("amixer -q set " .. volume.channel .. " " .. volume.step .. "-") + myvolumebar.notify() + end), + awful.key({ altkey }, "m", + function () + awful.util.spawn("amixer -q set " .. volume.channel .. " playback toggle") + myvolumebar.notify() + end), + awful.key({ altkey, "Control" }, "m", + function () + awful.util.spawn("amixer -q set " .. volume.channel .. " playback 100%") + myvolumebar.notify() + end), - -- Music control - awful.key({ altkey, "Control" }, "Up", function () - awful.util.spawn_with_shell( "mpc toggle || ncmpcpp toggle || ncmpc toggle || pms toggle", false ) - vicious.force({ mpdwidget } ) - end), - awful.key({ altkey, "Control" }, "Down", function () - awful.util.spawn_with_shell( "mpc stop || ncmpcpp stop || ncmpc stop || pms stop", false ) - vicious.force({ mpdwidget } ) - end ), - awful.key({ altkey, "Control" }, "Left", function () - awful.util.spawn_with_shell( "mpc prev || ncmpcpp prev || ncmpc prev || pms prev", false ) - vicious.force({ mpdwidget } ) - end ), - awful.key({ altkey, "Control" }, "Right", function () - awful.util.spawn_with_shell( "mpc next || ncmpcpp next || ncmpc next || pms next", false ) - vicious.force({ mpdwidget } ) - end ), + -- MPD control + awful.key({ altkey, "Control" }, "Up", + function () + awful.util.spawn_with_shell("mpc toggle || ncmpcpp toggle || ncmpc toggle || pms toggle") + mpdwidget.update() + end), + awful.key({ altkey, "Control" }, "Down", + function () + awful.util.spawn_with_shell("mpc stop || ncmpcpp stop || ncmpc stop || pms stop") + mpdwidget.update() + end), + awful.key({ altkey, "Control" }, "Left", + function () + awful.util.spawn_with_shell("mpc prev || ncmpcpp prev || ncmpc prev || pms prev") + mpdwidget.update() + end), + awful.key({ altkey, "Control" }, "Right", + function () + awful.util.spawn_with_shell("mpc next || ncmpcpp 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), @@ -891,42 +515,39 @@ clientkeys = awful.util.table.join( end) ) - --- Compute the maximum number of digit we need, limited to 9 -keynumber = 0 -for s = 1, screen.count() do - keynumber = math.min(9, math.max(#tags[s], keynumber)); -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, keynumber do +for i = 1, 9 do globalkeys = awful.util.table.join(globalkeys, awful.key({ modkey }, "#" .. i + 9, function () - screen = mouse.screen - if tags[screen][i] then - awful.tag.viewonly(tags[screen][i]) + 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 () - screen = mouse.screen - if tags[screen][i] then - awful.tag.viewtoggle(tags[screen][i]) + 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 () - if client.focus and tags[client.focus.screen][i] then - awful.client.movetotag(tags[client.focus.screen][i]) - end + 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 () - if client.focus and tags[client.focus.screen][i] then - awful.client.toggletag(tags[client.focus.screen][i]) + local tag = awful.tag.gettags(client.focus.screen)[i] + if client.focus and tag then + awful.client.toggletag(tag) end end)) end @@ -938,32 +559,30 @@ clientbuttons = awful.util.table.join( -- 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 - } - }, - + -- 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 } }, - + 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] } }, @@ -973,18 +592,10 @@ awful.rules.rules = { { rule = { class = "Gimp", role = "gimp-image-window" }, properties = { maximized_horizontal = true, maximized_vertical = true } }, - - { rule = { class = "Transmission-gtk" }, - properties = { tag = tags[1][4] } }, - - { rule = { class = "Torrent-search" }, - properties = { tag = tags[1][4] } }, } - -- }}} -- {{{ Signals - -- Signal function to execute when a new client appears. client.connect_signal("manage", function (c, startup) -- Enable sloppy focus @@ -995,15 +606,10 @@ client.connect_signal("manage", function (c, startup) end end) - if not startup then - -- Set the windows at the slave, - -- i.e. put it at the end of others instead of setting it master. - awful.client.setslave(c) - - -- Put windows in a smart way, only if they does not set an initial position. - if 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 + 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 end) @@ -1019,11 +625,9 @@ client.connect_signal("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)) @@ -1044,5 +648,4 @@ for s = 1, screen.count() do screen[s]:connect_signal("arrange", function () end end) end - -- }}} diff --git a/rc.lua.steamburn b/rc.lua.steamburn index 4b867a1..9f3f079 100755 --- a/rc.lua.steamburn +++ b/rc.lua.steamburn @@ -1,62 +1,32 @@ ---[[ ]]-- --- - --- Steamburn Awesome WM 3.5.+ config -- --- github.com/copycat-killer -- --- - ---[[ ]]-- - - --- {{{ Required Libraries +--[[ + + Steamburn Awesome WM config 2.0 + github.com/copycat-killer + +--]] +-- {{{ Required libraries local gears = require("gears") local awful = require("awful") awful.rules = require("awful.rules") -awful.autofocus = require("awful.autofocus") +require("awful.autofocus") local wibox = require("wibox") local beautiful = require("beautiful") local naughty = require("naughty") -local vicious = require("vicious") -local scratch = require("scratch") - +local drop = require("scratch.drop") +local lain = require("lain") -- }}} --- {{{ 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 -idle 10") - --- }}} - --- {{{ Localization - -os.setlocale(os.getenv("LANG")) - --- }}} - --- {{{ Error Handling - --- Check if awesome encountered an error during startup and fell back to --- another config (This code will only ever execute for the fallback config) +-- {{{ 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 --- Handle runtime errors after startup do - in_error = false + local in_error = false awesome.connect_signal("debug::error", function (err) - -- Make sure we don't go into an endless error loop if in_error then return end in_error = true @@ -66,431 +36,196 @@ do in_error = false end) end - -- }}} --- {{{ Variable Definitions +-- {{{ 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 -home = os.getenv("HOME") -confdir = home .. "/.config/awesome" -scriptdir = confdir .. "/script/" -themes = confdir .. "/themes" -active_theme = themes .. "/steamburn" +run_once("urxvtd") +run_once("unclutter") +run_once("compton") +-- }}} -beautiful.init(active_theme .. "/theme.lua") +-- {{{ Variable definitions +-- localization +os.setlocale(os.getenv("LANG")) -terminal = "urxvtc" -editor = os.getenv("EDITOR") or "vim" +-- home path +homedir = os.getenv("HOME") .. "/.config/awesome/" + +-- beautiful init +confdir = homedir .. "themes/steamburn/" +beautiful.init(confdir .. "theme.lua") + +-- common +modkey = "Mod4" +altkey = "Mod1" +terminal = "urxvtc" or "xterm" +editor = os.getenv("EDITOR") or "nano" or "vi" editor_cmd = terminal .. " -e " .. editor -gui_editor = "geany -ps" -browser = "dwb" -browser2 = "midori" -mail = terminal .. " -e mutt " -chat = terminal .. " -e irssi " -tasks = terminal .. " -e htop " -wifi = terminal .. " -e sudo wifi-menu " -musicplr = terminal .. " -g 130x34-320+16 -e ncmpcpp " -modkey = "Mod4" -altkey = "Mod1" +-- user defined +browser = "dwb" +browser2 = "iron" +gui_editor = "gvim" +graphics = "gimp" -layouts = -{ - awful.layout.suit.floating, -- 1 - awful.layout.suit.tile, -- 2 - awful.layout.suit.tile.left, -- 3 - awful.layout.suit.tile.bottom, -- 4 - awful.layout.suit.tile.top, -- 5 - awful.layout.suit.fair, -- 6 - awful.layout.suit.fair.horizontal, -- 7 - awful.layout.suit.spiral, -- 8 - awful.layout.suit.spiral.dwindle, -- 9 - awful.layout.suit.max, -- 10 +local layouts = { + awful.layout.suit.floating, + awful.layout.suit.tile, + awful.layout.suit.tile.top, + awful.layout.suit.fair, + awful.layout.suit.fair.horizontal, + awful.layout.suit.spiral.dwindle, } +-- }}} +-- {{{ Tags +tags = { + names = { "web", "term", "docs", "media", "down"}, + layout = { layouts[1], layouts[3], layouts[4], layouts[1], layouts[6] } +} +for s = 1, screen.count() do + 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 - -- }}} --- {{{ Tags - -tags = { - names = { "web", "term", "docs", "media", "down"}, - layout = { layouts[1], layouts[3], layouts[4], layouts[1], layouts[7] } - } -for s = 1, screen.count() do - tags[s] = awful.tag(tags.names, s, tags.layout) -end - --- }}} - --- {{{ Freedesktop menu - +-- {{{ Menu require("freedesktop/freedesktop") - -- }}} -- {{{ Wibox +markup = lain.util.markup +gray = "#94928F" --- Colours -coldef = "" -white = "" -gray = "" +-- Textclock +mytextclock = awful.widget.textclock(" %H:%M ") --- Textclock widget -mytextclock = awful.widget.textclock(white .. "%H:%M" .. coldef) +-- Calendar +lain.widgets.calendar:attach(mytextclock) --- Calendar attached to the textclock -local os = os -local string = string -local table = table -local util = awful.util +--[[ Mail IMAP check +-- commented because it needs to be set before use +mailwidget = lain.widgets.imap({ + timeout = 180, + server = "server", + mail = "mail", + password = "keyring get mail", + settings = function() + mail = "" + count = "" -char_width = nil -text_color = theme.fg_normal or "#FFFFFF" -today_color = theme.tasklist_fg_focus or "#FF7100" -calendar_width = 21 - -local calendar = nil -local offset = 0 - -local data = nil - -local function pop_spaces(s1, s2, maxsize) - local sps = "" - for i = 1, maxsize - string.len(s1) - string.len(s2) do - sps = sps .. " " - end - return s1 .. sps .. s2 -end - -local function create_calendar() - offset = offset or 0 - - local now = os.date("*t") - local cal_month = now.month + offset - local cal_year = now.year - if cal_month > 12 then - cal_month = (cal_month % 12) - cal_year = cal_year + 1 - elseif cal_month < 1 then - cal_month = (cal_month + 12) - cal_year = cal_year - 1 - end - - local last_day = os.date("%d", os.time({ day = 1, year = cal_year, - month = cal_month + 1}) - 86400) - local first_day = os.time({ day = 1, month = cal_month, year = cal_year}) - local first_day_in_week = - os.date("%w", first_day) - local result = "do lu ma me gi ve sa\n" - for i = 1, first_day_in_week do - result = result .. " " - end - - local this_month = false - for day = 1, last_day do - local last_in_week = (day + first_day_in_week) % 7 == 0 - local day_str = pop_spaces("", day, 2) .. (last_in_week and "" or " ") - if cal_month == now.month and cal_year == now.year and day == now.day then - this_month = true - result = result .. - string.format('%s', - today_color, day_str) - else - result = result .. day_str - end - if last_in_week and day ~= last_day then - result = result .. "\n" - end - end - - local header - if this_month then - header = os.date("%a, %d %b %Y") - else - header = os.date("%B %Y", first_day) - end - return header, string.format('%s', - theme.font, text_color, result) -end - -local function calculate_char_width() - return beautiful.get_font_height(theme.font) * 0.555 -end - -function hide() - if calendar ~= nil then - naughty.destroy(calendar) - calendar = nil - offset = 0 - end -end - -function show(inc_offset) - inc_offset = inc_offset or 0 - - local save_offset = offset - hide() - offset = save_offset + inc_offset - - local char_width = char_width or calculate_char_width() - local header, cal_text = create_calendar() - calendar = naughty.notify({ title = header, - text = cal_text, - timeout = 0, hover_timeout = 0.5, - }) -end - -function add_calendar(t_out) - hide() - local char_width = char_width or calculate_char_width() - local header, cal_text = create_calendar() - calendar = naughty.notify({ title = header, - text = cal_text, - timeout = t_out, - }) -end - -mytextclock:connect_signal("mouse::enter", function() show(0) end) -mytextclock:connect_signal("mouse::leave", hide) -mytextclock:buttons(util.table.join( awful.button({ }, 1, function() show(-1) end), - awful.button({ }, 3, function() show(1) end))) - --- Mail widget -mygmail = wibox.widget.textbox() -notify_shown = false -vicious.register(mygmail, vicious.widgets.gmail, - function (widget, args) - notify_title = "Hai un nuovo messaggio" - notify_text = '"' .. args["{subject}"] .. '"' - if (args["{count}"] > 0 ) then - if (notify_shown == false) then - if (args["{count}"] == 1) then - notify_title = "Hai 1 nuovo messaggio" - notify_text = args["{subject}"] - else - notify_title = "Hai " .. noti .. " nuovi messaggi" - notify_text = 'Ultimo: "' .. args["{subject}"] .. '"' - end - naughty.notify({ title = notify_title, text = notify_text, - timeout = 7, - position = "top_left", - icon = beautiful.widget_mail_notify, - fg = beautiful.fg_urgent, - bg = beautiful.bg_urgent }) - notify_shown = true - end - return gray .. " Mail " .. coldef .. white .. args["{count}"] .. " " .. coldef - else - notify_shown = false - return '' - end -end, 60) -mygmail:buttons(awful.util.table.join(awful.button({ }, 1, function () awful.util.spawn(mail, false) end))) - --- Mpd widget -mpdwidget = wibox.widget.textbox() -mpdwidget:buttons(awful.util.table.join(awful.button({ }, 1, function () awful.util.spawn_with_shell(musicplr) end))) -curr_track = nil -vicious.register(mpdwidget, vicious.widgets.mpd, -function(widget, args) - if (args["{state}"] == "Play") then - if( args["{Title}"] ~= curr_track ) - then - curr_track = args["{Title}"] - os.execute(scriptdir .. "mpdinfo") - old_id = naughty.notify({ - title = "Now playing", - text = args["{Artist}"] .. " (" .. args["{Album}"] .. ")\n" .. args["{Title}"], - icon = "/tmp/mpdnotify_cover.png", - timeout = 5, - replaces_id = old_id - }).id - end - return gray .. args["{Title}"] .. coldef .. white .. " " .. args["{Artist}"] .. coldef - elseif (args["{state}"] == "Pause") then - return gray .. "mpd " .. coldef .. white .. "paused" .. coldef - else - return "" - end -end, 1) - --- MEM widget -memwidget = wibox.widget.textbox() -vicious.register(memwidget, vicious.widgets.mem, gray .. "Mem " .. coldef .. white .. "$2 " .. coldef, 13) -- in Megabytes - --- CPU widget -cpuwidget = wibox.widget.textbox() -vicious.register(cpuwidget, vicious.widgets.cpu, gray .. "Cpu " .. coldef .. white .. "$1 " .. coldef, 3) - --- Temp widget -tempwidget = wibox.widget.textbox() -vicious.register(tempwidget, vicious.widgets.thermal, gray .. "Temp " .. coldef .. white .. "$1 " .. coldef, 9, {"coretemp.0", "core"} ) - --- /home fs widget -fshwidget = wibox.widget.textbox() -vicious.register(fshwidget, vicious.widgets.fs, -function (widget, args) - if ( args["{/home used_p}"] >= 99 ) then - naughty.notify({ title = "warning", text = "/home partition ran out!\nmake some room", - timeout = 10, - position = "top_right", - fg = beautiful.fg_urgent, - bg = beautiful.bg_urgent }) - end - return gray .. "Hdd " .. coldef .. white .. args["{/home used_p}"] .. coldef -end, 600) - -local infos = nil - -function remove_info() - if infos ~= nil then - naughty.destroy(infos) - infos = nil - end -end - -function add_info() - remove_info() - local capi = { - mouse = mouse, - screen = screen - } - local cal = awful.util.pread(scriptdir .. "dfs") - cal = string.gsub(cal, " ^%s*(.-)%s*$", "%1") - infos = naughty.notify({ - text = string.format('%s', "Tamsyn", cal), - timeout = 0, - position = "top_right", - margin = 10, - height = 210, - width = 680, - screen = capi.mouse.screen - }) -end - -fshwidget:connect_signal('mouse::enter', function () add_info() end) -fshwidget:connect_signal('mouse::leave', function () remove_info() end) - --- Battery widget -function batstate() - - local file = io.open("/sys/class/power_supply/BAT0/status", "r") - - if (file == nil) then - return "Cable plugged" - end - - local batstate = file:read("*line") - file:close() - - if (batstate == 'Discharging' or batstate == 'Charging') then - return batstate - else - return "Fully charged" - end -end - -batwidget = wibox.widget.textbox() -vicious.register(batwidget, vicious.widgets.bat, -function (widget, args) - -- plugged - if (batstate() == 'Cable plugged' or batstate() == 'Unknown') then - return '' - -- critical - elseif (args[2] <= 5 and batstate() == 'Discharging') then - naughty.notify({ - text = "sto per spegnermi...", - title = "Carica quasi esaurita!", - position = "top_right", - timeout = 1, - fg="#000000", - bg="#ffffff", - screen = 1, - ontop = true, - }) - -- low - elseif (args[2] <= 10 and batstate() == 'Discharging') then - naughty.notify({ - text = "attacca il cavo!", - title = "Carica bassa", - position = "top_right", - timeout = 1, - fg="#ffffff", - bg="#262729", - screen = 1, - ontop = true, - }) - end - return gray .. "Bat " .. coldef .. white .. args[2] .. " " .. coldef -end, 1, 'BAT0') - --- Volume widget -volumewidget = wibox.widget.textbox() -vicious.register(volumewidget, vicious.widgets.volume, -function (widget, args) - if (args[2] ~= "♩" ) then - return gray .. "Vol " .. coldef .. white .. args[1] .. " " .. coldef - else - return gray .. "Vol " .. coldef .. white .. "mute " .. coldef - end -end, 1, "Master") - --- Net widget -netwidget = wibox.widget.textbox() -vicious.register(netwidget, vicious.widgets.net, gray .. "Net " .. coldef .. white .. "${wlp3s0 down_kb} " .. "↓↑ " .. "${wlp3s0 up_kb} " .. coldef, 3) -netwidget:buttons(awful.util.table.join(awful.button({ }, 1, function () awful.util.spawn_with_shell(wifi) end))) - --- Weather widget -weatherwidget = wibox.widget.textbox() -sky_toshow = "" -vicious.register(weatherwidget, vicious.widgets.weather, - function (widget, args) - if args["{tempf}"] == "N/A" then - return gray .. "No " .. coldef .. white .. "Info " .. coldef - else - -- work in progress - ☂☔☃ ⛆⛇⛈ 🌂 - if( args["{sky}"] == "N/A" or string.find(args["{sky}"], "Clear") ~= nil ) then sky_toshow = "" - elseif( string.find(args["{sky}"], "Cloudy") ~= nil ) then sky_toshow = "" - end - if sky_toshow ~= "" then return gray .. sky_toshow .. coldef .. " " .. white .. args["{tempc}"] .. " " .. coldef - else return gray .. args["{sky}"] .. coldef .. " " .. white .. args["{tempc}"] .. " " .. coldef - end + if mailcount > 0 then + mail = "Arch " + count = mailcount .. " " end - end, 1800, "ICAO-CODE-GOES-HERE" ) + + widget:set_markup(markup(gray, mail) .. count) + end +}) +]] + +-- MPD +mpdwidget = lain.widgets.mpd({ + settings = function() + artist = mpd_now.artist .. " " + title = mpd_now.title .. " " + + if mpd_now.state == "pause" then + artist = "mpd " + title = "paused " + elseif mpd_now.state == "stop" then + artist = "" + title = "" + end + + widget:set_markup(markup(gray, artist) .. title) + end +}) + +-- CPU +cpuwidget = lain.widgets.sysload({ + settings = function() + widget:set_markup(markup(gray, " Cpu ") .. load_1 .. " ") + end +}) + +-- MEM +memwidget = lain.widgets.mem({ + settings = function() + widget:set_markup(markup(gray, " Mem ") .. mem_now.used .. " ") + end +}) + +-- Battery +batwidget = lain.widgets.bat({ + settings = function() + bat_perc = bat_now.perc + if bat_perc == "N/A" then bat_perc = "Plug" end + widget:set_markup(markup(gray, " Bat ") .. bat_perc .. " ") + end +}) + +-- Net checker +netwidget = lain.widgets.net({ + settings = function() + if net_now.state == "up" then net_state = "On" + else net_state = "Off" end + widget:set_markup(markup(gray, " Net ") .. net_state .. " ") + end +}) + +-- ALSA volume +volumewidget = lain.widgets.alsa({ + settings = function() + header = " Vol " + vlevel = volume_now.level + + if volume_now.status == "off" then + vlevel = vlevel .. "M " + else + vlevel = vlevel .. " " + end + + widget:set_markup(markup(gray, header) .. vlevel) + end +}) + +-- Weather +yawn = lain.widgets.yawn(123456) -- Separators +first = wibox.widget.textbox(markup.font("Tamsyn 4", " ")) spr = wibox.widget.textbox(' ') -leftbr = wibox.widget.textbox(' [') -rightbr = wibox.widget.textbox('] ') - --- }}} - --- {{{ Layout -- Create a wibox for each screen and add it mywibox = {} mypromptbox = {} -mylayoutbox = {} +txtlayoutbox = {} mytaglist = {} +mytasklist = {} 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 = {} + awful.button({ }, 5, function(t) awful.tag.viewprev(awful.tag.getscreen(t)) end)) mytasklist.buttons = awful.util.table.join( awful.button({ }, 1, function (c) if c == client.focus then @@ -525,18 +260,31 @@ mytasklist.buttons = awful.util.table.join( if client.focus then client.focus:raise() end end)) -for s = 1, screen.count() do +-- Writes a string representation of the current layout in a textbox widget +function updatelayoutbox(layout, s) + local screen = s or 1 + local txt_l = beautiful["layout_txt_" .. awful.layout.getname(awful.layout.get(screen))] or "" + layout:set_text(txt_l) +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 textbox widget which will contains a short string representing the + -- layout we're using. We need one layoutbox per screen. + txtlayoutbox[s] = wibox.widget.textbox(beautiful["layout_txt_" .. awful.layout.getname(awful.layout.get(s))]) + awful.tag.attached_connect_signal(s, "property::selected", function () + updatelayoutbox(txtlayoutbox[s], s) + end) + awful.tag.attached_connect_signal(s, "property::layout", function () + updatelayoutbox(txtlayoutbox[s], s) + end) + txtlayoutbox[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) @@ -544,98 +292,113 @@ for s = 1, screen.count() do -- Create a tasklist widget mytasklist[s] = awful.widget.tasklist(s, awful.widget.tasklist.filter.currenttags, mytasklist.buttons) - -- Create the upper wibox + -- Create the wibox mywibox[s] = awful.wibox({ position = "top", screen = s, height = 18 }) - -- Widgets that are aligned to the upper left + -- Widgets that are aligned to the left local left_layout = wibox.layout.fixed.horizontal() - left_layout:add(spr) + left_layout:add(first) left_layout:add(mytaglist[s]) - left_layout:add(leftbr) - left_layout:add(mylayoutbox[s]) - left_layout:add(rightbr) + left_layout:add(spr) + left_layout:add(txtlayoutbox[s]) + left_layout:add(spr) left_layout:add(mypromptbox[s]) - -- Widgets that are aligned to the upper right + -- Widgets that are aligned to the right local right_layout = wibox.layout.fixed.horizontal() if s == 1 then right_layout:add(wibox.widget.systray()) end right_layout:add(spr) right_layout:add(mpdwidget) - right_layout:add(spr) - right_layout:add(mygmail) - right_layout:add(spr) + --right_layout:add(mailwidget) right_layout:add(cpuwidget) - right_layout:add(spr) right_layout:add(memwidget) - right_layout:add(spr) - right_layout:add(tempwidget) - right_layout:add(spr) - right_layout:add(fshwidget) - right_layout:add(spr) right_layout:add(batwidget) - right_layout:add(spr) right_layout:add(netwidget) - right_layout:add(spr) right_layout:add(volumewidget) - right_layout:add(spr) - right_layout:add(weatherwidget) - right_layout:add(spr) right_layout:add(mytextclock) - right_layout:add(spr) -- 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) - end - -- }}} --- {{{ Mouse Bindings - +-- {{{ 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), - -- Capture a screenshot - awful.key({ altkey }, "p", function() awful.util.spawn("screenshot",false) 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), - -- Move clients - awful.key({ altkey }, "Next", function () awful.client.moveresize( 1, 1, -2, -2) end), - awful.key({ altkey }, "Prior", function () awful.client.moveresize(-1, -1, 2, 2) end), - awful.key({ altkey }, "Down", function () awful.client.moveresize( 0, 1, 0, 0) end), - awful.key({ altkey }, "Up", function () awful.client.moveresize( 0, -1, 0, 0) end), - awful.key({ altkey }, "Left", function () awful.client.moveresize(-1, 0, 0, 0) end), - awful.key({ altkey }, "Right", function () awful.client.moveresize( 1, 0, 0, 0) end), - awful.key({ modkey, }, "Left", awful.tag.viewprev ), - awful.key({ modkey, }, "Right", awful.tag.viewnext ), - awful.key({ modkey, }, "Escape", awful.tag.history.restore), - awful.key({ modkey, }, "k", + -- 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), + + -- Dynamic tag renaming + awful.key({ altkey, "Shift" }, "r", + function () + lain.util.prompt_rename_tag(mypromptbox) + 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({ modkey, }, "j", + awful.key({ altkey }, "j", function () awful.client.focus.byidx(-1) if client.focus then client.focus:raise() end end), - awful.key({ modkey, }, "w", function () mymainmenu:show({keygrabber=true}) 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 + mywibox[mouse.screen].visible = not mywibox[mouse.screen].visible end), -- Layout manipulation @@ -651,76 +414,84 @@ globalkeys = awful.util.table.join( 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), - awful.key({ modkey, }, "l", function () awful.tag.incmwfact( 0.05) end), - awful.key({ modkey, }, "h", function () awful.tag.incmwfact(-0.05) end), - awful.key({ modkey, "Shift" }, "h", function () awful.tag.incnmaster( 1) end), - awful.key({ modkey, "Shift" }, "l", function () awful.tag.incnmaster(-1) end), - awful.key({ modkey, "Control" }, "h", function () awful.tag.incncol( 1) end), - awful.key({ modkey, "Control" }, "l", 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), + awful.key({ modkey, "Control" }, "r", awesome.restart), + awful.key({ modkey, "Shift" }, "q", awesome.quit), -- Dropdown terminal - awful.key({ modkey, }, "z", function () scratch.drop(terminal) end), + awful.key({ modkey, }, "z", function () drop(terminal) end), -- Widgets popups - awful.key({ altkey, }, "c", function () add_calendar(7) end), + awful.key({ altkey, }, "c", function () lain.widgets.calendar:show(7) end), + awful.key({ altkey, }, "h", function () fshome.show(7) end), + awful.key({ altkey, }, "w", function () yawn.show(7) end), - -- Volume control - awful.key({ "Control" }, "Up", function () - awful.util.spawn("amixer set Master playback 1%+", false ) - vicious.force({ volumewidget }) - end), - awful.key({ "Control" }, "Down", function () - awful.util.spawn("amixer set Master playback 1%-", false ) - vicious.force({ volumewidget }) - end), - awful.key({ "Control" }, "m", function () - awful.util.spawn("amixer set Master playback toggle", false ) - vicious.force({ volumewidget }) - end), - awful.key({ altkey, "Control" }, "m", function () - awful.util.spawn("amixer set Master playback 100%", false ) - vicious.force({ volumewidget }) - end), + -- ALSA volume control + awful.key({ altkey }, "Up", + function () + awful.util.spawn("amixer -q set Master 1%+") + volumewidget.update() + end), + awful.key({ altkey }, "Down", + function () + awful.util.spawn("amixer -q set Master 1%-") + volumewidget.update() + end), + awful.key({ altkey }, "m", + function () + awful.util.spawn("amixer -q set Master playback toggle") + volumewidget.update() + end), + awful.key({ altkey, "Control" }, "m", + function () + awful.util.spawn("amixer -q set Master playback 100%") + volumewidget.update() + end), - -- Music control - awful.key({ altkey, "Control" }, "Up", function () - awful.util.spawn_with_shell( "mpc toggle || ncmpcpp toggle || ncmpc toggle || pms toggle", false ) - vicious.force({ mpdwidget } ) - end), - awful.key({ altkey, "Control" }, "Down", function () - awful.util.spawn_with_shell( "mpc stop || ncmpcpp stop || ncmpc stop || pms stop", false ) - vicious.force({ mpdwidget } ) - end ), - awful.key({ altkey, "Control" }, "Left", function () - awful.util.spawn_with_shell( "mpc prev || ncmpcpp prev || ncmpc prev || pms prev", false ) - vicious.force({ mpdwidget } ) - end ), - awful.key({ altkey, "Control" }, "Right", function () - awful.util.spawn_with_shell( "mpc next || ncmpcpp next || ncmpc next || pms next", false ) - vicious.force({ mpdwidget } ) - end ), + -- MPD control + awful.key({ altkey, "Control" }, "Up", + function () + awful.util.spawn_with_shell("mpc toggle || ncmpcpp toggle || ncmpc toggle || pms toggle") + mpdwidget.update() + end), + awful.key({ altkey, "Control" }, "Down", + function () + awful.util.spawn_with_shell("mpc stop || ncmpcpp stop || ncmpc stop || pms stop") + mpdwidget.update() + end), + awful.key({ altkey, "Control" }, "Left", + function () + awful.util.spawn_with_shell("mpc prev || ncmpcpp prev || ncmpc prev || pms prev") + mpdwidget.update() + end), + awful.key({ altkey, "Control" }, "Right", + function () + awful.util.spawn_with_shell("mpc next || ncmpcpp 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), + awful.key({ modkey }, "c", function () os.execute("xsel -p -o | xsel -i -b") end), -- User programs - awful.key({ modkey, }, "q", function () awful.util.spawn( "dwb", false ) end), - awful.key({ modkey, }, "a", function () awful.util.spawn( "midori", false ) end), - awful.key({ modkey, }, "s", function () awful.util.spawn(gui_editor) end), - awful.key({ modkey, }, "t", function () awful.util.spawn( "thunderbird", false ) end), - awful.key({ modkey, }, "d", function () awful.util.spawn( "spacefm", false ) end), + 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: " }, @@ -750,41 +521,39 @@ clientkeys = awful.util.table.join( end) ) --- Compute the maximum number of digit we need, limited to 9 -keynumber = 0 -for s = 1, screen.count() do - keynumber = math.min(9, math.max(#tags[s], keynumber)); -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, keynumber do +for i = 1, 9 do globalkeys = awful.util.table.join(globalkeys, awful.key({ modkey }, "#" .. i + 9, function () - screen = mouse.screen - if tags[screen][i] then - awful.tag.viewonly(tags[screen][i]) + 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 () - screen = mouse.screen - if tags[screen][i] then - awful.tag.viewtoggle(tags[screen][i]) + 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 () - if client.focus and tags[client.focus.screen][i] then - awful.client.movetotag(tags[client.focus.screen][i]) - end + 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 () - if client.focus and tags[client.focus.screen][i] then - awful.client.toggletag(tags[client.focus.screen][i]) + local tag = awful.tag.gettags(client.focus.screen)[i] + if client.focus and tag then + awful.client.toggletag(tag) end end)) end @@ -796,67 +565,43 @@ clientbuttons = awful.util.table.join( -- 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 = true, - keys = clientkeys, - buttons = clientbuttons, - size_hints_honor = false - } - }, + -- 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 } }, + properties = { floating = true } }, { rule = { class = "Dwb" }, - properties = { tag = tags[1][1], - maximized_vertical=true, - maximized_horizontal=true } }, + properties = { tag = tags[1][1] } }, - { rule = { class = "Midori" }, - properties = { tag = tags[1][1], - maximized_vertical=true, - maximized_horizontal=true } }, + { rule = { class = "Iron" }, + properties = { tag = tags[1][1] } }, - { rule = { class = "Geany" }, - properties = { tag = tags[1][2] } }, + { rule = { instance = "plugin-container" }, + properties = { tag = tags[1][1] } }, - { rule = { class = "Zathura" }, - properties = { tag = tags[1][3] } }, + { rule = { class = "Gimp" }, + properties = { tag = tags[1][4] } }, - { rule = { class = "Thunderbird" }, - properties = { tag = tags[1][3] } }, - - { rule = { class = "Dia" }, - properties = { tag = tags[1][4], - floating = true } }, - - { rule = { class = "Gimp" }, - properties = { tag = tags[1][4], - floating = true } }, - - { rule = { class = "Inkscape" }, - properties = { tag = tags[1][4], - floating = true } }, - - { rule = { class = "Transmission-gtk" }, - properties = { tag = tags[1][5] } }, - - { rule = { class = "Torrent-search" }, - properties = { tag = tags[1][5] } }, + { rule = { class = "Gimp", role = "gimp-image-window" }, + properties = { maximized_horizontal = true, + maximized_vertical = true } }, } +-- }}} - --- Signals - +-- {{{ Signals -- Signal function to execute when a new client appears. client.connect_signal("manage", function (c, startup) -- Enable sloppy focus @@ -867,59 +612,46 @@ client.connect_signal("manage", function (c, startup) end end) - if not startup then - -- Set the windows at the slave, - -- i.e. put it at the end of others instead of setting it master. - -- awful.client.setslave(c) - - -- Put windows in a smart way, only if they does not set an initial position. - if 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 - end - - local titlebars_enabled = false - if titlebars_enabled and (c.type == "normal" or c.type == "dialog") then - -- Widgets that are aligned to the left - local left_layout = wibox.layout.fixed.horizontal() - left_layout:add(awful.titlebar.widget.iconwidget(c)) - - -- 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)) - right_layout:add(awful.titlebar.widget.closebutton(c)) - - -- The title goes in the middle - local title = awful.titlebar.widget.titlewidget(c) - title: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) - )) - - -- Now bring it all together - local layout = wibox.layout.align.horizontal() - layout:set_left(left_layout) - layout:set_right(right_layout) - layout:set_middle(title) - - awful.titlebar(c):set_widget(layout) + 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 end) -client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus 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_width = "0" + c.border_color = beautiful.border_normal + else + c.border_width = beautiful.border_width + 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 + if awful.client.floating.get(c) or layout == "floating" then + c.border_width = beautiful.border_width + + -- No borders with only one visible client + elseif #clients == 1 or layout == "max" then + clients[1].border_width = 0 + awful.client.moveresize(0, 0, 2, 2, clients[1]) + else + c.border_width = beautiful.border_width + end + end + end + end) +end -- }}} diff --git a/scratch/drop.lua b/scratch/drop.lua index 95daeda..3168640 100644 --- a/scratch/drop.lua +++ b/scratch/drop.lua @@ -36,7 +36,6 @@ local capi = { -- Scratchdrop: drop-down applications manager for the awesome window manager local drop = {} -- module scratch.drop - local dropdown = {} -- Create a new window for the drop-down application when it doesn't diff --git a/scratch/pad.lua b/scratch/pad.lua index cdc4c01..6a61241 100644 --- a/scratch/pad.lua +++ b/scratch/pad.lua @@ -35,7 +35,6 @@ local capi = { -- Scratchpad: basic scratchpad manager for the awesome window manager local pad = {} -- module scratch.pad - local scratchpad = {} -- Toggle a set of properties on a client. diff --git a/scripts/dfs b/scripts/dfs deleted file mode 100755 index 6a6261e..0000000 --- a/scripts/dfs +++ /dev/null @@ -1,388 +0,0 @@ -#!/bin/bash -# -# Adapted from Eridan's "fs" (cleanup, enhancements and switch to bash/Linux) -# JM, 10/12/2004 -# -# ------------------------------------------------------------------------- -# 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 - -if [ ! -x ${AWK_COMMAND} ]; then -echo "### ${AWK_COMMAND} not present; install it! ###" -echo " On Mac OS X: install MacPorts and perform:" -echo " sudo port install gawk" -fi - -# ------------------------------------------------------------------------- -# 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 (*)%% UsatoSpazio liberoSpazio totale
\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/scripts/mpdinfo b/scripts/mpdinfo deleted file mode 100755 index 41fa8a0..0000000 --- a/scripts/mpdinfo +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/bash - -# A simple notify script for now-playing songs on mpd. This script uses -# notify-send (from libnotify) and mpc to get the current song information. -# ImageMagick is also needed for the cover. - -# Configuration------------------------------------------------------- - -# The music directory that contains the music and cover files -# Change according to your configuration -MUSIC_DIR="$HOME/Music" - -# The default cover to use (optional) -DEFAULT_ART="" - -# Regex expression used for image search -IMG_REG="(front|cover|art|Folder|folder)\.(jpg|jpeg|png|gif)$" - -# Path of temporary resized cover -TEMP_PATH="/tmp/mpdnotify_cover.png" - -# Resize cover to (optional, recommended) -COVER_RESIZE="100x100" - -# Thumbnail background (transparent by default) -COVER_BACKGROUND="none" - -#-------------------------------------------------------------------- - -# determine file -file="$(mpc current -f %file%)" - -# 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" -thumbnail $COVER_RESIZE -gravity center -background "$COVER_BACKGROUND" -extent $COVER_RESIZE "$TEMP_PATH" - cover="$TEMP_PATH" - fi -else - rm $TEMP_PATH -fi - -exit 0 diff --git a/themes/blackburn/icons/mail_notify.png b/themes/blackburn/icons/mail_notify.png deleted file mode 100644 index b44851f..0000000 Binary files a/themes/blackburn/icons/mail_notify.png and /dev/null differ diff --git a/themes/blackburn/icons/no_net_notify.png b/themes/blackburn/icons/no_net_notify.png deleted file mode 100755 index 1a3e8a8..0000000 Binary files a/themes/blackburn/icons/no_net_notify.png and /dev/null differ diff --git a/themes/blackburn/icons/tilegaps.png b/themes/blackburn/icons/uselesstile.png similarity index 100% rename from themes/blackburn/icons/tilegaps.png rename to themes/blackburn/icons/uselesstile.png diff --git a/themes/blackburn/icons/uselesstileleft.png b/themes/blackburn/icons/uselesstileleft.png new file mode 100644 index 0000000..a77c177 Binary files /dev/null and b/themes/blackburn/icons/uselesstileleft.png differ diff --git a/themes/blackburn/icons/uselesstiletop.png b/themes/blackburn/icons/uselesstiletop.png new file mode 100644 index 0000000..8f5afa9 Binary files /dev/null and b/themes/blackburn/icons/uselesstiletop.png differ diff --git a/themes/blackburn/theme.lua b/themes/blackburn/theme.lua index 8f406b6..e3d55f1 100644 --- a/themes/blackburn/theme.lua +++ b/themes/blackburn/theme.lua @@ -1,64 +1,63 @@ ---[[ ]]-- --- - --- Blackburn Awesome WM 3.5.+ theme -- --- github.com/copycat-killer -- --- - ---[[ ]]-- +--[[ + + Blackburn Awesome WM config 2.0 + github.com/copycat-killer + +--]] +theme = {} -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.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" +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.font = "Tamsyn 10" -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 = "#404040" +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.taglist_fg_focus = "#F6784F" -theme.taglist_bg_focus = "#060606" -theme.tasklist_fg_focus = "#F6784F" -theme.tasklist_bg_focus = "#060606" -theme.textbox_widget_margin_top = 1 -theme.awful_widget_height = 14 -theme.awful_widget_margin_top = 2 -theme.menu_height = "16" -theme.menu_width = "140" +theme.menu_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.menu_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.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 = "" -theme.tasklist_floating = "" -theme.tasklist_maximized_horizontal = "" -theme.tasklist_maximized_vertical = "" - -theme.widget_mail_notify = theme.dir .. "/icons/mail_notify.png" -theme.widget_no_net_notify = theme.dir .. "/icons/no_net_notify.png" +-- lain related +theme.useless_gap_width = "8" +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/themes/dremora/icons/mail_notify.png b/themes/dremora/icons/mail_notify.png deleted file mode 100644 index b44851f..0000000 Binary files a/themes/dremora/icons/mail_notify.png and /dev/null differ diff --git a/themes/dremora/icons/max.png b/themes/dremora/icons/max.png index b2a37f6..bda3c6a 100644 Binary files a/themes/dremora/icons/max.png and b/themes/dremora/icons/max.png differ diff --git a/themes/dremora/icons/no_net_notify.png b/themes/dremora/icons/no_net_notify.png deleted file mode 100755 index 1a3e8a8..0000000 Binary files a/themes/dremora/icons/no_net_notify.png and /dev/null differ diff --git a/themes/dremora/icons/tilegaps.png b/themes/dremora/icons/uselesstile.png similarity index 100% rename from themes/dremora/icons/tilegaps.png rename to themes/dremora/icons/uselesstile.png diff --git a/themes/dremora/icons/uselesstileleft.png b/themes/dremora/icons/uselesstileleft.png new file mode 100644 index 0000000..987dcc2 Binary files /dev/null and b/themes/dremora/icons/uselesstileleft.png differ diff --git a/themes/dremora/icons/uselesstiletop.png b/themes/dremora/icons/uselesstiletop.png new file mode 100644 index 0000000..1eabd27 Binary files /dev/null and b/themes/dremora/icons/uselesstiletop.png differ diff --git a/themes/dremora/theme.lua b/themes/dremora/theme.lua index 2491220..9af3d10 100644 --- a/themes/dremora/theme.lua +++ b/themes/dremora/theme.lua @@ -1,59 +1,62 @@ ---[[ ]]-- --- - --- Dremora Awesome WM 3.5.+ theme -- --- github.com/copycat-killer -- --- - ---[[ ]]-- +--[[ + + Dremora Awesome WM config 2.0 + github.com/copycat-killer + +--]] +theme = {} -theme = {} +theme.dir = os.getenv("HOME") .. "/.config/awesome/themes/dremora" +theme.wallpaper = theme.dir .. "/wall.png" -themes_dir = os.getenv("HOME") .. "/.config/awesome/themes/dremora" -theme.wallpaper = themes_dir .. "/wall.png" +theme.font = "Tamsyn 10" +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.font = "Tamsyn 10" -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.taglist_fg_focus = "#DDDCFF" -theme.taglist_bg_focus = "#121212" -theme.menu_height = "16" -theme.menu_width = "140" +theme.menu_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.menu_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.arrl_lr_pre = themes_dir .. "/icons/arrl_lr_pre.png" -theme.arrl_lr_post = themes_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.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.tasklist_disable_icon = true +theme.tasklist_floating = "" +theme.tasklist_maximized_horizontal = "" +theme.tasklist_maximized_vertical = "" -theme.tasklist_floating = "" -theme.tasklist_maximized_horizontal = "" -theme.tasklist_maximized_vertical = "" - -theme.widget_mail_notify = themes_dir .. "/icons/mail_notify.png" -theme.widget_no_net_notify = themes_dir .. "/icons/no_net_notify.png" +-- lain related +theme.useless_gap_width = "8" +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/themes/holo/icons/mpd_on.png b/themes/holo/icons/mpd_on.png deleted file mode 100644 index f160b3c..0000000 Binary files a/themes/holo/icons/mpd_on.png and /dev/null differ diff --git a/themes/holo/icons/no_net_notify.png b/themes/holo/icons/no_net_notify.png deleted file mode 100644 index 1a3e8a8..0000000 Binary files a/themes/holo/icons/no_net_notify.png and /dev/null differ diff --git a/themes/holo/icons/tilegaps.png b/themes/holo/icons/uselesstile.png similarity index 100% rename from themes/holo/icons/tilegaps.png rename to themes/holo/icons/uselesstile.png diff --git a/themes/holo/icons/vol_bg.png b/themes/holo/icons/vol_bg.png new file mode 100644 index 0000000..c928d5b Binary files /dev/null and b/themes/holo/icons/vol_bg.png differ diff --git a/themes/holo/original_wall.png b/themes/holo/original_wall.png deleted file mode 100644 index aa8de2f..0000000 Binary files a/themes/holo/original_wall.png and /dev/null differ diff --git a/themes/holo/theme.lua b/themes/holo/theme.lua index c1e052d..d858ce9 100644 --- a/themes/holo/theme.lua +++ b/themes/holo/theme.lua @@ -1,85 +1,91 @@ ---[[ ]]-- --- - --- Holo Awesome WM 3.5.+ theme -- --- github.com/copycat-killer -- --- - ---[[ ]]-- +--[[ + + Holo Awesome WM config 2.0 + github.com/copycat-killer + +--]] +theme = {} -theme = {} +theme.icon_dir = os.getenv("HOME") .. "/.config/awesome/themes/holo/icons" -theme.icon_dir = os.getenv("HOME") .. "/.config/awesome/themes/holo/icons" +theme.wallpaper = os.getenv("HOME") .. "/.config/awesome/themes/holo/wall.png" -theme.wallpaper = os.getenv("HOME") .. "/.config/awesome/themes/holo/wall.png" +theme.topbar_path = "png:" .. theme.icon_dir .. "/topbar/" -theme.topbar_path = "png:" .. theme.icon_dir .. "/topbar/" +theme.font = "Tamsyn 10" +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.font = "Tamsyn 10" -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 = "#505050" -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.menu_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.widget_bg = theme.icon_dir .. "/bg_focus_noline.png" -theme.awesome_icon = theme.icon_dir .. "/awesome_icon.png" -theme.menu_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.widget_no_net_notify = theme.icon_dir .. "/no_net_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.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 = "" -theme.tasklist_floating = "" -theme.tasklist_maximized_horizontal = "" -theme.tasklist_maximized_vertical = "" +-- lain related +theme.useless_gap_width = "4" +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/themes/multicolor/widgets/ac.png b/themes/multicolor/icons/ac.png similarity index 100% rename from themes/multicolor/widgets/ac.png rename to themes/multicolor/icons/ac.png diff --git a/themes/multicolor/icons/bat.png b/themes/multicolor/icons/bat.png new file mode 100755 index 0000000..454f053 Binary files /dev/null and b/themes/multicolor/icons/bat.png differ diff --git a/themes/multicolor/widgets/clock.png b/themes/multicolor/icons/clock.png similarity index 100% rename from themes/multicolor/widgets/clock.png rename to themes/multicolor/icons/clock.png diff --git a/themes/multicolor/widgets/cpu.png b/themes/multicolor/icons/cpu.png similarity index 100% rename from themes/multicolor/widgets/cpu.png rename to themes/multicolor/icons/cpu.png diff --git a/themes/multicolor/widgets/dish.png b/themes/multicolor/icons/dish.png similarity index 100% rename from themes/multicolor/widgets/dish.png rename to themes/multicolor/icons/dish.png diff --git a/themes/multicolor/widgets/fs.png b/themes/multicolor/icons/fs.png old mode 100755 new mode 100644 similarity index 100% rename from themes/multicolor/widgets/fs.png rename to themes/multicolor/icons/fs.png diff --git a/themes/multicolor/icons/mail.png b/themes/multicolor/icons/mail.png new file mode 100755 index 0000000..e8cf11e Binary files /dev/null and b/themes/multicolor/icons/mail.png differ diff --git a/themes/multicolor/widgets/mem.png b/themes/multicolor/icons/mem.png similarity index 100% rename from themes/multicolor/widgets/mem.png rename to themes/multicolor/icons/mem.png diff --git a/themes/multicolor/widgets/net_down.png b/themes/multicolor/icons/net_down.png similarity index 100% rename from themes/multicolor/widgets/net_down.png rename to themes/multicolor/icons/net_down.png diff --git a/themes/multicolor/widgets/net_up.png b/themes/multicolor/icons/net_up.png similarity index 100% rename from themes/multicolor/widgets/net_up.png rename to themes/multicolor/icons/net_up.png diff --git a/themes/multicolor/icons/note.png b/themes/multicolor/icons/note.png new file mode 100644 index 0000000..78f85bf Binary files /dev/null and b/themes/multicolor/icons/note.png differ diff --git a/themes/multicolor/widgets/note.png b/themes/multicolor/icons/note_on.png similarity index 100% rename from themes/multicolor/widgets/note.png rename to themes/multicolor/icons/note_on.png diff --git a/themes/multicolor/widgets/spkr.png b/themes/multicolor/icons/spkr.png similarity index 100% rename from themes/multicolor/widgets/spkr.png rename to themes/multicolor/icons/spkr.png diff --git a/themes/multicolor/icons/square_a.png b/themes/multicolor/icons/square_a.png new file mode 100755 index 0000000..1774d95 Binary files /dev/null and b/themes/multicolor/icons/square_a.png differ diff --git a/themes/multicolor/icons/square_b.png b/themes/multicolor/icons/square_b.png new file mode 100755 index 0000000..b47e9f3 Binary files /dev/null and b/themes/multicolor/icons/square_b.png differ diff --git a/themes/multicolor/submenu.png b/themes/multicolor/icons/submenu.png similarity index 100% rename from themes/multicolor/submenu.png rename to themes/multicolor/icons/submenu.png diff --git a/themes/multicolor/widgets/temp.png b/themes/multicolor/icons/temp.png similarity index 100% rename from themes/multicolor/widgets/temp.png rename to themes/multicolor/icons/temp.png diff --git a/themes/multicolor/layouts/dwindle.png b/themes/multicolor/layouts/dwindle.png deleted file mode 100755 index 81bf3e9..0000000 Binary files a/themes/multicolor/layouts/dwindle.png and /dev/null differ diff --git a/themes/multicolor/layouts/fairh.png b/themes/multicolor/layouts/fairh.png deleted file mode 100755 index 89712e2..0000000 Binary files a/themes/multicolor/layouts/fairh.png and /dev/null differ diff --git a/themes/multicolor/layouts/fairv.png b/themes/multicolor/layouts/fairv.png deleted file mode 100755 index e1ac18b..0000000 Binary files a/themes/multicolor/layouts/fairv.png and /dev/null differ diff --git a/themes/multicolor/layouts/floating.png b/themes/multicolor/layouts/floating.png deleted file mode 100755 index e0a3c39..0000000 Binary files a/themes/multicolor/layouts/floating.png and /dev/null differ diff --git a/themes/multicolor/layouts/fullscreen.png b/themes/multicolor/layouts/fullscreen.png deleted file mode 100755 index 84b7c27..0000000 Binary files a/themes/multicolor/layouts/fullscreen.png and /dev/null differ diff --git a/themes/multicolor/layouts/magnifier.png b/themes/multicolor/layouts/magnifier.png deleted file mode 100755 index 1188d50..0000000 Binary files a/themes/multicolor/layouts/magnifier.png and /dev/null differ diff --git a/themes/multicolor/layouts/max.png b/themes/multicolor/layouts/max.png deleted file mode 100755 index f0979c9..0000000 Binary files a/themes/multicolor/layouts/max.png and /dev/null differ diff --git a/themes/multicolor/layouts/spiral.png b/themes/multicolor/layouts/spiral.png deleted file mode 100755 index ec32ff3..0000000 Binary files a/themes/multicolor/layouts/spiral.png and /dev/null differ diff --git a/themes/multicolor/layouts/tile.png b/themes/multicolor/layouts/tile.png deleted file mode 100755 index 9bbf2fa..0000000 Binary files a/themes/multicolor/layouts/tile.png and /dev/null differ diff --git a/themes/multicolor/layouts/tilebottom.png b/themes/multicolor/layouts/tilebottom.png deleted file mode 100755 index ea85f92..0000000 Binary files a/themes/multicolor/layouts/tilebottom.png and /dev/null differ diff --git a/themes/multicolor/layouts/tilegaps.png b/themes/multicolor/layouts/tilegaps.png deleted file mode 100644 index 539e29c..0000000 Binary files a/themes/multicolor/layouts/tilegaps.png and /dev/null differ diff --git a/themes/multicolor/layouts/tileleft.png b/themes/multicolor/layouts/tileleft.png deleted file mode 100755 index 1b8e3c0..0000000 Binary files a/themes/multicolor/layouts/tileleft.png and /dev/null differ diff --git a/themes/multicolor/layouts/tiletop.png b/themes/multicolor/layouts/tiletop.png deleted file mode 100755 index a2d0f6a..0000000 Binary files a/themes/multicolor/layouts/tiletop.png and /dev/null differ diff --git a/themes/multicolor/taglist/square_a.png b/themes/multicolor/taglist/square_a.png deleted file mode 100755 index df65248..0000000 Binary files a/themes/multicolor/taglist/square_a.png and /dev/null differ diff --git a/themes/multicolor/taglist/square_b.png b/themes/multicolor/taglist/square_b.png deleted file mode 100755 index c3838b4..0000000 Binary files a/themes/multicolor/taglist/square_b.png and /dev/null differ diff --git a/themes/multicolor/theme.lua b/themes/multicolor/theme.lua index 3880d38..bede6c5 100644 --- a/themes/multicolor/theme.lua +++ b/themes/multicolor/theme.lua @@ -1,86 +1,85 @@ ---[[ ]]-- --- - --- Multicolor Awesome WM 3.5.+ config -- --- github.com/copycat-killer -- --- - ---[[ ]]-- +--[[ + + Multicolor Awesome WM config 2.0 + github.com/copycat-killer + +--]] -theme = {} -theme.confdir = os.getenv("HOME") .. "/.config/awesome/themes/multicolor" +theme = {} -theme.font = "Terminus 8" ---theme.taglist_font = +theme.confdir = os.getenv("HOME") .. "/.config/awesome/themes/multicolor" +theme.wallpaper = theme.confdir .. "/wall.png" -theme.menu_bg_normal = "#000000" -theme.menu_bg_focus = "#000000" +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.menu_submenu_icon = theme.confdir .. "/submenu.png" -theme.bg_normal = "#000000" -theme.bg_focus = "#000000" -theme.bg_urgent = "#000000" +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.fg_normal = "#aaaaaa" -theme.fg_focus = "#ff8c00" -theme.fg_urgent = "#af1d18" -theme.fg_minimize = "#ffffff" +theme.taglist_squares_sel = theme.confdir .. "/icons/square_a.png" +theme.taglist_squares_unsel = theme.confdir .. "/icons/square_b.png" -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.menu_submenu_icon = theme.confdir .. "/submenu.png" - -theme.widget_temp = theme.confdir .. "/widgets/temp.png" -theme.widget_uptime = theme.confdir .. "/widgets/ac.png" -theme.widget_cpu = theme.confdir .. "/widgets/cpu.png" -theme.widget_mem = theme.confdir .. "/widgets/mem.png" -theme.widget_fs = theme.confdir .. "/widgets/fs.png" -theme.widget_netdown = theme.confdir .. "/widgets/net_down.png" -theme.widget_netup = theme.confdir .. "/widgets/net_up.png" -theme.widget_gmail = theme.confdir .. "/widgets/mail.png" -theme.widget_batt = theme.confdir .. "/widgets/bat.png" -theme.widget_clock = theme.confdir .. "/widgets/clock.png" -theme.widget_vol = theme.confdir .. "/widgets/spkr.png" - -theme.taglist_squares_sel = theme.confdir .. "/taglist/square_a.png" -theme.taglist_squares_unsel = theme.confdir .. "/taglist/square_b.png" - -theme.tasklist_floating = "" +theme.tasklist_disable_icon = true +theme.tasklist_floating = "" theme.tasklist_maximized_horizontal = "" -theme.tasklist_maximized_vertical = "" +theme.tasklist_maximized_vertical = "" -theme.layout_tile = theme.confdir .. "/layouts/tile.png" -theme.layout_tilegaps = theme.confdir .. "/layouts/tilegaps.png" -theme.layout_tileleft = theme.confdir .. "/layouts/tileleft.png" -theme.layout_tilebottom = theme.confdir .. "/layouts/tilebottom.png" -theme.layout_tiletop = theme.confdir .. "/layouts/tiletop.png" -theme.layout_fairv = theme.confdir .. "/layouts/fairv.png" -theme.layout_fairh = theme.confdir .. "/layouts/fairh.png" -theme.layout_spiral = theme.confdir .. "/layouts/spiral.png" -theme.layout_dwindle = theme.confdir .. "/layouts/dwindle.png" -theme.layout_max = theme.confdir .. "/layouts/max.png" -theme.layout_fullscreen = theme.confdir .. "/layouts/fullscreen.png" -theme.layout_magnifier = theme.confdir .. "/layouts/magnifier.png" -theme.layout_floating = theme.confdir .. "/layouts/floating.png" +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" ---theme.awesome_icon = -theme.wallpaper = theme.confdir .. "/wall.png" return theme diff --git a/themes/multicolor/widgets/bat.png b/themes/multicolor/widgets/bat.png deleted file mode 100755 index 6a3ad09..0000000 Binary files a/themes/multicolor/widgets/bat.png and /dev/null differ diff --git a/themes/multicolor/widgets/mail.png b/themes/multicolor/widgets/mail.png deleted file mode 100755 index 2840f9d..0000000 Binary files a/themes/multicolor/widgets/mail.png and /dev/null differ diff --git a/themes/powerarrow-darker/icons/mail.png b/themes/powerarrow-darker/icons/mail.png index 4357fea..61abd6a 100644 Binary files a/themes/powerarrow-darker/icons/mail.png and b/themes/powerarrow-darker/icons/mail.png differ diff --git a/themes/powerarrow-darker/icons/mail_notify.png b/themes/powerarrow-darker/icons/mail_notify.png deleted file mode 100644 index b44851f..0000000 Binary files a/themes/powerarrow-darker/icons/mail_notify.png and /dev/null differ diff --git a/themes/powerarrow-darker/icons/submenu.png b/themes/powerarrow-darker/icons/submenu.png index 10ca014..b55ebce 100644 Binary files a/themes/powerarrow-darker/icons/submenu.png and b/themes/powerarrow-darker/icons/submenu.png differ diff --git a/themes/powerarrow-darker/icons/tilegaps.png b/themes/powerarrow-darker/icons/tilegaps.png deleted file mode 100644 index b1cc143..0000000 Binary files a/themes/powerarrow-darker/icons/tilegaps.png and /dev/null differ diff --git a/themes/powerarrow-darker/theme.lua b/themes/powerarrow-darker/theme.lua index 8e04646..7a65c61 100644 --- a/themes/powerarrow-darker/theme.lua +++ b/themes/powerarrow-darker/theme.lua @@ -1,84 +1,84 @@ ---[[ ]]-- --- - --- Powearrow Darker Awesome WM 3.5.+ theme -- --- github.com/copycat-killer -- --- - ---[[ ]]-- +--[[ + + Powerarrow Darker Awesome WM config 2.0 + github.com/copycat-killer + +--]] +theme = {} -theme = {} +themes_dir = os.getenv("HOME") .. "/.config/awesome/themes/powerarrow-darker" +theme.wallpaper = themes_dir .. "/wall.png" -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.font = "Terminus 9" -theme.fg_normal = "#DCDCCC" -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 = "#FF7100" -theme.tasklist_bg_focus = "#1A1A1A" -theme.tasklist_fg_focus = "#FF7100" -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.menu_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.menu_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.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.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.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_notify = themes_dir .. "/icons/mail_notify.png" - -theme.tasklist_floating = "" -theme.tasklist_maximized_horizontal = "" -theme.tasklist_maximized_vertical = "" +theme.tasklist_disable_icon = true +theme.tasklist_floating = "" +theme.tasklist_maximized_horizontal = "" +theme.tasklist_maximized_vertical = "" return theme diff --git a/themes/rainbow/icons/vol_bg.png b/themes/rainbow/icons/vol_bg.png new file mode 100644 index 0000000..7778d33 Binary files /dev/null and b/themes/rainbow/icons/vol_bg.png differ diff --git a/themes/rainbow/theme.lua b/themes/rainbow/theme.lua index 09de99c..a9a6a70 100644 --- a/themes/rainbow/theme.lua +++ b/themes/rainbow/theme.lua @@ -1,10 +1,9 @@ ---[[ ]]-- --- - --- Rainbow Awesome WM 3.5.+ theme -- --- github.com/copycat-killer -- --- - ---[[ ]]-- - +--[[ + + Rainbow Awesome WM config 2.0 + github.com/copycat-killer + +--]] theme = {} diff --git a/themes/steamburn/icons/dwindle.png b/themes/steamburn/icons/dwindle.png deleted file mode 100644 index ae8d084..0000000 Binary files a/themes/steamburn/icons/dwindle.png and /dev/null differ diff --git a/themes/steamburn/icons/fairh.png b/themes/steamburn/icons/fairh.png deleted file mode 100644 index 532237b..0000000 Binary files a/themes/steamburn/icons/fairh.png and /dev/null differ diff --git a/themes/steamburn/icons/fairv.png b/themes/steamburn/icons/fairv.png deleted file mode 100644 index 467541d..0000000 Binary files a/themes/steamburn/icons/fairv.png and /dev/null differ diff --git a/themes/steamburn/icons/floating.png b/themes/steamburn/icons/floating.png deleted file mode 100644 index 882738f..0000000 Binary files a/themes/steamburn/icons/floating.png and /dev/null differ diff --git a/themes/steamburn/icons/magnifier.png b/themes/steamburn/icons/magnifier.png deleted file mode 100644 index fda3d46..0000000 Binary files a/themes/steamburn/icons/magnifier.png and /dev/null differ diff --git a/themes/steamburn/icons/mail_notify.png b/themes/steamburn/icons/mail_notify.png deleted file mode 100644 index b44851f..0000000 Binary files a/themes/steamburn/icons/mail_notify.png and /dev/null differ diff --git a/themes/steamburn/icons/max.png b/themes/steamburn/icons/max.png deleted file mode 100644 index 2dda334..0000000 Binary files a/themes/steamburn/icons/max.png and /dev/null differ diff --git a/themes/steamburn/icons/spiral.png b/themes/steamburn/icons/spiral.png deleted file mode 100644 index ebd5999..0000000 Binary files a/themes/steamburn/icons/spiral.png and /dev/null differ diff --git a/themes/steamburn/icons/tile.png b/themes/steamburn/icons/tile.png deleted file mode 100644 index 128305f..0000000 Binary files a/themes/steamburn/icons/tile.png and /dev/null differ diff --git a/themes/steamburn/icons/tilebottom.png b/themes/steamburn/icons/tilebottom.png deleted file mode 100644 index e63d636..0000000 Binary files a/themes/steamburn/icons/tilebottom.png and /dev/null differ diff --git a/themes/steamburn/icons/tilegaps.png b/themes/steamburn/icons/tilegaps.png deleted file mode 100644 index eccd966..0000000 Binary files a/themes/steamburn/icons/tilegaps.png and /dev/null differ diff --git a/themes/steamburn/icons/tileleft.png b/themes/steamburn/icons/tileleft.png deleted file mode 100644 index fcac452..0000000 Binary files a/themes/steamburn/icons/tileleft.png and /dev/null differ diff --git a/themes/steamburn/icons/tiletop.png b/themes/steamburn/icons/tiletop.png deleted file mode 100644 index 1e860e1..0000000 Binary files a/themes/steamburn/icons/tiletop.png and /dev/null differ diff --git a/themes/steamburn/theme.lua b/themes/steamburn/theme.lua index 5a5759d..be82fe3 100644 --- a/themes/steamburn/theme.lua +++ b/themes/steamburn/theme.lua @@ -1,63 +1,52 @@ ---[[ ]]-- --- - --- Steamburn Awesome WM 3.5.+ theme -- --- github.com/copycat-killer -- --- - ---[[ ]]-- +--[[ + + Steamburn Awesome WM config 2.0 + github.com/copycat-killer + +--]] +theme = {} -theme = {} +themes_dir = os.getenv("HOME") .. "/.config/awesome/themes/steamburn" +theme.wallpaper = themes_dir .. "/wall.png" -themes_dir = os.getenv("HOME") .. "/.config/awesome/themes/steamburn" -theme.wallpaper = themes_dir .. "/wall.png" +theme.font = "Tamsyn 10" +theme.fg_normal = "#cdcdcd" +theme.fg_focus = "#d79d38" +theme.fg_urgent = "#CC9393" +theme.bg_normal = "#140c0b" +theme.bg_focus = "#140c0b" +theme.bg_urgent = "#2a1f1e" +theme.border_width = "1" +theme.border_normal = "#140c0f" +theme.border_focus = "#915543" +theme.border_marked = "#CC9393" +theme.taglist_fg_focus = "#d47456" +theme.tasklist_bg_focus = "#140c0b" +theme.tasklist_fg_focus = "#d47456" +theme.menu_height = "16" +theme.menu_width = "140" -theme.font = "Tamsyn 10" -theme.fg_normal = "#cdcdcd" -theme.fg_focus = "#d79d38" -theme.fg_urgent = "#CC9393" -theme.bg_normal = "#140c0b" -theme.bg_focus = "#140c0b" -theme.bg_urgent = "#2a1f1e" -theme.border_width = "1" -theme.border_normal = "#140c0f" -theme.border_focus = "#915543" -theme.border_marked = "#CC9393" -theme.titlebar_bg_focus = "#FFFFFF" -theme.titlebar_bg_normal = "#FFFFFF" -theme.taglist_fg_focus = "#f6784f" -theme.tasklist_bg_focus = "#140c0b" -theme.tasklist_fg_focus = "#f6784f" -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.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.menu_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.menu_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.tasklist_floating = "" -theme.tasklist_maximized_horizontal = "" -theme.tasklist_maximized_vertical = "" - -theme.widget_mail_notify = themes_dir .. "/icons/mail_notify.png" +theme.tasklist_disable_icon = true +theme.tasklist_floating = "" +theme.tasklist_maximized_horizontal = "" +theme.tasklist_maximized_vertical = "" return theme