Replace Awesome WM with Enlightenment
@@ -1,214 +0,0 @@
|
||||
local awful = require("awful")
|
||||
|
||||
local externals = {}
|
||||
|
||||
--{{{ helpers
|
||||
externals.hook = {
|
||||
before = function(object, handler, hook)
|
||||
local prev_handler = object[handler]
|
||||
object[handler] = function(...)
|
||||
if hook(...) then
|
||||
prev_handler(...)
|
||||
end
|
||||
end
|
||||
end,
|
||||
after = function(object, handler, hook)
|
||||
local prev_handler = object[handler]
|
||||
object[handler] = function(...)
|
||||
hook(..., prev_handler(...))
|
||||
end
|
||||
end
|
||||
}
|
||||
--}}}
|
||||
|
||||
-- specific
|
||||
externals.players = {}
|
||||
externals.browsers = {}
|
||||
externals.powers = {}
|
||||
externals.sounds = {}
|
||||
externals.mails = {}
|
||||
externals.displays = {}
|
||||
|
||||
--{{{ browsers.firefox
|
||||
externals.browsers.firefox = {
|
||||
exec = function(command)
|
||||
awful.util.spawn('firefox ' .. command)
|
||||
end,
|
||||
|
||||
manager = function()
|
||||
awful.util.spawn('firefox')
|
||||
end,
|
||||
|
||||
search = function(term)
|
||||
externals.browsers.firefox.exec('http://www.google.com/search?q=' .. string.gsub(term, ' ', '+'))
|
||||
end,
|
||||
|
||||
browse = function(...)
|
||||
externals.browsers.firefox.exec(...)
|
||||
end
|
||||
}
|
||||
--}}}
|
||||
|
||||
--{{{ browsers.chromium
|
||||
externals.browsers.chromium = {
|
||||
exec = function(command)
|
||||
awful.util.spawn('chromium ' .. command)
|
||||
end,
|
||||
|
||||
manager = function()
|
||||
awful.util.spawn('chromium')
|
||||
end,
|
||||
|
||||
search = function(term)
|
||||
externals.browsers.chromium.exec('http://www.google.com/search?q=' .. string.gsub(term, ' ', '+'))
|
||||
end,
|
||||
|
||||
browse = function(...)
|
||||
externals.browsers.chromium.exec(...)
|
||||
end
|
||||
}
|
||||
--}}}
|
||||
|
||||
--{{{ sounds.alsa
|
||||
externals.sounds.alsa = {
|
||||
exec = function(command)
|
||||
exec('amixer -q ' .. command)
|
||||
end,
|
||||
|
||||
manager = function()
|
||||
conexec('alsamixer')
|
||||
end,
|
||||
|
||||
mute = function()
|
||||
externals.sounds.alsa.exec('set ' .. externals.sound.channel .. ' toggle')
|
||||
end,
|
||||
|
||||
up = function()
|
||||
externals.sounds.alsa.exec('set ' .. externals.sound.channel .. ' 2dB+')
|
||||
end,
|
||||
|
||||
down = function()
|
||||
externals.sounds.alsa.exec('set ' .. externals.sound.channel .. ' 2dB-')
|
||||
end
|
||||
}
|
||||
--}}}
|
||||
|
||||
--{{{ sounds.pulse
|
||||
externals.sounds.pulse = {
|
||||
exec = function(command)
|
||||
exec('amixer -q ' .. command)
|
||||
end,
|
||||
|
||||
manager = function()
|
||||
conexec('alsamixer')
|
||||
end,
|
||||
|
||||
mute = function()
|
||||
externals.sounds.alsa.exec('set ' .. externals.sound.channel .. ' toggle')
|
||||
end,
|
||||
|
||||
up = function()
|
||||
externals.sounds.alsa.exec('set ' .. externals.sound.channel .. ' 2dB+')
|
||||
end,
|
||||
|
||||
down = function()
|
||||
externals.sounds.alsa.exec('set ' .. externals.sound.channel .. ' 2dB-')
|
||||
end
|
||||
}
|
||||
--}}}
|
||||
|
||||
--{{{ powers.pm
|
||||
externals.powers.pm = {
|
||||
exec = function(command)
|
||||
awful.util.spawn('systemctl ' .. command)
|
||||
end,
|
||||
|
||||
reboot = function()
|
||||
externals.powers.pm.exec('reboot')
|
||||
end,
|
||||
|
||||
halt = function()
|
||||
externals.powers.pm.exec('poweroff')
|
||||
end,
|
||||
|
||||
suspend = function()
|
||||
externals.powers.pm.exec('suspend')
|
||||
end,
|
||||
|
||||
hibernate = function()
|
||||
externals.powers.pm.exec('hibernate')
|
||||
end,
|
||||
|
||||
switch_profile = function()
|
||||
externals.powers.pm.exec('/opt/bin/powerctl switch')
|
||||
end
|
||||
}
|
||||
--}}}
|
||||
|
||||
--{{{ powers.ck
|
||||
externals.powers.ck = {
|
||||
exec = function(command)
|
||||
awful.util.spawn('dbus-send --system --print-reply --dest="org.freedesktop.ConsoleKit" /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.' .. command)
|
||||
end,
|
||||
|
||||
reboot = function()
|
||||
externals.powers.ck.exec('Restart')
|
||||
end,
|
||||
|
||||
halt = function()
|
||||
externals.powers.ck.exec('Stop')
|
||||
end,
|
||||
|
||||
pm_exec = function(command)
|
||||
awful.util.spawn('dbus-send --system --print-reply --dest="org.freedesktop.UPower" /org/freedesktop/UPower org.freedesktop.UPower.' .. command)
|
||||
end,
|
||||
|
||||
suspend = function()
|
||||
externals.powers.ck.pm_exec('Suspend')
|
||||
end,
|
||||
|
||||
hibernate = function()
|
||||
externals.powers.ck.pm_exec('Hibernate')
|
||||
end
|
||||
}
|
||||
--}}}
|
||||
|
||||
--{{{ mails.gmail
|
||||
externals.mails.gmail = {
|
||||
open = function(target)
|
||||
externals.browser.browse("https://gmail.com")
|
||||
end,
|
||||
|
||||
manager = function(...)
|
||||
externals.mail.open(...)
|
||||
end
|
||||
}
|
||||
--}}}
|
||||
|
||||
-- general
|
||||
--externals.player = externals.players.mpd
|
||||
|
||||
externals.browser = externals.browsers.chromium
|
||||
|
||||
externals.mail = externals.mails.gmail
|
||||
|
||||
externals.sound = externals.sounds.alsa
|
||||
externals.sound.channel = 'Speaker'
|
||||
|
||||
externals.display = {
|
||||
switch = function() exec('/opt/powerctl switch-display') end,
|
||||
screensaver = function() exec('xautolock -locknow') end,
|
||||
toggle = nil,
|
||||
turn_off = function() exec('xset dpms force off') end,
|
||||
save = function () exec("scrot -e 'mv $f ~/Pictures/'") end,
|
||||
backlight = {
|
||||
down = function() exec("sudo sh -c 'echo $[$(</sys/class/backlight/intel_backlight/brightness)-500] >/sys/class/backlight/intel_backlight/brightness'") end,
|
||||
up = function() exec("sudo sh -c 'echo $[$(</sys/class/backlight/intel_backlight/brightness)+500] >/sys/class/backlight/intel_backlight/brightness'") end
|
||||
}
|
||||
}
|
||||
|
||||
externals.power = externals.powers.ck
|
||||
|
||||
return externals
|
||||
|
||||
-- vim: set foldmarker=--{{{,--}}} foldmethod=marker:
|
||||
@@ -1,41 +0,0 @@
|
||||
function for_month(month, year, formats)
|
||||
-- build header
|
||||
local text = " "
|
||||
for day_of_week = 1, 7 do
|
||||
-- Jan 1 2006 is Sunday
|
||||
text = text .. os.date("%a ", os.time{year = 2006, month = 1, day = day_of_week})
|
||||
end
|
||||
|
||||
formats = formats or {}
|
||||
|
||||
local week = tonumber(os.date("%V", os.time{year = year, month = month, day = 1}))
|
||||
local current_day = os.date("*t")
|
||||
|
||||
local prev_month_last_day = os.date("*t", os.time{year = year, month = month, day = 0})
|
||||
local month_last_day = os.date("*t", os.time{year = year, month = month + 1, day = 0})
|
||||
for day = 1 - (prev_month_last_day.wday % 7), month_last_day.day do
|
||||
if (day + prev_month_last_day.wday - 1) % 7 == 0 then
|
||||
text = text .. "\n " .. string.format("%.2d", week) .. " "
|
||||
week = week + 1
|
||||
end
|
||||
local day_format, day_number
|
||||
if day <= 0 then
|
||||
day_format = "prev_month"
|
||||
day_number = prev_month_last_day.day + day
|
||||
elseif day == current_day.day and
|
||||
month_last_day.month == current_day.month and
|
||||
month_last_day.year == current_day.year then
|
||||
day_format = "today"
|
||||
day_number = day
|
||||
else
|
||||
day_format = "default"
|
||||
day_number = day
|
||||
end
|
||||
|
||||
text = text .. string.format(formats[day_format] or "%s", string.format(" %2d ", day_number))
|
||||
end
|
||||
|
||||
return string.format("%13s%.2d.%d", "", month_last_day.month, month_last_day.year) .. "\n\n" .. text
|
||||
end
|
||||
|
||||
return { for_month = for_month }
|
||||
@@ -1,49 +0,0 @@
|
||||
-- typical mpc/mpd tasks:
|
||||
-- *
|
||||
|
||||
prompt = {
|
||||
box = nil,
|
||||
exec = {
|
||||
lua = function(command)
|
||||
end,
|
||||
google = function(command)
|
||||
end,
|
||||
player = function(command)
|
||||
end
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
-- Prompt
|
||||
awful.key({ modkey }, "r", function () mypromptbox[mouse.screen]:run() end),
|
||||
|
||||
-- TODO: unite in a single prompt with prefix (=2+2, g weather in Minsk, http://tut.by/ etc)
|
||||
|
||||
awful.key({ modkey }, "x",
|
||||
function()
|
||||
awful.prompt.run({ prompt = "Run Lua code: " },
|
||||
mypromptbox[mouse.screen].widget,
|
||||
function (...)
|
||||
local result = awful.util.eval(...)
|
||||
promptbox.widget:set_text(result) -- I need a calculator :(
|
||||
end, nil,
|
||||
awful.util.getdir("cache") .. "/history_eval")
|
||||
end),
|
||||
|
||||
awful.key({ modkey }, "s",
|
||||
function()
|
||||
awful.prompt.run({ prompt = "Google: " },
|
||||
mypromptbox[mouse.screen].widget,
|
||||
externals.browser.search, nil,
|
||||
awful.util.getdir("cache") .. "/history_search")
|
||||
end),
|
||||
|
||||
awful.key({ modkey }, "p",
|
||||
function()
|
||||
awful.prompt.run({ prompt = "Play: " },
|
||||
mypromptbox[mouse.screen].widget,
|
||||
externals.music.search, nil,
|
||||
awful.util.getdir("cache") .. "/history_play")
|
||||
end),
|
||||
|
||||
@@ -1,720 +0,0 @@
|
||||
-- Standard awesome library
|
||||
local gears = require("gears")
|
||||
local awful = require("awful")
|
||||
awful.rules = require("awful.rules")
|
||||
require("awful.autofocus")
|
||||
-- Widget and layout library
|
||||
local wibox = require("wibox")
|
||||
-- Theme handling library
|
||||
local beautiful = require("beautiful")
|
||||
-- Notification library
|
||||
local naughty = require("naughty")
|
||||
local menubar = require("menubar")
|
||||
|
||||
-- Delightful Widgets (OMG paths)
|
||||
--require('widgets.delightful.delightful.widgets.cpu')
|
||||
local widgets_date = require('widgets.date')
|
||||
local widgets_bat = require('widgets.bat')
|
||||
--require('widgets.delightful.delightful.widgets.imap')
|
||||
--require('widgets.delightful.delightful.widgets.memory')
|
||||
--require('widgets.delightful.delightful.widgets.network')
|
||||
--require('widgets.delightful.delightful.widgets.pulseaudio')
|
||||
--require('widgets.delightful.delightful.widgets.weather')
|
||||
|
||||
-- External programs
|
||||
local externals = require("externals")
|
||||
--{{{ 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 })
|
||||
in_error = false
|
||||
end)
|
||||
end
|
||||
--}}}
|
||||
|
||||
--{{{ Variable definitions
|
||||
-- Themes define colours, icons, and wallpapers
|
||||
beautiful.init(".config/awesome/theme/theme.lua")
|
||||
|
||||
-- TODO: when launching external app, make con window floating and switch to corresponding tab
|
||||
|
||||
-- This is used later as the default terminal and editor to run.
|
||||
terminal = "xterm"
|
||||
editor = os.getenv("EDITOR") or "vi"
|
||||
editor_cmd = terminal .. " -e " .. editor
|
||||
|
||||
function exec(command)
|
||||
awful.util.spawn(command, false)
|
||||
end
|
||||
|
||||
function conexec(command)
|
||||
exec(terminal .. ' -e ' .. command)
|
||||
end
|
||||
|
||||
-- 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"
|
||||
menukey = "Menu"
|
||||
|
||||
-- Table of layouts to cover with awful.layout.inc, order matters.
|
||||
local 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
|
||||
}
|
||||
--}}}
|
||||
|
||||
--{{{ Wallpaper
|
||||
if beautiful.wallpaper then
|
||||
for s = 1, screen.count() do
|
||||
gears.wallpaper.maximized(beautiful.wallpaper, s, false, { x = 0, y = -50 })
|
||||
end
|
||||
end
|
||||
--}}}
|
||||
|
||||
--{{{ Tags
|
||||
-- Define a tag table which hold all screen tags.
|
||||
tags = {}
|
||||
for s = 1, screen.count() do
|
||||
-- Each screen has its own tag table.
|
||||
tags[s] = awful.tag(
|
||||
{ "1:term", "2:bw", "3:vim", "4:skype", "5:IM", "6:vbox", 7, }, s,
|
||||
{ layouts[7], layouts[10], layouts[10], layouts[7], layouts[10], layouts[10], layouts[10] }
|
||||
)
|
||||
end
|
||||
--}}}
|
||||
|
||||
--{{{ Menu
|
||||
-- Create a laucher widget and a main menu
|
||||
myawesomemenu = {
|
||||
{ "manual", terminal .. " -e man awesome" },
|
||||
{ "edit config", editor_cmd .. " " .. awesome.conffile },
|
||||
{ "restart", awesome.restart },
|
||||
{ "quit", awesome.quit }
|
||||
}
|
||||
|
||||
mymainmenu = awful.menu({ items = {
|
||||
{ "awesome", myawesomemenu, beautiful.awesome_icon },
|
||||
{ "open terminal", terminal },
|
||||
{ "shutdown", {
|
||||
{ "reboot", externals.power.reboot },
|
||||
{ "halt", externals.power.halt },
|
||||
{ "suspend", externals.power.suspend },
|
||||
{ "hibernate", externals.power.hibernate }
|
||||
} }
|
||||
}})
|
||||
|
||||
-- Menubar configuration
|
||||
menubar.utils.terminal = terminal -- Set the terminal for applications that require it
|
||||
|
||||
mylauncher = awful.widget.launcher({
|
||||
image = beautiful.awesome_icon,
|
||||
menu = mymainmenu
|
||||
})
|
||||
--}}}
|
||||
|
||||
--{{{ Wibox
|
||||
--{{{ Reusable separator
|
||||
separator = wibox.widget.imagebox()
|
||||
separator:set_image(beautiful.widget_sep)
|
||||
--}}}
|
||||
|
||||
require('externals')
|
||||
|
||||
--require('widgets/cpu')
|
||||
--require('widgets/mem')
|
||||
--require('widgets/fs')
|
||||
--require('widgets/net')
|
||||
--require('widgets/wifi')
|
||||
--require('widgets/vol')
|
||||
--require('widgets/mpd')
|
||||
--require('widgets/wth')
|
||||
--require('widgets/gmail')
|
||||
--require('widgets/pkg')
|
||||
--require('widgets/bat')
|
||||
--require('widgets/date')
|
||||
|
||||
-- Create a wibox for each screen and add it
|
||||
mywibox = {}
|
||||
mypromptbox = {}
|
||||
mylayoutbox = {}
|
||||
mytaglist = {}
|
||||
mytaglist.buttons = awful.util.table.join(
|
||||
awful.button({ }, 1, awful.tag.viewonly),
|
||||
awful.button({ modkey }, 1, awful.client.movetotag),
|
||||
awful.button({ }, 3, awful.tag.viewtoggle),
|
||||
awful.button({ modkey }, 3, awful.client.toggletag),
|
||||
awful.button({ }, 4, function(t) awful.tag.viewnext(awful.tag.getscreen(t)) end),
|
||||
awful.button({ }, 5, function(t) awful.tag.viewprev(awful.tag.getscreen(t)) end)
|
||||
)
|
||||
mytasklist = {}
|
||||
mytasklist.buttons = awful.util.table.join(
|
||||
awful.button({ }, 1, function (c)
|
||||
if c == client.focus then
|
||||
c.minimized = true
|
||||
else
|
||||
-- Without this, the following
|
||||
-- :isvisible() makes no sense
|
||||
c.minimized = false
|
||||
if not c:isvisible() then
|
||||
awful.tag.viewonly(c:tags()[1])
|
||||
end
|
||||
-- This will also un-minimize
|
||||
-- the client, if needed
|
||||
client.focus = c
|
||||
c:raise()
|
||||
end
|
||||
end),
|
||||
awful.button({ }, 3, function ()
|
||||
if instance then
|
||||
instance:hide()
|
||||
instance = nil
|
||||
else
|
||||
instance = awful.menu.clients({ width=250 })
|
||||
end
|
||||
end),
|
||||
awful.button({ }, 4, function ()
|
||||
awful.client.focus.byidx(1)
|
||||
if client.focus then client.focus:raise() end
|
||||
end),
|
||||
awful.button({ }, 5, function ()
|
||||
awful.client.focus.byidx(-1)
|
||||
if client.focus then client.focus:raise() end
|
||||
end))
|
||||
|
||||
for s = 1, screen.count() do
|
||||
-- Create a promptbox for each screen
|
||||
mypromptbox[s] = awful.widget.prompt()
|
||||
-- Create an imagebox widget which will contains an icon indicating which layout we're using.
|
||||
-- We need one layoutbox per screen.
|
||||
mylayoutbox[s] = awful.widget.layoutbox(s)
|
||||
mylayoutbox[s]:buttons(awful.util.table.join(
|
||||
awful.button({ }, 1, function () awful.layout.inc(layouts, 1) end),
|
||||
awful.button({ }, 3, function () awful.layout.inc(layouts, -1) end),
|
||||
awful.button({ }, 4, function () awful.layout.inc(layouts, 1) end),
|
||||
awful.button({ }, 5, function () awful.layout.inc(layouts, -1) end)))
|
||||
-- Create a taglist widget
|
||||
mytaglist[s] = awful.widget.taglist(s, awful.widget.taglist.filter.all, mytaglist.buttons)
|
||||
|
||||
-- Create a tasklist widget
|
||||
mytasklist[s] = awful.widget.tasklist(s, awful.widget.tasklist.filter.currenttags, mytasklist.buttons)
|
||||
|
||||
-- Create the wibox
|
||||
mywibox[s] = awful.wibox({ position = "top", screen = s })
|
||||
|
||||
-- Widgets that are aligned to the left
|
||||
local left_layout = wibox.layout.fixed.horizontal()
|
||||
left_layout:add(mylauncher)
|
||||
left_layout:add(mytaglist[s])
|
||||
left_layout:add(mypromptbox[s])
|
||||
|
||||
--[[
|
||||
local right_widgets = awful.util.table.join({
|
||||
cpuwidget.i,
|
||||
cpuwidget.g,
|
||||
cpuwidget.w,
|
||||
separator,
|
||||
|
||||
memwidget.i,
|
||||
memwidget.w,
|
||||
separator,
|
||||
|
||||
fswidget.i
|
||||
},
|
||||
fswidget.get_fs_widgets(),
|
||||
{
|
||||
|
||||
fswidget.w,
|
||||
separator,
|
||||
|
||||
volwidget.i,
|
||||
volwidget.w,
|
||||
separator,
|
||||
|
||||
mpdwidget.i,
|
||||
mpdwidget.w,
|
||||
separator,
|
||||
|
||||
netwidget.i_dn,
|
||||
netwidget.w,
|
||||
netwidget.i_up,
|
||||
wifiwidget.i,
|
||||
wifiwidget.w,
|
||||
separator,
|
||||
|
||||
s == 1 and wibox.widget.systray() or nil,
|
||||
|
||||
gmailwidget.i,
|
||||
gmailwidget.w,
|
||||
pkgwidget.i,
|
||||
pkgwidget.w,
|
||||
batwidget.i,
|
||||
batwidget.w,
|
||||
separator,
|
||||
|
||||
datewidget.i,
|
||||
datewidget.w,
|
||||
separator,
|
||||
mylayoutbox[s]
|
||||
})
|
||||
--]]
|
||||
-- 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(awful.widget.textclock())
|
||||
|
||||
local delightful_container = { widgets = {}, icons = {} }
|
||||
local widgets, icons = widgets_date:create()
|
||||
if widgets then
|
||||
if not icons then
|
||||
icons = {}
|
||||
end
|
||||
table.insert(delightful_container.widgets, awful.util.table.reverse(widgets))
|
||||
table.insert(delightful_container.icons, awful.util.table.reverse(icons))
|
||||
end
|
||||
|
||||
local widgets, icons = widgets_bat:create()
|
||||
if widgets then
|
||||
if not icons then
|
||||
icons = {}
|
||||
end
|
||||
table.insert(delightful_container.widgets, awful.util.table.reverse(widgets))
|
||||
table.insert(delightful_container.icons, awful.util.table.reverse(icons))
|
||||
end
|
||||
|
||||
for delightful_container_index, delightful_container_data in pairs(delightful_container.widgets) do
|
||||
for widget_index, widget_data in pairs(delightful_container_data) do
|
||||
right_layout:add(widget_data)
|
||||
if delightful_container.icons[delightful_container_index] and delightful_container.icons[delightful_container_index][widget_index] then
|
||||
right_layout:add(delightful_container.icons[delightful_container_index][widget_index])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
right_layout:add(mylayoutbox[s])
|
||||
|
||||
-- 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
|
||||
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
|
||||
-- read with 'xev' (xorg-xev)
|
||||
globalkeys = awful.util.table.join(
|
||||
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, }, "j",
|
||||
function ()
|
||||
awful.client.focus.byidx( 1)
|
||||
if client.focus then client.focus:raise() end
|
||||
end),
|
||||
awful.key({ modkey, }, "k",
|
||||
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),
|
||||
|
||||
-- Layout manipulation
|
||||
awful.key({ modkey, "Shift" }, "j", function () awful.client.swap.byidx( 1) end),
|
||||
awful.key({ modkey, "Shift" }, "k", function () awful.client.swap.byidx(-1) end),
|
||||
awful.key({ modkey, "Control" }, "j", function () awful.screen.focus_relative( 1) end),
|
||||
awful.key({ modkey, "Control" }, "k", function () awful.screen.focus_relative(-1) end),
|
||||
awful.key({ modkey, }, "u", awful.client.urgent.jumpto),
|
||||
awful.key({ modkey, }, "Tab",
|
||||
function ()
|
||||
awful.client.focus.history.previous()
|
||||
if client.focus then
|
||||
client.focus:raise()
|
||||
end
|
||||
end),
|
||||
|
||||
-- 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 }, "F12", externals.display.screensaver),
|
||||
|
||||
--awful.key({ modkey, "Control" }, "Up", externals.player.toggle),
|
||||
--awful.key({ modkey, "Control" }, "Down", externals.player.stop),
|
||||
--awful.key({ modkey, "Control" }, "Left", externals.player.prev),
|
||||
--awful.key({ modkey, "Control" }, "Right", externals.player.next),
|
||||
|
||||
awful.key({ modkey }, "Up", externals.sound.up),
|
||||
awful.key({ modkey }, "Down", externals.sound.down),
|
||||
|
||||
-- Media Keys
|
||||
--awful.key({ }, 'XF86AudioPlay', externals.player.toggle),
|
||||
--awful.key({ }, 'XF86AudioPrev', externals.player.prev),
|
||||
--awful.key({ }, 'XF86AudioNext', externals.player.next),
|
||||
--awful.key({ }, 'XF86AudioStop', externals.player.stop),
|
||||
|
||||
awful.key({ }, 'XF86AudioMute', externals.sound.mute),
|
||||
awful.key({ }, 'XF86AudioRaiseVolume', externals.sound.up),
|
||||
awful.key({ }, 'XF86AudioLowerVolume', externals.sound.down),
|
||||
|
||||
awful.key({ }, 'XF86MonBrightnessDown', externals.display.backlight.down),
|
||||
awful.key({ }, 'XF86MonBrightnessUp', externals.display.backlight.up),
|
||||
|
||||
awful.key({ }, 'XF86Search', externals.browser.search), -- this will fail. Use the same func as Meta+S does instead
|
||||
awful.key({ }, 'XF86Mail', externals.mail.manager),
|
||||
awful.key({ }, 'XF86HomePage', externals.browser.manager),
|
||||
|
||||
awful.key({ }, 'XF86Display', externals.display.switch),
|
||||
awful.key({ }, 'XF86ScreenSaver', externals.display.screensaver),
|
||||
awful.key({ }, 'XF86Launch6', externals.power.switch_profile),
|
||||
--awful.key({ }, 252, externals.display.turn_off),
|
||||
|
||||
awful.key({ }, 'XF86PowerOff', function() end),
|
||||
awful.key({ }, 'XF86WLAN', function() end),
|
||||
|
||||
awful.key({ }, "Print", externals.display.save),
|
||||
--awful.key({ }, "Pause", externals.alarm.stop),
|
||||
|
||||
-- Prompt
|
||||
awful.key({ modkey }, "r", function () mypromptbox[mouse.screen]:run() end),
|
||||
|
||||
-- TODO: unite in a single prompt with prefix (=2+2, g weather in Minsk, http://tut.by/ etc)
|
||||
|
||||
awful.key({ modkey }, "x",
|
||||
function()
|
||||
awful.prompt.run({ prompt = "Eval: " },
|
||||
mypromptbox[mouse.screen].widget,
|
||||
function (s)
|
||||
local result = awful.util.eval('return ' .. s)
|
||||
if not result then result = 'Error' end
|
||||
mypromptbox[mouse.screen].widget:set_text('[ ' .. result .. ' ]')
|
||||
end, nil,
|
||||
awful.util.getdir("cache") .. "/history_eval")
|
||||
end),
|
||||
|
||||
awful.key({ modkey }, "s",
|
||||
function()
|
||||
awful.prompt.run({ prompt = "Google: " },
|
||||
mypromptbox[mouse.screen].widget,
|
||||
externals.browser.search, nil,
|
||||
awful.util.getdir("cache") .. "/history_search")
|
||||
end),
|
||||
|
||||
awful.key({ modkey }, "p",
|
||||
function()
|
||||
awful.prompt.run({ prompt = "Play: " },
|
||||
mypromptbox[mouse.screen].widget,
|
||||
externals.player.search, nil,
|
||||
awful.util.getdir("cache") .. "/history_play")
|
||||
end),
|
||||
|
||||
awful.key({ modkey }, "g",
|
||||
function()
|
||||
awful.prompt.run({ prompt = "Go: " },
|
||||
mypromptbox[mouse.screen].widget,
|
||||
externals.browser.browse, nil,
|
||||
awful.util.getdir("cache") .. "/history_goto")
|
||||
end),
|
||||
|
||||
awful.key({ modkey }, "b",
|
||||
function ()
|
||||
mywibox[mouse.screen].visible = not mywibox[mouse.screen].visible
|
||||
end)
|
||||
)
|
||||
|
||||
clientkeys = awful.util.table.join(
|
||||
awful.key({ modkey, }, "f", function (c) c.fullscreen = not c.fullscreen end),
|
||||
awful.key({ modkey, }, "F4", function (c) c:kill() end),
|
||||
awful.key({ modkey, "Control" }, "space", awful.client.floating.toggle ),
|
||||
awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end),
|
||||
awful.key({ modkey, }, "o", awful.client.movetoscreen ),
|
||||
awful.key({ modkey, }, "t", function (c) c.ontop = not c.ontop end),
|
||||
awful.key({ modkey, }, "n",
|
||||
function (c)
|
||||
-- The client currently has the input focus, so it cannot be
|
||||
-- minimized, since minimized clients can't have the focus.
|
||||
c.minimized = true
|
||||
end),
|
||||
awful.key({ modkey, }, "m",
|
||||
function (c)
|
||||
c.maximized_horizontal = not c.maximized_horizontal
|
||||
c.maximized_vertical = not c.maximized_vertical
|
||||
end)
|
||||
)
|
||||
|
||||
-- Bind all key numbers to tags.
|
||||
-- Be careful: we use keycodes to make it works on any keyboard layout.
|
||||
-- This should map on the top row of your keyboard, usually 1 to 9.
|
||||
for i = 1, 9 do
|
||||
globalkeys = awful.util.table.join(globalkeys,
|
||||
awful.key({ modkey }, "#" .. i + 9,
|
||||
function ()
|
||||
local screen = mouse.screen
|
||||
local tag = awful.tag.gettags(screen)[i]
|
||||
if tag then
|
||||
awful.tag.viewonly(tag)
|
||||
end
|
||||
end),
|
||||
awful.key({ modkey, "Control" }, "#" .. i + 9,
|
||||
function ()
|
||||
local screen = mouse.screen
|
||||
local tag = awful.tag.gettags(screen)[i]
|
||||
if tag then
|
||||
awful.tag.viewtoggle(tag)
|
||||
end
|
||||
end),
|
||||
awful.key({ modkey, "Shift" }, "#" .. i + 9,
|
||||
function ()
|
||||
if client.focus then
|
||||
local tag = awful.tag.gettags(client.focus.screen)[i]
|
||||
if tag then
|
||||
awful.client.movetotag(tag)
|
||||
end
|
||||
end
|
||||
end),
|
||||
awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9,
|
||||
function ()
|
||||
if client.focus then
|
||||
local tag = awful.tag.gettags(client.focus.screen)[i]
|
||||
if tag then
|
||||
awful.client.toggletag(tag)
|
||||
end
|
||||
end
|
||||
end))
|
||||
end
|
||||
|
||||
clientbuttons = awful.util.table.join(
|
||||
awful.button({ }, 1, function (c) client.focus = c; c:raise() end),
|
||||
awful.button({ modkey }, 1, awful.mouse.client.move),
|
||||
awful.button({ modkey }, 3, awful.mouse.client.resize))
|
||||
|
||||
-- Set keys
|
||||
root.keys(globalkeys)
|
||||
--}}}
|
||||
|
||||
--{{{ Rules
|
||||
-- get class / etc with 'xprop' (xorg-xprop)
|
||||
-- ex.:
|
||||
-- ...
|
||||
-- WM_CLASS(STRING) = "Navigator", "Swiftfox"
|
||||
-- WM_NAME(STRING) = "Problem loading page - Swiftfox"
|
||||
-- ...
|
||||
--
|
||||
-- instance = "Navigator", class = "Swiftfox", name = "Problem loading page - Swiftfox"
|
||||
-- http://awesome.naquadah.org/wiki/Understanding_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
|
||||
}
|
||||
}, {
|
||||
rule_any = { class = { "MPlayer", "pinentry", "gimp" } },
|
||||
properties = { floating = true }
|
||||
}, {
|
||||
rule_any = { instance = { "Navigator" }, class = { "Chromium" } },
|
||||
properties = { tag = tags[1][2] }
|
||||
}, {
|
||||
rule = { instance = "gvim" },
|
||||
properties = { tag = tags[1][3] }
|
||||
}, {
|
||||
rule = { class = "Skype" },
|
||||
properties = { tag = tags[1][4], size_hints_honor = false, switchtotag = true },
|
||||
callback = function(c)
|
||||
if c.name:sub(1, 12) == "Profile for " then
|
||||
awful.client.floating.set(c, true)
|
||||
end
|
||||
end
|
||||
}, {
|
||||
rule = { name = "Psi+" },
|
||||
properties = { tag = tags[1][5], switchtotag = true }
|
||||
}, {
|
||||
rule = { class = "XTerm" },
|
||||
callback = function(c)
|
||||
if c.name:sub(#c.name - 9) == " - mcabber" then
|
||||
awful.client.movetotag(tags[1][5], c)
|
||||
end
|
||||
|
||||
-- see /usr/share/awesome/lib/wibox/layout/
|
||||
--
|
||||
-- eval geometry with respect to hint
|
||||
--local geom = c:geometry()
|
||||
--local hint = c.size_hints
|
||||
|
||||
--print("geom was: " .. geom.width .. "x" .. geom.height)
|
||||
|
||||
--local w_ratio = math.floor((geom.width - hint.base_width) / hint.width_inc)
|
||||
--local h_ratio = math.floor((geom.height - hint.base_height) / hint.height_inc)
|
||||
|
||||
--geom.width = hint.base_width + hint.width_inc * w_ratio
|
||||
--geom.height = hint.base_height + hint.height_inc * h_ratio
|
||||
|
||||
--print("geom is: " .. geom.width .. "x" .. geom.height)
|
||||
|
||||
--c:geometry(geom)
|
||||
end
|
||||
}, {
|
||||
rule = { class = "XTerm" },
|
||||
properties = { opacity = 0.9, size_hints_honor = false }
|
||||
}, {
|
||||
rule = { instance = "VCLSalFrame.DocumentWindow", class = "LibreOffice 3.5" },
|
||||
properties = { size_hints_honor = false }
|
||||
}, {
|
||||
rule = { class = "VirtualBox" },
|
||||
properties = { tag = tags[1][6], switchtotag = true }
|
||||
}, {
|
||||
rule = { role = "pop-up" },
|
||||
properties = { floating = true }
|
||||
}
|
||||
}
|
||||
--}}}
|
||||
|
||||
--{{{ Signals
|
||||
-- Signal function to execute when a new client appears.
|
||||
client.connect_signal("manage", function (c, startup)
|
||||
-- Add a titlebar
|
||||
--awful.titlebar.add(c, { modkey = modkey })
|
||||
|
||||
-- Enable sloppy focus
|
||||
c:connect_signal("mouse::enter", function(c)
|
||||
if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier and awful.client.focus.filter(c) then
|
||||
client.focus = c
|
||||
end
|
||||
end)
|
||||
|
||||
if not startup 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
|
||||
|
||||
client.connect_signal("focus", function(c)
|
||||
c.border_color = beautiful.border_focus
|
||||
end)
|
||||
client.connect_signal("unfocus", function(c)
|
||||
c.border_color = beautiful.border_normal
|
||||
local titlebars_enabled = false
|
||||
end)
|
||||
local titlebars_enabled = false
|
||||
if c.role == "pop-up" then --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)
|
||||
end
|
||||
end)
|
||||
|
||||
client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end)
|
||||
client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end)
|
||||
for s = 1, screen.count() do
|
||||
screen[s]:add_signal("tag::history::update", function()
|
||||
client.focus = client.focus
|
||||
end)
|
||||
end
|
||||
--}}}
|
||||
|
||||
-- vim: set foldmarker=--{{{,--}}} foldmethod=marker:
|
||||
@@ -1,12 +0,0 @@
|
||||
All 'awesome' icons in this package were created by Adrian C. (anrxc).
|
||||
They are licensed under the same terms as the awesome distribution itself
|
||||
- GNU General Public License version 2. To view a human-readable summary
|
||||
of this license, visit: http://creativecommons.org/licenses/GPL/2.0/
|
||||
|
||||
The widget icons with the exception of: 'chat', 'crypt', 'power' and
|
||||
'rss' icons (which were made by me) were originally made by 'sm4tik'
|
||||
for purposes of 'dzen', I could not find any licensing information
|
||||
attached to those original bitmaps. Assuming they are in the public
|
||||
domain I am licensing the widget icons under the terms of the
|
||||
Creative Commons Attribution-Share Alike license. To view a copy of
|
||||
this license, visit: http://creativecommons.org/licenses/by-sa/3.0/
|
||||
|
Before Width: | Height: | Size: 205 B |
|
Before Width: | Height: | Size: 213 B |
|
Before Width: | Height: | Size: 219 B |
|
Before Width: | Height: | Size: 216 B |
|
Before Width: | Height: | Size: 238 B |
|
Before Width: | Height: | Size: 219 B |
|
Before Width: | Height: | Size: 203 B |
|
Before Width: | Height: | Size: 251 B |
|
Before Width: | Height: | Size: 189 B |
|
Before Width: | Height: | Size: 210 B |
|
Before Width: | Height: | Size: 189 B |
|
Before Width: | Height: | Size: 206 B |
|
Before Width: | Height: | Size: 221 B |
|
Before Width: | Height: | Size: 205 B |
|
Before Width: | Height: | Size: 201 B |
|
Before Width: | Height: | Size: 226 B |
|
Before Width: | Height: | Size: 211 B |
|
Before Width: | Height: | Size: 188 B |
|
Before Width: | Height: | Size: 206 B |
|
Before Width: | Height: | Size: 190 B |
|
Before Width: | Height: | Size: 207 B |
|
Before Width: | Height: | Size: 215 B |
|
Before Width: | Height: | Size: 207 B |
|
Before Width: | Height: | Size: 192 B |
|
Before Width: | Height: | Size: 226 B |
|
Before Width: | Height: | Size: 232 B |
|
Before Width: | Height: | Size: 222 B |
|
Before Width: | Height: | Size: 203 B |
|
Before Width: | Height: | Size: 226 B |
|
Before Width: | Height: | Size: 195 B |
|
Before Width: | Height: | Size: 203 B |
|
Before Width: | Height: | Size: 152 B |
|
Before Width: | Height: | Size: 154 B |
|
Before Width: | Height: | Size: 240 B |
|
Before Width: | Height: | Size: 227 B |
|
Before Width: | Height: | Size: 209 B |
|
Before Width: | Height: | Size: 368 B |
|
Before Width: | Height: | Size: 207 B |
|
Before Width: | Height: | Size: 337 B |
|
Before Width: | Height: | Size: 359 B |
|
Before Width: | Height: | Size: 326 B |
|
Before Width: | Height: | Size: 200 B |
|
Before Width: | Height: | Size: 335 B |
|
Before Width: | Height: | Size: 366 B |
|
Before Width: | Height: | Size: 347 B |
|
Before Width: | Height: | Size: 186 B |
|
Before Width: | Height: | Size: 331 B |
|
Before Width: | Height: | Size: 347 B |
|
Before Width: | Height: | Size: 332 B |
|
Before Width: | Height: | Size: 197 B |
|
Before Width: | Height: | Size: 328 B |
|
Before Width: | Height: | Size: 359 B |
|
Before Width: | Height: | Size: 328 B |
|
Before Width: | Height: | Size: 275 B |
|
Before Width: | Height: | Size: 224 B |
|
Before Width: | Height: | Size: 215 B |
@@ -1,125 +0,0 @@
|
||||
local theme = {}
|
||||
local awful = require("awful")
|
||||
|
||||
theme.font = "Terminus 9"
|
||||
theme.confdir = awful.util.getdir("config") .. "/theme"
|
||||
theme.wallpaper = theme.confdir .. "/wallpaper.jpg"
|
||||
|
||||
theme.bg_normal = "#222222"
|
||||
theme.bg_focus = "#535d6c"
|
||||
theme.bg_urgent = "#ff0000"
|
||||
theme.bg_minimize = "#444444"
|
||||
theme.bg_systray = theme.bg_normal
|
||||
|
||||
theme.fg_normal = "#aaaaaa"
|
||||
theme.fg_focus = "#ffffff"
|
||||
theme.fg_urgent = "#ffffff"
|
||||
theme.fg_minimize = "#ffffff"
|
||||
|
||||
theme.border_width = 1
|
||||
theme.border_normal = "#404080"
|
||||
theme.border_focus = "#535d6c"
|
||||
theme.border_marked = "#91231c"
|
||||
|
||||
theme.fg_widget = "#AECF96"
|
||||
theme.fg_center_widget = "#88A175"
|
||||
theme.fg_end_widget = "#FF5656"
|
||||
theme.fg_off_widget = "#494B4F"
|
||||
theme.fg_netup_widget = "#7F9F7F"
|
||||
theme.fg_netdn_widget = "#CC9393"
|
||||
theme.bg_widget = "#3F3F3F"
|
||||
theme.border_widget = "#3F3F3F"
|
||||
|
||||
-- There are other variable sets
|
||||
-- overriding the default one when
|
||||
-- defined, the sets are:
|
||||
-- [taglist|tasklist]_[bg|fg]_[focus|urgent]
|
||||
-- titlebar_[bg|fg]_[normal|focus]
|
||||
-- tooltip_[font|opacity|fg_color|bg_color|border_width|border_color]
|
||||
-- mouse_finder_[color|timeout|animate_timeout|radius|factor]
|
||||
-- Example:
|
||||
--theme.taglist_bg_focus = "#ff0000"
|
||||
|
||||
-- Display the taglist squares
|
||||
theme.taglist_squares_sel = theme.confdir .. "/icons/taglist/sel.png"
|
||||
theme.taglist_squares_unsel = theme.confdir .. "/icons/taglist/unsel.png"
|
||||
|
||||
-- Variables set for theming the menu:
|
||||
-- menu_[bg|fg]_[normal|focus]
|
||||
-- menu_[border_color|border_width]
|
||||
theme.menu_submenu_icon = "/usr/share/awesome/themes/default/submenu.png"
|
||||
theme.menu_height = 15
|
||||
theme.menu_width = 100
|
||||
|
||||
-- You can add as many variables as
|
||||
-- you wish and access them by using
|
||||
-- beautiful.variable in your rc.lua
|
||||
--theme.bg_widget = "#cc0000"
|
||||
|
||||
-- {{{ Widget icons
|
||||
theme.widget_cpu = theme.confdir .. "/icons/cpu.png"
|
||||
theme.widget_bat = theme.confdir .. "/icons/bat.png"
|
||||
theme.widget_mem = theme.confdir .. "/icons/mem.png"
|
||||
theme.widget_fs = theme.confdir .. "/icons/disk.png"
|
||||
theme.widget_net = theme.confdir .. "/icons/down.png"
|
||||
theme.widget_netup = theme.confdir .. "/icons/up.png"
|
||||
theme.widget_wifi = theme.confdir .. "/icons/wifi.png"
|
||||
theme.widget_mail = theme.confdir .. "/icons/mail.png"
|
||||
theme.widget_vol = theme.confdir .. "/icons/vol.png"
|
||||
theme.widget_org = theme.confdir .. "/icons/cal.png"
|
||||
theme.widget_date = theme.confdir .. "/icons/time.png"
|
||||
theme.widget_crypto = theme.confdir .. "/icons/crypto.png"
|
||||
theme.widget_pacman = theme.confdir .. "/icons/pacman.png"
|
||||
theme.widget_sep = theme.confdir .. "/icons/separator.png"
|
||||
theme.widget_music = theme.confdir .. "/icons/music.png"
|
||||
-- }}}
|
||||
|
||||
-- {{{ Layout icons
|
||||
theme.layout_tile = theme.confdir .. "/icons/layouts/tile.png"
|
||||
theme.layout_tileleft = theme.confdir .. "/icons/layouts/tileleft.png"
|
||||
theme.layout_tilebottom = theme.confdir .. "/icons/layouts/tilebottom.png"
|
||||
theme.layout_tiletop = theme.confdir .. "/icons/layouts/tiletop.png"
|
||||
theme.layout_fairv = theme.confdir .. "/icons/layouts/fairv.png"
|
||||
theme.layout_fairh = theme.confdir .. "/icons/layouts/fairh.png"
|
||||
theme.layout_spiral = theme.confdir .. "/icons/layouts/spiral.png"
|
||||
theme.layout_dwindle = theme.confdir .. "/icons/layouts/dwindle.png"
|
||||
theme.layout_max = theme.confdir .. "/icons/layouts/max.png"
|
||||
theme.layout_fullscreen = theme.confdir .. "/icons/layouts/fullscreen.png"
|
||||
theme.layout_magnifier = theme.confdir .. "/icons/layouts/magnifier.png"
|
||||
theme.layout_floating = theme.confdir .. "/icons/layouts/floating.png"
|
||||
-- }}}
|
||||
|
||||
theme.awesome_icon = "/usr/share/awesome/icons/awesome16.png"
|
||||
|
||||
-- {{{ Titlebar icons
|
||||
theme.titlebar_close_button_focus = theme.confdir .. "/icons/titlebar/close_focus.png"
|
||||
theme.titlebar_close_button_normal = theme.confdir .. "/icons/titlebar/close_normal.png"
|
||||
|
||||
theme.titlebar_ontop_button_focus_active = theme.confdir .. "/icons/titlebar/ontop_focus_active.png"
|
||||
theme.titlebar_ontop_button_normal_active = theme.confdir .. "/icons/titlebar/ontop_normal_active.png"
|
||||
theme.titlebar_ontop_button_focus_inactive = theme.confdir .. "/icons/titlebar/ontop_focus_inactive.png"
|
||||
theme.titlebar_ontop_button_normal_inactive = theme.confdir .. "/icons/titlebar/ontop_normal_inactive.png"
|
||||
|
||||
theme.titlebar_sticky_button_focus_active = theme.confdir .. "/icons/titlebar/sticky_focus_active.png"
|
||||
theme.titlebar_sticky_button_normal_active = theme.confdir .. "/icons/titlebar/sticky_normal_active.png"
|
||||
theme.titlebar_sticky_button_focus_inactive = theme.confdir .. "/icons/titlebar/sticky_focus_inactive.png"
|
||||
theme.titlebar_sticky_button_normal_inactive = theme.confdir .. "/icons/titlebar/sticky_normal_inactive.png"
|
||||
|
||||
theme.titlebar_floating_button_focus_active = theme.confdir .. "/icons/titlebar/floating_focus_active.png"
|
||||
theme.titlebar_floating_button_normal_active = theme.confdir .. "/icons/titlebar/floating_normal_active.png"
|
||||
theme.titlebar_floating_button_focus_inactive = theme.confdir .. "/icons/titlebar/floating_focus_inactive.png"
|
||||
theme.titlebar_floating_button_normal_inactive = theme.confdir .. "/icons/titlebar/floating_normal_inactive.png"
|
||||
|
||||
theme.titlebar_maximized_button_focus_active = theme.confdir .. "/icons/titlebar/maximized_focus_active.png"
|
||||
theme.titlebar_maximized_button_normal_active = theme.confdir .. "/icons/titlebar/maximized_normal_active.png"
|
||||
theme.titlebar_maximized_button_focus_inactive = theme.confdir .. "/icons/titlebar/maximized_focus_inactive.png"
|
||||
theme.titlebar_maximized_button_normal_inactive = theme.confdir .. "/icons/titlebar/maximized_normal_inactive.png"
|
||||
-- }}}
|
||||
|
||||
-- Define the icon theme for application icons. If not set then the icons
|
||||
-- from /usr/share/icons and /usr/share/icons/hicolor will be used.
|
||||
theme.icon_theme = nil
|
||||
|
||||
return theme
|
||||
|
||||
-- vim: set foldmarker=--{{{,--}}} foldmethod=marker:
|
||||
@@ -1,45 +0,0 @@
|
||||
local awful = require('awful')
|
||||
local beautiful = require('beautiful')
|
||||
local wibox = require('wibox')
|
||||
local vicious = require('vicious')
|
||||
|
||||
-- {{{ OK: Battery state
|
||||
function create(self, bat)
|
||||
local widget = wibox.widget.textbox()
|
||||
local icon = wibox.widget.imagebox()
|
||||
local tooltip = awful.tooltip({
|
||||
objects = { widget, icon }
|
||||
})
|
||||
--[[
|
||||
batwidget.b = awful.util.table.join(
|
||||
awful.button({ }, 1, function ()
|
||||
vicious.force({ batwidget })
|
||||
end),
|
||||
awful.button({ }, 3, function ()
|
||||
conexec("'sudo powertop'")
|
||||
end)
|
||||
)
|
||||
batwidget.w:buttons(batwidget.b)
|
||||
batwidget.i:buttons(batwidget.b)
|
||||
--]]
|
||||
vicious.register({}, vicious.widgets.bat, function(widget, args)
|
||||
--if args[2] == 0 then
|
||||
-- widget:set_text('')
|
||||
-- icon:set_image(nil)
|
||||
--else
|
||||
widget:set_text(args[1] .. args[2] .. '%')
|
||||
icon:set_image(beautiful.widget_bat)
|
||||
--end
|
||||
|
||||
--if args[3] == 'N/A' then
|
||||
-- tooltip:set_text('')
|
||||
--else
|
||||
tooltip:set_text(args[3] .. ' remaining')
|
||||
--end
|
||||
end, 57, bat)
|
||||
|
||||
return { widget }, { icon }
|
||||
end
|
||||
|
||||
return { create = create }
|
||||
-- }}}
|
||||
@@ -1,25 +0,0 @@
|
||||
-- {{{ OK: CPU usage and temperature
|
||||
cpuwidget = {}
|
||||
cpuwidget.i = wibox.widget.imagebox()
|
||||
cpuwidget.i:set_image(beautiful.widget_cpu)
|
||||
cpuwidget.g = awful.widget.graph()
|
||||
cpuwidget.w = wibox.widget.textbox()
|
||||
cpuwidget.g:set_width(40):set_height(height)
|
||||
cpuwidget.g:set_background_color(beautiful.fg_off_widget)
|
||||
--cpuwidget.g:set_gradient_angle(0):set_gradient_colors({
|
||||
-- beautiful.fg_end_widget, beautiful.fg_center_widget, beautiful.fg_widget
|
||||
--})
|
||||
cpuwidget.b = awful.util.table.join(
|
||||
awful.button({ }, 1, function ()
|
||||
vicious.force({ cpuwidget.w, cpuwidget.g })
|
||||
end),
|
||||
awful.button({ }, 3, function ()
|
||||
conexec('htop')
|
||||
end)
|
||||
)
|
||||
cpuwidget.w:buttons(cpuwidget.b)
|
||||
cpuwidget.g:buttons(cpuwidget.b)
|
||||
cpuwidget.i:buttons(cpuwidget.b)
|
||||
vicious.register(cpuwidget.g, vicious.widgets.cpu, '$1')
|
||||
vicious.register(cpuwidget.w, vicious.widgets.thermal, ' $1C', 19, 'thermal_zone0')
|
||||
-- }}}
|
||||
@@ -1,73 +0,0 @@
|
||||
local calendar = require("../misc/calendar")
|
||||
local awful = require('awful')
|
||||
local beautiful = require('beautiful')
|
||||
local wibox = require('wibox')
|
||||
local vicious = require('vicious')
|
||||
|
||||
-- {{{ OK: Date and time
|
||||
function calendar_for_month_markup(month, year)
|
||||
local formats = {
|
||||
today = '<span color="black" background="yellow">%s</span>',
|
||||
prev_month = '<span color="#aaa">%s</span>'
|
||||
}
|
||||
return '<span font_desc="fixed">' .. calendar.for_month(month, year, formats) .. '</span>'
|
||||
end
|
||||
|
||||
function create(self, format)
|
||||
local calendar_formats = {
|
||||
prev_month = '',
|
||||
today = ''
|
||||
}
|
||||
local widget = wibox.widget.textbox()
|
||||
local format = format or '%a, %m/%d %R'
|
||||
|
||||
local year, month = 0, 0
|
||||
widget:connect_signal('mouse::enter', function()
|
||||
year, month = os.date('%Y'), os.date('%m')
|
||||
end)
|
||||
|
||||
local tooltip = awful.tooltip({
|
||||
objects = { widget },
|
||||
timer_function = function()
|
||||
widget:set_text(os.date(' ' .. format .. ':%S '))
|
||||
return calendar_for_month_markup(month, year)
|
||||
end,
|
||||
timeout = 1
|
||||
})
|
||||
function adjust_calendar(delta_months)
|
||||
month = month + delta_months
|
||||
tooltip:set_text(calendar_for_month_markup(month, year))
|
||||
end
|
||||
|
||||
widget:buttons(awful.util.table.join(
|
||||
awful.button({ }, 1, function()
|
||||
adjust_calendar(-1)
|
||||
end),
|
||||
awful.button({ }, 3, function()
|
||||
adjust_calendar(1)
|
||||
end),
|
||||
awful.button({ }, 4, function()
|
||||
adjust_calendar(1)
|
||||
end),
|
||||
awful.button({ }, 5, function()
|
||||
adjust_calendar(-1)
|
||||
end),
|
||||
awful.button({ 'Shift' }, 1, function()
|
||||
adjust_calendar(-12)
|
||||
end),
|
||||
awful.button({ 'Shift' }, 3, function()
|
||||
adjust_calendar(12)
|
||||
end),
|
||||
awful.button({ 'Shift' }, 4, function()
|
||||
adjust_calendar(12)
|
||||
end),
|
||||
awful.button({ 'Shift' }, 5, function()
|
||||
adjust_calendar(-12)
|
||||
end)
|
||||
))
|
||||
vicious.register(widget, vicious.widgets.date, ' ' .. format .. ' ', 61)
|
||||
return { widget }
|
||||
end
|
||||
|
||||
return { create = create }
|
||||
-- }}}
|
||||
@@ -1,48 +0,0 @@
|
||||
-- {{{ OK: File system usage
|
||||
fswidget = {}
|
||||
fswidget.locations = { '/boot', '/', '/home' }
|
||||
fswidget.i = wibox.widget.imagebox()
|
||||
fswidget.i:set_image(beautiful.widget_fs)
|
||||
fswidget.w = wibox.widget.textbox()
|
||||
fswidget.t = awful.tooltip({
|
||||
objects = { fswidget.i, fswidget.w }
|
||||
})
|
||||
fswidget.b = awful.util.table.join(
|
||||
awful.button({ }, 1, function () vicious.force({ fswidget }) end),
|
||||
awful.button({ }, 3, function () conexec('mc') end)
|
||||
)
|
||||
fswidget.w:buttons(fswidget.b)
|
||||
fswidget.i:buttons(fswidget.b)
|
||||
fswidget.fs_bars = {}
|
||||
|
||||
fswidget.get_fs_widgets = function()
|
||||
local ws = {}
|
||||
for _,v in pairs(fswidget.fs_bars) do table.insert(ws, v) end
|
||||
return ws
|
||||
end
|
||||
|
||||
for index, path in pairs(fswidget.locations) do
|
||||
local fs_w = awful.widget.progressbar()
|
||||
fs_w:set_vertical(true):set_ticks(true)
|
||||
fs_w:set_height(height):set_width(5):set_ticks_size(2)
|
||||
fs_w:set_border_color(beautiful.border_widget)
|
||||
fs_w:set_background_color(beautiful.fg_off_widget)
|
||||
-- fs_w:set_gradient_colors({ beautiful.fg_widget,
|
||||
-- beautiful.fg_center_widget, beautiful.fg_end_widget
|
||||
-- })
|
||||
fs_w:buttons(fswidget.b)
|
||||
fswidget.fs_bars[path] = fs_w
|
||||
fswidget.t:add_to_object(fs_w)
|
||||
end
|
||||
|
||||
vicious.register(fswidget, vicious.widgets.fs, function(widget, args)
|
||||
local tip = ''
|
||||
for path,w in pairs(widget.fs_bars) do
|
||||
w:set_value(args['{' .. path .. ' used_p}'] / 100)
|
||||
tip = tip .. path .. ' [' .. args['{' .. path .. ' used_p}'] .. '%] - <b>' .. args['{' .. path .. ' avail_gb}'] .. '</b> GB free\n' ..
|
||||
' ' .. args['{' .. path .. ' used_gb}'] .. ' / ' .. args['{' .. path .. ' size_gb}'] .. ' GB\n\n'
|
||||
end
|
||||
widget.t:set_text(tip)
|
||||
end, 599)
|
||||
vicious.register(fswidget.w, vicious.widgets.hddtemp, ' ${/dev/sda}C', 17)
|
||||
-- }}}
|
||||
@@ -1,27 +0,0 @@
|
||||
-- {{{ OK: gmail
|
||||
gmailwidget = {}
|
||||
gmailwidget.i = wibox.widget.imagebox()
|
||||
gmailwidget.w = wibox.widget.textbox()
|
||||
gmailwidget.t = awful.tooltip({ objects = { gmailwidget.i, gmailwidget.w } })
|
||||
gmailwidget.b = awful.util.table.join(
|
||||
awful.button({ }, 1, function ()
|
||||
vicious.force({ gmailwidget })
|
||||
end),
|
||||
awful.button({ }, 3, function ()
|
||||
externals.mail.open('Inbox')
|
||||
end)
|
||||
)
|
||||
gmailwidget.w:buttons(gmailwidget.b)
|
||||
gmailwidget.i:buttons(gmailwidget.b)
|
||||
vicious.register(gmailwidget, vicious.widgets.gmail, function(widget, args)
|
||||
local count = tonumber(args['{count}'])
|
||||
if count > 0 then
|
||||
widget.t:set_text(args['{subject}'])
|
||||
widget.w:set_text(count)
|
||||
widget.i:set_image(beautiful.widget_mail)
|
||||
else
|
||||
widget.w:set_text('')
|
||||
widget.i:set_image(nil)
|
||||
end
|
||||
end, 60 * 15 + 7)
|
||||
-- }}}
|
||||
@@ -1,26 +0,0 @@
|
||||
-- {{{ OK: Memory usage
|
||||
memwidget = {}
|
||||
memwidget.i = wibox.widget.imagebox()
|
||||
memwidget.i:set_image(beautiful.widget_mem)
|
||||
memwidget.w = awful.widget.progressbar()
|
||||
memwidget.w:set_vertical(true):set_ticks(true)
|
||||
memwidget.w:set_height(height):set_width(8):set_ticks_size(2)
|
||||
memwidget.w:set_background_color(beautiful.fg_off_widget)
|
||||
--memwidget.w:set_gradient_colors({ beautiful.fg_widget,
|
||||
-- beautiful.fg_center_widget, beautiful.fg_end_widget
|
||||
--})
|
||||
memwidget.t = awful.tooltip({
|
||||
objects = { memwidget.i, memwidget.w }
|
||||
})
|
||||
memwidget.w:buttons(cpuwidget.b);
|
||||
memwidget.i:buttons(cpuwidget.b);
|
||||
vicious.register(memwidget, vicious.widgets.mem, function(widget, args)
|
||||
widget.t:set_text(
|
||||
'RAM [' .. args[1] .. '%] - <b>' .. args[4] .. '</b> MB free\n' ..
|
||||
' ' .. args[2] .. ' / ' .. args[3] .. ' MB\n\n' ..
|
||||
'SWAP [' .. args[5] .. '%] - <b>' .. args[8] .. '</b> MB free\n' ..
|
||||
' ' .. args[6] .. ' / ' .. args[7] .. ' MB\n\n' ..
|
||||
'mem+buf+cache: ' .. args[9] .. ' MB')
|
||||
memwidget.w:set_value(args[1] / 100)
|
||||
end, 13)
|
||||
-- }}}
|
||||
@@ -1,38 +0,0 @@
|
||||
-- {{{ OK: MPD
|
||||
mpdwidget = {};
|
||||
mpdwidget.i = wibox.widget.imagebox()
|
||||
mpdwidget.i:set_image(beautiful.widget_music)
|
||||
mpdwidget.w = wibox.widget.textbox();
|
||||
mpdwidget.t = awful.tooltip({ objects = { mpdwidget.i, mpdwidget.w } })
|
||||
mpdwidget.refresh = function() vicious.force({ mpdwidget }) end
|
||||
externals.hook.after(externals.player, 'update', mpdwidget.refresh)
|
||||
externals.hook.after(externals.player, 'toggle', mpdwidget.refresh)
|
||||
externals.hook.after(externals.player, 'prev', mpdwidget.refresh)
|
||||
externals.hook.after(externals.player, 'next', mpdwidget.refresh)
|
||||
externals.hook.after(externals.player, 'stop', mpdwidget.refresh)
|
||||
mpdwidget.b = awful.util.table.join(
|
||||
awful.button({ }, 1, function ()
|
||||
vicious.force({ mpdwidget })
|
||||
end),
|
||||
awful.button({ }, 2, externals.player.update),
|
||||
awful.button({ }, 3, externals.player.toggle),
|
||||
awful.button({ }, 4, externals.player.prev),
|
||||
awful.button({ }, 5, externals.player.next)
|
||||
)
|
||||
mpdwidget.w:buttons(mpdwidget.b);
|
||||
vicious.register(mpdwidget, vicious.widgets.mpd, function(widget, args)
|
||||
widget.t:set_text(' ' .. args["{Artist}"] .. ' - ' .. args["{Title}"] .. '\n '
|
||||
.. args["{Album}"] .. ' (' .. args["{Genre}"] .. ') ')
|
||||
|
||||
local state = args["{state}"]
|
||||
if state == "Play" then
|
||||
widget.w:set_text('>>')
|
||||
else
|
||||
if state == "Pause" then
|
||||
widget.w:set_text('||')
|
||||
else
|
||||
widget.w:set_text('[]')
|
||||
end
|
||||
end
|
||||
end, 7, { "56379534" })
|
||||
-- }}}
|
||||
@@ -1,49 +0,0 @@
|
||||
-- {{{ OK: Network usage
|
||||
netwidget = {}
|
||||
netwidget.i_dn = wibox.widget.imagebox()
|
||||
netwidget.i_up = wibox.widget.imagebox()
|
||||
netwidget.i_dn:set_image(beautiful.widget_net)
|
||||
netwidget.i_up:set_image(beautiful.widget_netup)
|
||||
netwidget.w = wibox.widget.textbox()
|
||||
netwidget.t = awful.tooltip({ objects = { netwidget.i_dn, netwidget.i_up, netwidget.w } })
|
||||
netwidget.b = awful.util.table.join(
|
||||
awful.button({ }, 1, function ()
|
||||
vicious.force({ netwidget })
|
||||
end),
|
||||
awful.button({ }, 3, function ()
|
||||
conexec('wicd-curses')
|
||||
end)
|
||||
)
|
||||
netwidget.w:buttons(netwidget.b)
|
||||
netwidget.i_dn:buttons(netwidget.b)
|
||||
netwidget.i_up:buttons(netwidget.b)
|
||||
vicious.register(netwidget, vicious.widgets.net, function(widget, args)
|
||||
local up, down, tip = '', '', ''
|
||||
for i=0,19 do
|
||||
local eth = 'eth' .. i
|
||||
if i > 9 then
|
||||
eth = 'wlan' .. (i-10)
|
||||
end
|
||||
if args['{' .. eth .. ' carrier}'] == 1 then
|
||||
if down ~= '' then
|
||||
down = down .. '/'
|
||||
up = up .. '/'
|
||||
end
|
||||
down = down .. args['{' .. eth .. ' down_kb}']
|
||||
up = up .. args['{' .. eth .. ' up_kb}']
|
||||
tip = tip .. eth .. '\n RX: ' .. args['{' .. eth .. ' rx_mb}'] .. ' MB' ..
|
||||
'\n TX: ' .. args['{' .. eth .. ' tx_mb}'] .. ' MB' ..
|
||||
'\n'
|
||||
end
|
||||
end
|
||||
|
||||
if down ~= '' then
|
||||
widget.w:set_markup('<span color="' ..
|
||||
beautiful.fg_netdn_widget .. '">' .. down .. '</span> <span color="' ..
|
||||
beautiful.fg_netup_widget .. '">' .. up .. '</span>')
|
||||
else
|
||||
widget.w:set_text('N/A')
|
||||
end
|
||||
widget.t:set_text(tip)
|
||||
end, 3)
|
||||
-- }}}
|
||||
@@ -1,25 +0,0 @@
|
||||
-- {{{ OK: Packages
|
||||
pkgwidget = {}
|
||||
pkgwidget.i = wibox.widget.imagebox()
|
||||
pkgwidget.w = wibox.widget.textbox()
|
||||
pkgwidget.b = awful.util.table.join(
|
||||
awful.button({ }, 1, function ()
|
||||
vicious.force({ pkgwidget })
|
||||
end),
|
||||
awful.button({ }, 3, function ()
|
||||
conexec("'yaourt -Suy --aur; read'")
|
||||
end)
|
||||
)
|
||||
pkgwidget.w:buttons(pkgwidget.b);
|
||||
pkgwidget.i:buttons(pkgwidget.b);
|
||||
vicious.register(pkgwidget, vicious.widgets.pkg, function(widget, args)
|
||||
local pkcnt = tonumber(args[1])
|
||||
if pkcnt > 0 then
|
||||
widget.i:set_image(beautiful.widget_pacman)
|
||||
widget.w:set_text(pkcnt)
|
||||
else
|
||||
widget.i:set_image(nil)
|
||||
widget.w:set_text('')
|
||||
end
|
||||
end, 60 * 60 + 13, 'Arch')
|
||||
-- }}}
|
||||
@@ -1,32 +0,0 @@
|
||||
-- {{{ OK: Volume level
|
||||
volwidget = {}
|
||||
volwidget.i = wibox.widget.textbox()
|
||||
--volwidget.i:set_image(beautiful.widget_vol)
|
||||
volwidget.w = awful.widget.progressbar()
|
||||
volwidget.w:set_vertical(true):set_ticks(true)
|
||||
volwidget.w:set_height(height):set_width(8):set_ticks_size(2)
|
||||
volwidget.w:set_background_color(beautiful.fg_off_widget)
|
||||
--volwidget.w:set_gradient_colors({
|
||||
-- beautiful.fg_widget,
|
||||
-- beautiful.fg_center_widget,
|
||||
-- beautiful.fg_end_widget
|
||||
--})
|
||||
volwidget.t = awful.tooltip({ objects = { volwidget.i, volwidget.w } })
|
||||
volwidget.refresh = function() vicious.force({ volwidget }) end
|
||||
externals.hook.after(externals.sound, 'down', volwidget.refresh)
|
||||
externals.hook.after(externals.sound, 'up', volwidget.refresh)
|
||||
externals.hook.after(externals.sound, 'mute', volwidget.refresh)
|
||||
volwidget.b = awful.util.table.join(
|
||||
awful.button({ }, 1, externals.sound.mute),
|
||||
awful.button({ }, 3, externals.sound.manager),
|
||||
awful.button({ }, 4, externals.sound.up),
|
||||
awful.button({ }, 5, externals.sound.down)
|
||||
)
|
||||
volwidget.i:buttons(volwidget.b)
|
||||
volwidget.w:buttons(volwidget.b)
|
||||
vicious.register(volwidget, vicious.widgets.volume, function(widget, args)
|
||||
widget.i:set_text(args[2] .. ' ')
|
||||
widget.w:set_value(args[1] / 100.0)
|
||||
widget.t:set_text(args[1] .. '%')
|
||||
end, 15, externals.sound.channel)
|
||||
-- }}}
|
||||
@@ -1,24 +0,0 @@
|
||||
-- {{{ OK: Wifi
|
||||
wifiwidget = {}
|
||||
wifiwidget.i = wibox.widget.imagebox()
|
||||
wifiwidget.w = wibox.widget.textbox()
|
||||
wifiwidget.t = awful.tooltip({ objects = { wifiwidget.w, wifiwidget.i } })
|
||||
wifiwidget.w:buttons(netwidget.b)
|
||||
wifiwidget.i:buttons(netwidget.b)
|
||||
vicious.register(wifiwidget, vicious.widgets.wifi, function(widget, args)
|
||||
if args['{ssid}'] == 'N/A' then
|
||||
widget.t:set_text('')
|
||||
widget.i:set_image(nil)
|
||||
widget.w:set_text('')
|
||||
else
|
||||
widget.t:set_text(
|
||||
'mode : ' .. args['{mode}'] .. '\n' ..
|
||||
'rate : ' .. args['{rate}'] .. ' Mbit/s\n' ..
|
||||
'channel : ' .. args['{chan}'] .. '\n' ..
|
||||
'strength: ' .. args['{sign}'] .. ' db'
|
||||
)
|
||||
widget.i:set_image(beautiful.widget_wifi)
|
||||
widget.w:set_text(' ' .. args['{ssid}'])
|
||||
end
|
||||
end, 67, 'wlan0')
|
||||
-- }}}
|
||||
@@ -1,25 +0,0 @@
|
||||
-- {{{ OK: Weather
|
||||
wthwidget = {}
|
||||
wthwidget.w = widget({ type = "textbox" })
|
||||
wthwidget.t = awful.tooltip({
|
||||
objects = { wthwidget.w }
|
||||
})
|
||||
wthwidget.b = awful.util.table.join(
|
||||
awful.button({ }, 1, function ()
|
||||
vicious.force({ wthwidget })
|
||||
end),
|
||||
awful.button({ }, 3, function ()
|
||||
awful.util.spawn('firefox http://www.weathercity.com/by/minsk/')
|
||||
end)
|
||||
)
|
||||
wthwidget.w:buttons(wthwidget.b)
|
||||
vicious.register(wthwidget, vicious.widgets.weather, function(widget, args)
|
||||
widget.w:set_text(' ' .. args['{city}'] .. ': ' .. args['{tempc}'] .. 'C')
|
||||
widget.t:set_text(
|
||||
'Weather for ' .. args['{city}'] .. '\n' ..
|
||||
' wind : ' .. args['{wind}'] .. ' ' .. args['{windkmh}'] .. ' km/h\n' ..
|
||||
' sky : ' .. args['{sky}'] .. '\n' ..
|
||||
' humidity: ' .. args['{humid}'] .. '%\n' ..
|
||||
' pressure: ' .. args['{press}'] .. ' mm')
|
||||
end, 60 * 30 + 23, 'UMMS')
|
||||
-- }}}
|
||||
22
.xinitrc
@@ -1,26 +1,10 @@
|
||||
#!/bin/sh
|
||||
|
||||
LOGS_DIR=.cache/awesome
|
||||
LOGS_DIR=.cache/enlightenment
|
||||
mkdir -p $LOGS_DIR
|
||||
exec >$LOGS_DIR/awesome.out 2>$LOGS_DIR/awesome.err
|
||||
exec >$LOGS_DIR/stdout.log 2>$LOGS_DIR/stderr.log
|
||||
|
||||
pulseaudio --start
|
||||
xrdb -merge .Xresources
|
||||
setxkbmap -layout "us,ru" -option "grp:caps_toggle,grp_led:caps,compose:ralt"
|
||||
xset dpms 610 610 610
|
||||
xset r rate 290 30
|
||||
|
||||
#xset +fp /usr/share/fonts/local
|
||||
#xset fp rehash
|
||||
# if this doesn't work, run mkfontdir there
|
||||
|
||||
(
|
||||
xautolock -locker slock &
|
||||
gtk-redshift &
|
||||
skype &
|
||||
psi-plus &
|
||||
nm-applet &
|
||||
clipit &
|
||||
)
|
||||
|
||||
exec awesome
|
||||
exec enlightenment_start
|
||||
|
||||