From: Penny Leach Date: Sun, 13 Sep 2009 16:28:10 +0000 (+0200) Subject: added my awesome customisations and my theme X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=cd7d170dbcae48d284dbb9ba2988b01de1074821;p=dotfiles%2Fawesome.git added my awesome customisations and my theme --- diff --git a/.config/awesome/rc.lua b/.config/awesome/rc.lua index f7db3f6..cd4d8e9 100644 --- a/.config/awesome/rc.lua +++ b/.config/awesome/rc.lua @@ -11,9 +11,10 @@ require("debian.menu") -- {{{ Variable definitions -- Themes define colours, icons, and wallpapers -- The default is a dark theme -theme_path = "/usr/share/awesome/themes/default/theme.lua" +--theme_path = "/usr/share/awesome/themes/default/theme.lua" -- Uncommment this for a lighter theme -- theme_path = "/usr/share/awesome/themes/sky/theme.lua" +theme_path = "/home/penny/.config/awesome/theme.lua" -- Actually load theme beautiful.init(theme_path) @@ -28,21 +29,21 @@ editor_cmd = terminal .. " -e " .. editor -- 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" +modkey = "Mod1" -- 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.left, awful.layout.suit.tile.bottom, - awful.layout.suit.tile.top, - awful.layout.suit.fair, - awful.layout.suit.fair.horizontal, +-- awful.layout.suit.tile.top, +-- awful.layout.suit.fair, +-- awful.layout.suit.fair.horizontal, awful.layout.suit.max, - awful.layout.suit.max.fullscreen, - awful.layout.suit.magnifier, - awful.layout.suit.floating +-- awful.layout.suit.max.fullscreen, +-- awful.layout.suit.magnifier, +-- awful.layout.suit.floating } -- Table of clients that should be set floating. The index may be either @@ -53,6 +54,7 @@ floatapps = { -- by class ["MPlayer"] = true, + ["vboxgtk"] = true, ["pinentry"] = true, ["gimp"] = true, -- by instance @@ -61,9 +63,12 @@ floatapps = -- Applications to be moved to a pre-defined tag by class or instance. -- Use the screen and tags indices. +--screens = xrandr_screens() apptags = { - -- ["Firefox"] = { screen = 1, tag = 2 }, + --["iceweasel"] = { screen = 1, tag = 2 }, +-- ["skype"] = { screen = screens["LVDS"], tag = 3 }, + ["skype"] = { screen = 1, tag = 3 }, -- ["mocp"] = { screen = 2, tag = 4 }, } @@ -182,7 +187,7 @@ for s = 1, screen.count() do mypromptbox[s], mytextbox, mylayoutbox[s], - s == 1 and mysystray or nil } + s == screen.count() and mysystray or nil } mywibox[s].screen = s end -- }}} @@ -261,6 +266,7 @@ clientkeys = awful.util.table.join( 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 }, "a", function(c) c.ontop = not c.ontop end, nil, "toggle on top"), -- TODO figure out how to add this later awful.key({ modkey }, "t", awful.client.togglemarked), awful.key({ modkey,}, "m", function (c) @@ -407,7 +413,7 @@ awful.hooks.manage.register(function (c, startup) -- awful.client.setslave(c) -- Honor size hints: if you want to drop the gaps between windows, set this to false. - -- c.size_hints_honor = false + c.size_hints_honor = false end) -- Hook function to execute when arranging the screen. @@ -430,6 +436,98 @@ end) -- Hook called every minute awful.hooks.timer.register(60, function () - mytextbox.text = os.date(" %a %b %d, %H:%M ") + mytextbox.text = os.date(" %a %b %d, %H:%M ") .. get_acpibatt() end) -- }}} + +-- {{{ Statusbar battery +-- +function get_acpibatt() + + local f=io.popen('acpi -b', 'r') + if not f then + return "acpi -b failed" + end + local s=f:read('*l') + f:close() + if not s then + return laststring; + end +-- Battery 0: Discharging, 89%, 00:02:14 remaining +-- or! Battery 0: Full, 100% +-- so find the first bit first and then go look for the time + local st, en, status, percent = string.find(s, '%a+%s%d[:]%s(%a+),%s(%d+%%)'); + local st, en, time = string.find(s, ',%s(%d+[:]%d+[:]%d+)%s%a+', en); + + if not status or not percent then -- time can be empty if we're full + return "couldn't parse line " ..s + end + + if not time then + return percent + end + + if status == 'Charging' then + status = '+'; + else + status = '-'; + end + + return percent .. ' (' .. status .. ') '; -- .. ' ' .. time .. ' left'; +end +-- }}} + +-- {{{ penny key binding additions +table.foreach(awful.key({ modkey }, 'F6', + function () + os.execute('~/bin/x p') + end), function(_, k) table.insert(globalkeys, k) end) +table.foreach(awful.key({ nil },'XF86AudioRaiseVolume', + function() + os.execute("amixer set Master 2+") + end), function(_, k) table.insert(globalkeys, k) end) +table.foreach(awful.key({ nil },'XF86AudioLowerVolume', + function() + os.execute("amixer set Master 2-") + end), function(_, k) table.insert(globalkeys, k) end) +table.foreach(awful.key({ modkey, 'Ctrl' }, 'x', + function() + os.execute('/sbin/start-stop-daemon --start --background --exec /usr/bin/gnome-screensaver; gnome-screensaver-command --lock') + end), function(_, k) table.insert(globalkeys, k) end) +table.foreach(awful.key({ modkey, 'Shift' },'x', + function() + os.execute("gnome-screensaver-command --exit") + end), function(_, k) table.insert(globalkeys, k) end) +table.foreach(awful.key({ modkey, 'Shift' }, 'Return' , + function() + awful.util.spawn('gmrun') + end), function(_, k) table.insert(globalkeys, k) end) +root.keys(globalkeys) + +-- {{{ broken +-- +-- commented out for various (broken) reasons, and need updating to 3.3 syntax +--keybinding({modkey},'x', function() os.execute("/sbin/start-stop-daemon --start --background --exec /usr/bin/xscreensaver; xscreensaver-command -lock") end):add() +--keybinding({modkey,"Shift"}, 'x', function() os.execute("xscreensaver-command -exit") end):add() + +--keybinding({modkey},"F7", function() os.execute('~/bin/paste.pl') end):add() +--keybinding({modkey},"XF86MonBrightnessUp", function() os.execute('xbacklight -inc 10') end):add() +--keybinding({modkey},"XF86MonBrightnessDown", function() os.execute('xbacklight -dec 10') end):add() +-- }}} + +--{{{ +-- taken from http://awesome.naquadah.org/wiki/XRandR_Screen_Table +function xrandr_screens () + local screens = {} + local counter = 1 + local handle = io.popen("xrandr -q") + for display in handle:read("*all"):gmatch("([%a%d-]+) connected") do + screens[display] = counter + counter = counter + 1 + end + handle:close() + return screens +end + + +--}}} diff --git a/.config/awesome/theme.lua b/.config/awesome/theme.lua new file mode 100644 index 0000000..26610ff --- /dev/null +++ b/.config/awesome/theme.lua @@ -0,0 +1,93 @@ +--------------------------- +-- Default awesome theme -- +--------------------------- + +theme = {} + +theme.font = "sans 8" + +theme.bg_normal = "#222222" +theme.bg_focus = "#535d6c" +theme.bg_urgent = "#ff0000" +theme.bg_minimize = "#444444" + +theme.fg_normal = "#aaaaaa" +theme.fg_focus = "#ffffff" +theme.fg_urgent = "#ffffff" +theme.fg_minimize = " #ffffff" + +theme.border_width = "1" +theme.border_normal = "#000000" +theme.border_focus = "#535d6c" +theme.border_marked = "#91231c" + +-- There are another variables sets +-- overriding the default one when +-- defined, the sets are: +-- [taglist|tasklist]_[bg|fg]_[focus|urgent] +-- titlebar_[bg|fg]_[normal|focus] +-- Example: +--taglist_bg_focus = #ff0000 + +-- Display the taglist squares +theme.taglist_squares_sel = "/usr/share/awesome/themes/default/taglist/squarefw.png" +theme.taglist_squares_unsel = "/usr/share/awesome/themes/default/taglist/squarew.png" + +theme.tasklist_floating_icon = "/usr/share/awesome/themes/default/tasklist/floatingw.png" + +-- Variables set for theming 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 +--bg_widget = #cc0000 + +-- Define the image to load +theme.titlebar_close_button_normal = "/usr/share/awesome/themes/default/titlebar/close_normal.png" +theme.titlebar_close_button_focus = "/usr/share/awesome/themes/default/titlebar/close_focus.png" + +theme.titlebar_ontop_button_normal_inactive = "/usr/share/awesome/themes/default/titlebar/ontop_normal_inactive.png" +theme.titlebar_ontop_button_focus_inactive = "/usr/share/awesome/themes/default/titlebar/ontop_focus_inactive.png" +theme.titlebar_ontop_button_normal_active = "/usr/share/awesome/themes/default/titlebar/ontop_normal_active.png" +theme.titlebar_ontop_button_focus_active = "/usr/share/awesome/themes/default/titlebar/ontop_focus_active.png" + +theme.titlebar_sticky_button_normal_inactive = "/usr/share/awesome/themes/default/titlebar/sticky_normal_inactive.png" +theme.titlebar_sticky_button_focus_inactive = "/usr/share/awesome/themes/default/titlebar/sticky_focus_inactive.png" +theme.titlebar_sticky_button_normal_active = "/usr/share/awesome/themes/default/titlebar/sticky_normal_active.png" +theme.titlebar_sticky_button_focus_active = "/usr/share/awesome/themes/default/titlebar/sticky_focus_active.png" + +theme.titlebar_floating_button_normal_inactive = "/usr/share/awesome/themes/default/titlebar/floating_normal_inactive.png" +theme.titlebar_floating_button_focus_inactive = "/usr/share/awesome/themes/default/titlebar/floating_focus_inactive.png" +theme.titlebar_floating_button_normal_active = "/usr/share/awesome/themes/default/titlebar/floating_normal_active.png" +theme.titlebar_floating_button_focus_active = "/usr/share/awesome/themes/default/titlebar/floating_focus_active.png" + +theme.titlebar_maximized_button_normal_inactive = "/usr/share/awesome/themes/default/titlebar/maximized_normal_inactive.png" +theme.titlebar_maximized_button_focus_inactive = "/usr/share/awesome/themes/default/titlebar/maximized_focus_inactive.png" +theme.titlebar_maximized_button_normal_active = "/usr/share/awesome/themes/default/titlebar/maximized_normal_active.png" +theme.titlebar_maximized_button_focus_active = "/usr/share/awesome/themes/default/titlebar/maximized_focus_active.png" + +-- You can use your own command to set your wallpaper +theme.wallpaper_cmd = { "XLIB_SKIP_ARGB_VISUALS=1 chbg -mode maximize /home/penny/images/desktops/swirls.jpg" } +--theme.wallpaper_cmd = { "awsetbg /home/penny/images/desktops/swirls.jpg" } + +-- You can use your own layout icons like this: +theme.layout_fairh = "/usr/share/awesome/themes/default/layouts/fairhw.png" +theme.layout_fairv = "/usr/share/awesome/themes/default/layouts/fairvw.png" +theme.layout_floating = "/usr/share/awesome/themes/default/layouts/floatingw.png" +theme.layout_magnifier = "/usr/share/awesome/themes/default/layouts/magnifierw.png" +theme.layout_max = "/usr/share/awesome/themes/default/layouts/maxw.png" +theme.layout_fullscreen = "/usr/share/awesome/themes/default/layouts/fullscreenw.png" +theme.layout_tilebottom = "/usr/share/awesome/themes/default/layouts/tilebottomw.png" +theme.layout_tileleft = "/usr/share/awesome/themes/default/layouts/tileleftw.png" +theme.layout_tile = "/usr/share/awesome/themes/default/layouts/tilew.png" +theme.layout_tiletop = "/usr/share/awesome/themes/default/layouts/tiletopw.png" + +theme.awesome_icon = "/usr/share/awesome/icons/awesome16.png" + +return theme +-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80