SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#251 2012-05-05 21:51:33

Eren
#! Die Hard
From: Black Mesa
Registered: 2009-07-27
Posts: 830

Re: Big Ol' Awesome Config Thread!

I'm using awesome config file from /etc, I didn't use it under home. Here's a config of mine with some widgets,

-- Standard awesome library
require("awful")
require("awful.autofocus")
require("awful.rules")
-- Theme handling library
require("beautiful")
-- Notification library
require("naughty")
--Wiget Library
require("vicious")

-- Load Debian menu entries
require("debian.menu")

-- {{{ 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.add_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("/home/goku/.config/awesome/themes/default/theme.lua")

-- This is used later as the default terminal and editor to run.
terminal = "x-terminal-emulator"
editor = os.getenv("EDITOR") or "vim"
editor_cmd = terminal .. " -e " .. editor

-- 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"

-- Table of layouts to cover with awful.layout.inc, order matters.
layouts =
{
    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.magnifier,
    awful.layout.suit.floating
}
-- }}}

-- {{{ Tags
 -- Define a tag table which will hold all screen tags.
 tags = {
   names  = { "home", "www", "media", "game", "work" },
   layout = { layouts[8], layouts[8], layouts[8], layouts[8], layouts[8]
 }}
 for s = 1, screen.count() do
 tags[s] = awful.tag(tags.names, s, tags.layout)
    end
 -- }}}

-- {{{ Menu
-- Create a laucher widget and a main menu
myawesomemenu = {
   { "manual", terminal .. " -e man awesome" },
   { "edit config", editor_cmd .. " " .. awful.util.getdir("config") .. "/rc.lua" },
   { "restart", awesome.restart },
   { "quit", awesome.quit }
}

mymainmenu = awful.menu({ items = { { "awesome", myawesomemenu, beautiful.awesome_icon },
                                    { "Debian", debian.menu.Debian_menu.Debian },
                    { "open terminal", terminal }
                                  }
                        })

mylauncher = awful.widget.launcher({ image = image(beautiful.awesome_icon),
                                     menu = mymainmenu })
-- }}}

-- Separators

spacer = widget({ type = "textbox" })
seperator = widget({ type = "textbox" })
dash = widget({ type = "textbox" })
spacer.text = " "
seperator.text = "|"
dash.text = "-"

-- {{{ Wibox

-- MPD Widget
mpdicon = widget({ type = "imagebox" })
mpdicon.image = image("/home/goku/images/icons/awesome/music.png")
-- Initialize widget
mpdwidget = widget({ type = "textbox" })
-- Register Widget
vicious.register(mpdwidget, vicious.widgets.mpd, "<span color='#34bdef'> ♪</span> ${Title}, ${Artist}", 13)
--vicious.register(mpdwidget, vicious.widgets.mpd, " ♪ ${Title}, ${Artist}", 13)

--Seperator
spicon = widget({ type = "imagebox" })
spicon.image = image("/home/goku/images/icons/awesome/separator.png")

-- Create a netwidget (usage)
dnicon = widget({ type = "imagebox" })
upicon = widget({ type = "imagebox" })
dnicon.image = image("/home/goku/images/icons/awesome/down-blue.png")
upicon.image = image("/home/goku/images/icons/awesome/up-blue.png")
-- Initialize widget
netwidget = widget({ type = "textbox" })
-- Register widget
vicious.register(netwidget, vicious.widgets.net, "${wlan0 down_kb} / ${wlan0 up_kb}", 1)

-- Create a battery widget
baticon = widget({ type = "imagebox" })
baticon.image = image("/home/goku/images/icons/awesome/bat-blue.png")
--Initialize widget
batwidget = widget({ type = "textbox" })
--Register widget
vicious.register(batwidget, vicious.widgets.bat, "$1$2", 32, "BAT1")

--Create a cpuwidget
cpuicon = widget({ type = "imagebox" })
cpuicon.image = image("/home/goku/images/icons/awesome/cpuinfo-blue.png")
--Initialize widget
cpuwidget = widget({ type = "textbox" })
--Register widget
vicious.register(cpuwidget, vicious.widgets.cpu, "$1%", 2)
-- Create a textclock widget
mytextclock = awful.widget.textclock({ align = "right" })

-- Create a systray
mysystray = widget({ type = "systray" })

-- 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, awful.tag.viewnext),
                    awful.button({ }, 5, awful.tag.viewprev)
                    )
mytasklist = {}
mytasklist.buttons = awful.util.table.join(
                     awful.button({ }, 1, function (c)
                                              if not c:isvisible() then
                                                  awful.tag.viewonly(c:tags()[1])
                                              end
                                              client.focus = c
                                              c:raise()
                                          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
    -- Set a screen margin for borders
awful.screen.padding( screen[s], {top = 0} )
    -- Create a promptbox for each screen
    mypromptbox[s] = awful.widget.prompt({ layout = awful.widget.layout.horizontal.leftright, 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.label.all, mytaglist.buttons)

    -- Create a tasklist widget
    mytasklist[s] = awful.widget.tasklist(function(c)
                                              return awful.widget.tasklist.label.currenttags(c, s)
                                          end, mytasklist.buttons)

    -- Create the wibox
    mywibox[s] = awful.wibox({ position = "top", screen = s, border_width = 0, height=14 })
   -- Add widgets to the wibox - order matters
    mywibox[s].widgets = {
        {
            mytaglist[s], spacer, mpdwidget, spacer,
            mypromptbox[s],
            layout = awful.widget.layout.horizontal.leftright
        },
        
         s == 1 and mylayoutbox[s] or nil, mytextclock,
        seperator, spacer, cpuwidget, spacer, cpuicon, spacer, seperator, upicon, netwidget, dnicon, seperator, spacer,
        batwidget, baticon,
        mysystray,
        layout = awful.widget.layout.horizontal.rightleft
    }
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(
    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),

    --Volume manipulation  
     awful.key({ }, "XF86AudioRaiseVolume", function () awful.util.spawn("amixer set Master 5+") end),
     awful.key({ }, "XF86AudioLowerVolume", function () awful.util.spawn("amixer set Master 5-") 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),

    -- Prompt
    awful.key({ modkey },            "r",     function () mypromptbox[mouse.screen]:run() end),

    awful.key({ modkey }, "x",
              function ()
                  awful.prompt.run({ prompt = "Run Lua code: " },
                  mypromptbox[mouse.screen].widget,
                  awful.util.eval, nil,
                  awful.util.getdir("cache") .. "/history_eval")
              end)
)

clientkeys = awful.util.table.join(
    awful.key({ modkey,           }, "f",      function (c) c.fullscreen = not c.fullscreen  end),
    awful.key({ modkey, "Shift"   }, "c",      function (c) c:kill()                         end),
    awful.key({ modkey, "Control" }, "space",  awful.client.floating.toggle                     ),
    awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end),
    awful.key({ modkey,           }, "o",      awful.client.movetoscreen                        ),
    awful.key({ modkey, "Shift"   }, "r",      function (c) c:redraw()                       end),
    awful.key({ modkey,           }, "t",      function (c) c.ontop = not c.ontop            end),
    awful.key({ modkey,           }, "n",      function (c) c.minimized = not c.minimized    end),
    awful.key({ modkey,           }, "m",
        function (c)
            c.maximized_horizontal = not c.maximized_horizontal
            c.maximized_vertical   = not c.maximized_vertical
        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
    globalkeys = awful.util.table.join(globalkeys,
        awful.key({ modkey }, "#" .. i + 9,
                  function ()
                        local screen = mouse.screen
                        if tags[screen][i] then
                            awful.tag.viewonly(tags[screen][i])
                        end
                  end),
        awful.key({ modkey, "Control" }, "#" .. i + 9,
                  function ()
                      local screen = mouse.screen
                      if tags[screen][i] then
                          awful.tag.viewtoggle(tags[screen][i])
                      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
                  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])
                      end
                  end))
end

clientbuttons = awful.util.table.join(
    awful.button({ }, 1, function (c) client.focus = c; c:raise() end),
    awful.button({ modkey }, 1, awful.mouse.client.move),
    awful.button({ modkey }, 3, awful.mouse.client.resize))

-- Set keys
root.keys(globalkeys)
-- }}}

-- {{{ Rules
awful.rules.rules = {
    -- All clients will match this rule.
    { rule = { },
      properties = { border_width = beautiful.border_width,
                     border_color = beautiful.border_normal,
             size_hints_honor = false,
                     focus = true,
                     keys = clientkeys,
                     buttons = clientbuttons } },
    { rule = { class = "MPlayer" },
      properties = { floating = true } },
    { rule = { class = "pinentry" },
      properties = { floating = true } },
    { rule = { class = "gimp" },
      properties = { floating = true } },
    -- Set Firefox to always map on tags number 2 of screen 1.
    -- { rule = { class = "Firefox" },
    --   properties = { tag = tags[1][2] } },
}
-- }}}

-- {{{ Signals
-- Signal function to execute when a new client appears.
client.add_signal("manage", function (c, startup)
    -- Add a titlebar
    -- awful.titlebar.add(c, { modkey = modkey })

    -- Enable sloppy focus
    c:add_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
end)

client.add_signal("focus", function(c) c.border_color = beautiful.border_focus end)
client.add_signal("unfocus", function(c) c.border_color = beautiful.border_normal end)

-- {{{ Tag signal handler - selection
-- - ASCII tags 1 [2] 3 4...
--   - start with tag 1 named [1] in tag setup
for s = 1, screen.count() do
    for t = 1, #tags[s] do
        tags[s][t]:add_signal("property::selected", function ()
            if tags[s][t].selected then
                tags[s][t].name = "[" .. tags[s][t].name .. "]"
            else
                tags[s][t].name = tags[s][t].name:gsub("[%[%]]", "")
            end
        end)
    end
end
-- }}}

awful.util.spawn_with_shell("xcompmgr -cCfF -t-5 -l-5 -r4.2 -o.55 -D6")
awful.util.spawn_with_shell("mpd")
awful.util.spawn_with_shell("setxkbmap tr")

My theme,

--{{{ Main
require("awful.util")

theme = {}

home          = os.getenv("HOME")
config        = awful.util.getdir("config")
shared        = "/usr/share/awesome"
if not awful.util.file_readable(shared .. "/icons/awesome16.png") then
    shared    = "/usr/share/local/awesome"
end
sharedicons   = shared .. "/icons"
sharedthemes  = shared .. "/themes"
themes        = config .. "/themes"
themename     = "/default"
if not awful.util.file_readable(themes .. themename .. "/theme.lua") then
       themes = sharedthemes
end
themedir      = themes .. themename

wallpaper1    = themedir .. "/background.jpg"
wallpaper2    = themedir .. "/background.png"
wallpaper3    = sharedthemes .. "/zenburn/zenburn-background.png"
wallpaper4    = sharedthemes .. "/default/background.png"

if awful.util.file_readable(wallpaper1) then
    theme.wallpaper_cmd = { "awsetbg " .. wallpaper1 }
elseif awful.util.file_readable(wallpaper2) then
    theme.wallpaper_cmd = { "awsetbg " .. wallpaper2 }
elseif awful.util.file_readable(wallpaper3) then
    theme.wallpaper_cmd = { "awsetbg " .. wallpaper3 }
else
    theme.wallpaper_cmd = { "awsetbg " .. wallpaper4 }
end

--}}}

theme.font          = "lime 8"

theme.bg_normal     = "#000000"
theme.bg_focus      = "#000000"
theme.bg_urgent     = "#000000"
theme.bg_minimize   = "#000000"

theme.fg_normal     = "#575757"
theme.fg_focus      = "#34bdef"
theme.fg_urgent     = "#000000"
theme.fg_minimize   = "#000000"

theme.border_width  = "0"
theme.border_normal = "#000000"
theme.border_focus  = "#000000"
theme.border_marked = "#000000"


-- Display the taglist squares
theme.taglist_squares_sel   = sharedthemes .. "/default/taglist/squarefw.png"
theme.taglist_squares_unsel = sharedthemes .. "/default/taglist/squarew.png"

theme.tasklist_floating_icon = sharedthemes .. "/default/tasklist/floatingw.png"

-- Variables set for theming the menu:
theme.menu_submenu_icon = sharedthemes .. "/default/submenu.png"
theme.menu_height = "15"
theme.menu_width  = "100"

-- Define the image to load
theme.titlebar_close_button_normal = sharedthemes .. "/default/titlebar/close_normal.png"
theme.titlebar_close_button_focus  = sharedthemes .. "/default/titlebar/close_focus.png"

theme.titlebar_ontop_button_normal_inactive = sharedthemes .. "/default/titlebar/ontop_normal_inactive.png"
theme.titlebar_ontop_button_focus_inactive  = sharedthemes .. "/default/titlebar/ontop_focus_inactive.png"
theme.titlebar_ontop_button_normal_active = sharedthemes .. "/default/titlebar/ontop_normal_active.png"
theme.titlebar_ontop_button_focus_active  = sharedthemes .. "/default/titlebar/ontop_focus_active.png"

theme.titlebar_sticky_button_normal_inactive = sharedthemes .. "/default/titlebar/sticky_normal_inactive.png"
theme.titlebar_sticky_button_focus_inactive  = sharedthemes .. "/default/titlebar/sticky_focus_inactive.png"
theme.titlebar_sticky_button_normal_active = sharedthemes .. "/default/titlebar/sticky_normal_active.png"
theme.titlebar_sticky_button_focus_active  = sharedthemes .. "/default/titlebar/sticky_focus_active.png"

theme.titlebar_floating_button_normal_inactive = sharedthemes .. "/default/titlebar/floating_normal_inactive.png"
theme.titlebar_floating_button_focus_inactive  = sharedthemes .. "/default/titlebar/floating_focus_inactive.png"
theme.titlebar_floating_button_normal_active = sharedthemes .. "/default/titlebar/floating_normal_active.png"
theme.titlebar_floating_button_focus_active  = sharedthemes .. "/default/titlebar/floating_focus_active.png"

theme.titlebar_maximized_button_normal_inactive = sharedthemes .. "/default/titlebar/maximized_normal_inactive.png"
theme.titlebar_maximized_button_focus_inactive  = sharedthemes .. "/default/titlebar/maximized_focus_inactive.png"
theme.titlebar_maximized_button_normal_active = sharedthemes .. "/default/titlebar/maximized_normal_active.png"
theme.titlebar_maximized_button_focus_active  = sharedthemes .. "/default/titlebar/maximized_focus_active.png"

-- You can use your own layout icons like this:
theme.layout_fairh = sharedthemes .. "/default/layouts/fairhw.png"
theme.layout_fairv = sharedthemes .. "/default/layouts/fairvw.png"
theme.layout_floating  = sharedthemes .. "/default/layouts/floatingw.png"
theme.layout_magnifier = sharedthemes .. "/default/layouts/magnifierw.png"
theme.layout_max = sharedthemes .. "/default/layouts/maxw.png"
theme.layout_fullscreen = sharedthemes .. "/default/layouts/fullscreenw.png"
theme.layout_tilebottom = sharedthemes .. "/default/layouts/tilebottomw.png"
theme.layout_tileleft   = sharedthemes .. "/default/layouts/tileleftw.png"
theme.layout_tile = sharedthemes .. "/default/layouts/tilew.png"
theme.layout_tiletop = sharedthemes .. "/default/layouts/tiletopw.png"
theme.layout_spiral  = sharedthemes .. "/default/layouts/spiralw.png"
theme.layout_dwindle = sharedthemes .. "/default/layouts/dwindlew.png"

theme.awesome_icon = sharedicons .. "/awesome16.png"

return theme
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80

If you want to use symbolic tags for tag names,

tags = {
    -- names = { "☠", "⌥", "✇", "⌤", "⍜", "✣", "⌨", "⌘", "☕" },
    names = { "☭", "⌥", "✇", "⌤", "☼", "⌘" },
    layout = { layouts[2], layouts[2], layouts[2], layouts[2], layouts[2] , layouts[2] }
}

Editing the status bar, as you can see your position, size, the layout of your widgets etc. You can add, delete, or what ever you want to do in here.

    -- Create the wibox
    mywibox[s] = awful.wibox({ position = "top", screen = s, border_width = 0, height=14 })
   -- Add widgets to the wibox - order matters
    mywibox[s].widgets = {
        {
            mytaglist[s], spacer, mpdwidget, spacer,
           -- mytaglist[s], spacer,
        mypromptbox[s],
            layout = awful.widget.layout.horizontal.leftright
        },
        
         s == 1 and mylayoutbox[s] or nil, mytextclock,
        seperator, spacer, cpuwidget, spacer, cpuicon, spacer, seperator, upicon, netwidget, dnicon, seperator, spacer,
        batwidget, baticon,
        mysystray,
        layout = awful.widget.layout.horizontal.rightleft
    }
end
-- }}}

Autostart without .xinitrc or .xsessions, the bad thing about this the applications start and start again if you restart your awesome. There're also another ways to use autostart but I prefer this one, easy of course.

awful.util.spawn_with_shell("mpd")

dzen images,
icojoy_pixel_icons_452.jpg
Downlad it from here

Icons in my screeshot, download.

For detailed information, here.

Screen of my desktop,
aakvzsXy.jpg

Last edited by Eren (2012-05-05 22:22:07)

Offline

Be excellent to each other!

#252 2012-05-21 00:51:56

yamba
Member
Registered: 2012-04-30
Posts: 10

Re: Big Ol' Awesome Config Thread!

HI, I am running waldorf with slim login .
I am just learning awesome and I managed to get the network applet to load
by editing the lua config.
I need help getting the volume icon that is used in the default openbox Tint 2 menu to show up
in Awesome. I know this is basic compared with everything you are doing with configuring Awesome.

I want to learn more by studying this thread but i just need the volume icon to have a usable basic Awsome config to build upon when I have more time..
Thank you.
scott

Offline

#253 2012-05-21 10:26:06

n2o4
New Member
From: Finland
Registered: 2012-04-04
Posts: 7

Re: Big Ol' Awesome Config Thread!

yamba wrote:

HI, I am running waldorf with slim login .
I need help getting the volume icon that is used in the default openbox Tint 2 menu to show up
in Awesome.

The "traditional" way would be adding "volumeicon &" to ~/.xinitrc, but let's walk you through a few alternate solutions:

1) "Dirty" way

By appending

os.execute("volumeicon &")

to your rc.lua will work, but every time you reload your configuration a new instance of volumeicon will show up.

2) Cleaner way

By appending

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("volumeicon")

to your rc.lua will run every run_once-instance once at startup and not every time Awesome is restarted.

Offline

#254 2012-05-21 21:17:41

yamba
Member
Registered: 2012-04-30
Posts: 10

Re: Big Ol' Awesome Config Thread!

Thank you n2o4 i think the probleme is in the naming
"volumeicon" is not working.

has the volume applet name changed in testing release waldorf?

scott@crunchbang:~$ volumeicon
ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Connection refused

volumeicon: alsa_backend.c:88: asound_get_volume: Assertion `m_elem != ((void *)0)' failed.
Aborted

Offline

#255 2012-05-23 02:07:57

dLclassic
Member
Registered: 2008-12-24
Posts: 30

Re: Big Ol' Awesome Config Thread!

Im using conky in my awesome setup and im able to  close conkywith my alt f4 just like any other window. What do I need to do to make it unclosable? And sorry if this is wrong topic didnt know if it was an awesome or conky problem


formerly known as ley_lines

Offline

#256 2012-05-24 12:20:53

n2o4
New Member
From: Finland
Registered: 2012-04-04
Posts: 7

Re: Big Ol' Awesome Config Thread!

yamba wrote:

scott@crunchbang:~$ volumeicon
ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Connection refused

volumeicon: alsa_backend.c:88: asound_get_volume: Assertion `m_elem != ((void *)0)' failed.
Aborted

This sounds more like a Pulseaudio-related problem to me.

Offline

#257 2012-06-05 03:50:05

doug piston
Member
Registered: 2012-02-11
Posts: 35

Re: Big Ol' Awesome Config Thread!

ley_lines wrote:

Im using conky in my awesome setup and im able to  close conkywith my alt f4 just like any other window. What do I need to do to make it unclosable? And sorry if this is wrong topic didnt know if it was an awesome or conky problem


Haven't used conky in a long time but I believe 'own_window = no' should get you to your happy place.

Last edited by doug piston (2012-06-05 03:50:20)

Offline

#258 2012-11-07 10:14:46

M.I.H.H
#! Member
From: /etc/init.d/
Registered: 2012-11-01
Posts: 72
Website

Re: Big Ol' Awesome Config Thread!

how to install awesomeWM on Crunchbang.
should i must put some source URL in source.list ?


i will continue to seek knowledge.


selling vpn, tutorials.

Offline

#259 2012-11-07 12:41:07

m5
#! CrunchBanger
From: 200 years ago.
Registered: 2011-12-08
Posts: 221

Re: Big Ol' Awesome Config Thread!

^ just type :

sudo apt-get install awesome

in terminal.


Keep digging.
Linux beginner.

Offline

#260 2012-11-07 13:06:56

Istvan
#! CrunchBanger
From: Budapest, Hungary
Registered: 2010-02-20
Posts: 148

Re: Big Ol' Awesome Config Thread!

m5 wrote:

^ just type :

sudo apt-get install awesome

in terminal.

Perhaps also this :
sudo apt-get install awesome-extra


Ha ezt el tudod olvasni, biztosan nem vagy rövidlátó.

Offline

#261 2012-11-08 10:50:39

M.I.H.H
#! Member
From: /etc/init.d/
Registered: 2012-11-01
Posts: 72
Website

Re: Big Ol' Awesome Config Thread!

Istvan wrote:
m5 wrote:

^ just type :

sudo apt-get install awesome

in terminal.

Perhaps also this :
sudo apt-get install awesome-extra


when i typing: sudo apt-get install awesome
and then
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unabel to locate package awesome

so, what should i do ?


i will continue to seek knowledge.


selling vpn, tutorials.

Offline

#262 2013-01-15 15:45:14

rohan166
Member
Registered: 2012-09-23
Posts: 48

Re: Big Ol' Awesome Config Thread!

Hey guys.
I just installed awesome-wm and I think something's not right.
After a fresh install when I launch awesome, I right click and click on manual or config buttons but none of them work; nothing opens.
Also, I tried using someone else's config but it did not detect any configs in the ~/.config/awesome folder so I tried replacing the config in /etc/xdg/awesome.
After I did that and restarted awesome-wm it showed an error and brought me back to login screen.

Did this happen to anyone ?

What do I do ?
Thanks.

@M.I.H.H :

Type in terminal uname -r
The last word you see ( eg. amd64 or i686 ) note it down.
Go to ----> http://packages.debian.org/wheezy/awesome
Scroll to bottom , you'll see kind of a table. Click on the word that corresponds to the output of uname -r
A .deb file will be downloaded, install it.

Offline

#263 2013-01-21 10:00:18

yt
#! Member
From: Cologne / Germany
Registered: 2009-06-01
Posts: 73

Re: Big Ol' Awesome Config Thread!

Did someone manage to compile awesome 3.5? I get always the error glib-unix.h missing.

Offline

#264 2013-01-27 21:50:34

Lula
Member
Registered: 2013-01-08
Posts: 10

Re: Big Ol' Awesome Config Thread!

Hey! i have a problem, and it seems like you guys are good at awesome! smile I am trying to set Libreoffice to open in a specific tag but it aint working. Can someone help me? Thanks! big_smile

-- {{{ Rules
awful.rules.rules = {
    -- clients will match this rule.
    { rule = { },
      properties = { border_width = beautiful.border_width,
                     border_color = beautiful.border_normal,
                     focus = true,
                     keys = clientkeys,
                     buttons = clientbuttons } },
                     
    { rule = { class = "MPlayer" },
      properties = { floating = true } },
    { rule = { class = "pinentry" },
      properties = { floating = true } },
    { rule = { class = "gimp" },
      properties = { floating = true } },
     
     { rule = { class = "Vlc"},
            properties = { tag = tags[1][4] } },
     { rule = { class = "Google-chrome" },
            properties = { tag = tags[1][2] } },
     { rule = { class = "Empathy" },
            properties = { tag = tags[1][2] } },
     { rule = { class = "Spotify" },
            properties = { tag = tags[1][4] } },
     { rule = { class = "Geany" },
            properties = { tag = tags[1][5] } },
     { rule = { class = "Transmission" },
            properties = { tag = tags[1][5] } },
     { rule = { class = "Evince" },
            properties = { tag = tags[1][3] } },
     { rule = { class = "X-terminal-emulator" },
            properties = { tag = tags[1][5] } },
     { rule = { class = "Gimp" },
            properties = { tag = tags[1][3] } },
     { rule = { class = "Catfish" },
            properties = { tag = tags[1][5] } },
     { rule = { class = " libreoffice -writer" },
            properties = { tag = tags[1][3] } },                              
                   

Offline

#265 2013-02-01 08:05:18

Resident Bot
#! Die Hard
From: The Netherlands
Registered: 2012-02-17
Posts: 564

Re: Big Ol' Awesome Config Thread!

Whenever I have had a problem  with opening an app on a specific window it turned out to be the name of the class was wrong - just a small thing like a capital L instead of a small l  can mean all the difference.


Troll = not a fanatic
slave of #!  and arch

Offline

#266 2013-02-01 18:20:51

gutterslob
#! Resident Bum
Registered: 2009-11-03
Posts: 2,926

Re: Big Ol' Awesome Config Thread!

If you look closely (2nd last line), you'll notice a space between the " and the libreoffice launch command. Could that be the reason?
Sorry, I've got no experience with libreoffice, and I haven't used awesome in a long time, so I can't make any further guesses.

Last edited by gutterslob (2013-02-01 18:21:46)


Point & Squirt

Offline

#267 2013-02-01 18:59:17

PackRat
#! Die Hard
From: USA
Registered: 2011-03-03
Posts: 1,101

Re: Big Ol' Awesome Config Thread!

@lula

When I use xprop I get:

WM_CLASS(STRING) = "VCLSalFrame", "libreoffice-writer"

If the WM_CLASS(STRING) is what's needed in Awesome - and as I recall it is - you'll need to take out the space between libreoffice and -writer; as well as the space gutterslob is talking about.


"It does not require many words to speak the truth." - Chief Joseph, Nez Perce tribe

Offline

#268 2013-02-01 20:29:24

Lula
Member
Registered: 2013-01-08
Posts: 10

Re: Big Ol' Awesome Config Thread!

Thanks everyone! you guys are aweeeesome! big_smile It's working with "libreoffice-writer", the problem was the space between libreoffice and -writer.  This is a great forum, so much love.

Offline

#269 2013-02-26 04:28:27

BobTheZealot
Member
Registered: 2012-08-29
Posts: 30

Re: Big Ol' Awesome Config Thread!

Hi all,

I'm trying to bind a key to move and resize floating windows to specific positions and an absolute height and width.  I've tried the code below, but it doesn't work -- anyone have any ideas how to get it to work?

Thanks!

clientkeys = awful.util.table.join(
    awful.key({ modkey,           }, "u",
        function (c)
            c:geometry( {x = 50, y = 50, width = 200, height = 600} )
        end)
)

Offline

#270 2013-09-07 14:20:19

Jing
New Member
Registered: 2013-09-07
Posts: 3

Re: Big Ol' Awesome Config Thread!

crosspost from the monster conky thread:

i use #! too but on my other laptop *hides*
adxH6nY4.jpg


busyish wink

abfSJ4EF.jpg

and clean...running 5 conkys
big_smile

*looks proud*
kinda new to conky...copied the code from various forums >:}

heres the rc.lua...

--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")
require('freedesktop.utils')
require('freedesktop.menu')
freedesktop.utils.icon_theme = 'HighContrast'
local naughty = require("naughty")
local menubar = require("menubar")
local vicious = require("vicious")
local wi = require("wi")

require("volume")





sexec = awful.util.spawn_with_shell

-- {{{ 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("/home/jing/.config/awesome/themes/aw/themes/zenburn/theme.lua")

-- This is used later as the default terminal and editor to run.
terminal = "lilyterm"
editor = os.getenv("EDITOR") or "nano"
editor_cmd = terminal .. " -e " .. editor

-- 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"
rodkey = "Mod1"


rttmux        = "sudo terminal --geometry=80x30+20+36 --default-working-directory=/root/ -x tmux -2"
ttmux         = "lilyterm -T tmux -g 80x30+20+36 -e tmux -2"
tetmux        = "terminal --geometry=80x34+20+36 -x tmux -2"


iptraf        = "lilyterm -T 'IP traffic monitor' -g 80x34-20+34 -e sudo iptraf-ng -i all"
mailmutt      = "lilyterm -T 'Mutt' -g 80x34-20+34 -e mutt"
weechat      = "lilyterm -T 'weechat-curses' -g 80x34-20+34 -e weechat-curses"
editor        = os.getenv("EDITOR") or "vim"
editor_cmd    = terminal .. " -e " .. editor
browser       = "firefox"
fm            = "spacefm"


cyan = "<span color='0da2d9'>"


-- Table of layouts to cover with awful.layout.inc, order matters.
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,
    awful.layout.suit.max.fullscreen,
    awful.layout.suit.magnifier
}
-- }}}

-- {{{ 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  = {
         '☭:sys',
         '⚡:net',
         '♨:doc',
         '☠:dev',
         '☃:irc',
         '⌥:vbx',
         '⌘:foo',
         '✇',
         '✣',
           }
}
for s = 1, screen.count() do
    -- Each screen has its own tag table.
    tags[s] = awful.tag( tags.names, s, layouts[1] )
end

-- }}}

-- {{{ Menu
-- Create a laucher widget and a main menu
menu_items = freedesktop.menu.new()
menu_items = freedesktop.menu.new()
myawesomemenu = {
   { "manual", terminal .. " -e man awesome", freedesktop.utils.lookup_icon({ icon = 'help' }) },
   { "edit config", editor_cmd .. " " .. awesome.conffile, freedesktop.utils.lookup_icon({ icon = 'package_settings' }) },
   { "restart", awesome.restart, freedesktop.utils.lookup_icon({ icon = 'system-shutdown-panel' }) },
   { "quit", awesome.quit, freedesktop.utils.lookup_icon({ icon = 'system-shutdown-restart-panel' }) }   
}

mysys = {
   { "manual", terminal .. " -e man awesome" },
   { "exit", '/home/jing/.config/awesome/shut.sh'},  
   { "edit config", editor_cmd .. " " .. awesome.conffile },
   { "restart", awesome.restart },
   { "quit", awesome.quit },
   { "htop" , "htop" },
   { "gui-tweak" , "lxappearance" }
}

mygeany = {
   
   { "geany", 'geany'}
}

myfold = {

   { "ranger", terminal .. " -e ranger"},
   { "spacefm", 'spacefm'}
}

mygimp = {

   { "gimp", 'gimp'}
}

myfox = {

   { "firefox", 'firefox'}
}

mypdf = {

   { "mupdf", 'mupdf'},
   { "abiword", 'abiword'}
}

myemacs = {

   { "emacs", 'emacs'}
}


        table.insert(menu_items, { "awesome", myawesomemenu, beautiful.awesome_icon })

 mymainmenu = awful.menu({ items = menu_items, width = 150 })


mygmenu = awful.menu({ items = { { "geany", mygeany },
                                    { " ", terminal }
                                  }
                        })

                                  
myfoldmenu = awful.menu({ items = { { "spacefm", myfold },
                                    { " ", terminal }
                                  }
                        })
 
mygimpmenu = awful.menu({ items = { { "gimp", mygimp },
                                    { " ", terminal }
                                  }
                        })

myfoxmenu = awful.menu({ items = { { "firefox", myfox },
                                    { " ", terminal }
                                  }
                        })

mypdfmenu = awful.menu({ items = { { "mupdf", mypdf },
                                    { " ", terminal }
                                  }
                        })

myemacsmenu = awful.menu({ items = { { "emacs", myemacs },
                                    { " ", terminal }
                                  }
                        })

mysysmenu = awful.menu({ items = { { "awesome", mysys, beautiful.awesome_icon },
                                    { " ", terminal }
                                  }
                        })

syslauncher = awful.widget.launcher({ image = beautiful.widget_www,
                                     menu = mysysmenu })


glauncher = awful.widget.launcher({ image = beautiful.geany,
                                     menu = mygmenu })

foldlauncher = awful.widget.launcher({ image = beautiful.fold,
                                     menu = myfoldmenu })

gimplauncher = awful.widget.launcher({ image = beautiful.gimp,
                                     menu = mygimpmenu })

foxlauncher = awful.widget.launcher({ image = beautiful.fox,
                                     menu = myfoxmenu })

pdflauncher = awful.widget.launcher({ image = beautiful.pdf,
                                     menu = mypdfmenu })

emacslauncher = awful.widget.launcher({ image = beautiful.emacs,
                                     menu = myemacsmenu })

mylauncher = awful.widget.launcher({ image = beautiful.awesome_icon,
                                     menu = mymainmenu })

-- Menubar configuration
menubar.utils.terminal = terminal -- Set the terminal for applications that require it
-- }}}

spacer       = wibox.widget.textbox()
spacer:set_text(' | ')

tiny = wibox.widget.textbox()
tiny:set_text(' ')

small = wibox.widget.textbox()
small:set_text('  ')


space       = wibox.widget.textbox()
space:set_text('  |  ')

spacey       = wibox.widget.textbox()
spacey:set_text('   ')

-----volt       = wibox.widget.textbox()
-------volt:set_text(' ⌁ ')

weather = wibox.widget.textbox()
vicious.register(weather, vicious.widgets.weather, '<span color="#0da2d9">${city}.</span> T: <span color="#0da2d9">${tempc}c</span> S: <span color="#0da2d9">${sky}.</span>', 1200, "EGNX")

batt = wibox.widget.textbox()
vicious.register(batt, vicious.widgets.bat, "Batt: $2% Rem: $3", 61, "BAT1")

myicon =  wibox.widget.textbox()
myicon:set_text ('Jing')






myicon:buttons(awful.util.table.join(awful.button({ }, 1, 
function () awful.util.spawn_with_shell(weechat) end)))









wifiicon = wibox.widget.imagebox()
wifiicon:set_image(beautiful.widget_wifi)
--
wifi = wibox.widget.textbox()
vicious.register(wifi, vicious.widgets.wifi, ' Rate: <span color="#0da2d9">${rate}MB/s</span> L: <span color="#0da2d9">${link}%</span> M: <span color="#0da2d9">${mode}</span>', 3, "wlp3s0")

-- End Wifi }}}
 

----------------------------------------


local wibox = require("wibox")
local awful = require("awful")

volume_widget = wibox.widget.textbox()
volume_widget:set_align("right")

function update_volume(widget)
   local fd = io.popen("amixer sget Master")
 local status = fd:read("*all")
   fd:close()

 local volume = tonumber(string.match(status, "(%d?%d?%d)%%")) / 100
 local volume = string.match(status, "(%d?%d?%d)%%")
 volume = string.format("% 3d", volume)

 status = string.match(status, "%[(o[^%]]*)%]")

if string.find(status, "on", 1, true) then
--       For the volume numbers
      volume = volume .. "%"
  else
  --     For the mute button
       volume = volume .. "M"

   end
   widget:set_markup(volume)
end

update_volume(volume_widget)

mytimer = timer({ timeout = 0.2 })
mytimer:connect_signal("timeout", function () update_volume(volume_widget) end)
mytimer:start()
--------------------------------------------------











--------------------------------------------------

-- Battery attributes
local bat_state  = ""
local bat_charge = 0
local bat_time   = 0
local blink      = true

-- Icon
baticon = wibox.widget.imagebox()
baticon:set_image(beautiful.widget_batfull)

-- Charge %
batpct = wibox.widget.textbox()
vicious.register(batpct, vicious.widgets.bat, function(widget, args)
  bat_state  = args[1]
  bat_charge = args[2]
  bat_time   = args[3]

  if args[1] == "-" then
    if bat_charge > 70 then
      baticon:set_image(beautiful.widget_batfull)
    elseif bat_charge > 30 then
      baticon:set_image(beautiful.widget_batmed)
    elseif bat_charge > 10 then
      baticon:set_image(beautiful.widget_batlow)
    else
      baticon:set_image(beautiful.widget_batempty)
    end
  else
    baticon:set_image(beautiful.widget_ac)
    if args[1] == "+" then
      blink = not blink
      if blink then
        baticon:set_image(beautiful.widget_acblink)
      end
    end
  end

return args[2] .. "%"
end, nil, "BAT1")
-- Buttons
function popup_bat()
  local state = ""
  if bat_state == "↯" then
    state = "Full"
  elseif bat_state == "↯" then
    state = "Charged"
  elseif bat_state == "+" then
    state = "Charging"
  elseif bat_state == "-" then
    state = "Discharging"
  elseif bat_state == "⌁" then
    state = "Not charging"
  else
    state = "Unknown"
  end

  naughty.notify { text = "Charge : " .. bat_charge .. "%\nState  : " .. state ..
    " (" .. bat_time .. ")", timeout = 5, hover_timeout = 0.5 }
end
batpct:buttons(awful.util.table.join(awful.button({ }, 1, popup_bat)))
baticon:buttons(batpct:buttons())
-- End Battery}}}











neticon = wibox.widget.imagebox()
neticon:set_image(beautiful.widget_net)
neticon:buttons(awful.util.table.join(awful.button({ }, 1,
function () awful.util.spawn_with_shell(iptraf) end)))



--------------------

netwidget = wibox.widget.textbox()
vicious.register(netwidget, vicious.widgets.net, '<span color="#CC9090">⇩${wlp3s0 down_kb}</span> <span color="#7F9F7F">⇧${wlp3s0 up_kb}</span>', 3)

--------------------------------------------












--------------------



-- gmail widget and tooltip
mygmail = wibox.widget.textbox()
gmail_t = awful.tooltip({ objects = { mygmail },})

mygmailimg = wibox.widget.imagebox()
mygmailimg:set_image(beautiful.widget_mail)

mygmailimg:buttons(awful.util.table.join(awful.button({ }, 1,
function () awful.util.spawn_with_shell(mailmutt) end)))



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, 120) 
                 --the '120' here means check every 2 minutes.


--cpuwidget = awful.widget.graph()
--vicious.register(cpuwidget, vicious.widgets.cpu, "$1")
--cpuwidget:set_background_color('#000000')
--cpuwidget:set_color('#70B8FF')
--cpuwidget:set_color({ type = "linear", from = { 0, 0 }, to = { 0, 20 }, stops = { { 0, "#0066CC" }, { 0.5, "#66FFFF" }, { 1, "#B280E6" } }})




-- {{{ PACMAN
-- Icon
pacicon = wibox.widget.imagebox()
pacicon:set_image(beautiful.widget_pac)
--
-- Upgrades
pacwidget = wibox.widget.textbox()
vicious.register(pacwidget, vicious.widgets.pkg, function(widget, args)
   if args[1] > 0 then
   pacicon:set_image(beautiful.widget_pacnew)
   else
   pacicon:set_image(beautiful.widget_pac)
   end

  return args[1]
  end, 1801, "Arch S") -- Arch S for ignorepkg
--
-- Buttons
  function popup_pac()
  local pac_updates = ""
  local f = io.popen("pacman -Sup --dbpath /tmp/pacsync")
  if f then
  pac_updates = f:read("*a"):match(".*/(.*)-.*\n$")
  end
  f:close()
  if not pac_updates then
  pac_updates = "System is up to date"
  end
  naughty.notify { text = pac_updates }
  end
  pacwidget:buttons(awful.util.table.join(awful.button({ }, 1, popup_pac)))
  pacicon:buttons(pacwidget:buttons())
-- End Pacman }}}


 
wir = wibox.widget.imagebox()
wir:set_image(beautiful.wire)


volicon = wibox.widget.imagebox()
volicon:set_image(beautiful.widget_vol)

annicon = wibox.widget.imagebox()
annicon:set_image(beautiful.ann)

daveicon = wibox.widget.imagebox()
daveicon:set_image(beautiful.dave)








-- {{{ Wibox
-- Create a textclock widget

-- original code made by Bzed and published on [url]http://awesome.naquadah.org/wiki/Calendar_widget[/url]
-- modified by Marc Dequènes (Duck) <Duck@DuckCorp.org> (2009-12-29), under the same licence,
-- and with the following changes:
--   + transformed to module
--   + the current day formating is customizable




clockicon = wibox.widget.imagebox()
clockicon:set_image(beautiful.widget_clock)
mytextclock = wibox.widget.textbox()
vicious.register(mytextclock, vicious.widgets.date, '%H:%M ')




-------------------------------------





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 "#0da29d"
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 = "mo tu wn th fr sa sn\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('<span weight="bold" foreground = "%s">%s</span>',
                          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('<span font="%s" foreground="%s">%s</span>',
                                theme.fontt, text_color, result)
end

local function calculate_char_width()
   return beautiful.get_font_height(theme.fontt) * 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)))















-----------------------














mwee = wibox.widget.imagebox()
mwee:set_image(beautiful.avatar)












cpuicon = wibox.widget.imagebox()
cpuicon:set_image(beautiful.cppu)


cpu = wibox.widget.textbox()
vicious.register(cpu, vicious.widgets.cpu, 'Cpu: <span color="#0da2d9">$1%</span> ', 1)




mem = wibox.widget.textbox()
vicious.register(mem, vicious.widgets.mem, 'Mem: <span color="#0da2d9">$1%</span>', 2)





-- CPU widget from [url]http://awesome.naquadah.org/wiki/CPU_Usage[/url]
-- adapted to awesome 3.5 by pdizzle

-- {{ define wibox
cpuwidget = wibox.widget.textbox()
cpuwidget:set_align("right")
-- }}

-- {{ function
jiffies = {}

function activecpu()
        cpusage = ""
        for line in io.lines("/proc/stat") do
                local cpu, newjiffies = string.match(line, "(cpu%d*)%s+(%d+)")
                if cpu and newjiffies then
                        if not jiffies[cpu] then
                                jiffies[cpu] = newjiffies
                        end
                        --The string.format prevents your task list from jumping around 
                        --when CPU usage goes above/below 10%
                        cpusage = cpusage .. "." .. string.format("%02d", newjiffies-jiffies[cpu])
                        jiffies[cpu] = newjiffies
                end
        end
        cpuwidget:set_markup(cpusage)
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)))



-- Calendar widget to attach to the textclock
-- Pacman Widget



-- Create a wibox for each screen and add it
mywibox = {}
--mysysbox = {}
myinfowibox = {}
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", height = "18", 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(mylauncher)  
    left_layout:add(spacer)
    left_layout:add(mypromptbox[s])

    -- Widgets that are aligned to the right
    local right_layout = wibox.layout.fixed.horizontal()
   right_layout:add(spacer) 
--right_layout:add(daveicon)
right_layout:add(pacicon)
right_layout:add(tiny)

--   if s == 1 then right_layout:add(wibox.widget.systray()) end
--    right_layout:add(spacer)

right_layout:add(daveicon)  
right_layout:add(tiny)
right_layout:add(mwee)
right_layout:add(tiny)
  right_layout:add(myicon)
right_layout:add(tiny)
right_layout:add(daveicon)
right_layout:add(tiny)
--   right_layout:add(spacer)

   
   right_layout:add(mygmailimg)
  right_layout:add(tiny)
--  right_layout:add(spacer)
right_layout:add(daveicon)  
right_layout:add(tiny)
  right_layout:add(volicon)
--    right_layout:add(volpct)
--    right_layout:add(volspace)
  right_layout:add(volume_widget)  
--  right_layout:add(spacer)
right_layout:add(tiny)
right_layout:add(daveicon)  
right_layout:add(tiny)
--  right_layout:add(binClock)
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()
    layout:set_left(left_layout)
    layout:set_middle(mytasklist[s])
    layout:set_right(right_layout)

    mywibox[s]:set_widget(layout)

  --  mysysbox[s] = awful.wibox({ position = "left", height = "13", screen = s })
--local left_layout = wibox.layout.fixed.horizontal()

--left_layout:add(spacer)
--   if s == 1 then right_layout:add(wibox.widget.systray()) end

--mysysbox[s]:set_widget(layout)

myinfowibox[s] = awful.wibox({ position = "bottom", height = "19", screen = s })
   -- Widgets that are aligned to the bottom
    local bottom_layout = wibox.layout.fixed.horizontal()

   bottom_layout:add(small)    
    bottom_layout:add(syslauncher)
--bottom_layout:add(arrow1)

bottom_layout:add(small)



bottom_layout:add(glauncher)
bottom_layout:add(small)
bottom_layout:add(foldlauncher)

bottom_layout:add(small)
bottom_layout:add(gimplauncher)
bottom_layout:add(small)
bottom_layout:add(foxlauncher)
bottom_layout:add(small)
bottom_layout:add(pdflauncher)
bottom_layout:add(small)
bottom_layout:add(emacslauncher)
bottom_layout:add(tiny)
bottom_layout:add(annicon)

bottom_layout:add(tiny)


   bottom_layout:add(neticon)
    bottom_layout:add(wifi)



bottom_layout:add(tiny)
bottom_layout:add(annicon)
bottom_layout:add(tiny)

bottom_layout:add(cpuicon)
bottom_layout:add(cpu)
bottom_layout:add(tiny)
bottom_layout:add(mem)

--bottom_layout:add(cpuwidget)

--bottom_layout:add(netwidget)
--bottom_layout:add(space)

bottom_layout:add(tiny)
bottom_layout:add(annicon)
bottom_layout:add(tiny)

bottom_layout:add(weather)
--bottom_layout:add(wg_rss)

bottom_layout:add(tiny)
bottom_layout:add(annicon)
bottom_layout:add(tiny)


--bottom_layout:add(space)
if s == 1 then bottom_layout:add(wibox.widget.systray()) end  
--  bottom_layout:add(space)
bottom_layout:add(tiny)
bottom_layout:add(annicon)
bottom_layout:add(tiny)
    bottom_layout:add(baticon)
 bottom_layout:add(tiny)
 bottom_layout:add(batpct)



--bottom_layout:add(space)
-- bottom_layout:add(pacicon)

--    bottom_layout:add(cpuwidget)
-- bottom_layout:add(space)
-- bottom_layout:add(arrow0)
-- bottom_layout:add(arrow1)
-- bottom_layout:add(arrow2)
-- bottom_layout:add(arrow3)




 -- Now bring it all together
    --local layout = wibox.layout.align.horizontal()
    --layout:set_bottom(bottom_layout)

    myinfowibox[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(
    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() end),

  awful.key({modkey }, "p", function()
  awful.util.spawn_with_shell( "exe=`dmenu_path | dmenu -b -nf '#888888' -nb '#222222' -sf '#ffffff' -sb '#285577'` && exec $exe")
   end),

  awful.key({rodkey }, "l", function()
  awful.util.spawn_with_shell( "sakura" )
   end), 
  
  awful.key({rodkey }, "f", function()
  awful.util.spawn_with_shell( "firefox" )
   end),

 awful.key({rodkey }, "q", function ()
       awful.util.spawn("amixer set Master 9%+") end),
   awful.key({rodkey }, "w", function ()
       awful.util.spawn("amixer set Master 9%-") end),
   awful.key({rodkey }, "e", function ()
       awful.util.spawn("amixer sset Master toggle") 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),

    -- Prompt
    awful.key({ modkey },            "r",     function () mypromptbox[mouse.screen]:run() end),

    awful.key({ modkey }, "x",
              function ()
                  awful.prompt.run({ prompt = "Run Lua code: " },
                  mypromptbox[mouse.screen].widget,
                  awful.util.eval, nil,
                  awful.util.getdir("cache") .. "/history_eval")
              end),
    -- Menubar
    awful.key({ modkey }, "p", function() menubar.show() end)
)

clientkeys = awful.util.table.join(
    awful.key({ modkey,           }, "f",      function (c) c.fullscreen = not c.fullscreen  end),
    awful.key({ modkey, "Shift"   }, "c",      function (c) c:kill()                         end),
    awful.key({ modkey, "Control" }, "space",  awful.client.floating.toggle                     ),
    awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end),
    awful.key({ modkey,           }, "o",      awful.client.movetoscreen                        ),
    awful.key({ modkey,           }, "t",      function (c) c.ontop = not c.ontop            end),
    awful.key({ modkey,           }, "n",
        function (c)
            -- The client currently has the input focus, so it cannot be
            -- minimized, since minimized clients can't have the focus.
            c.minimized = true
        end),
    awful.key({ modkey,           }, "m",
        function (c)
            c.maximized_horizontal = not c.maximized_horizontal
            c.maximized_vertical   = not c.maximized_vertical
        end)
)

-- Bind all key numbers to tags.
-- Be careful: we use keycodes to make it works on any keyboard layout.
-- This should map on the top row of your keyboard, usually 1 to 9.
for i = 1, 9 do
    globalkeys = awful.util.table.join(globalkeys,
        awful.key({ modkey }, "#" .. i + 9,
                  function ()
                        local screen = mouse.screen
                        local tag = awful.tag.gettags(screen)[i]
                        if tag then
                           awful.tag.viewonly(tag)
                        end
                  end),
        awful.key({ modkey, "Control" }, "#" .. i + 9,
                  function ()
                      local screen = mouse.screen
                      local tag = awful.tag.gettags(screen)[i]
                      if tag then
                         awful.tag.viewtoggle(tag)
                      end
                  end),
        awful.key({ modkey, "Shift" }, "#" .. i + 9,
                  function ()
                      local tag = awful.tag.gettags(client.focus.screen)[i]
                      if client.focus and tag then
                          awful.client.movetotag(tag)
                     end
                  end),
        awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9,
                  function ()
                      local tag = awful.tag.gettags(client.focus.screen)[i]
                      if client.focus and tag then
                          awful.client.toggletag(tag)
                      end


                  end))
end

clientbuttons = awful.util.table.join(
    awful.button({ }, 1, function (c) client.focus = c; c:raise() end),
    awful.button({ rodkey }, 1, awful.mouse.client.move),
    awful.button({ modkey }, 3, awful.mouse.client.resize))

-- Set keys
root.keys(globalkeys)
-- }}}

-- {{{ Rules
awful.rules.rules = {
    -- All clients will match this rule.
    { rule = { },
      properties = { border_width = beautiful.border_width,
                     border_color = beautiful.border_normal,
                     focus = awful.client.focus.filter,
                     keys = clientkeys,
                     size_hints_honor = false,                     
                     buttons = clientbuttons } },
                      
    { rule = { class = "MPlayer" },
      properties = { floating = true } },
    { rule = { class = "pinentry" },
      properties = { floating = true } },
    { rule = { class = "gimp" },
      properties = { floating = true } },
    -- Set Firefox to always map on tags number 2 of screen 1.
    -- { rule = { class = "Firefox" },
    --   properties = { tag = tags[1][2] } },
}

-- }}}

-- {{{ Signals
-- Signal function to execute when a new client appears.
client.connect_signal("manage", function (c, startup)
    -- Enable sloppy focus
    c:connect_signal("mouse::enter", function(c)
        if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier
            and awful.client.focus.filter(c) then
            client.focus = c
        end
    end)

    if not startup 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)
    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)
cpu_timer = timer({timeout = 1})
cpu_timer:connect_signal("timeout", function() activecpu() end)
cpu_timer:start()


-- }}}
awful.util.spawn_with_shell("cairo-compmgr")
awful.util.spawn_with_shell("udisks-glue")
awful.util.spawn("parcellite")

--awful.util.spawn_with_shell("conky -c ~/sharkrcc")
--awful.util.spawn_with_shell("conky -c /home/jing/.alpharc")
--awful.util.spawn_with_shell("conky -c ~/box/conkyrc_ports")
--awful.util.spawn_with_shell("conky -c ~/.conkyrc")
--awful.util.spawn_with_shell("conky -c ~/box/conkyrc_procpu")
--awful.util.spawn_with_shell("conky -c ~/box/conkyrc_promem")



awful.util.spawn_with_shell("conky -c ~/box/diskrc")
awful.util.spawn_with_shell("conky -c ~/box/conkyrc_cal")
awful.util.spawn_with_shell("conky -c ~/box/conkyrc_net")
awful.util.spawn_with_shell("conky -c ~/box/conkyrc_procpu2")
awful.util.spawn_with_shell("conky -c ~/box/conkyrc_promem2")
awful.util.spawn_with_shell("conky -c ~/box/conkyrcc")
awful.util.spawn_with_shell("conky -c ~/box/alrc")
awful.util.spawn_with_shell("conky -c ~/.conky/rss_col3")
awful.util.spawn_with_shell("conky -c ~/.conky/rss_col1")
awful.util.spawn_with_shell("conky -c ~/.conky/rss_col2")
awful.util.spawn_with_shell("conky -c ~/.conky/rss_col4")
awful.util.spawn_with_shell("conky -c ~/box/batrc")
awful.util.spawn_with_shell("conky -c ~/box/netrc")

and the conkys:

diskrc (heavily derived from "conky2")

# Conky settings #
background no
update_interval 1

cpu_avg_samples 2
net_avg_samples 2

override_utf8_locale yes

double_buffer yes
no_buffers yes

text_buffer_size 2048
#imlib_cache_size 0

temperature_unit celsius

# Window specifications #
own_window_class Conky
own_window yes
own_window_type override
own_window_transparent yes
own_window_hints undecorate,sticky,skip_taskbar,skip_pager,below
own_window_argb_visual yes
own_window_argb_value 0

border_inner_margin 0
border_outer_margin 0

minimum_size 350 550
maximum_width 550

alignment top_middle
gap_x -80
gap_y 290

# Graphics settings #
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no

# Text settings #
use_xft yes
override_utf8_locale yes
xftfont Pf Tempesta Five:bold:size=6
xftalpha 0.8
uppercase no

temperature_unit celsius

default_color 333333
color0 140A00
color1 ADC2FF
color2 1994D1
color3 1994D1 

# Lua Load  ##${voffset 750}
lua_load ~/box/disk.lua
lua_draw_hook_pre ring_stats

TEXT
${voffset 166} 
${color 000000}${voffset 2}${hr 1}${voffset 5}
${color 000000}${offset 130}Hostname:${color 140A00} ${offset 7}${nodename}
${color 000000}${offset 130}OS:${color 140A00} ${offset 40}${pre_exec cat /etc/issue.net} $machine
${color 000000}${offset 130}Kernel:${color 140A00} ${offset 7}${kernel}$color
${color 000000}${offset 130}Frequency:${color 140A00} ${offset 7}${freq_g cpu cpu0} GHz${color} 

#${font Pf Tempesta Five:bold:size=6}${alignr 250}${color 000000}${cpu}% / ${color 000000}${acpitemp}°C
#${font Pf Tempesta Five:bold:size=6}${alignr 250}${color 000000}${memperc}% / ${color 000000}${memmax}
#${font Pf Tempesta Five:bold:size=6}${alignr 250}${color 000000}${swapperc}% / ${color 000000}${swapmax}
#${font Pf Tempesta Five:bold:size=6}${color 000000}${alignr 250}UP: ${uptime_short}
#${font Pf Tempesta Five:bold:size=6}${goto 29}Processes:${alignr 145}${processes} / ${running_processes}
#${font Pf Tempesta Five:bold:size=6}${goto 19}${pre_exec cat /etc/issue.net}${color1}${alignr 145}${machine}
#${font Xirod:size=10}${color0}${voffset 3}${offset 70}SYS
#${font Xirod:size=8}${color0}${voffset 91}${goto 178}INTERNET INFO
#${font Pf Tempesta Five:bold:size=6}${goto 146}${voffset -3}${color1}Down${goto 205}${color1}${totaldown wlp3s0} / ${color1}${downspeed wlan0}
#${font Pf Tempesta Five:bold:size=6}${goto 146}Up${goto 195}${color1}${totalup wlp3s0} / ${color1}${upspeed wlan0}
#${font Pf Tempesta Five:bold:size=6}${goto 146}WiFi${goto 185}${color1}${wireless_essid wlan0}
${font Pf Tempesta Five:bold:size=6}${voffset 3}${goto 145}Rot${color 000000}${alignr 135}/ ${color 000000}${fs_size /}
${font Pf Tempesta Five:bold:size=6}${goto 135}${color 000000}Home${alignr 135}/ ${color 000000}${fs_size /home}
${font Pf Tempesta Five:bold:size=6}${goto 145}${color 000000}Usb${alignr 135}/ ${color 000000}${fs_size /media/}
${font Xirod:size=8}${color 072332}${goto 158}${voffset 2}HDD
#${font Xirod:size=8}${goto 185}${voffset 78}${color0}${time %d} ${color0}${time %A}
#${font Xirod:size=18}${goto 165}${color1}${voffset -3}${time %H}:${time %M}
#${font Xirod:size=8}${color0}${goto 143}${voffset 10}${color1}${battery_percent BAT1}%
#${font Xirod:size=8}${color0}${goto 105}${voffset -1}BATTERY

disk.lua

settings_table = {
    

    {
        name='fs_used_perc',
        arg='/',
        max=100,
        bg_colour=0x000000,
        bg_alpha=0.8,
        fg_colour=0x1676A7,
        fg_alpha=0.8,
        x=220, y=300,
        radius=40,
        thickness=15,
        start_angle=0,
        end_angle=270
    },
    {
        name='fs_used_perc',
        arg='/home',
        max=100,
        bg_colour=0x000000,
        bg_alpha=0.6,
        fg_colour=0x1676A7,
        fg_alpha=0.8,
        x=220, y=300,
        radius=25,
        thickness=10,
        start_angle=0,
        end_angle=270
    },
    {
        name='fs_used_perc',
        arg='/media/',
        max=100,
        bg_colour=0x000000,
        bg_alpha=0.4,
        fg_colour=0x1676A7,
        fg_alpha=0.8,
        x=220, y=300,
        radius=15,
        thickness=5,
        start_angle=0,
        end_angle=270
    },

}

require 'cairo'

function rgb_to_r_g_b(colour,alpha)
    return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
end

function draw_ring(cr,t,pt)
    local w,h=conky_window.width,conky_window.height
    
    local xc,yc,ring_r,ring_w,sa,ea=pt['x'],pt['y'],pt['radius'],pt['thickness'],pt['start_angle'],pt['end_angle']
    local bgc, bga, fgc, fga=pt['bg_colour'], pt['bg_alpha'], pt['fg_colour'], pt['fg_alpha']

    local angle_0=sa*(2*math.pi/360)-math.pi/2
    local angle_f=ea*(2*math.pi/360)-math.pi/2
    local t_arc=t*(angle_f-angle_0)

    -- Draw background ring

    cairo_arc(cr,xc,yc,ring_r,angle_0,angle_f)
    cairo_set_source_rgba(cr,rgb_to_r_g_b(bgc,bga))
    cairo_set_line_width(cr,ring_w)
    cairo_stroke(cr)
    
    -- Draw indicator ring

    cairo_arc(cr,xc,yc,ring_r,angle_0,angle_0+t_arc)
    cairo_set_source_rgba(cr,rgb_to_r_g_b(fgc,fga))
    cairo_stroke(cr)        
end

function conky_ring_stats()
    local function setup_rings(cr,pt)
        local str=''
        local value=0
        
        str=string.format('${%s %s}',pt['name'],pt['arg'])
        str=conky_parse(str)
        
        value=tonumber(str)
        if value == nil then value = 0 end
        pct=value/pt['max']
        
        draw_ring(cr,pct,pt)
    end

    if conky_window==nil then return end
    local cs=cairo_xlib_surface_create(conky_window.display,conky_window.drawable,conky_window.visual, conky_window.width,conky_window.height)
    
    local cr=cairo_create(cs)    
    
    local updates=conky_parse('${updates}')
    update_num=tonumber(updates)
    
    if update_num>5 then
        for i in pairs(settings_table) do
            setup_rings(cr,settings_table[i])
        end
    end
   cairo_surface_destroy(cs)
  cairo_destroy(cr)
end


the clockrc and .lua(made by someone on the monster conky thread ^^)

# Conky settings #
background no
update_interval 1

cpu_avg_samples 2
net_avg_samples 2

override_utf8_locale yes

double_buffer yes
no_buffers yes

text_buffer_size 2048
#imlib_cache_size 0

temperature_unit celsius

# Window specifications #
own_window_class Conky
own_window yes
own_window_type override
own_window_transparent yes
own_window_hints undecorate,sticky,skip_taskbar,skip_pager,below
own_window_argb_visual yes
own_window_argb_value 0

border_inner_margin 0
border_outer_margin 0

minimum_size 350 550
maximum_width 550

alignment bottom_middle
gap_x 115
gap_y 5

# Graphics settings #
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no

# Text settings #
use_xft yes
override_utf8_locale yes
xftfont Pf Tempesta Five:bold:size=6
xftalpha 0.8
uppercase no

temperature_unit celsius

default_color 333333
color0 1994D1
color1 ADC2FF
color2 1994D1
color3 1994D1 

# Lua Load  ##${voffset 750}
lua_load ~/box/al.lua
lua_draw_hook_pre conky_main

TEXT
#empesta Five:bold:size=6}${voffset 10}${goto 96}${color1}CPU ${alignr 145}${color1}${cpu}% / ${color1}${acpitemp}°C
#${font Pf Tempesta Five:bold:size=6}${goto 79}${color1}RAM ${alignr 145}${color1}${memperc}% / ${color1}${memmax}
#${font Pf Tempesta Five:bold:size=6}${goto 63}${color1}SWAP${alignr 145}${color1}${swapperc}% / ${color1}${swapmax}
#${font Pf Tempesta Five:bold:size=6}${goto 48}Uptime${color1}${alignr 145}${uptime_short}
#${font Pf Tempesta Five:bold:size=6}${goto 29}Processes:${alignr 145}${processes} / ${running_processes}
#${font Pf Tempesta Five:bold:size=6}${goto 19}${pre_exec cat /etc/issue.net}${color1}${alignr 145}${machine}
#${font Xirod:size=10}${color0}${voffset 3}${offset 3}SYSTEM INFO
#${font Xirod:size=8}${color0}${voffset 91}${goto 178}INTERNET INFO
#${font Pf Tempesta Five:bold:size=6}${goto 146}${voffset -3}${color1}Down${goto 205}${color1}${totaldown wlan0} / ${color1}${downspeed wlan0}
#${font Pf Tempesta Five:bold:size=6}${goto 146}Up${goto 195}${color1}${totalup wlan0} / ${color1}${upspeed wlan0}
#${font Pf Tempesta Five:bold:size=6}${goto 146}WiFi${goto 185}${color1}${wireless_essid wlan0}
#${font Pf Tempesta Five:bold:size=6}${goto 107}${voffset 20}Rot${color1}${alignr 135}${fs_used_perc /}% / ${color1}${fs_size /}
#${font Pf Tempesta Five:bold:size=6}${goto 95}Home${alignr 135}${color1}${fs_used_perc /home}% / ${color1}${fs_size /home}
#${font Pf Tempesta Five:bold:size=6}${goto 86}Usb${alignr 135}${color1}${fs_used_perc /media/usb0}% / ${color1}${fs_size /media/usb0}
#${font Xirod:size=8}${color0}${goto 68}${voffset 2}HARD DRIVE
#${font Xirod:size=8}${goto 185}${voffset 78}${color0}${time %d} ${color0}${time %A}
#${font Xirod:size=18}${goto 165}${color1}${voffset -3}${time %H}:${time %M}
#${font Xirod:size=8}${color0}${goto 143}${voffset 10}${color1}${battery_percent BAT1}%
#${font Xirod:size=8}${color0}${goto 105}${voffset -1}BATERY
${font snap:size8}.

clock.lua


--[[ Clock for conky
written by easysid
Thu 09 May 2013 19:20:16 IST
]]--

require 'cairo'

function conky_main()

clock_table ={
    {
        -- Draw the seconds
        arg = "time %S",
        xc = 200,  
        yc = 150,
        r  = 55, -- radius
        font_face = "LCDMono",
--font_face = "FourFuncStrict",
--font_face = "Radioland",  
      top_font_size = 18, -- actual font size for display 
        min_font_size = 6,  -- min font for trail
        max_font_size = 15, -- max font fot trail
        max_alpha = .5,     -- max alpha for trail
        trail = 40,         -- size of trail max = 60
        main_color = {0x0da2d9, 1}, --color of numbers
        trail_color = {0xffffff, 1} --color of trail.
--        main_color = {0x0da2d9, 1}, --color of numbers
--        trail_color = {0x000000, 1} --color of trail  

  },
    
    {
        -- Draw the Minutes
        arg = "time %M",
        xc = 200,
        yc = 150,
        r  = 33,        -- radius
      font_face = "LCDMono",   
--font_face = "Crystal",
        top_font_size = 18, -- font size for display
        min_font_size = 3,  -- min font for trail
        max_font_size = 15, -- max font fot trail
        max_alpha = .2,     -- max alpha for trail
        trail = 40,         -- size of trail
       main_color = {0x0da2d9, 1}, --color of numbers
        trail_color = {0xffffff, 1} --color of trail
--        main_color = {0x0da2d9, 1}, --color of numbers
--        trail_color = {0x000000, 1} --color of trail
 


   },

    {
        -- Draw the Hours
        arg = "time %H",
        xc = 200,
        yc = 150,
        r  = 60,
        font_face = "t",
--font_face = "The Vandor Spot",  
--font_face = "DS-Digital",
--font_face = "FourFuncStrict",  
--font_face = "Let's go Digital",  
font_face = "Radioland",

  top_font_size = 25, -- font size for display
        min_font_size = 3,  -- min font for trail
        max_font_size = 12, -- max font fot trail
        max_alpha = .6,     -- max alpha for trail
        trail = 40,         -- size of trail
        main_color = {0x0da2d9, 1}, --color of numbers
        trail_color = {0xADC2FF, 1} --color of trail
--        main_color = {0x0da2d9, 1}, --color of numbers
--        trail_color = {0x000000, 1} --color of trail

    },
}
    if conky_window == nil then return end
    local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
    cr = cairo_create(cs)
    local updates=tonumber(conky_parse('${updates}'))
    if updates>3 then
        for i in ipairs(clock_table) do
            draw_clock(cr, clock_table[i])
        end
    end
    cairo_destroy(cr)
    cairo_surface_destroy(cs)
    cr=nil
end-- end main function


function draw_clock(cr, t)
         
        cairo_select_font_face (cr, t.font_face, CAIRO_FONT_SLANT_NORMAL,  CAIRO_FONT_WEIGHT_NORMAL)

        local value = tonumber(conky_parse(string.format("${%s}",t.arg)))
        local first = value - t.trail
        
        if t.arg == 'time %H' then -- special case for the hour digit
             cairo_set_source_rgba (cr, rgba_to_r_g_b_a(t.main_color))
             cairo_set_font_size (cr, t.top_font_size)
             cairo_move_to(cr, t.xc - t.top_font_size/3, t.yc+t.top_font_size/4) -- minor adjustment. Tweak here for your setting
             cairo_show_text(cr, value) 
        else
            for i = first, value do
        
                local theta = i*2*math.pi/60 -math.pi/2 -- calculate the angle
                local alpha = t.max_alpha*(i-first)/(value-first) -- map alpha value to [0, max_alpha]
                local font_size = (t.max_font_size-t.min_font_size)*(i-first)/(value-first) + t.min_font_size -- map font size similar to alpha
                t.trail_color[2] = alpha
                cairo_set_source_rgba (cr, rgba_to_r_g_b_a(t.trail_color))
                cairo_set_font_size (cr, font_size)
                if i == value then -- if we have the main value
                    cairo_set_source_rgba (cr, rgba_to_r_g_b_a(t.main_color)) -- switch color
                    cairo_set_font_size (cr, t.top_font_size) -- switch font
                end -- end if
                local k = i
                if k < 0 then k = 60 + i end  -- adjust seconds
                cairo_move_to(cr, t.xc + t.r*math.cos(theta), t.yc + t.r*math.sin(theta))
                cairo_show_text(cr, k) 

            end -- end for
        end --end if
end -- end draw_clock
   

function rgba_to_r_g_b_a(tcolor)
    local color,alpha=tcolor[1],tcolor[2]
    return ((color / 0x10000) % 0x100) / 255., 
        ((color / 0x100) % 0x100) / 255., (color % 0x100) / 255., alpha
end --end rgba

news feeds box

#avoid flicker
double_buffer yes


own_window_class Conky
own_window yes
own_window_transparent true
own_window_type override
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
own_window_argb_visual yes
own_window_argb_value 0



# Borders
draw_borders no
border_inner_margin 2

# Contour around fonts
draw_outline no

# Shades
draw_shades no
default_shade_color 222222

# Position
gap_y 64
gap_x 164

# Alignment
#alignment middle_left
 alignment top_left

# Interval
update_interval 2

# Colors
default_color FFFFFF
color1 1793D1
color2 535353
color3 FFFFFF
color4 A3A3A3
#color4 B2B2B2

# Font
use_xft yes
xftfont prime:size=8

# Text alpha when using Xft
#xftalpha 0.10

# to prevent window from moving
#use_spacer none
minimum_size 400 150
maximum_width 150
default_bar_size 82 6

TEXT

${color1}Reuters - News
${color4}${rss [url]http://feeds.reuters.com/reuters/topNews[/url] 80 item_titles 13}

Last edited by Jing (2013-09-07 14:23:13)

Offline

#271 2013-09-20 22:46:27

cbdxs
#! Die Hard
From: Capital Wasteland
Registered: 2011-08-03
Posts: 1,898

Re: Big Ol' Awesome Config Thread!

^That is an awesome config. I just installed Awesome 3.5.1 and ran into some issues. I have an error on my awful util.lua file saying attempt to index local color (a nil value).


叫我差不多先生。

Offline

#272 2013-10-05 14:45:17

chameleon
#! Die Hard
From: luxembourg (uk guy)
Registered: 2009-01-13
Posts: 591
Website

Re: Big Ol' Awesome Config Thread!

Does anybody have Awesome 3.5 running on Crunchbang?
If so, any issues to report?

Offline

#273 2013-10-18 21:53:08

cbdxs
#! Die Hard
From: Capital Wasteland
Registered: 2011-08-03
Posts: 1,898

Re: Big Ol' Awesome Config Thread!

^None to report so far for me.


叫我差不多先生。

Offline

#274 2013-10-24 09:47:58

selcuk
New Member
Registered: 2013-10-24
Posts: 1

Re: Big Ol' Awesome Config Thread!

How can awesome 3.5 installed? The one on repo is 3.4.x.

Offline

Be excellent to each other!

#275 2013-10-26 18:39:35

DanielFGray
Member
From: Galveston, TX
Registered: 2011-10-16
Posts: 27

Re: Big Ol' Awesome Config Thread!

selcuk: backport from experimental

echo 'deb-src http://http.debian.net/debian experimental main' | sudo tee -a /etc/apt/sources.list
apt-get update
sudo apt-get build-dep awesome
mkdir ~/build && cd ~/build
apt-get source -b awesome=3.5.1-1
sudo dpkg -i awesome*.deb

DISCLAIMER: I haven't tried this myself so I can't guarantee how well backporting this particular package will work, but those are the general steps for backporting

Edit: Backported myself, been using for a little while, runs great, no bugs or crashes [yet]. Updating your config is a pain though.

Last edited by DanielFGray (2013-11-10 19:16:17)

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.

Debian Logo