From d00f1c8e3d54ad6106c10eb8c46dcf457be128cc Mon Sep 17 00:00:00 2001 From: guerremdq Date: Tue, 18 Dec 2012 12:41:48 -0300 Subject: [PATCH] first commit --- #rc.lua# | 500 +++++++++++++++ README.md | 0 icons/LICENSE | 12 + icons/awesome.png | Bin 0 -> 205 bytes icons/bat.png | Bin 0 -> 213 bytes icons/cal.png | Bin 0 -> 215 bytes icons/chat.png | Bin 0 -> 216 bytes icons/cpu.png | Bin 0 -> 238 bytes icons/crypto.png | Bin 0 -> 219 bytes icons/disk.png | Bin 0 -> 203 bytes icons/down.png | Bin 0 -> 251 bytes icons/info.png | Bin 0 -> 189 bytes icons/layouts/copia de dwindle.png | Bin 0 -> 210 bytes icons/layouts/copia de fairh.png | Bin 0 -> 189 bytes icons/layouts/copia de fairv.png | Bin 0 -> 206 bytes icons/layouts/copia de floating.png | Bin 0 -> 221 bytes icons/layouts/copia de fullscreen.png | Bin 0 -> 205 bytes icons/layouts/copia de magnifier.png | Bin 0 -> 201 bytes icons/layouts/copia de max.png | Bin 0 -> 226 bytes icons/layouts/copia de spiral.png | Bin 0 -> 211 bytes icons/layouts/copia de tile.png | Bin 0 -> 188 bytes icons/layouts/copia de tilebottom.png | Bin 0 -> 206 bytes icons/layouts/copia de tileleft.png | Bin 0 -> 190 bytes icons/layouts/copia de tiletop.png | Bin 0 -> 207 bytes icons/layouts/dwindle.png | Bin 0 -> 210 bytes icons/layouts/fairh.png | Bin 0 -> 189 bytes icons/layouts/fairv.png | Bin 0 -> 206 bytes icons/layouts/floating.png | Bin 0 -> 221 bytes icons/layouts/fullscreen.png | Bin 0 -> 205 bytes icons/layouts/magnifier.png | Bin 0 -> 201 bytes icons/layouts/max.png | Bin 0 -> 226 bytes icons/layouts/spiral.png | Bin 0 -> 211 bytes icons/layouts/tile.png | Bin 0 -> 188 bytes icons/layouts/tilebottom.png | Bin 0 -> 206 bytes icons/layouts/tileleft.png | Bin 0 -> 190 bytes icons/layouts/tiletop.png | Bin 0 -> 207 bytes icons/mail.png | Bin 0 -> 215 bytes icons/mem.png | Bin 0 -> 207 bytes icons/music.png | Bin 0 -> 192 bytes icons/pacman.png | Bin 0 -> 226 bytes icons/phones.png | Bin 0 -> 232 bytes icons/power-bat-high.png | Bin 0 -> 213 bytes icons/power.png | Bin 0 -> 222 bytes icons/rss.png | Bin 0 -> 203 bytes icons/sat.png | Bin 0 -> 226 bytes icons/sun.png | Bin 0 -> 203 bytes icons/taglist/squarefz.png | Bin 0 -> 152 bytes icons/taglist/squarefza.png | Bin 0 -> 163 bytes icons/taglist/squarez.png | Bin 0 -> 159 bytes icons/taglist/squareza.png | Bin 0 -> 154 bytes icons/temp.png | Bin 0 -> 240 bytes icons/time.png | Bin 0 -> 227 bytes icons/titlebar/close_focus.png | Bin 0 -> 209 bytes icons/titlebar/close_normal.png | Bin 0 -> 368 bytes icons/titlebar/floating_focus_active.png | Bin 0 -> 207 bytes icons/titlebar/floating_focus_inactive.png | Bin 0 -> 337 bytes icons/titlebar/floating_normal_active.png | Bin 0 -> 359 bytes icons/titlebar/floating_normal_inactive.png | Bin 0 -> 326 bytes icons/titlebar/maximized_focus_active.png | Bin 0 -> 200 bytes icons/titlebar/maximized_focus_inactive.png | Bin 0 -> 335 bytes icons/titlebar/maximized_normal_active.png | Bin 0 -> 366 bytes icons/titlebar/maximized_normal_inactive.png | Bin 0 -> 347 bytes icons/titlebar/ontop_focus_active.png | Bin 0 -> 186 bytes icons/titlebar/ontop_focus_inactive.png | Bin 0 -> 331 bytes icons/titlebar/ontop_normal_active.png | Bin 0 -> 347 bytes icons/titlebar/ontop_normal_inactive.png | Bin 0 -> 332 bytes icons/titlebar/sticky_focus_active.png | Bin 0 -> 197 bytes icons/titlebar/sticky_focus_inactive.png | Bin 0 -> 328 bytes icons/titlebar/sticky_normal_active.png | Bin 0 -> 359 bytes icons/titlebar/sticky_normal_inactive.png | Bin 0 -> 328 bytes icons/up.png | Bin 0 -> 275 bytes icons/vol.png | Bin 0 -> 224 bytes icons/wifi.png | Bin 0 -> 215 bytes obvious | 1 + osk.lua | 90 +++ rc.lua | 471 ++++++++++++++ rc.lua-f | 428 +++++++++++++ rc.lua.2 | 635 +++++++++++++++++++ rc.lua.30082011 | 546 ++++++++++++++++ rc.lua.backup | 535 ++++++++++++++++ rc.lua.backup2410 | 500 +++++++++++++++ rc.lua.backup2410.1 | 500 +++++++++++++++ rc.lua.dual | 598 +++++++++++++++++ rc.lua.new | 436 +++++++++++++ rc.lua~ | 467 ++++++++++++++ rc2410.lua | 500 +++++++++++++++ scratchpad.lua | 136 ++++ teardrop.lua | 128 ++++ vicious | 1 + zenburn.lua | 143 +++++ 90 files changed, 6627 insertions(+) create mode 100644 #rc.lua# create mode 100644 README.md create mode 100644 icons/LICENSE create mode 100644 icons/awesome.png create mode 100644 icons/bat.png create mode 100644 icons/cal.png create mode 100644 icons/chat.png create mode 100644 icons/cpu.png create mode 100644 icons/crypto.png create mode 100644 icons/disk.png create mode 100644 icons/down.png create mode 100644 icons/info.png create mode 100644 icons/layouts/copia de dwindle.png create mode 100644 icons/layouts/copia de fairh.png create mode 100644 icons/layouts/copia de fairv.png create mode 100644 icons/layouts/copia de floating.png create mode 100644 icons/layouts/copia de fullscreen.png create mode 100644 icons/layouts/copia de magnifier.png create mode 100644 icons/layouts/copia de max.png create mode 100644 icons/layouts/copia de spiral.png create mode 100644 icons/layouts/copia de tile.png create mode 100644 icons/layouts/copia de tilebottom.png create mode 100644 icons/layouts/copia de tileleft.png create mode 100644 icons/layouts/copia de tiletop.png create mode 100644 icons/layouts/dwindle.png create mode 100644 icons/layouts/fairh.png create mode 100644 icons/layouts/fairv.png create mode 100644 icons/layouts/floating.png create mode 100644 icons/layouts/fullscreen.png create mode 100644 icons/layouts/magnifier.png create mode 100644 icons/layouts/max.png create mode 100644 icons/layouts/spiral.png create mode 100644 icons/layouts/tile.png create mode 100644 icons/layouts/tilebottom.png create mode 100644 icons/layouts/tileleft.png create mode 100644 icons/layouts/tiletop.png create mode 100644 icons/mail.png create mode 100644 icons/mem.png create mode 100644 icons/music.png create mode 100644 icons/pacman.png create mode 100644 icons/phones.png create mode 100644 icons/power-bat-high.png create mode 100644 icons/power.png create mode 100644 icons/rss.png create mode 100644 icons/sat.png create mode 100644 icons/sun.png create mode 100644 icons/taglist/squarefz.png create mode 100644 icons/taglist/squarefza.png create mode 100644 icons/taglist/squarez.png create mode 100644 icons/taglist/squareza.png create mode 100644 icons/temp.png create mode 100644 icons/time.png create mode 100644 icons/titlebar/close_focus.png create mode 100644 icons/titlebar/close_normal.png create mode 100644 icons/titlebar/floating_focus_active.png create mode 100644 icons/titlebar/floating_focus_inactive.png create mode 100644 icons/titlebar/floating_normal_active.png create mode 100644 icons/titlebar/floating_normal_inactive.png create mode 100644 icons/titlebar/maximized_focus_active.png create mode 100644 icons/titlebar/maximized_focus_inactive.png create mode 100644 icons/titlebar/maximized_normal_active.png create mode 100644 icons/titlebar/maximized_normal_inactive.png create mode 100644 icons/titlebar/ontop_focus_active.png create mode 100644 icons/titlebar/ontop_focus_inactive.png create mode 100644 icons/titlebar/ontop_normal_active.png create mode 100644 icons/titlebar/ontop_normal_inactive.png create mode 100644 icons/titlebar/sticky_focus_active.png create mode 100644 icons/titlebar/sticky_focus_inactive.png create mode 100644 icons/titlebar/sticky_normal_active.png create mode 100644 icons/titlebar/sticky_normal_inactive.png create mode 100644 icons/up.png create mode 100644 icons/vol.png create mode 100644 icons/wifi.png create mode 160000 obvious create mode 100644 osk.lua create mode 100644 rc.lua create mode 100644 rc.lua-f create mode 100644 rc.lua.2 create mode 100644 rc.lua.30082011 create mode 100644 rc.lua.backup create mode 100644 rc.lua.backup2410 create mode 100644 rc.lua.backup2410.1 create mode 100644 rc.lua.dual create mode 100644 rc.lua.new create mode 100644 rc.lua~ create mode 100644 rc2410.lua create mode 100644 scratchpad.lua create mode 100644 teardrop.lua create mode 160000 vicious create mode 100644 zenburn.lua diff --git a/#rc.lua# b/#rc.lua# new file mode 100644 index 0000000..58c628f --- /dev/null +++ b/#rc.lua# @@ -0,0 +1,500 @@ +-- Standard awesome library +require("awful") +require("awful.autofocus") +require("awful.rules") + +-- Theme handling library +require("beautiful") +-- Notification library +require("naughty") +require("obvious") +--obvious +require("obvious.popup_run_prompt") +require("obvious.battery") +require("obvious.wlan") +require("obvious.clock") +require("obvious.volume_alsa") +require("obvious.net") + +require("vicious") +-- Load Debian menu entries +require("debian.menu") + +-- {{{ Variable definitions +-- Themes define colours, icons, and wallpapers +beautiful.init("/usr/share/awesome/themes/zenburn/theme.lua") + +-- This is used later as the default terminal and editor to run. +terminal = "x-terminal-emulator" +editor = os.getenv("EDITOR") or "editor" +editor_cmd = terminal .. " -e " .. editor +browser = "nautilus --no-desktop --browser" +initawesome = "sh /home/guerre/.awesomestart" +icewe= "iceweasel" +lock= "sh /home/guerre/lock" +xterm="xterm" +firefoxbeta="sh /home/guerre/Descargas/firefox/firefox" +start="sh /home/guerre/.awesomestart" +--brilloup= "sh /home/guerre/scripts/video_brightnessup.sh" +--brillodown= "sh /home/guerre/scripts/video_brightnessdown.sh" + +-- 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.spiral, + awful.layout.suit.spiral.dwindle, + awful.layout.suit.max, + awful.layout.suit.max.fullscreen, + awful.layout.suit.magnifier, + awful.layout.suit.floating +} +-- }}} + +-- {{{ Tags +-- Define a tag table which hold all screen tags. + +-- ************************************** +-- {{{ Tags +-- Define a tag table which hold all screen tags. +tags = {} +tags.settings = { + { name = "xterm's", layout = layouts[5] }, + { name = "www", layout = layouts[9] }, + { name = "im", layout = layouts[1] }, + { name = "irc", layout = layouts[1] }, + { name = "media", layout = layouts[12] }, + { name = "work", layout = layouts[3] }, + { name = "docs", layout = layouts[3] }, + { name = "prog", layout = layouts[3] }, + { name = "sys", layout = layouts[1] } +} + +for s = 1, screen.count() do + tags[s] = {} + for i, v in ipairs(tags.settings) do + tags[s][i] = tag({ name = v.name }) + tags[s][i].screen = s + awful.tag.setproperty(tags[s][i], "layout", v.layout) + end + tags[s][1].selected = true +end +-- }}} + +-- Initialize widget +memwidget = awful.widget.progressbar() +-- Progressbar properties +memwidget:set_width(8) +memwidget:set_height(10) +memwidget:set_vertical(true) +memwidget:set_background_color("#494B4F") +memwidget:set_border_color(nil) +memwidget:set_color("#AECF96") +memwidget:set_gradient_colors({ "#AECF96", "#88A175", "#FF5656" }) +-- Register widget +vicious.register(memwidget, vicious.widgets.mem, "$1", 13) + +-- {{{ 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 }) +-- }}} + +-- {{{ Wibox +-- 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 + -- Create a promptbox for each screen + mypromptbox[s] = awful.widget.prompt({ layout = awful.widget.layout.horizontal.leftright }) + -- 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 }) + -- Add widgets to the wibox - order matters + mywibox[s].widgets = { + { + mylauncher, + mytaglist[s], + mypromptbox[s], + volicon, + spacer, + batterywidget, + baticon, + spacer, + memwidget, + spacer, + memicon, + --obvious.battery(), + --obvious.volume_alsa(), + layout = awful.widget.layout.horizontal.leftright + }, + mylayoutbox[s], + obvious.battery(), + --obvious.volume_alsa(), + mytextclock, + s == 1 and mysystray or nil, + mytasklist[s], + layout = awful.widget.layout.horizontal.rightleft + } +end +-- }}} + +-- {{{ Battery state +-- Widget icon +baticon = widget({ type = "imagebox", name = "baticon" }) + +-- Initialize widget +batterywidget = widget({type = "textbox", name = "batterywidget", align = "right" }) +function batteryInfo(adapter) + spacer = " " + local fcur = io.open("/sys/class/power_supply/"..adapter.."/charge_now") + local fcap = io.open("/sys/class/power_supply/"..adapter.."/charge_full") + local fsta = io.open("/sys/class/power_supply/"..adapter.."/status") + local cur = fcur:read() + local cap = fcap:read() + local sta = fsta:read() + local battery = math.floor(cur * 100 / cap) + if sta:match("Charging") then + baticon.image=image(confdir.."/icons/power-ac.png") + elseif sta:match("Discharging") then + baticon.image=image(confdir.."/icons/power-bat.png") + if tonumber(battery) > 25 and tonumber(battery) < 75 then + --battery = battery + elseif tonumber(battery) < 25 then + if tonumber(battery) < 10 then + naughty.notify({ title = "Battery Warning" + , text = "Battery low!"..spacer..battery.."%"..spacer.."left!" + , timeout = 5 + , position = "top_right" + , fg = beautiful.fg_focus + , bg = beautiful.bg_focus + }) + end + --battery = battery + else + --battery = battery + end + else + baticon.image=image(confdir.."/icons/power-ac.png") + --battery = "A/C" + end + battery = battery + batterywidget.text = spacer..battery.."%"..spacer + fcur:close() + fcap:close() + fsta:close() +end +-- }}} + +-- {{{ Volume state +-- Widget +volicon = widget({ type = "imagebox", name = "volicon" }) +-- Register widget +vicious.register(volicon, vicious.widgets.volumecontrol, + function (widget, args) + if args[1] == "mute" then + volicon.image=image(confdir.."/icons/vol-mute.png") + elseif args[1] == "hi" then + volicon.image=image(confdir.."/icons/vol-hi.png") + elseif args[1] == "med" then + volicon.image=image(confdir.."/icons/vol-med.png") + else + volicon.image = image(confdir.."/icons/vol-low.png") + end + end, + 1, "Master") + + +-- {{{ 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(true) end), + + -- Layout manipulation + awful.key({ modkey, "Shift" }, "j", function () awful.client.swap.byidx( 1) end), + awful.key({ modkey, "Shift" }, "k", function () awful.client.swap.byidx( -1) end), + awful.key({ modkey, "Control" }, "j", function () awful.screen.focus_relative( 1) end), + awful.key({ modkey, "Control" }, "k", function () awful.screen.focus_relative(-1) end), + awful.key({ modkey, }, "u", awful.client.urgent.jumpto), + awful.key({ modkey, }, "Tab", + function () + awful.client.focus.history.previous() + if client.focus then + client.focus:raise() + end + end), + + -- Standard program + awful.key({ modkey, }, "Return", function () awful.util.spawn(terminal) end), + awful.key({ modkey, "Control" }, "r", awesome.restart), + awful.key({ modkey, "Shift" }, "q", awesome.quit), + + awful.key({ modkey, }, "l", function () awful.tag.incmwfact( 0.05) end), + awful.key({ modkey, }, "h", function () awful.tag.incmwfact(-0.05) end), + awful.key({ modkey, "Shift" }, "h", function () awful.tag.incnmaster( 1) end), + awful.key({ modkey, "Shift" }, "l", function () awful.tag.incnmaster(-1) end), + awful.key({ modkey, "Control" }, "h", function () awful.tag.incncol( 1) end), + awful.key({ modkey, "Control" }, "l", function () awful.tag.incncol(-1) end), + awful.key({ modkey, }, "space", function () awful.layout.inc(layouts, 1) end), + awful.key({ modkey, "Shift" }, "space", function () awful.layout.inc(layouts, -1) end), + awful.key({ modkey, }, "b", function() awful.util.spawn(browser) end), + -- awful.key({ modkey, }, "i", function() awful.util.spawn(icewe) end), + awful.key({ modkey }, "r", obvious.popup_run_prompt.run_prompt), + awful.key({ modkey, }, "c", function() awful.util.spawn(lock) end), + awful.key({ modkey, }, "t", function () awful.util.spawn(xterm) end), + awful.key({ modkey }, "i", function () awful.util.spawn(firefoxbeta) end), + awful.key({ modkey }, "o", function () awful.util.spawn(start) end), +-- Prompt + awful.key({ modkey }, "F1", function () mypromptbox[mouse.screen]:run() end), + + -- Prompt + --awful.key({ modkey }, "F2", function () awful.prompt({ prompt = "Run: ", cursor_fg = fg_focus, cursor_bg = bg_focus }, mypromptbox, awful$ + -- end), + + awful.key({ modkey }, "F2", + function () + awful.prompt.run({ prompt = "Run: " }, + mypromptbox[mouse.screen].widget, + awful.util.spawn, + awful.completion.bash, + awful.util.getdir("cache") .. "/history") + 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, }, "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, + 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 = "Navigator" }, + properties = { tag = tags[1][2] } }, + { rule = { class = "VirtualBox" }, + properties = { tag = tags[1][9] } }, + { rule = { class = "pidgin" }, + properties = { tag = tags[1][3] } }, + { rule = { class = "emesene" }, + properties = { tag = tags[1][3] } }, + { rule = { class = "Controler.py" }, + properties = { tag = tags[1][3] } }, + +} +-- }}} + +-- {{{ 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) +-- }}} diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 diff --git a/icons/LICENSE b/icons/LICENSE new file mode 100644 index 0000000..ce5da9d --- /dev/null +++ b/icons/LICENSE @@ -0,0 +1,12 @@ +All 'awesome' icons in this package were created by Adrian C. (anrxc). +They are licensed under the same terms as the awesome distribution itself +- GNU General Public License version 2. To view a human-readable summary +of this license, visit: http://creativecommons.org/licenses/GPL/2.0/ + +The widget icons with the exception of: 'chat', 'crypt', 'power' and +'rss' icons (which were made by me) were originally made by 'sm4tik' +for purposes of 'dzen', I could not find any licensing information +attached to those original bitmaps. Assuming they are in the public +domain I am licensing the widget icons under the terms of the +Creative Commons Attribution-Share Alike license. To view a copy of +this license, visit: http://creativecommons.org/licenses/by-sa/3.0/ diff --git a/icons/awesome.png b/icons/awesome.png new file mode 100644 index 0000000000000000000000000000000000000000..44697e6d80972753bf5eb4722c1768ca84dd4440 GIT binary patch literal 205 zcmeAS@N?(olHy`uVBq!ia0vp^d?3uh1|;P@bT0xa#^NA%Cx&(BWL^R}oCO|{#X!Z^ zL734=V|E2lkiEpy*OmPyBcHgH-VvYs?LeV;PZ!4!jq`UWT5~l72r#R^zMNexqMxZ) zXLhYFV1t0+(@BYmi?(H-ZD!&BY!~s&ur&09iQpoWjfH{V+T~AKHtdY>;}%$u>c#ta vjrRq!z>{2(1`k&8EuP(f>8H`JmN}va+2uAdSzFBlTE*b$>gTe~DWM4f96>?g literal 0 HcmV?d00001 diff --git a/icons/bat.png b/icons/bat.png new file mode 100644 index 0000000000000000000000000000000000000000..37081f5e43c809e4124bc4690ceccb4e7335d582 GIT binary patch literal 213 zcmeAS@N?(olHy`uVBq!ia0vp^JRr=$1|-8uW1a&k#^NA%Cx&(BWL^R}Y)RhkE)4%c zaKYZ?lYt_f1s;*b3=G`DAk4@xYmNj^kiEpy*OmPy4=V#RgTk|w+krx%o-U3d8t0P} z7MLcq82)Q-J;*9;WBT9Nz`(#HXFuQc^q8$(jUd1pY3`$F*Q@g)OvyXRxP^1JHAvlJ v?IWuh^K{$yUy7L&JJo`E4iPvW)W=dCk=7BG0a`njxgN@xNAr6xUp literal 0 HcmV?d00001 diff --git a/icons/cal.png b/icons/cal.png new file mode 100644 index 0000000000000000000000000000000000000000..fdb2701f0dd6c6f72e99030cb3682c94f603d07a GIT binary patch literal 215 zcmeAS@N?(olHy`uVBq!ia0vp^JRr=$1|-8uW1a&k#^NA%Cx&(BWL^R}Y)RhkE)4%c zaKYZ?lYt_f1s;*b3=G`DAk4@xYmNj^kiEpy*OmPy4=V$U_F?H`20)>3PZ!4!jq`H@ z9l013IA&jTukQRYXONyRKo`d@piqlu%h zi+M}oRV_9V=?kKZGMpwQD_y&>W?^GOz&qRi6*npl@Fe^#Gj#vIGY Z;62-T&(XN!bAUE8c)I$ztaD0e0su*;P)z^; literal 0 HcmV?d00001 diff --git a/icons/crypto.png b/icons/crypto.png new file mode 100644 index 0000000000000000000000000000000000000000..20f0313c7be79dce36c0a7e435112a496275d229 GIT binary patch literal 219 zcmeAS@N?(olHy`uVBq!ia0vp^d?3uh1|;P@bT0xa#^NA%Cx&(BWL^R}Y)RhkE)4%c zaKYZ?lYt_f1s;*b3=G`DAk4@xYmNj^kiEpy*OmPy8$Z9fIj@4lcA!wSr;B5V#`)v~ z38MzVnZfq^<&OR7_l-?XQjTe0?N0nJy)E9|aKpji&-S}ieV$l}-aYo;!^|LIV)Btp zFVdQ&MBb@ E0BP|;W&i*H literal 0 HcmV?d00001 diff --git a/icons/disk.png b/icons/disk.png new file mode 100644 index 0000000000000000000000000000000000000000..db9a6fe6c8b62283bb72e70bb99186eee5930e87 GIT binary patch literal 203 zcmeAS@N?(olHy`uVBq!ia0vp^JRr=$1|-8uW1a&k#^NA%Cx&(BWL^R}Y)RhkE)4%c zaKYZ?lYt_f1s;*b3=G`DAk4@xYmNj^kiEpy*OmPy4=V$!T+e1>kh$KTE{-7@=aUl_ zm?pFszIuNB|MBG;3^z`k*a!ryksA_!m%8P2N!yq{Y%`qrN@bGih6kJFW*cw3)o@xr o#ga4c(*F$xJkJxj!)`G%glh{csqfzQ7HBMkr>mdKI;Vst0NC6?H2?qr literal 0 HcmV?d00001 diff --git a/icons/down.png b/icons/down.png new file mode 100644 index 0000000000000000000000000000000000000000..53c2d899c1a8baaaee1127e4f2b286e284fd3d46 GIT binary patch literal 251 zcmeAS@N?(olHy`uVBq!ia0vp^JRr=$1|-8uW1a&k#^NA%Cx&(BWL^R}Y)RhkE)4%c zaKYZ?lYt_f1s;*b3=G`DAk4@xYmNj^kiEpy*OmPy4=V$!j!R0?C7@8Xr;B5V#`(Sd zzI;s%JgxhUoP1&`W;~4OzkFch7aOVOYrHCtmq?i1y6XM=SKWi_$=U_qMa!>e?wY#R~*<0|{XNQQXiiv@Vipc|$7S`p*Sa~bvdTs0VdBVo`*L0Gs dg);{OL$E2&mHXO1mjVr9@O1TaS?83{1OPi4F?;|3 literal 0 HcmV?d00001 diff --git a/icons/layouts/copia de dwindle.png b/icons/layouts/copia de dwindle.png new file mode 100644 index 0000000000000000000000000000000000000000..55fdca8a3c056d2ac5c2393f0a673ab33b8001dc GIT binary patch literal 210 zcmeAS@N?(olHy`uVBq!ia0vp^JRr=$1|-8uW1a&k#^NA%Cx&(BWL^R}Y)RhkE)4%c zaKYZ?lYt_f1s;*b3=G`DAk4@xYmNj^kiEpy*OmPy4=V$=k;022d!SH|r;B5V#`&#* z2YC-Ta5ODjY|!-E{{hFFr26UJ#r(ceacvm_3Jfkt(KFerPIDzSU$isI!o*SP{ yYnrP)<9ytsFAKhHS(0$w8xS$i$ebOujXKbLh*2~7ZjT}CSa literal 0 HcmV?d00001 diff --git a/icons/layouts/copia de fairh.png b/icons/layouts/copia de fairh.png new file mode 100644 index 0000000000000000000000000000000000000000..03337106ba81534fe10d4f7ae7b1c0f8f5ef7ccb GIT binary patch literal 189 zcmeAS@N?(olHy`uVBq!ia0vp^JRr=$1|-8uW1a&k#^NA%Cx&(BWL^R}Y)RhkE)4%c zaKYZ?lYt_f1s;*b3=G`DAk4@xYmNj^kiEpy*OmPy4=V$YyjIzcUZ9Yzr;B5V#`)xw zgoK10#m{+|&oVroYn}e@@C_awp8pe{PWaISWbkNdsqy$Mxn&?@5+JgM$D(QarUX?< a28Kl|c&GI9J~;z4h{4m<&t;ucLK6T;nl+pN literal 0 HcmV?d00001 diff --git a/icons/layouts/copia de fairv.png b/icons/layouts/copia de fairv.png new file mode 100644 index 0000000000000000000000000000000000000000..65f0e5936ee999fe3a70c70d1f0784940ab6a04c GIT binary patch literal 206 zcmeAS@N?(olHy`uVBq!ia0vp^JRr=$1|-8uW1a&k#^NA%Cx&(BWL^R}Y)RhkE)4%c zaKYZ?lYt_f1s;*b3=G`DAk4@xYmNj^kiEpy*OmPy4=V$Yx%^>)a-fi(r;B5V#`)xw zgoK10#m{+|JsU)Ld&=L<`PuK?*Vy>bUTAhB2y`~O9N;LP)YZjlwmj*E!=}j*9fgdW p-nN+hX}9W~SXZZD8R6NN$uOr}&BQJ8WB|})22WQ%mvv4FO#sLHKehk> literal 0 HcmV?d00001 diff --git a/icons/layouts/copia de floating.png b/icons/layouts/copia de floating.png new file mode 100644 index 0000000000000000000000000000000000000000..e4543acbaf87cfe65d7ef1c2d776eb41c0667b5f GIT binary patch literal 221 zcmeAS@N?(olHy`uVBq!ia0vp^JRr=$1|-8uW1a&k#^NA%Cx&(BWL^R}Y)RhkE)4%c zaKYZ?lYt_f1s;*b3=G`DAk4@xYmNj^kiEpy*OmPy4=V#N&-TkFgn&Y^o-U3d8t1o8 zJji*#fQQ*%b#X<@oBa;E9XECVda2ARER^wHQ@}2f@k`xCFUAeMDoU@S9v+9E6NaMeSetgaR2}S literal 0 HcmV?d00001 diff --git a/icons/layouts/copia de fullscreen.png b/icons/layouts/copia de fullscreen.png new file mode 100644 index 0000000000000000000000000000000000000000..3bf6329ed1c283c594cc472b3e1dc0b3ab084eb1 GIT binary patch literal 205 zcmeAS@N?(olHy`uVBq!ia0vp^JRr=$1|-8uW1a&k#^NA%Cx&(BWL^R}Y)RhkE)4%c zaKYZ?lYt_f1s;*b3=G`DAk4@xYmNj^kiEpy*OmPy4=V$&?A_!S4}e0xo-U3d8t0Q! z5)u-26hG%-KFjcUu66o9;l+K8jg5}3M_U?MV+D8@Q?wJz9(-coWy3w`PQA`7iHocrWkM&V oCd@suVo_4lS^h74VL^-xdEaEUnR5ZyF|FY33eJuc`v+RO#SEKXFX=w>DMc}TUg<6|v6+kKeYq?j_nKk<7tLwmHIJBq PwlR3R`njxgN@xNA!d6R% literal 0 HcmV?d00001 diff --git a/icons/layouts/copia de spiral.png b/icons/layouts/copia de spiral.png new file mode 100644 index 0000000000000000000000000000000000000000..2f266d40367f437a193a5d98f509d33900d3dd41 GIT binary patch literal 211 zcmeAS@N?(olHy`uVBq!ia0vp^JRr=$1|-8uW1a&k#^NA%Cx&(BWL^R}Y)RhkE)4%c zaKYZ?lYt_f1s;*b3=G`DAk4@xYmNj^kiEpy*OmPy4=V$oM4O8L8lX_Hr;B5V#`)xw zgoK10#m{+|&oVroYn}dYakrs?L4t5{K%ik_g3?tsu_Td|D`p(H>2kB+`8mmo0|93} ydzNJV=$A>-(o*YDxyev$zc1l$zpCB|W(NCKk@-PK^w$E7XYh3Ob6Mw<&;$U{xj^Co literal 0 HcmV?d00001 diff --git a/icons/layouts/copia de tile.png b/icons/layouts/copia de tile.png new file mode 100644 index 0000000000000000000000000000000000000000..a098c34a6a2620675fa9387ec76c220bf2948a77 GIT binary patch literal 188 zcmeAS@N?(olHy`uVBq!ia0vp^JRr=$1|-8uW1a&k#^NA%Cx&(BWL^R}Y)RhkE)4%c zaKYZ?lYt_f1s;*b3=G`DAk4@xYmNj^kiEpy*OmPy4=V$omfvSN9iWhnr;B5V#`)xw zgoK10#m{+|&oVroYn}dYakrs?L4t5{K%ik_g3?tsu^6+}D`res^3XoYVZ!?*4?= literal 0 HcmV?d00001 diff --git a/icons/layouts/copia de tileleft.png b/icons/layouts/copia de tileleft.png new file mode 100644 index 0000000000000000000000000000000000000000..74fe702a9a0ce451b0b5627c6a00f44ba9052b1a GIT binary patch literal 190 zcmeAS@N?(olHy`uVBq!ia0vp^JRr=$1|-8uW1a&k#^NA%Cx&(BWL^R}Y)RhkE)4%c zaKYZ?lYt_f1s;*b3=G`DAk4@xYmNj^kiEpy*OmPy4=V!~Z~xRhXP}Usr;B5V#`)xw zgoK10#m{+|JsU)Ld&=L<`Pr{`?7)Er-=0Pg=xlU3z)?J@tBZ4!aN#Y7YIRkt(KFerPIDzSU$isI!o*SP{ yYnrP)<9ytsFAKhHS(0$w8xS$i$ebOujXKbLh*2~7ZjT}CSa literal 0 HcmV?d00001 diff --git a/icons/layouts/fairh.png b/icons/layouts/fairh.png new file mode 100644 index 0000000000000000000000000000000000000000..03337106ba81534fe10d4f7ae7b1c0f8f5ef7ccb GIT binary patch literal 189 zcmeAS@N?(olHy`uVBq!ia0vp^JRr=$1|-8uW1a&k#^NA%Cx&(BWL^R}Y)RhkE)4%c zaKYZ?lYt_f1s;*b3=G`DAk4@xYmNj^kiEpy*OmPy4=V$YyjIzcUZ9Yzr;B5V#`)xw zgoK10#m{+|&oVroYn}e@@C_awp8pe{PWaISWbkNdsqy$Mxn&?@5+JgM$D(QarUX?< a28Kl|c&GI9J~;z4h{4m<&t;ucLK6T;nl+pN literal 0 HcmV?d00001 diff --git a/icons/layouts/fairv.png b/icons/layouts/fairv.png new file mode 100644 index 0000000000000000000000000000000000000000..65f0e5936ee999fe3a70c70d1f0784940ab6a04c GIT binary patch literal 206 zcmeAS@N?(olHy`uVBq!ia0vp^JRr=$1|-8uW1a&k#^NA%Cx&(BWL^R}Y)RhkE)4%c zaKYZ?lYt_f1s;*b3=G`DAk4@xYmNj^kiEpy*OmPy4=V$Yx%^>)a-fi(r;B5V#`)xw zgoK10#m{+|JsU)Ld&=L<`PuK?*Vy>bUTAhB2y`~O9N;LP)YZjlwmj*E!=}j*9fgdW p-nN+hX}9W~SXZZD8R6NN$uOr}&BQJ8WB|})22WQ%mvv4FO#sLHKehk> literal 0 HcmV?d00001 diff --git a/icons/layouts/floating.png b/icons/layouts/floating.png new file mode 100644 index 0000000000000000000000000000000000000000..e4543acbaf87cfe65d7ef1c2d776eb41c0667b5f GIT binary patch literal 221 zcmeAS@N?(olHy`uVBq!ia0vp^JRr=$1|-8uW1a&k#^NA%Cx&(BWL^R}Y)RhkE)4%c zaKYZ?lYt_f1s;*b3=G`DAk4@xYmNj^kiEpy*OmPy4=V#N&-TkFgn&Y^o-U3d8t1o8 zJji*#fQQ*%b#X<@oBa;E9XECVda2ARER^wHQ@}2f@k`xCFUAeMDoU@S9v+9E6NaMeSetgaR2}S literal 0 HcmV?d00001 diff --git a/icons/layouts/fullscreen.png b/icons/layouts/fullscreen.png new file mode 100644 index 0000000000000000000000000000000000000000..3bf6329ed1c283c594cc472b3e1dc0b3ab084eb1 GIT binary patch literal 205 zcmeAS@N?(olHy`uVBq!ia0vp^JRr=$1|-8uW1a&k#^NA%Cx&(BWL^R}Y)RhkE)4%c zaKYZ?lYt_f1s;*b3=G`DAk4@xYmNj^kiEpy*OmPy4=V$&?A_!S4}e0xo-U3d8t0Q! z5)u-26hG%-KFjcUu66o9;l+K8jg5}3M_U?MV+D8@Q?wJz9(-coWy3w`PQA`7iHocrWkM&V oCd@suVo_4lS^h74VL^-xdEaEUnR5ZyF|FY33eJuc`v+RO#SEKXFX=w>DMc}TUg<6|v6+kKeYq?j_nKk<7tLwmHIJBq PwlR3R`njxgN@xNA!d6R% literal 0 HcmV?d00001 diff --git a/icons/layouts/spiral.png b/icons/layouts/spiral.png new file mode 100644 index 0000000000000000000000000000000000000000..2f266d40367f437a193a5d98f509d33900d3dd41 GIT binary patch literal 211 zcmeAS@N?(olHy`uVBq!ia0vp^JRr=$1|-8uW1a&k#^NA%Cx&(BWL^R}Y)RhkE)4%c zaKYZ?lYt_f1s;*b3=G`DAk4@xYmNj^kiEpy*OmPy4=V$oM4O8L8lX_Hr;B5V#`)xw zgoK10#m{+|&oVroYn}dYakrs?L4t5{K%ik_g3?tsu_Td|D`p(H>2kB+`8mmo0|93} ydzNJV=$A>-(o*YDxyev$zc1l$zpCB|W(NCKk@-PK^w$E7XYh3Ob6Mw<&;$U{xj^Co literal 0 HcmV?d00001 diff --git a/icons/layouts/tile.png b/icons/layouts/tile.png new file mode 100644 index 0000000000000000000000000000000000000000..a098c34a6a2620675fa9387ec76c220bf2948a77 GIT binary patch literal 188 zcmeAS@N?(olHy`uVBq!ia0vp^JRr=$1|-8uW1a&k#^NA%Cx&(BWL^R}Y)RhkE)4%c zaKYZ?lYt_f1s;*b3=G`DAk4@xYmNj^kiEpy*OmPy4=V$omfvSN9iWhnr;B5V#`)xw zgoK10#m{+|&oVroYn}dYakrs?L4t5{K%ik_g3?tsu^6+}D`res^3XoYVZ!?*4?= literal 0 HcmV?d00001 diff --git a/icons/layouts/tileleft.png b/icons/layouts/tileleft.png new file mode 100644 index 0000000000000000000000000000000000000000..74fe702a9a0ce451b0b5627c6a00f44ba9052b1a GIT binary patch literal 190 zcmeAS@N?(olHy`uVBq!ia0vp^JRr=$1|-8uW1a&k#^NA%Cx&(BWL^R}Y)RhkE)4%c zaKYZ?lYt_f1s;*b3=G`DAk4@xYmNj^kiEpy*OmPy4=V!~Z~xRhXP}Usr;B5V#`)xw zgoK10#m{+|JsU)Ld&=L<`Pr{`?7)Er-=0Pg=xlU3z)?J@tBZ4!aN#Y7YIR*AJ(aV1X{u1>FVdQ&MBb@0M;Kt A;{X5v literal 0 HcmV?d00001 diff --git a/icons/mem.png b/icons/mem.png new file mode 100644 index 0000000000000000000000000000000000000000..16adb2f2b5bc42763be9e3bd5d401ee297b84c84 GIT binary patch literal 207 zcmeAS@N?(olHy`uVBq!ia0vp^JRr=$1|-8uW1a&k#^NA%Cx&(BWL^R}Y)RhkE)4%c zaKYZ?lYt_f1s;*b3=G`DAk4@xYmNj^kiEpy*OmPy4=V$k*h<$Ii-AJ^o-U3d8t0P} z7MLcq8UAZ;H8hyg^2h#w-o1`qyB!}Bl$n7*xr@!Fq425}8wiM{9Axu9``@B;O_Rhq omsRo^>l;)2jT1kc=*_ZYV3?w(!1Zcv0m!)wp00i_>zopr0Cmbc_y7O^ literal 0 HcmV?d00001 diff --git a/icons/music.png b/icons/music.png new file mode 100644 index 0000000000000000000000000000000000000000..4c2764d1099f4009c710b762915ba088572fc601 GIT binary patch literal 192 zcmeAS@N?(olHy`uVBq!ia0vp^d?3uh1|;P@bT0xa#^NA%Cx&(BWL^R}Y)RhkE)4%c zaKYZ?lYt_f1s;*b3=G`DAk4@xYmNj^kiEpy*OmPyBcGUw=qt8DDWH≺B5V#`)v~ z38MzVnV;=-dK!UX;lbd~_GU+WJ9`Vh`aHRHqRD$v;_p(C>kD=_lGBGv^3Z-n6Xk?R81%ZSn4f0!Hnu z)8#iO^;E{wmAY(E-T^vI+&R-35 zNav2&T4AVHTb*eBdP(N?_zFnBX!>)XyOShV* zPR5RhKm4v7ShR8-Z~gU|oS|hr3{C3xj4wi8oc!8)TV3q)nfe#!_VseTpROYzKKrlh V;(UQ${XjbzJYD@<);T3K0RVSDPO1O^ literal 0 HcmV?d00001 diff --git a/icons/power-bat-high.png b/icons/power-bat-high.png new file mode 100644 index 0000000000000000000000000000000000000000..37081f5e43c809e4124bc4690ceccb4e7335d582 GIT binary patch literal 213 zcmeAS@N?(olHy`uVBq!ia0vp^JRr=$1|-8uW1a&k#^NA%Cx&(BWL^R}Y)RhkE)4%c zaKYZ?lYt_f1s;*b3=G`DAk4@xYmNj^kiEpy*OmPy4=V#RgTk|w+krx%o-U3d8t0P} z7MLcq82)Q-J;*9;WBT9Nz`(#HXFuQc^q8$(jUd1pY3`$F*Q@g)OvyXRxP^1JHAvlJ v?IWuh^K{$yUy7L&JJo`E4iPvW)W=dCk=7BG0a`njxgN@xNAr6xUp literal 0 HcmV?d00001 diff --git a/icons/power.png b/icons/power.png new file mode 100644 index 0000000000000000000000000000000000000000..b8add29a1cef8567acba867f4c447a2b6e55f8a2 GIT binary patch literal 222 zcmeAS@N?(olHy`uVBq!ia0vp^d?3uh1|;P@bT0xa#^NA%Cx&(BWL^R}Y)RhkE)4Yy z^BL;5n8Y&zMK}vQB8wRqxP?KOkzv*x37{Z*iKnkC`%QK(VOh}?EB)RAh2lJ2978nD zCnrc4H3-fOw%;!|^S6AgZ*r1y%p}h4#Q)OU;@gWCy!rp4YsQ9*q?`{|Tr$2~Ny)fT zH&-y$Sa@fhOhs=G@4Q+67d9T^;0|0N;l;DzLC2#1Cm37SWp*$!aG6O7zs@Ot4z!8E M)78&qol`;+0M6q^WB>pF literal 0 HcmV?d00001 diff --git a/icons/rss.png b/icons/rss.png new file mode 100644 index 0000000000000000000000000000000000000000..62d361e08b35527630ea372cac31da025f390fca GIT binary patch literal 203 zcmeAS@N?(olHy`uVBq!ia0vp^d?3uh1|;P@bT0xa#^NA%Cx&(BWL^R}Y)RhkE)4%c zaKYZ?lYt_f1s;*b3=G`DAk4@xYmNj^kiEpy*OmPy8^3^%_OlflAalJvT^vI+&L<~G z7&Qpa47T6@&))86Z)b18SDhD=cyF&aPP%;M!OG4g4Q|7(4U)&4TEsV4&F5@C_J4NZYsSBZCINI$e|=Wb=`*UyZn2XZj1T9mi9W0lfL zn?j4@Pd1*{*nP{;FiCJ#SN)NmP~%Sqv-5R!SH+*a9e$SQ_SK39`qd0xlY)#BqBg7s P+Q#7N>gTe~DWM4fYSK#< literal 0 HcmV?d00001 diff --git a/icons/sun.png b/icons/sun.png new file mode 100644 index 0000000000000000000000000000000000000000..2f22c8e6c3016b3598b5cf00ce52d79f17aa5799 GIT binary patch literal 203 zcmeAS@N?(olHy`uVBq!ia0vp^d?3uh1|;P@bT0xa#^NA%Cx&(BWL^R}Y)RhkE)4%c zaKYZ?lYt_f1s;*b3=G`DAk4@xYmNj^kiEpy*OmPyyEG#k&!o>;!9XEzPZ!4!jq}L~ z5=ISzGe7_TU(W^vZTzu&k#Kyzopr08v0TEC2ui literal 0 HcmV?d00001 diff --git a/icons/taglist/squarefz.png b/icons/taglist/squarefz.png new file mode 100644 index 0000000000000000000000000000000000000000..f0c1912bd4519f6d486dac8f542443feb715139d GIT binary patch literal 152 zcmeAS@N?(olHy`uVBq!ia0vp^EI`b|!3HE<7s&_%DaPU;cPEB*=VV?2Ic!PZ?k)`f zL2$v|<&%LToCO|{#S9F5M?jcysy3fAP>{XE)7O>#CJ&3aA^RuwU0;Dh5}q!OAsp9} q{}j~!t!Gm?aHN5agPTW;f#Jw>=GLk64{8C`FnGH9xvX{XE)7O>#CJ&3ap{Cx)?N&e`WltB!5RU7~ ye+ugV*0ZS`XgMPoz>|{V^vnPR7Gz86FfddVa{XE)7O>#CJ&3a5sL%!jvks0 wJ;l$@)U%~D=oCCZH}k&_Pey~F^JxV}hP|46f?lQvKsGXXy85}Sb4q9e06UZ^X#fBK literal 0 HcmV?d00001 diff --git a/icons/taglist/squareza.png b/icons/taglist/squareza.png new file mode 100644 index 0000000000000000000000000000000000000000..94736d4fcf110314d4eb72d62f0cb0b1edb0f169 GIT binary patch literal 154 zcmeAS@N?(olHy`uVBq!ia0vp^EI`b|!3HE<7s&_%DaPU;cPEB*=VV?2Ic!PZ?k)`f zL2$v|<&%LToCO|{#S9F5M?jcysy3fAP>{XE)7O>#CJ&3akxX#D!Y!bXl&6bh2*>s0 rJ;l$@)U%~D=p8uHz-GY0#?8RsKaHK|!R3T=KvfK$u6{1-oD!MPZ!4!jq_K7 z9Qhg)cwS#LQm!L4nqdxa eM9Q)FGR9|41#K?sNnt>{89ZJ6T-G@yGywpMuvGB? literal 0 HcmV?d00001 diff --git a/icons/time.png b/icons/time.png new file mode 100644 index 0000000000000000000000000000000000000000..3fb987d1919a38851194fdeb0a3a6d75a9dff74b GIT binary patch literal 227 zcmeAS@N?(olHy`uVBq!ia0vp^JRr=$1|-8uW1a&k#^NA%Cx&(BWL^R}Y)RhkE)4%c zaKYZ?lYt_f1s;*b3=G`DAk4@xYmNj^kiEpy*OmPy4=V#ZhgaZ}Mxao#r;B5V#`)xg z1*QoukBhIJU;n>N=faE|CypFA@In4qy3@2Hi)L)BtNUx8(kwYqnQ^fJ| Q4WM-lp00i_>zopr0D4AEd;kCd literal 0 HcmV?d00001 diff --git a/icons/titlebar/close_focus.png b/icons/titlebar/close_focus.png new file mode 100644 index 0000000000000000000000000000000000000000..6b037ed69175f3a6a3e5c7f680278d870187e107 GIT binary patch literal 209 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|*pj^6T^Rm@ z;DWu&Cj&(|3p^r=85p>QL70(Y)*K0-AbW|YuPgga4mk!HmKmO+c|f5+PZ!4!i_^&o z609Q3ZaGcqYX1MuA2@J8z&w{xnVFgS@S-&>|9OBwZRbvjS2HsnG3ojyv!%>V)Z1D1 uSBLp(?13gQ&rUPlPLl|O?tvw9n1bDhQhFF|V zPLN;~VRp-DlD>55k^~SWO`Y$W;_4@ literal 0 HcmV?d00001 diff --git a/icons/titlebar/floating_focus_active.png b/icons/titlebar/floating_focus_active.png new file mode 100644 index 0000000000000000000000000000000000000000..cd367c1d8a9a46b16a78abd273b885d1cf794ef6 GIT binary patch literal 207 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|*pj^6T^Q~F z;hDwk*)M=1oCO|{#S9GG!XV7ZFl&wkP>{XE)7O>#CcBh~ibU_Je;rH$S|D-4 rqf~rDg0RbW$z#XaX1HCxsKCGw`cXt|<&pMkpwSGTu6{1-oD!M<6;MFn literal 0 HcmV?d00001 diff --git a/icons/titlebar/floating_focus_inactive.png b/icons/titlebar/floating_focus_inactive.png new file mode 100644 index 0000000000000000000000000000000000000000..2ae6e946eb07afaaf485afc49744961bec3e1fe6 GIT binary patch literal 337 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!60wlNoGJgf6SkfJR9T^xl_H+M9WCijWi-X*q z7}lMWc?skwBzpw;GB8xBF)%c=FfjZA3N^f7U???UV0e|lz+g3lfkC`r&aOZkpafHr zx4R1i!>V3oBOs5nz$3Dlfq`2Xgc%uT&5-~JmK8Xr18J}$7-EjCJq+ZSdb&783qOcZmIq#8glbf oGSe!d8q9T#%tDNetc=a9j7%UJelczI0%~CJboFyt=akR{07TMVJ^%m! literal 0 HcmV?d00001 diff --git a/icons/titlebar/floating_normal_active.png b/icons/titlebar/floating_normal_active.png new file mode 100644 index 0000000000000000000000000000000000000000..3d1778095b91c577e565a2571b0d295f6b5d7e1d GIT binary patch literal 359 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Ea{HEjtmT0oejY^o&fob#X;^) z4C~IxyaaL-l0AZa85pY67#JE_7#My5g&JNkFq9fFFuY1&V6d9Oz#v{QXIG#NP=YPV z+ua371Hn({-St3Q&rUPlPLl|O?tvw9nxO=)dhFF|V zPLN;~VRp-D+GEqi0|Ms!Q&r{pBD79HT9^9PCCo(%xZ=%u4 z8Lsl;7fgBF7)2Qv>~h4oq-~;efJUm8xJHzuB$lLFB^RXvDF!1014~^43teM_5CbDC zBTFk&Gi@Nlz#zaa)gMJeZhlH;S|wD2xvr5}h>?+%v6+>T2}Hv$rj1@e4Gf;HelF{r G5}E*qiCZuL literal 0 HcmV?d00001 diff --git a/icons/titlebar/floating_normal_inactive.png b/icons/titlebar/floating_normal_inactive.png new file mode 100644 index 0000000000000000000000000000000000000000..3faa1a33fc7c3fd16ca7e854c6351b29975dd93f GIT binary patch literal 326 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!60wlNoGJgf6SkfJR9T^xl_H+M9WCijWi-X*q z7}lMWc?skwBzpw;GB8xBF)%c=FfjZA3N^f7U???UV0e|lz+g3lfkC`r&aOZkpafHr zx4R1i!>V3oBOs5nz$3Dlfq`2Xgc%uT&5-~JmK8Xr18J}$7-EjCJq+Y%dAc};Xq-<@ zkceuS-Z=fC&#jpzacprafoeiN4KM8`m#OvI2y2ude!$8gT+Ssa+OTpOP?u_nYeY#( zVo9o1a#1RfVlXl=u+%lM&^0y)F)*?+Hn1`_)CMvP4Dv*m`JiaX%}>cptHiBA-b3yK PPy>UftDnm{r-UW|)E7|i literal 0 HcmV?d00001 diff --git a/icons/titlebar/maximized_focus_active.png b/icons/titlebar/maximized_focus_active.png new file mode 100644 index 0000000000000000000000000000000000000000..6b235a509248ead8025384f5a321f5e4c90df06e GIT binary patch literal 200 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|*pj^6T^K$v z+-F!{cv?LSD8gCb5n0T@z%2~Ij105pNB{-dOFVsD*>AE-i5SZ46}s~mDCFVk;uvCa zIypgtRfO3sr%C?Z`v3iE|K~S0Haa>O3OL&eFV#yp_}oZ)y%-x1v?brpk|>mPFcv?M nljgw3oRfIWWL6&=BLl;;|J+;&ExWG*&1CR&^>bP0l+XkK3qm(x literal 0 HcmV?d00001 diff --git a/icons/titlebar/maximized_focus_inactive.png b/icons/titlebar/maximized_focus_inactive.png new file mode 100644 index 0000000000000000000000000000000000000000..53d914b82cab6b673e83d2b91fc24fe45d0112c7 GIT binary patch literal 335 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!60wlNoGJgf6SkfJR9T^xl_H+M9WCijWi-X*q z7}lMWc?skwBzpw;GB8xBF)%c=FfjZA3N^f7U???UV0e|lz+g3lfkC`r&aOZkpafHr zx4R1i!>V3oBOs5nz$3Dlfq`2Xgc%uT&5-~JmK8Xr18J}$7-EjCJq+X+d%8G=Xq-<@ zkYH*MJh8Of0R8EFc=5PMQkzCQ&rUPlPLl|O?tvw9n_<6cGhFF|V zPLN;~VRp-DI)AQYiQ~-83reJznVFlXcplX$+3GW8R|9MN4;?ljC~fxxQEju?Po+OJ zYDm*-xXF{esGaj`i~-jQ28O<6JRyM-qOJl>RxNRjC`m~yNwrEYN(E93Mg|6!x&{`y z#s(ngoU N!PC{xWt~$(69CYaV2uC( literal 0 HcmV?d00001 diff --git a/icons/titlebar/maximized_normal_inactive.png b/icons/titlebar/maximized_normal_inactive.png new file mode 100644 index 0000000000000000000000000000000000000000..7dc97ee4477bda86ef120e43a65904bf15f001fe GIT binary patch literal 347 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!60wlNoGJgf6SkfJR9T^xl_H+M9WCijWi-X*q z7}lMWc?skwBzpw;GB8xBF)%c=FfjZA3N^f7U???UV0e|lz+g3lfkC`r&aOZkpafHr zx4R1i!>V3oBOs5nz$3Dlfq`2Xgc%uT&5-~JmK8Xr18J}$7-EjCJq+a7d%8G=Xq-<@ zkYH*MJZLld*ntBE-HnZky^RM`#C)c7vK&5VFemXr>Vs5^!v$=fQxUO_QmvAUQh^kMk%57wu7QQFu|bG|k(IH5m9ddF mkYQjD|98(t6b-rgDVb@NxHaf4V95n)VDNPHb6Mw<&;$Sq<6Rv9 literal 0 HcmV?d00001 diff --git a/icons/titlebar/ontop_focus_active.png b/icons/titlebar/ontop_focus_active.png new file mode 100644 index 0000000000000000000000000000000000000000..16b44d59a72a5c75d52042323365d92deead4b02 GIT binary patch literal 186 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|*pj^6T^Q~F z;hDwk*)M=1oCO|{#S9GG!XV7ZFl&wkP>{XE)7O>#CcBh~DRV3oBOs5nz$3Dlfq`2Xgc%uT&5-~JmK8Xr18J}$7-EjCJq+aNd%8G=Xq-<@ zkYH*MJh-P{WerEV;lj)x=Re4YHgq;JBsgB=-6-TXIgd$M%C>}o;i3eqK<7N4xj?O| zC9V-ADTyViR>?)FK#IZ0z`#=1z(Uv9AjH7P%E;2n)Jz-5Ffa&kOZ7+5kei>9nN|ta jV6JOq7Gh*%Wom3?Xb91up*e#SsDZ)L)z4*}Q$iB}pA%9c literal 0 HcmV?d00001 diff --git a/icons/titlebar/ontop_normal_active.png b/icons/titlebar/ontop_normal_active.png new file mode 100644 index 0000000000000000000000000000000000000000..ba39ce80369ae5481a3be8ae2c5eb5a911beddc3 GIT binary patch literal 347 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Ea{HEjtmT0oejY^o&fob#X;^) z4C~IxyaaL-l0AZa85pY67#JE_7#My5g&JNkFq9fFFuY1&V6d9Oz#v{QXIG#NP=YPV z+ua371Hn({-St3Q&rUPlPLl|O?tvw9nSbMrShFF|V zPLN;~VRp-DI)APtAyg+ds8R8l%Yh~njboe~k`4kJ9&DW1*w~mT#%K37)}WiAUL*i$ zbpHf)fp;l=dx6HNmbgZgq$HN4S|t~y0x1R~0|QH40}EYagAfBFD+rhUN@Tpaup{S3j3^P6V3oBOs5nz$3Dlfq`2Xgc%uT&5-~JmK8Xr18J}$7-EjCJq+X+c)B=-Xq-<@ zkYH*MJZRIblEaj4xG>Wr*~3{hAxVKDBA~?B;EdCvPUFS}%I!dxbIGvWT(Ww}ZJ=J& z64!{5l*E!$tK_0oAjM#0U|^|hV4-Vl5Mp3tWo%$&Y^V)n7#QS9nO2Eg UgS>~_2cQN9Pgg&ebxsLQ0P7M_VgLXD literal 0 HcmV?d00001 diff --git a/icons/titlebar/sticky_focus_active.png b/icons/titlebar/sticky_focus_active.png new file mode 100644 index 0000000000000000000000000000000000000000..3e897c70fa9cf7a0d0ad931049f901aa352c7c21 GIT binary patch literal 197 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|*pj^6T^Q~F z;hDwk*)M=1oCO|{#S9GG!XV7ZFl&wkP>{XE)7O>#CcBh~GM`!e-87((tEY=&h{fsT z1PN9VX1AOs`FHF8pFeQmK*H0jhfVV3oBOs5nz$3Dlfq`2Xgc%uT&5-~JmK8Xr18J}$7-EjCJq+aNc)B=-Xq-<@ zkcfKl@Bi=rTP3zgy!*fZzr5lp7Y}LWrj@NKHN6$W8sFff?-3oPIiNz?)AQ!R0g zC`m~yNwrEYN(E93Mg|6!x&{`y#s(nQ&rUPlPLl|O?tvw9nxO=)dhFF|V zPLN;~VRp-DI)AQYiJ^gk!3yh=b4dva2|Fqm*z`6wHaebKk|ee(N^RDThUxACs~??@ zzn9!`@fd3fZ*!mnD+9w@W?`-k0{;bpMyi&$MwFx^mZVxG7o`Fz1|tIlOI-sCU1Ng~ z10yRVODj_|Z6L$IAiyovA4NlMeoAIqB~*jCu8~=Yk&%_LsgV3oBOs5nz$3Dlfq`2Xgc%uT&5-~JmK8Xr18J}$7-EjCJq+aNc)B=-Xq-<@ zkcfKVb8Dta99vwQac24@fki$oTMU(E?D04>ztg<2$ef3hf#Kpjt~1qU$M}HyR7+eV zN>UO_QmvAUQh^kMk%57wu7QQFu|bG|k(IH5m9ddFkYQjD|98(t6b-rgDVb@NxHaf4 SV95n)VDNPHb6Mw<&;$UE?o>Dc literal 0 HcmV?d00001 diff --git a/icons/up.png b/icons/up.png new file mode 100644 index 0000000000000000000000000000000000000000..e79b29652d9a248c31b390f0d8c99b25232b2442 GIT binary patch literal 275 zcmeAS@N?(olHy`uVBq!ia0vp^JRr=$1|-8uW1a&k#^NA%Cx&(BWL^R}Y)RhkE)4%c zaKYZ?lYt_f1s;*b3=G`DAk4@xYmNj^kiEpy*OmPy4=aPX`f8`soj{?)q9SXL3xuT1{Maj>9`#t$^o+_uOn&uHZ zt#5&o&IxZjV|uiYajyD#;|C|_JGh&gXwR|vneBUb{k<788E&!e{cv-WwN0DFz2nhq z1=OT>CgnF?J7eUaQFVXPf<5dLwmZp(i>*<~`uAk=er@Y^&E?;!Kk)x$ur|-mm{A9G O9)qW=pUXO@geCxKlVMN* literal 0 HcmV?d00001 diff --git a/icons/vol.png b/icons/vol.png new file mode 100644 index 0000000000000000000000000000000000000000..31b396f186cf5020c8b3dbc5232064d4d0271726 GIT binary patch literal 224 zcmeAS@N?(olHy`uVBq!ia0vp^JRr=$1|-8uW1a&k#^NA%Cx&(BWL^R}Y)RhkE)4%c zaKYZ?lYt_f1s;*b3=G`DAk4@xYmNj^kiEpy*OmPy4=V$k^_y8+t^tJ-JY5_^G|nd{ zEHF)IG5puwdXQDx#`M2=&i->9iwdr4v4MbEiLew<@bTl#4<mdKI;Vst01|gZG5`Po literal 0 HcmV?d00001 diff --git a/obvious b/obvious new file mode 160000 index 0000000..71cf36f --- /dev/null +++ b/obvious @@ -0,0 +1 @@ +Subproject commit 71cf36fa106523a2a03d4c7906a00d3637836a21 diff --git a/osk.lua b/osk.lua new file mode 100644 index 0000000..d4f5bf4 --- /dev/null +++ b/osk.lua @@ -0,0 +1,90 @@ +---------------------------------------------------- +-- On Screen Keyboard for the awesome window manager +---------------------------------------------------- +-- Coded by: farhaven +-- Hacked by: Adrian C. +-- Licensed under the WTFPL version 2 +-- * http://sam.zoy.org/wtfpl/COPYING +---------------------------------------------------- +-- To use this module add: +-- require("osk") +-- to your rc.lua, and call it from a keybinding: +-- osk(position, screen) +-- +-- Parameters: +-- position - optional, "bottom" by default +-- screen - optional, screen.count() by default +---------------------------------------------------- + +-- Grab environment +local util = require("awful.util") +local wibox = require("awful.wibox") +local button = require("awful.button") +local layout = require("awful.widget.layout") +local table = table +local ipairs = ipairs +local tostring = tostring +local setmetatable = setmetatable +local capi = { + widget = widget, + screen = screen, + fake_input = root.fake_input +} + +-- OSK: On Screen Keyboard for the awesome window manager +module("osk") + +-- Variable definitions +local kbd = {} +kbd.codes = { + q=24, w=25, e=26, r=27, t=28, z=52, u=30, i=31, o=32, p=33, ["."]=60, + a=38, s=39, d=40, f=41, g=42, h=43, j=44, k=45, l=46, + Caps=66, y=29, x=53, c=54, v=55, b=56, n=57, m=58, Spc=65, Ret=36, Del=22, +} + +-- Create a chain of key widgets for an OSK row +local function create_button_row(...) + local widgets = { layout = layout.horizontal.flex } + + for _, i in ipairs(arg) do + local w = capi.widget({ type = "textbox" }) + w:margin({ top = 10, left = 10, right = 10, bottom = 10 }) + w.border_width = 1 + w.text_align = "center" + w.border_color = "#1E2320" + w.text = util.escape(tostring(i)) + w:buttons(util.table.join( + button({ }, 1, nil, function () + capi.fake_input("key_press", kbd.codes[i]) + capi.fake_input("key_release", kbd.codes[i]) + end) + )) + + table.insert(widgets, w) + end + + return widgets +end + +-- Create a wibox holding OSK rows and toggle its visibility +setmetatable(_M, { __call = function (_, pos, scr) + if not kbd.init then + kbd.box = wibox({ + height = 100, + position = pos or "bottom", + screen = scr or capi.screen.count(), + fg = "#F0DFAF", + bg = "#4F4F4F", + widgets = { + { create_button_row("q", "w", "e", "r", "t", "z", "u", "i", "o", "p", ".") }, + { create_button_row("a", "s", "d", "f", "g", "h", "j", "k", "l") }, + { create_button_row("Caps", "y", "x", "c", "v", "b", "n", "m", "Spc", "Ret", "Del") }, + layout = layout.vertical.flex + } + }) + kbd.init = true + kbd.box.visible = false + end + + kbd.box.visible = not kbd.box.visible +end }) diff --git a/rc.lua b/rc.lua new file mode 100644 index 0000000..cf7e258 --- /dev/null +++ b/rc.lua @@ -0,0 +1,471 @@ +-- Standard awesome library +require("awful") +require("awful.autofocus") +require("awful.rules") + +-- Theme handling library +require("beautiful") +-- Notification library +require("naughty") +require("obvious") +--obvious +require("obvious.popup_run_prompt") +--require("obvious.battery") +require("obvious.wlan") +require("obvious.clock") +require("obvious.volume_alsa") +require("obvious.net") + +require("vicious") +-- Load Debian menu entries +require("debian.menu") + +-- {{{ Variable definitions +-- Themes define colours, icons, and wallpapers +beautiful.init("/usr/share/awesome/themes/default/theme.lua") + +-- Variable with the config directory +confdir = awful.util.getdir("config") + + +-- This is used later as the default terminal and editor to run. +terminal = "x-terminal-emulator" +editor = os.getenv("EDITOR") or "editor" +editor_cmd = terminal .. " -e " .. editor +browser = "nautilus --no-desktop --browser" +initawesome = "sh /home/guerre/.awesomestart" +icewe= "iceweasel" +lock= "xscreensaver-command -lock" +--lock= "sh /home/fguerrer/lock" +xterm="xterm" +weechat = terminal .. " -name weechat -e weechat-curses" +firefoxbeta="sh /home/guerre/Descargas/firefox/firefox" +start="sh /home/guerre/.awesomestart" +--brilloup= "sh /home/guerre/scripts/video_brightnessup.sh" +--brillodown= "sh /home/guerre/scripts/video_brightnessdown.sh" + +-- 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.spiral, + awful.layout.suit.spiral.dwindle, + awful.layout.suit.max, + awful.layout.suit.max.fullscreen, + awful.layout.suit.magnifier, + awful.layout.suit.floating +} +-- }}} + +-- {{{ Tags +-- Define a tag table which hold all screen tags. + +-- ************************************** +-- {{{ Tags +-- Define a tag table which hold all screen tags. +tags = {} +tags.settings = { + { name = "1", layout = layouts[5] }, + { name = "2", layout = layouts[9] }, + { name = "3", layout = layouts[1] }, + { name = "4", layout = layouts[1] }, + { name = "5", layout = layouts[12] }, + { name = "6", layout = layouts[12] }, + { name = "7", layout = layouts[12] }, + { name = "8", layout = layouts[3] }, + { name = "9", layout = layouts[1] } +} + +for s = 1, screen.count() do + tags[s] = {} + for i, v in ipairs(tags.settings) do + tags[s][i] = tag({ name = v.name }) + tags[s][i].screen = s + awful.tag.setproperty(tags[s][i], "layout", v.layout) + end + tags[s][1].selected = true +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 }) +-- }}} +-- Reusable separators. +spacer = widget({ type = "textbox", name = "spacer" }) +separator = widget({ type = "textbox", name = "separator" }) +spacer.text = " " +separator.text = "|" +--clock +clockicon = widget({ type = "imagebox", name = "clockicon"}) +clockicon.image = image(confdir.."/icons/time.png") + +-- Volúmen Alsa + volicon = widget({ type = "imagebox" }) + volicon.image = image(confdir.."/icons/vol.png") + volwidget = widget({ type = "textbox" }) + vicious.register(volwidget, vicious.widgets.volume, " Vol: $1% ", 2, "PCM") + +-- Mouse-Buttons +volicon:buttons(awful.util.table.join( +awful.button({ }, 1, function () awful.util.spawn("amixer -q sset PCM toggle", false) end), +awful.button({ }, 4, function () awful.util.spawn("amixer -q sset PCM 1%+",false) end), +awful.button({ }, 5, function () awful.util.spawn("amixer -q sset PCM 1%-",false) end))) + +-- + + +-- }}} +-- 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 + -- Create a promptbox for each screen + mypromptbox[s] = awful.widget.prompt({ layout = awful.widget.layout.horizontal.leftright }) + -- 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 }) + -- Add widgets to the wibox - order matters + mywibox[s].widgets = { + { + mylauncher, + mytaglist[s], + mypromptbox[s], + layout = awful.widget.layout.horizontal.leftright + }, + mylayoutbox[s], + s == 1 and mysystray or nil, + mytextclock, + clockicon, + spacer, + separator, + volwidget, + volicon, + separator, + spacer, + cpuwidget, + --obvious.volume_alsa(), + mytasklist[s], + layout = awful.widget.layout.horizontal.rightleft + } +end +-- }}} + + +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(true) end), + + -- Layout manipulation + awful.key({ modkey, "Shift" }, "j", function () awful.client.swap.byidx( 1) end), + awful.key({ modkey, "Shift" }, "k", function () awful.client.swap.byidx( -1) end), + awful.key({ modkey, "Control" }, "j", function () awful.screen.focus_relative( 1) end), + awful.key({ modkey, "Control" }, "k", function () awful.screen.focus_relative(-1) end), + awful.key({ modkey, }, "u", awful.client.urgent.jumpto), + awful.key({ modkey, }, "Tab", + function () + awful.client.focus.history.previous() + if client.focus then + client.focus:raise() + end + end), + + -- Standard program + awful.key({ modkey, }, "Return", function () awful.util.spawn(terminal) end), + awful.key({ modkey, "Control" }, "r", awesome.restart), + awful.key({ modkey, "Shift" }, "q", awesome.quit), + + awful.key({ modkey, }, "l", function () awful.tag.incmwfact( 0.05) end), + awful.key({ modkey, }, "h", function () awful.tag.incmwfact(-0.05) end), + awful.key({ modkey, "Shift" }, "h", function () awful.tag.incnmaster( 1) end), + awful.key({ modkey, "Shift" }, "l", function () awful.tag.incnmaster(-1) end), + awful.key({ modkey, "Control" }, "h", function () awful.tag.incncol( 1) end), + awful.key({ modkey, "Control" }, "l", function () awful.tag.incncol(-1) end), + awful.key({ modkey, }, "space", function () awful.layout.inc(layouts, 1) end), + awful.key({ modkey, "Shift" }, "space", function () awful.layout.inc(layouts, -1) end), + awful.key({ modkey, }, "b", function() awful.util.spawn(browser) end), + -- awful.key({ modkey, }, "i", function() awful.util.spawn(icewe) end), + -- awful.key({ modkey }, "r", obvious.popup_run_prompt.run_prompt), + awful.key({ modkey, }, "c", function() awful.util.spawn(lock) end), + awful.key({ modkey, }, "t", function () awful.util.spawn(xterm) end), + awful.key({ modkey }, "i", function () awful.util.spawn(firefoxbeta) end), + awful.key({ modkey }, "o", function () awful.util.spawn(start) end), +-- Prompt + awful.key({ modkey }, "F1", function () mypromptbox[mouse.screen]:run() end), + awful.key({}, "#123", function () awful.util.spawn("amixer -q sset Master 5+", false) end), + awful.key({}, "#122", function () awful.util.spawn("amixer -q sset Master 5-", false) end), + -- end), + + awful.key({ modkey }, "F2", + function () + awful.prompt.run({ prompt = "Run: " }, + mypromptbox[mouse.screen].widget, + awful.util.spawn, + awful.completion.bash, + awful.util.getdir("cache") .. "/history") + end), + + awful.key({ modkey }, "s", + function () + awful.prompt.run({ prompt = "SSH: " }, + mypromptbox[mouse.screen].widget, + function (s) + awful.util.spawn(terminal .. " -e ssh -p60 -l ipaddress " .. s) + end) + 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, }, "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, + 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 = { instance = "Navigator" }, + properties = { tag = tags[1][2] } }, + { rule = { instance = "Firefox" }, + properties = { tag = tags[1][2] } }, + { rule = { class = "VirtualBox" }, + properties = { tag = tags[1][9] } }, + { rule = { class = "Pidgin" }, + properties = { tag = tags[1][5] } }, + { rule = { class = "emesene" }, + properties = { tag = tags[1][5] } }, + { rule = { class = "Controler.py" }, + properties = { tag = tags[1][5] } }, + { rule = { instance = "weechat" }, + properties = { tag = tags[1][9] } }, + { rule = { class = "weechat 0.3.0" }, + properties = { tag = tags[1][9] } }, + { rule = { class = "weechat-curses" }, + properties = { tag = tags[1][4] } }, + { rule = { class = "Mail" }, + properties = { tag = tags[1][6] } }, + { rule = { class = "Thunderbird" }, + properties = { tag = tags[1][6] } }, + { rule = { class = "Skype" }, + properties = { tag = tags[1][9] } }, + +} +-- }}} + +-- {{{ 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) +-- }}} diff --git a/rc.lua-f b/rc.lua-f new file mode 100644 index 0000000..82e80ce --- /dev/null +++ b/rc.lua-f @@ -0,0 +1,428 @@ +-- Standard awesome library +require("awful") +require("awful.autofocus") +require("awful.rules") + +-- Theme handling library +require("beautiful") +-- Notification library +require("naughty") +require("obvious") +--obvious +require("obvious.popup_run_prompt") +require("obvious.battery") +require("obvious.wlan") +require("obvious.clock") +require("obvious.volume_alsa") +require("obvious.net") + +require("vicious") +-- Load Debian menu entries +require("debian.menu") + +-- {{{ Variable definitions +-- Themes define colours, icons, and wallpapers +beautiful.init("/usr/share/awesome/themes/zenburn/theme.lua") + +-- This is used later as the default terminal and editor to run. +terminal = "x-terminal-emulator" +editor = os.getenv("EDITOR") or "editor" +editor_cmd = terminal .. " -e " .. editor +browser = "nautilus --no-desktop --browser" +initawesome = "sh /home/guerre/.awesomestart" +icewe= "iceweasel" +lock= "sh /home/guerre/lock" +xterm="xterm" +firefoxbeta="sh /home/guerre/Descargas/firefox/firefox" +start="sh /home/guerre/.awesomestart" +--brilloup= "sh /home/guerre/scripts/video_brightnessup.sh" +--brillodown= "sh /home/guerre/scripts/video_brightnessdown.sh" + +-- 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.spiral, + awful.layout.suit.spiral.dwindle, + awful.layout.suit.max, + awful.layout.suit.max.fullscreen, + awful.layout.suit.magnifier, + awful.layout.suit.floating +} +-- }}} + +-- {{{ Tags +-- Define a tag table which hold all screen tags. + +-- ************************************** +-- {{{ Tags +-- Define a tag table which hold all screen tags. +tags = {} +tags.settings = { + { name = "xterm's", layout = layouts[5] }, + { name = "www", layout = layouts[9] }, + { name = "im", layout = layouts[1] }, + { name = "irc", layout = layouts[1] }, + { name = "media", layout = layouts[12] }, + { name = "work", layout = layouts[3] }, + { name = "docs", layout = layouts[3] }, + { name = "prog", layout = layouts[3] }, + { name = "sys", layout = layouts[1] } +} + +for s = 1, screen.count() do + tags[s] = {} + for i, v in ipairs(tags.settings) do + tags[s][i] = tag({ name = v.name }) + tags[s][i].screen = s + awful.tag.setproperty(tags[s][i], "layout", v.layout) + end + tags[s][1].selected = true +end +-- }}} + +-- Initialize widget +memwidget = awful.widget.progressbar() + + +-- {{{ 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 }) +-- }}} + +-- {{{ Wibox + + +-- {{{ Mouse bindings +-- 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 + -- Create a promptbox for each screen + mypromptbox[s] = awful.widget.prompt({ layout = awful.widget.layout.horizontal.leftright }) + -- 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 }) + -- Add widgets to the wibox - order matters + mywibox[s].widgets = { + { + mylauncher, + mytaglist[s], + mypromptbox[s], + --volicon, + -- spacer, + -- batterywidget, + --baticon, + --spacer, + --memwidget, + --spacer, + --memicon, + --obvious.battery(), + --obvious.volume_alsa(), + layout = awful.widget.layout.horizontal.leftright + }, + mylayoutbox[s], + obvious.battery(), + --obvious.volume_alsa(), + mytextclock, + s == 1 and mysystray or nil, + mytasklist[s], + layout = awful.widget.layout.horizontal.rightleft + } +end +-- }}} + + +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(true) end), + + -- Layout manipulation + awful.key({ modkey, "Shift" }, "j", function () awful.client.swap.byidx( 1) end), + awful.key({ modkey, "Shift" }, "k", function () awful.client.swap.byidx( -1) end), + awful.key({ modkey, "Control" }, "j", function () awful.screen.focus_relative( 1) end), + awful.key({ modkey, "Control" }, "k", function () awful.screen.focus_relative(-1) end), + awful.key({ modkey, }, "u", awful.client.urgent.jumpto), + awful.key({ modkey, }, "Tab", + function () + awful.client.focus.history.previous() + if client.focus then + client.focus:raise() + end + end), + + -- Standard program + awful.key({ modkey, }, "Return", function () awful.util.spawn(terminal) end), + awful.key({ modkey, "Control" }, "r", awesome.restart), + awful.key({ modkey, "Shift" }, "q", awesome.quit), + + awful.key({ modkey, }, "l", function () awful.tag.incmwfact( 0.05) end), + awful.key({ modkey, }, "h", function () awful.tag.incmwfact(-0.05) end), + awful.key({ modkey, "Shift" }, "h", function () awful.tag.incnmaster( 1) end), + awful.key({ modkey, "Shift" }, "l", function () awful.tag.incnmaster(-1) end), + awful.key({ modkey, "Control" }, "h", function () awful.tag.incncol( 1) end), + awful.key({ modkey, "Control" }, "l", function () awful.tag.incncol(-1) end), + awful.key({ modkey, }, "space", function () awful.layout.inc(layouts, 1) end), + awful.key({ modkey, "Shift" }, "space", function () awful.layout.inc(layouts, -1) end), + awful.key({ modkey, }, "b", function() awful.util.spawn(browser) end), + -- awful.key({ modkey, }, "i", function() awful.util.spawn(icewe) end), + awful.key({ modkey }, "r", obvious.popup_run_prompt.run_prompt), + awful.key({ modkey, }, "c", function() awful.util.spawn(lock) end), + awful.key({ modkey, }, "t", function () awful.util.spawn(xterm) end), + awful.key({ modkey }, "i", function () awful.util.spawn(firefoxbeta) end), + awful.key({ modkey }, "o", function () awful.util.spawn(start) end), +-- Prompt + awful.key({ modkey }, "F1", function () mypromptbox[mouse.screen]:run() end), + + -- Prompt + --awful.key({ modkey }, "F2", function () awful.prompt({ prompt = "Run: ", cursor_fg = fg_focus, cursor_bg = bg_focus }, mypromptbox, awful$ + -- end), + + awful.key({ modkey }, "F2", + function () + awful.prompt.run({ prompt = "Run: " }, + mypromptbox[mouse.screen].widget, + awful.util.spawn, + awful.completion.bash, + awful.util.getdir("cache") .. "/history") + 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, }, "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, + 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 = "Navigator" }, + properties = { tag = tags[1][2] } }, + { rule = { class = "VirtualBox" }, + properties = { tag = tags[1][9] } }, + { rule = { class = "pidgin" }, + properties = { tag = tags[1][3] } }, + { rule = { class = "emesene" }, + properties = { tag = tags[1][3] } }, + { rule = { class = "Controler.py" }, + properties = { tag = tags[1][3] } }, + +} +-- }}} + +-- {{{ 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) +-- }}} diff --git a/rc.lua.2 b/rc.lua.2 new file mode 100644 index 0000000..498d02d --- /dev/null +++ b/rc.lua.2 @@ -0,0 +1,635 @@ +-- Standard awesome library +require("awful") +-- Theme handling library +require("beautiful") +-- Notification library +require("naughty") + +-- Load Debian menu entries +-- require("debian.menu") + +-- Functions + +-- Battery widget function + + +-- {{{ Variable definitions +-- Themes define colours, icons, and wallpapers +-- The default is a dark theme +-- theme_path = "/usr/share/awesome/themes/dark/theme.lua" +-- Uncommment this for a lighter theme +-- theme_path = "/usr/share/awesome/themes/sky/theme.lua" + +theme_path = "/usr/share/awesome/themes/sky/theme.lua" + +-- Actually load theme +beautiful.init(theme_path) + +-- This is used later as the default terminal and editor to run. +terminal = "urxvt" +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" + +-- 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.max, + 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 +-- the application class or instance. The instance is useful when running +-- a console app in a terminal like (Music on Console) +-- x-terminal-emulator -name mocp -e mocp +floatapps = +{ + -- by class + ["xmessage"] = true, +-- ["pinentry"] = true, +-- ["gimp"] = true, + -- by instance +-- ["mocp"] = true +} + +-- Applications to be moved to a pre-defined tag by class or instance. +-- Use the screen and tags indices. +apptags = +{ +["arora"] = { screen = 1, tag = 2 }, +["okular"] = { screen = 1, tag = 4 }, +["kwrite"] = { screen = 1, tag = 4 }, +["kate"] = { screen = 1, tag = 4}, +["kspread"] = { screen = 1, tag = 4 }, +["kstars"] = { screen = 1, tag = 8 }, +["stellarium"] = { screen = 1, tag = 8 }, +["kaffeine"] = { screen = 1, tag = 6 }, +["mixer"] = { screen = 1, tag = 6 }, +["ncmpc"] = { screen = 1, tag = 6 }, +["install"] = { screen = 1, tag = 5 }, +["vim"] = { screen = 1, tag = 4 }, +["fixe"] = { screen = 1, tag = 7 }, +["server"] = { screen = 1, tag = 7 }, +["router"] = { screen = 1, tag = 7 }, +["kmldonkey"] = { screen = 1, tag = 7 }, +["dolphin"] = { screen = 1, tag = 5 }, +["mc"] = { screen = 1, tag = 5 }, +["kismet"] = { screen = 1, tag = 7 }, +["centerim"] = { screen = 1, tag = 3 }, + -- ["mocp"] = { screen = 2, tag = 4 }, +} + +-- Define if we want to use titlebar on all applications. +use_titlebar = false +-- }}} + +-- {{{ Tags +-- Define tags table. +tags_names = {"main", "www", "im", "doc", "admin", "multi", "net", "other"} +tags_layout = { + +layouts[1], +layouts[7], +layouts[1], +layouts[1], +layouts[1], +layouts[1], +layouts[1], +layouts[1] + +} +tags = {} +for s = 1, screen.count() do + -- Each screen has its own tag table. + tags[s] = {} + -- Create x tags per screen. Change x valor for configure number of tags. + x = 8 + for tagnumber = 1, x do + tags[s][tagnumber] = tag(tags_names[tagnumber]) + -- Add tags to screen one by one + tags[s][tagnumber].screen = s + awful.layout.set(tags_layout[tagnumber], tags[s][tagnumber]) + end + -- I'm sure you want to see at least one tag. + tags[s][1].selected = true +end +-- }}} + +-- {{{ Wibox +-- Create a textbox widget +mytextbox = widget({ type = "textbox", align = "right" }) +-- Set the default text in textbox +mytextbox.text = " " .. awesome.release .. " " + +-- 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 }, + { "suspend", "sudo pm-suspend" }, + { "hibernate", "sudo pm-hibernate" }, + { "reboot", "sudo shutdown -r now" }, + { "halt", "sudo shutdown -h now" } +} + +adminmenu = { + { "install", install }, + { "file manager", "dolphin" }, + { "mc", mc }, + { "mixer", mixer } +} + +docmenu = { + { "writer", "kwrite" }, + { "kate", kate }, + { "spreadsheet", "kspread" }, + { "vim", vim }, + { "okular", "okular" } +} + +netmenu = { + { "ssh fixe", fixe }, + { "ssh server", server }, + { "ssh router", router }, + { "kismet", kismet }, + { "kmldonkey", "kmldonkey" } +} + +sciencemenu = { + { "kstars", "kstars" }, + { "stellarium", "stellarium" } +} + +mediamenu = { + { "ncmpc", ncmpc }, + { "kaffeine", "kaffeine" } +} + +wwwmenu = { + { "arora", "arora" }, + { "centerim", messenger} +} + +mymainmenu = awful.menu.new({ items = { { "awesome", myawesomemenu, beautiful.awesome_icon }, +{ "documents", docmenu }, +{ "net", netmenu }, +{ "www", wwwmenu }, +{ "media", mediamenu }, +{ "science", sciencemenu }, +{ "admin", adminmenu }, +{ "open terminal", terminal } + } + }) + +mylauncher = awful.widget.launcher({ image = image(beautiful.awesome_icon), + menu = mymainmenu }) + +-- Create a systray +mysystray = widget({ type = "systray", align = "right" }) + +-- Create a wibox for each screen and add it +mywibox = {} +mywibox2 = {} +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, function (tag) tag.selected = not tag.selected end), + 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 + -- Create a promptbox for each screen + mypromptbox[s] = awful.widget.prompt({ align = "left" }) + -- Create an imagebox widget which will contains an icon indicating which layout we're using. + -- We need one layoutbox per screen. + mylayoutbox[s] = widget({ type = "imagebox", align = "right" }) + 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] = wibox({ position = "top", fg = beautiful.fg_normal, bg = beautiful.bg_normal }) + mywibox2[s] = wibox({ position = "bottom", fg = beautiful.fg_normal, bg = beautiful.bg_normal }) + + -- Create battery widget + batterywidget = widget({type = "textbox", name = "batterywidget", align = "right" }) + + -- Create volume widget + tb_volume = widget({ type = "textbox", name = "tb_volume", align = "right" }) + tb_volume:buttons({ + button({ }, 4, function () volume("up", tb_volume) end), +button({ }, 5, function () volume("down", tb_volume) end), +button({ }, 1, function () volume("mute", tb_volume) end) + }) + volume("update", tb_volume) + + -- Create CPU widget + cpuinfo = widget({ type = "textbox", align = "right" }) + + -- Create RAM widget + meminfo = widget({ type = "textbox", align = "right" }) + + -- Create temp widget + tempinfo = widget({ type = "textbox", align = "right" }) + + -- Add widgets to the wibox - order matters + mywibox[s].widgets = { mylauncher, + mytaglist[s], + mypromptbox[s], + cpuinfo, + meminfo, + tempinfo, + batterywidget, + tb_volume, + mytextbox, + mylayoutbox[s], + s == 1 and mysystray or nil } + mywibox[s].screen = s + + mywibox2[s].widgets = { mytasklist[s], + s == 1 and mysystray or nil } + mywibox2[s].screen = s + +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(true) end), + + -- Layout manipulation + awful.key({ modkey, "Shift" }, "j", function () awful.client.swap.byidx( 1) end), + awful.key({ modkey, "Shift" }, "k", function () awful.client.swap.byidx( -1) end), + awful.key({ modkey, "Control" }, "j", function () awful.screen.focus( 1) end), + awful.key({ modkey, "Control" }, "k", function () awful.screen.focus(-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), + + -- Programs + awful.key({modkey, }, "n", function () awful.util.spawn("arora", false) end), + awful.key({modkey, }, "p", function () awful.util.spawn("okular", false) end), + awful.key({modkey, }, "a", function () awful.util.spawn("dolphin", false) end), + awful.key({modkey, "Shift" }, "a", function () awful.util.spawn(mc, false) end), + awful.key({modkey, }, "e", function () awful.util.spawn("kate", false) end), + awful.key({modkey, "Control" }, "e", function () awful.util.spawn("kwrite", false) end), + awful.key({modkey, "Shift" }, "e", function () awful.util.spawn(vim, false) end), + awful.key({modkey, }, "t", function () awful.util.spawn("kspread", false) end), + awful.key({modkey, }, "s", function () awful.util.spawn("kstars", false) end), + awful.key({modkey, "Shift" }, "s", function () awful.util.spawn("stellarium", false) end), + awful.key({modkey, }, "v", function () awful.util.spawn("kaffeine", false) end), + awful.key({modkey, }, "i", function () awful.util.spawn(install, false) end), + awful.key({modkey, }, ".", function () awful.util.spawn(fixe, false) end), + awful.key({modkey, "Shift" }, ".", function () awful.util.spawn(server, false) end), + awful.key({modkey, "Control" }, ".", function () awful.util.spawn(router, false) end), + awful.key({modkey, }, "-", function () awful.util.spawn(kismet, false) end), + awful.key({modkey, }, "d", function () awful.util.spawn("kmldonkey", false) end), + awful.key({modkey, }, "z", function () awful.util.spawn(mixer, false) end), + awful.key({modkey, }, "t", function () awful.util.spawn(ncmpc, false) end), + awful.key({modkey, }, ",", function () awful.util.spawn(messenger, false) end), + + -- Multimedia keys + + awful.key( { }, "#123", function () volume("up", tb_volume) end), + awful.key( { }, "#122", function () volume("down", tb_volume) end), + awful.key( { }, "#121", function () volume("mute", tb_volume) end), + + -- Prompts + + -- manual + + awful.key({ modkey }, "F1", function () awful.prompt.run({ prompt = "Manual: " }, mypromptbox[mouse.screen].widget, + function (host) awful.util.spawn( terminal.. " -e man " .. host, false) end) + end), + + -- exe + + awful.key({ modkey }, "F2", function () mypromptbox[mouse.screen]:run() end), + + -- calculate + + awful.key({ modkey }, "F3", function () awful.prompt.run({ prompt = "Calculate: " }, mypromptbox[mouse.screen].widget, + function (expr) + awful.util.spawn_with_shell("echo '" .. expr .. ' = ' .. awful.util.eval("return (" .. expr .. ")") .. "' | xmessage -center -timeout 10 -file -", false) + end) + end), + + -- spanish dictionary + + awful.key({ modkey }, "F4", function () awful.prompt.run({ prompt = "Spanish dictionary: " }, mypromptbox[mouse.screen].widget, + function (swords) + awful.util.spawn_with_shell("~/.config/awesome/scripts/dictspanish " .. swords .. " | xmessage -center -timeout 20 -file -", false) + end) + end), + + -- english dictionary + + awful.key({ modkey, "Shift" }, "F4", function () awful.prompt.run({ prompt = "English dictionary: " }, mypromptbox[mouse.screen].widget, + function (ewords) + awful.util.spawn_with_shell("~/.config/awesome/scripts/dictenglish " .. ewords .. " | xmessage -center -timeout 20 -file -", false) + end) + end), + + -- lua code + + 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) +) + +-- Client awful tagging: this is useful to tag some clients and then do stuff like move to tag on them +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", awful.client.togglemarked), + 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 + +for i = 1, keynumber do + table.foreach(awful.key({ modkey }, i, + function () + local screen = mouse.screen + if tags[screen][i] then + awful.tag.viewonly(tags[screen][i]) + end + end), function(_, k) table.insert(globalkeys, k) end) + table.foreach(awful.key({ modkey, "Control" }, i, + function () + local screen = mouse.screen + if tags[screen][i] then + tags[screen][i].selected = not tags[screen][i].selected + end + end), function(_, k) table.insert(globalkeys, k) end) + table.foreach(awful.key({ modkey, "Shift" }, i, + function () + if client.focus and tags[client.focus.screen][i] then + awful.client.movetotag(tags[client.focus.screen][i]) + end + end), function(_, k) table.insert(globalkeys, k) end) + table.foreach(awful.key({ modkey, "Control", "Shift" }, i, + function () + if client.focus and tags[client.focus.screen][i] then + awful.client.toggletag(tags[client.focus.screen][i]) + end + end), function(_, k) table.insert(globalkeys, k) end) + table.foreach(awful.key({ modkey, "Shift" }, "F" .. i, + function () + local screen = mouse.screen + if tags[screen][i] then + for k, c in pairs(awful.client.getmarked()) do + awful.client.movetotag(tags[screen][i], c) + end + end + end), function(_, k) table.insert(globalkeys, k) end) +end + +-- Set keys +root.keys(globalkeys) +-- }}} + +-- {{{ Hooks +-- Hook function to execute when focusing a client. +awful.hooks.focus.register(function (c) + if not awful.client.ismarked(c) then + c.border_color = beautiful.border_focus + end +end) + +-- Hook function to execute when unfocusing a client. +awful.hooks.unfocus.register(function (c) + if not awful.client.ismarked(c) then + c.border_color = beautiful.border_normal + end +end) + +-- Hook function to execute when marking a client +awful.hooks.marked.register(function (c) + c.border_color = beautiful.border_marked +end) + +-- Hook function to execute when unmarking a client. +awful.hooks.unmarked.register(function (c) + c.border_color = beautiful.border_focus +end) + +-- Hook function to execute when the mouse enters a client. +awful.hooks.mouse_enter.register(function (c) + -- Sloppy focus, but disabled for magnifier layout + if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier + and awful.client.focus.filter(c) then + client.focus = c + end +end) + +-- Hook function to execute when a new client appears. +awful.hooks.manage.register(function (c, startup) + -- If we are not managing this application at startup, + -- move it to the screen where the mouse is. + -- We only do it for filtered windows (i.e. no dock, etc). + if not startup and awful.client.focus.filter(c) then + c.screen = mouse.screen + end + + if use_titlebar then + -- Add a titlebar + awful.titlebar.add(c, { modkey = modkey }) + end + -- Add mouse bindings + c:buttons(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) + )) + -- New client may not receive focus + -- if they're not focusable, so set border anyway. + c.border_width = beautiful.border_width + c.border_color = beautiful.border_normal + + -- Check if the application should be floating. + local cls = c.class + local inst = c.instance + if floatapps[cls] then + awful.client.floating.set(c, floatapps[cls]) + elseif floatapps[inst] then + awful.client.floating.set(c, floatapps[inst]) + end + + -- Check application->screen/tag mappings. + local target + if apptags[cls] then + target = apptags[cls] + elseif apptags[inst] then + target = apptags[inst] + end + if target then + c.screen = target.screen + awful.client.movetotag(tags[target.screen][target.tag], c) + end + + -- Do this after tag mapping, so you don't see it on the wrong tag for a split second. + client.focus = c + + -- Set key bindings + c:keys(clientkeys) + + -- Set the windows at the slave, + -- i.e. put it at the end of others instead of setting it master. + -- 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 +end) + +-- Hook function to execute when arranging the screen. +-- (tag switch, new client, etc) +awful.hooks.arrange.register(function (screen) + local layout = awful.layout.getname(awful.layout.get(screen)) + if layout and beautiful["layout_" ..layout] then + mylayoutbox[screen].image = image(beautiful["layout_" .. layout]) + else + mylayoutbox[screen].image = nil + end + + -- Give focus to the latest client in history if no window has focus + -- or if the current window is a desktop or a dock one. + if not client.focus then + local c = awful.client.focus.history.get(screen, 0) + if c then client.focus = c end + end +end) + +-- Hook called every minute +awful.hooks.timer.register(60, function () +-- mytextbox.text = os.date(" %a %b %d, %H:%M ") + mytextbox.text = os.date(" %H:%M ") +end) + +-- Hook called every 20 seconds +awful.hooks.timer.register(20, function() + batteryInfo("BAT1") + volume("update", tb_volume) + meminfo.text = activeram() +end) + +-- Hook called every 1 seconds +awful.hooks.timer.register(1, function() + cpuinfo.text = activecpu() + tempinfo.text = get_temp() +end) + +-- }}} diff --git a/rc.lua.30082011 b/rc.lua.30082011 new file mode 100644 index 0000000..b24d0ab --- /dev/null +++ b/rc.lua.30082011 @@ -0,0 +1,546 @@ +-- Standard awesome library +require("awful") +require("awful.autofocus") +require("awful.rules") + +-- Theme handling library +require("beautiful") +-- Notification library +require("naughty") +require("obvious") +--obvious +require("obvious.popup_run_prompt") +require("obvious.battery") +require("obvious.wlan") +require("obvious.clock") +require("obvious.volume_alsa") +require("obvious.net") + +require("vicious") +-- Load Debian menu entries +require("debian.menu") + +-- {{{ Variable definitions +-- Themes define colours, icons, and wallpapers +beautiful.init("/usr/share/awesome/themes/default/theme.lua") + +-- Variable with the config directory +confdir = awful.util.getdir("config") + + +-- This is used later as the default terminal and editor to run. +terminal = "x-terminal-emulator" +editor = os.getenv("EDITOR") or "editor" +editor_cmd = terminal .. " -e " .. editor +browser = "nautilus --no-desktop --browser" +initawesome = "sh /home/guerre/.awesomestart" +icewe= "iceweasel" +lock= "sh /home/guerre/lock" +xterm="xterm" +weechat = terminal .. " -name weechat -e weechat-curses" +firefoxbeta="sh /home/guerre/Descargas/firefox/firefox" +start="sh /home/guerre/.awesomestart" +--brilloup= "sh /home/guerre/scripts/video_brightnessup.sh" +--brillodown= "sh /home/guerre/scripts/video_brightnessdown.sh" + +-- 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.spiral, + awful.layout.suit.spiral.dwindle, + awful.layout.suit.max, + awful.layout.suit.max.fullscreen, + awful.layout.suit.magnifier, + awful.layout.suit.floating +} +-- }}} + +-- {{{ Tags +-- Define a tag table which hold all screen tags. + +-- ************************************** +-- {{{ Tags +-- Define a tag table which hold all screen tags. +tags = {} +tags.settings = { + { name = "1", layout = layouts[5] }, + { name = "2", layout = layouts[9] }, + { name = "3", layout = layouts[1] }, + { name = "4", layout = layouts[1] }, + { name = "5", layout = layouts[12] }, + { name = "6", layout = layouts[3] }, + { name = "7", layout = layouts[3] }, + { name = "8", layout = layouts[3] }, + { name = "9", layout = layouts[1] } +} + +for s = 1, screen.count() do + tags[s] = {} + for i, v in ipairs(tags.settings) do + tags[s][i] = tag({ name = v.name }) + tags[s][i].screen = s + awful.tag.setproperty(tags[s][i], "layout", v.layout) + end + tags[s][1].selected = true +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 }) +-- }}} +-- Reusable separators. +spacer = widget({ type = "textbox", name = "spacer" }) +separator = widget({ type = "textbox", name = "separator" }) +spacer.text = " " +separator.text = "|" +--clock +clockicon = widget({ type = "imagebox", name = "clockicon"}) +clockicon.image = image(confdir.."/icons/time.png") +-- Icon +memicon = widget({ type = "imagebox", name = "memicon"}) +memicon.image = image(confdir.."/icons/mem.png") +--Widget +memwidget = widget({ type = "textbox", name = "memwidget"}) +-- Register widget +vicious.register(memwidget, vicious.widgets.mem, "$2 MB", 11) +--ok + +-- CPU + cpuico = widget({ type = "imagebox" }) + cpuico.image = image(confdir.."/icons/cpu.png") + cpuwidget = widget({ type = "textbox" }) +-- Register widget + vicious.register(cpuwidget, vicious.widgets.cpu, " Cpu: $1% ") +-- Monitor de Red + netup = widget({ type = "imagebox" }) + netup.image = image(confdir.."/icons/up.png" ) + netdown = widget({ type = "imagebox" }) + netdown.image = image(confdir.."/icons/down.png" ) + rednet = widget({ type = "textbox" }) + vicious.register(rednet, vicious.widgets.net, " ${wlan0 up_kb} - ${wlan0 down_kb} ", 3) + +-- Volúmen Alsa + volicon = widget({ type = "imagebox" }) + volicon.image = image(confdir.."/icons/vol.png") + volwidget = widget({ type = "textbox" }) + vicious.register(volwidget, vicious.widgets.volume, " Vol: $1% ", 2, "PCM") + +-- Mouse-Buttons +volicon:buttons(awful.util.table.join( +awful.button({ }, 1, function () awful.util.spawn("amixer -q sset PCM toggle", false) end), +awful.button({ }, 4, function () awful.util.spawn("amixer -q sset PCM 1%+",false) end), +awful.button({ }, 5, function () awful.util.spawn("amixer -q sset PCM 1%-",false) end))) + +-- + +-- Widget icon +baticon = widget({ type = "imagebox", name = "baticon" }) +-- Initialize widget +batwidget = widget({ type = "textbox", name = "batwidget" }) +-- Register widget +vicious.register(batwidget, vicious.widgets.bat, + function (widget, args) + if args[1] == "⌁" then + baticon.image=image(confdir.. "/icons/power-ac.png") + return "" + elseif args[1] == "+" then + baticon.image=image(confdir.. "/icons/power-ac.png") + return "("..args[2]..")" + else + if args[2] > 70 then + baticon.image=image(confdir.. "/icons/power-bat-high.png") + return "("..args[2]..")" + elseif args[2] > 40 and args[2] <= 70 then + baticon.image=image(confdir.. "/icons/power-bat.png") + return "("..args[2]..")" + elseif args[2] > 10 and args[2] <= 40 then + baticon.image=image(confdir.. "/icons/power-bat-low2.png") + return "("..args[2]..")" + elseif args[2] > 5 and args[2] <= 10 then + baticon.image=image(confdir.. "/icons/power-bat-low.png") + return "("..args[2]..")" + else + baticon.image=image(confdir.. "/icons/power-bat-low.png") + naughty.notify({ title = "Battery Warning" + , text = "Battery low! "..args[1].."% left!" + , timeout = 5 + , position = "top_right" + , fg = beautiful.fg_focus + , bg = beautiful.bg_focus + }) + return "("..args[2]..")" + end + end + end, + 23, "BAT0") +-- }}} + +-- }}} +-- 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 + -- Create a promptbox for each screen + mypromptbox[s] = awful.widget.prompt({ layout = awful.widget.layout.horizontal.leftright }) + -- 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 }) + -- Add widgets to the wibox - order matters + mywibox[s].widgets = { + { + mylauncher, + mytaglist[s], + mypromptbox[s], + layout = awful.widget.layout.horizontal.leftright + }, + mylayoutbox[s], + s == 1 and mysystray or nil, + mytextclock, + + --baticon, + --batwidget, + clockicon, + separator, + spacer, + spacer, + obvious.battery(), + spacer, + separator, + spacer, + cpuwidget, + cpuico, + separator, + netdown, + rednet, + netup, + separator, + memwidget, + spacer, + memicon, + separator, + volwidget, + volicon, + separator, + spacer, + --cpuwidget, + --obvious.volume_alsa(), + mytasklist[s], + layout = awful.widget.layout.horizontal.rightleft + } +end +-- }}} + + +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(true) end), + + -- Layout manipulation + awful.key({ modkey, "Shift" }, "j", function () awful.client.swap.byidx( 1) end), + awful.key({ modkey, "Shift" }, "k", function () awful.client.swap.byidx( -1) end), + awful.key({ modkey, "Control" }, "j", function () awful.screen.focus_relative( 1) end), + awful.key({ modkey, "Control" }, "k", function () awful.screen.focus_relative(-1) end), + awful.key({ modkey, }, "u", awful.client.urgent.jumpto), + awful.key({ modkey, }, "Tab", + function () + awful.client.focus.history.previous() + if client.focus then + client.focus:raise() + end + end), + + -- Standard program + awful.key({ modkey, }, "Return", function () awful.util.spawn(terminal) end), + awful.key({ modkey, "Control" }, "r", awesome.restart), + awful.key({ modkey, "Shift" }, "q", awesome.quit), + + awful.key({ modkey, }, "l", function () awful.tag.incmwfact( 0.05) end), + awful.key({ modkey, }, "h", function () awful.tag.incmwfact(-0.05) end), + awful.key({ modkey, "Shift" }, "h", function () awful.tag.incnmaster( 1) end), + awful.key({ modkey, "Shift" }, "l", function () awful.tag.incnmaster(-1) end), + awful.key({ modkey, "Control" }, "h", function () awful.tag.incncol( 1) end), + awful.key({ modkey, "Control" }, "l", function () awful.tag.incncol(-1) end), + awful.key({ modkey, }, "space", function () awful.layout.inc(layouts, 1) end), + awful.key({ modkey, "Shift" }, "space", function () awful.layout.inc(layouts, -1) end), + awful.key({ modkey, }, "b", function() awful.util.spawn(browser) end), + -- awful.key({ modkey, }, "i", function() awful.util.spawn(icewe) end), + -- awful.key({ modkey }, "r", obvious.popup_run_prompt.run_prompt), + awful.key({ modkey, }, "c", function() awful.util.spawn(lock) end), + awful.key({ modkey, }, "t", function () awful.util.spawn(xterm) end), + awful.key({ modkey }, "i", function () awful.util.spawn(firefoxbeta) end), + awful.key({ modkey }, "o", function () awful.util.spawn(start) end), +-- Prompt + awful.key({ modkey }, "F1", function () mypromptbox[mouse.screen]:run() end), + awful.key({}, "#123", function () awful.util.spawn("amixer -q sset Master 5+", false) end), + awful.key({}, "#122", function () awful.util.spawn("amixer -q sset Master 5-", false) end), + -- Prompt + --awful.key({ modkey }, "F2", function () awful.prompt({ prompt = "Run: ", cursor_fg = fg_focus, cursor_bg = bg_focus }, mypromptbox, awful$ + -- end), + + awful.key({ modkey }, "F2", + function () + awful.prompt.run({ prompt = "Run: " }, + mypromptbox[mouse.screen].widget, + awful.util.spawn, + awful.completion.bash, + awful.util.getdir("cache") .. "/history") + 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, }, "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, + 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 = { instance = "Navigator" }, + properties = { tag = tags[1][2] } }, + { rule = { instance = "Firefox" }, + properties = { tag = tags[1][2] } }, + { rule = { class = "VirtualBox" }, + properties = { tag = tags[1][9] } }, + { rule = { class = "Pidgin" }, + properties = { tag = tags[1][5] } }, + { rule = { class = "emesene" }, + properties = { tag = tags[1][4] } }, + { rule = { class = "Controler.py" }, + properties = { tag = tags[1][4] } }, + { rule = { instance = "weechat" }, + properties = { tag = tags[1][4] } }, + { rule = { class = "weechat 0.3.0" }, + properties = { tag = tags[1][4] } }, + { rule = { class = "weechat-curses" }, + properties = { tag = tags[1][4] } }, + { rule = { class = "Mail" }, + properties = { tag = tags[1][6] } }, + { rule = { class = "Thunderbird" }, + properties = { tag = tags[1][6] } }, + { rule = { class = "Skype" }, + properties = { tag = tags[1][9] } }, + +} +-- }}} + +-- {{{ 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) +-- }}} diff --git a/rc.lua.backup b/rc.lua.backup new file mode 100644 index 0000000..860ec63 --- /dev/null +++ b/rc.lua.backup @@ -0,0 +1,535 @@ +-- Standard awesome library +require("awful") +-- Theme handling library +require("beautiful") +-- Notification library +require("naughty") +require("wicked") +-- Load Debian menu entries +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" +-- Uncommment this for a lighter theme +-- theme_path = "/usr/share/awesome/themes/sky/theme.lua" + +-- Actually load theme +beautiful.init(theme_path) + +-- This is used later as the default terminal and editor to run. +terminal = "x-terminal-emulator" +editor = os.getenv("EDITOR") or "editor" +editor_cmd = terminal .. " -e " .. editor +browser = "nautilus --no-desktop --browser" +initawesome = "sh /home/guerre/.awesomestart" +-- Widgets using wicked, modified by Comtom + +-- Grafico de uso de RAM +membarwidget = widget({ + type = 'progressbar', + name = 'membarwidget', + align = 'right' +}) + +membarwidget:bar_properties_set('mem', { +width = 40, +height = 0.65, +gap = 0, +border_padding = 1, +border_width = 1, +ticks_count = 0, +ticks_gap = 0, +vertical = false +}) + +membarwidget:bar_properties_set('mem', { +bg = '#333333', +fg = '#525C6B', +fg_center = '#525C6B', +fg_end = '#525C6B', +fg_off = '#333333', +border_color = '#0a0a0a', +reverse = false, +min_value = 0, +max_value = 100 +}) + +wicked.register(membarwidget, wicked.widgets.mem, '$1', 2, 'mem') + +-- Grafico de CPU +cpugraphwidget = widget({ + type = 'graph', + name = 'cpugraphwidget', + align = 'right' +}) + +cpugraphwidget.height = 0.85 +cpugraphwidget.width = 45 +cpugraphwidget.bg = '#333333' +cpugraphwidget.border_color = '#0a0a0a' +cpugraphwidget.grow = 'left' + +cpugraphwidget:plot_properties_set('cpu', { + fg = '#AEC6D8', + fg_center = '#285577', + fg_end = '#285577', + vertical_gradient = false +}) + +wicked.register(cpugraphwidget, wicked.widgets.cpu, '$1', 2, 'cpu') + +-- file system +fswidget = widget({ + type = 'textbox', + name = 'fswidget', + align = "right" +}) +wicked.register(fswidget, wicked.widgets.fs, + ' Disk / ${/ usep}% ', 30) + +-- 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.max, + 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 +-- the application class or instance. The instance is useful when running +-- a console app in a terminal like (Music on Console) +-- x-terminal-emulator -name mocp -e mocp +floatapps = +{ + -- by class + ["wicd-client.py"] = true, + ["MPlayer"] = true, + ["pinentry"] = true, + ["gimp"] = true, + -- by instance + ["mocp"] = true +} + +-- Applications to be moved to a pre-defined tag by class or instance. +-- Use the screen and tags indices. +apptags = +{ + ["Navigator"] = { screen = 1, tag = 2 }, + -- ["mocp"] = { screen = 2, tag = 4 }, + ["pidgin"] = { screen = 1, tag = 3 }, + ["xchat"] = { screen = 1, tag = 4 }, + ["xterm"] = { screen = 1, tag = 1 } + +} + +-- Define if we want to use titlebar on all applications. +use_titlebar = false +-- }}} + +-- {{{ Tags +tags_names = {"xterm", "www", "im", "irc", "media", "misc", "doc", "prog", "sys"} + + +-- Define tags table. +tags = {} +for s = 1, screen.count() do + -- Each screen has its own tag table. + tags[s] = {} + -- Create 9 tags per screen. + for tagnumber = 1, 9 do + --tags[s][tagnumber] = tag(tagnumber) version mas vieja ! + tags[s][tagnumber] = tag(tags_names[tagnumber]) + -- Add tags to screen one by one + tags[s][tagnumber].screen = s + awful.layout.set(layouts[1], tags[s][tagnumber]) + end + -- I'm sure you want to see at least one tag. + tags[s][1].selected = true + -- layout 5 para la tag 1 + awful.layout.set(layouts[5], tags[s][1]) +end +-- }}} + +-- {{{ Wibox +-- Create a textbox widget +mytextbox = widget({ type = "textbox", align = "right" }) +-- Set the default text in textbox +mytextbox.text = " " .. awesome.release .. " " + +-- 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.new({ items = { { "awesome", myawesomemenu, beautiful.awesome_icon }, + { "open terminal", terminal }, + { "Debian", debian.menu.Debian_menu.Debian }, + { "Nautilus", browser } + } + }) + +mylauncher = awful.widget.launcher({ image = image(beautiful.awesome_icon), + menu = mymainmenu }) + +-- Create a systray +mysystray = widget({ type = "systray", align = "right" }) + +-- 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, function (tag) tag.selected = not tag.selected end), + 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 + -- Create a promptbox for each screen + mypromptbox[s] = awful.widget.prompt({ align = "left" }) + -- Create an imagebox widget which will contains an icon indicating which layout we're using. + -- We need one layoutbox per screen. + mylayoutbox[s] = widget({ type = "imagebox", align = "right" }) + 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] = wibox({ position = "top", fg = beautiful.fg_normal, bg = beautiful.bg_normal }) + -- Add widgets to the wibox - order matters + mywibox[s].widgets = { mylauncher, + mytaglist[s], + mytasklist[s], + mypromptbox[s], + fswidget, + cpugraphwidget, + membarwidget, + mytextbox, + mylayoutbox[s], + s == 1 and mysystray or nil } + mywibox[s].screen = s +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(true) end), + + -- Layout manipulation + awful.key({ modkey, "Shift" }, "j", function () awful.client.swap.byidx( 1) end), + awful.key({ modkey, "Shift" }, "k", function () awful.client.swap.byidx( -1) end), + awful.key({ modkey, "Control" }, "j", function () awful.screen.focus( 1) end), + awful.key({ modkey, "Control" }, "k", function () awful.screen.focus(-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, }, "b", function() awful.util.spawn(browser) end), + awful.key({ modkey, }, "i", function() awful.util.spawn(initawesome) end), + -- Prompt + awful.key({ modkey }, "F1", function () mypromptbox[mouse.screen]:run() end), + + -- Prompt + --awful.key({ modkey }, "F2", function () awful.prompt({ prompt = "Run: ", cursor_fg = fg_focus, cursor_bg = bg_focus }, mypromptbox, awful.spawn, awful.completion.bash) + -- end), + + awful.key({ modkey }, "F2", + function () + awful.prompt.run({ prompt = "Run: " }, + mypromptbox[mouse.screen].widget, + awful.util.spawn, + awful.completion.bash, + awful.util.getdir("cache") .. "/history") + 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) +) + +-- Client awful tagging: this is useful to tag some clients and then do stuff like move to tag on them +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", awful.client.togglemarked), + 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 + +for i = 1, keynumber do + globalkeys = awful.util.table.join(globalkeys, + awful.key({ modkey }, i, + function () + local screen = mouse.screen + if tags[screen][i] then + awful.tag.viewonly(tags[screen][i]) + end + end), + awful.key({ modkey, "Control" }, i, + function () + local screen = mouse.screen + if tags[screen][i] then + tags[screen][i].selected = not tags[screen][i].selected + end + end), + awful.key({ modkey, "Shift" }, i, + 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, + function () + if client.focus and tags[client.focus.screen][i] then + awful.client.toggletag(tags[client.focus.screen][i]) + end + end), + awful.key({ modkey, "Shift" }, "F" .. i, + function () + local screen = mouse.screen + if tags[screen][i] then + for k, c in pairs(awful.client.getmarked()) do + awful.client.movetotag(tags[screen][i], c) + end + end + end)) +end + +-- Set keys +root.keys(globalkeys) +-- }}} + +-- {{{ Hooks +-- Hook function to execute when focusing a client. +awful.hooks.focus.register(function (c) + if not awful.client.ismarked(c) then + c.border_color = beautiful.border_focus + end +end) + +-- Hook function to execute when unfocusing a client. +awful.hooks.unfocus.register(function (c) + if not awful.client.ismarked(c) then + c.border_color = beautiful.border_normal + end +end) + +-- Hook function to execute when marking a client +awful.hooks.marked.register(function (c) + c.border_color = beautiful.border_marked +end) + +-- Hook function to execute when unmarking a client. +awful.hooks.unmarked.register(function (c) + c.border_color = beautiful.border_focus +end) + +-- Hook function to execute when the mouse enters a client. +awful.hooks.mouse_enter.register(function (c) + -- Sloppy focus, but disabled for magnifier layout + if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier + and awful.client.focus.filter(c) then + client.focus = c + end +end) + +-- Hook function to execute when a new client appears. +awful.hooks.manage.register(function (c, startup) + -- If we are not managing this application at startup, + -- move it to the screen where the mouse is. + -- We only do it for filtered windows (i.e. no dock, etc). + if not startup and awful.client.focus.filter(c) then + c.screen = mouse.screen + end + + if use_titlebar then + -- Add a titlebar + awful.titlebar.add(c, { modkey = modkey }) + end + -- Add mouse bindings + c:buttons(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) + )) + -- New client may not receive focus + -- if they're not focusable, so set border anyway. + c.border_width = beautiful.border_width + c.border_color = beautiful.border_normal + + -- Check if the application should be floating. + local cls = c.class + local inst = c.instance + if floatapps[cls] ~= nil then + awful.client.floating.set(c, floatapps[cls]) + elseif floatapps[inst] ~= nil then + awful.client.floating.set(c, floatapps[inst]) + end + + -- Check application->screen/tag mappings. + local target + if apptags[cls] then + target = apptags[cls] + elseif apptags[inst] then + target = apptags[inst] + end + if target then + c.screen = target.screen + awful.client.movetotag(tags[target.screen][target.tag], c) + end + + -- Do this after tag mapping, so you don't see it on the wrong tag for a split second. + client.focus = c + + -- Set key bindings + c:keys(clientkeys) + + -- Set the windows at the slave, + -- i.e. put it at the end of others instead of setting it master. + -- 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 +end) + +-- Hook function to execute when arranging the screen. +-- (tag switch, new client, etc) +awful.hooks.arrange.register(function (screen) + local layout = awful.layout.getname(awful.layout.get(screen)) + if layout and beautiful["layout_" ..layout] then + mylayoutbox[screen].image = image(beautiful["layout_" .. layout]) + else + mylayoutbox[screen].image = nil + end + + -- Give focus to the latest client in history if no window has focus + -- or if the current window is a desktop or a dock one. + if not client.focus then + local c = awful.client.focus.history.get(screen, 0) + if c then client.focus = c end + end +end) + +-- Hook called every minute +awful.hooks.timer.register(60, function () + mytextbox.text = os.date(" %a %b %d, %H:%M ") +end) +-- }}} diff --git a/rc.lua.backup2410 b/rc.lua.backup2410 new file mode 100644 index 0000000..4b14b14 --- /dev/null +++ b/rc.lua.backup2410 @@ -0,0 +1,500 @@ +-- Standard awesome library +require("awful") +-- Theme handling library +require("beautiful") +-- Notification library +require("naughty") +require("wicked") +--require("obvious") +-- Load Debian menu entries +require("debian.menu") +--obvious +--require("obvious.popup_run_prompt") +--require("obvious.battery") +--require("obvious.wlan") +--require("obvious.clock") +--require("obvious.volume_alsa") +--require("obvious.net") +-- {{{ Variable definitions +-- Themes define colours, icons, and wallpapers +-- The default is a dark theme +theme_path = "/usr/share/awesome/themes/default/theme.lua" +-- Uncommment this for a lighter theme +-- theme_path = "/usr/share/awesome/themes/sky/theme.lua" + +-- Actually load theme +beautiful.init(theme_path) + +-- This is used later as the default terminal and editor to run. +terminal = "x-terminal-emulator" +editor = os.getenv("EDITOR") or "editor" +editor_cmd = terminal .. " -e " .. editor +browser = "nautilus --no-desktop --browser" +initawesome = "sh /home/guerre/.awesomestart" +icewe= "iceweasel" +lock= "sh /home/guerre/lock" +brilloup= "sh /home/guerre/scripts/video_brightnessup.sh" +brillodown= "sh /home/guerre/scripts/video_brightnessdown.sh" +-- Widgets using wicked, modified by Comtom + +os.execute("/home/guerre/.awesomestart") + + +-- 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.max, + 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 +-- the application class or instance. The instance is useful when running +-- a console app in a terminal like (Music on Console) +-- x-terminal-emulator -name mocp -e mocp +floatapps = +{ + -- by class + ["wicd-client.py"] = true, + ["MPlayer"] = true, + ["pinentry"] = true, + ["gimp"] = true, + ["nautilus"] = true, + -- by instance + ["mocp"] = true +} + +-- Applications to be moved to a pre-defined tag by class or instance. +-- Use the screen and tags indices. +apptags = +{ + ["Navigator"] = { screen = 1, tag = 2 }, + -- ["mocp"] = { screen = 2, tag = 4 }, + ["pidgin"] = { screen = 1, tag = 3 }, + --["xchat"] = { screen = 1, tag = 4 }, + -- ["xterm"] = { screen = 1, tag = 1 } + ["ocp"] = { screen = 1, tag = 1 }, + ["alsamixer"] = { screen = 1, tag = 1 }, + ["htop"] = { screen = 1, tag = 1 }, + ["screen"] = { screen = 1, tag = 1 }, + ["VirtualBox"] = { screen =1, tag = 9 } + + + +} + +-- Define if we want to use titlebar on all applications. +use_titlebar = false +-- }}} + +-- {{{ Tags +tags_names = {"xterm", "www", "im", "work", "media", "misc", "doc", "prog", "vbox"} + + +-- Define tags table. +tags = {} +for s = 1, screen.count() do + -- Each screen has its own tag table. + tags[s] = {} + -- Create 9 tags per screen. + for tagnumber = 1, 9 do + --tags[s][tagnumber] = tag(tagnumber) version mas vieja ! + tags[s][tagnumber] = tag(tags_names[tagnumber]) + -- Add tags to screen one by one + tags[s][tagnumber].screen = s + awful.layout.set(layouts[1], tags[s][tagnumber]) + end + -- I'm sure you want to see at least one tag. + tags[s][1].selected = true + -- layout 5 para la tag 1 + awful.layout.set(layouts[5], tags[s][1]) + -- awful.layou.set(layouts[10], tags[s][2]) +end +-- }}} + +-- {{{ Wibox +-- Create a textbox widget +mytextbox = widget({ type = "textbox", align = "right" }) +-- Set the default text in textbox +mytextbox.text = " " .. awesome.release .. " " + +-- 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.new({ items = { { "awesome", myawesomemenu, beautiful.awesome_icon }, + { "open terminal", terminal }, + { "Debian", debian.menu.Debian_menu.Debian }, + { "Nautilus", browser } + } + }) + +mylauncher = awful.widget.launcher({ image = image(beautiful.awesome_icon), + menu = mymainmenu }) + +-- Create a systray +mysystray = widget({ type = "systray", align = "right" }) + +-- 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, function (tag) tag.selected = not tag.selected end), + 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 + -- Create a promptbox for each screen + mypromptbox[s] = awful.widget.prompt({ align = "left" }) + -- Create an imagebox widget which will contains an icon indicating which layout we're using. + -- We need one layoutbox per screen. + mylayoutbox[s] = widget({ type = "imagebox", align = "right" }) + 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] = wibox({ position = "top", fg = beautiful.fg_normal, bg = beautiful.bg_normal }) + -- Add widgets to the wibox - order matters + mywibox[s].widgets = { mylauncher, + mytaglist[s], + mytasklist[s], + mypromptbox[s], + -- obvious.battery(), + --obvious.volume_alsa(), + --obvious.wlan(), + -- obvious.net(), + --obvious.clock(), + mytextbox, + mylayoutbox[s], + s == 1 and mysystray or nil } + mywibox[s].screen = s +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(true) end), + + -- Layout manipulation + awful.key({ modkey, "Shift" }, "j", function () awful.client.swap.byidx( 1) end), + awful.key({ modkey, "Shift" }, "k", function () awful.client.swap.byidx( -1) end), + awful.key({ modkey, "Control" }, "j", function () awful.screen.focus( 1) end), + awful.key({ modkey, "Control" }, "k", function () awful.screen.focus(-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, }, "b", function() awful.util.spawn(browser) end), + awful.key({ modkey, }, "i", function() awful.util.spawn(icewe) end), + awful.key({ modkey }, "r", obvious.popup_run_prompt.run_prompt), + awful.key({ modkey, }, "c", function() awful.util.spawn(lock) end), + awful.key({}, "XF86MonBrightnessUp", function () awful.util.spawn(brilloup) end), + awful.key({}, "XF86MonBrightnessDown", function () awful.util.spawn(brillodown) end), +-- Prompt + awful.key({ modkey }, "F1", function () mypromptbox[mouse.screen]:run() end), + + -- Prompt + --awful.key({ modkey }, "F2", function () awful.prompt({ prompt = "Run: ", cursor_fg = fg_focus, cursor_bg = bg_focus }, mypromptbox, awful.spawn, awful.completion.bash) + -- end), + + awful.key({ modkey }, "F2", + function () + awful.prompt.run({ prompt = "Run: " }, + mypromptbox[mouse.screen].widget, + awful.util.spawn, + awful.completion.bash, + awful.util.getdir("cache") .. "/history") + 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) +) + +-- Client awful tagging: this is useful to tag some clients and then do stuff like move to tag on them +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", awful.client.togglemarked), + 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 + +for i = 1, keynumber do + globalkeys = awful.util.table.join(globalkeys, + awful.key({ modkey }, i, + function () + local screen = mouse.screen + if tags[screen][i] then + awful.tag.viewonly(tags[screen][i]) + end + end), + awful.key({ modkey, "Control" }, i, + function () + local screen = mouse.screen + if tags[screen][i] then + tags[screen][i].selected = not tags[screen][i].selected + end + end), + awful.key({ modkey, "Shift" }, i, + 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, + function () + if client.focus and tags[client.focus.screen][i] then + awful.client.toggletag(tags[client.focus.screen][i]) + end + end), + awful.key({ modkey, "Shift" }, "F" .. i, + function () + local screen = mouse.screen + if tags[screen][i] then + for k, c in pairs(awful.client.getmarked()) do + awful.client.movetotag(tags[screen][i], c) + end + end + end)) +end + +-- Set keys +root.keys(globalkeys) +-- }}} + +-- {{{ Hooks +-- Hook function to execute when focusing a client. +awful.hooks.focus.register(function (c) + if not awful.client.ismarked(c) then + c.border_color = beautiful.border_focus + end +end) + +-- Hook function to execute when unfocusing a client. +awful.hooks.unfocus.register(function (c) + if not awful.client.ismarked(c) then + c.border_color = beautiful.border_normal + end +end) + +-- Hook function to execute when marking a client +awful.hooks.marked.register(function (c) + c.border_color = beautiful.border_marked +end) + +-- Hook function to execute when unmarking a client. +awful.hooks.unmarked.register(function (c) + c.border_color = beautiful.border_focus +end) + +-- Hook function to execute when the mouse enters a client. +awful.hooks.mouse_enter.register(function (c) + -- Sloppy focus, but disabled for magnifier layout + if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier + and awful.client.focus.filter(c) then + client.focus = c + end +end) + +-- Hook function to execute when a new client appears. +awful.hooks.manage.register(function (c, startup) + -- If we are not managing this application at startup, + -- move it to the screen where the mouse is. + -- We only do it for filtered windows (i.e. no dock, etc). + if not startup and awful.client.focus.filter(c) then + c.screen = mouse.screen + end + + if use_titlebar then + -- Add a titlebar + awful.titlebar.add(c, { modkey = modkey }) + end + -- Add mouse bindings + c:buttons(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) + )) + -- New client may not receive focus + -- if they're not focusable, so set border anyway. + c.border_width = beautiful.border_width + c.border_color = beautiful.border_normal + + -- Check if the application should be floating. + local cls = c.class + local inst = c.instance + if floatapps[cls] ~= nil then + awful.client.floating.set(c, floatapps[cls]) + elseif floatapps[inst] ~= nil then + awful.client.floating.set(c, floatapps[inst]) + end + + -- Check application->screen/tag mappings. + local target + if apptags[cls] then + target = apptags[cls] + elseif apptags[inst] then + target = apptags[inst] + end + if target then + c.screen = target.screen + awful.client.movetotag(tags[target.screen][target.tag], c) + end + + -- Do this after tag mapping, so you don't see it on the wrong tag for a split second. + client.focus = c + + -- Set key bindings + c:keys(clientkeys) + + -- Set the windows at the slave, + -- i.e. put it at the end of others instead of setting it master. + -- 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 +end) + +-- Hook function to execute when arranging the screen. +-- (tag switch, new client, etc) +awful.hooks.arrange.register(function (screen) + local layout = awful.layout.getname(awful.layout.get(screen)) + if layout and beautiful["layout_" ..layout] then + mylayoutbox[screen].image = image(beautiful["layout_" .. layout]) + else + mylayoutbox[screen].image = nil + end + + -- Give focus to the latest client in history if no window has focus + -- or if the current window is a desktop or a dock one. + if not client.focus then + local c = awful.client.focus.history.get(screen, 0) + if c then client.focus = c end + end +end) + +-- Hook called every minute +awful.hooks.timer.register(60, function () + mytextbox.text = os.date(" %a %b %d, %H:%M ") +end) +-- }}} diff --git a/rc.lua.backup2410.1 b/rc.lua.backup2410.1 new file mode 100644 index 0000000..db5609f --- /dev/null +++ b/rc.lua.backup2410.1 @@ -0,0 +1,500 @@ +-- Standard awesome library +require("awful") +-- Theme handling library +require("beautiful") +-- Notification library +require("naughty") +require("wicked") +require("obvious") +-- Load Debian menu entries +require("debian.menu") +--obvious +require("obvious.popup_run_prompt") +require("obvious.battery") +--require("obvious.wlan") +require("obvious.clock") +require("obvious.volume_alsa") +--require("obvious.net") +-- {{{ Variable definitions +-- Themes define colours, icons, and wallpapers +-- The default is a dark theme +theme_path = "/usr/share/awesome/themes/default/theme.lua" +-- Uncommment this for a lighter theme +-- theme_path = "/usr/share/awesome/themes/sky/theme.lua" + +-- Actually load theme +beautiful.init(theme_path) + +-- This is used later as the default terminal and editor to run. +terminal = "x-terminal-emulator" +editor = os.getenv("EDITOR") or "editor" +editor_cmd = terminal .. " -e " .. editor +browser = "nautilus --no-desktop --browser" +initawesome = "sh /home/guerre/.awesomestart" +icewe= "iceweasel" +lock= "sh /home/guerre/lock" +brilloup= "sh /home/guerre/scripts/video_brightnessup.sh" +brillodown= "sh /home/guerre/scripts/video_brightnessdown.sh" +-- Widgets using wicked, modified by Comtom + +os.execute("/home/guerre/.awesomestart") + + +-- 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.max, + 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 +-- the application class or instance. The instance is useful when running +-- a console app in a terminal like (Music on Console) +-- x-terminal-emulator -name mocp -e mocp +floatapps = +{ + -- by class + ["wicd-client.py"] = true, + ["MPlayer"] = true, + ["pinentry"] = true, + ["gimp"] = true, + ["nautilus"] = true, + -- by instance + ["mocp"] = true +} + +-- Applications to be moved to a pre-defined tag by class or instance. +-- Use the screen and tags indices. +apptags = +{ + ["Navigator"] = { screen = 1, tag = 2 }, + -- ["mocp"] = { screen = 2, tag = 4 }, + ["pidgin"] = { screen = 1, tag = 3 }, + --["xchat"] = { screen = 1, tag = 4 }, + -- ["xterm"] = { screen = 1, tag = 1 } + ["ocp"] = { screen = 1, tag = 1 }, + ["alsamixer"] = { screen = 1, tag = 1 }, + ["htop"] = { screen = 1, tag = 1 }, + ["screen"] = { screen = 1, tag = 1 }, + ["VirtualBox"] = { screen =1, tag = 9 } + + + +} + +-- Define if we want to use titlebar on all applications. +use_titlebar = false +-- }}} + +-- {{{ Tags +tags_names = {"xterm", "www", "im", "work", "media", "misc", "doc", "prog", "vbox"} + + +-- Define tags table. +tags = {} +for s = 1, screen.count() do + -- Each screen has its own tag table. + tags[s] = {} + -- Create 9 tags per screen. + for tagnumber = 1, 9 do + --tags[s][tagnumber] = tag(tagnumber) version mas vieja ! + tags[s][tagnumber] = tag(tags_names[tagnumber]) + -- Add tags to screen one by one + tags[s][tagnumber].screen = s + awful.layout.set(layouts[1], tags[s][tagnumber]) + end + -- I'm sure you want to see at least one tag. + tags[s][1].selected = true + -- layout 5 para la tag 1 + awful.layout.set(layouts[5], tags[s][1]) + -- awful.layou.set(layouts[10], tags[s][2]) +end +-- }}} + +-- {{{ Wibox +-- Create a textbox widget +mytextbox = widget({ type = "textbox", align = "right" }) +-- Set the default text in textbox +mytextbox.text = " " .. awesome.release .. " " + +-- 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.new({ items = { { "awesome", myawesomemenu, beautiful.awesome_icon }, + { "open terminal", terminal }, + { "Debian", debian.menu.Debian_menu.Debian }, + { "Nautilus", browser } + } + }) + +mylauncher = awful.widget.launcher({ image = image(beautiful.awesome_icon), + menu = mymainmenu }) + +-- Create a systray +mysystray = widget({ type = "systray", align = "right" }) + +-- 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, function (tag) tag.selected = not tag.selected end), + 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 + -- Create a promptbox for each screen + mypromptbox[s] = awful.widget.prompt({ align = "left" }) + -- Create an imagebox widget which will contains an icon indicating which layout we're using. + -- We need one layoutbox per screen. + mylayoutbox[s] = widget({ type = "imagebox", align = "right" }) + 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] = wibox({ position = "top", fg = beautiful.fg_normal, bg = beautiful.bg_normal }) + -- Add widgets to the wibox - order matters + mywibox[s].widgets = { mylauncher, + mytaglist[s], + mytasklist[s], + mypromptbox[s], + obvious.battery(), + obvious.volume_alsa(), + --obvious.wlan(), + -- obvious.net(), + --obvious.clock(), + mytextbox, + mylayoutbox[s], + s == 1 and mysystray or nil } + mywibox[s].screen = s +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(true) end), + + -- Layout manipulation + awful.key({ modkey, "Shift" }, "j", function () awful.client.swap.byidx( 1) end), + awful.key({ modkey, "Shift" }, "k", function () awful.client.swap.byidx( -1) end), + awful.key({ modkey, "Control" }, "j", function () awful.screen.focus( 1) end), + awful.key({ modkey, "Control" }, "k", function () awful.screen.focus(-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, }, "b", function() awful.util.spawn(browser) end), + awful.key({ modkey, }, "i", function() awful.util.spawn(icewe) end), + awful.key({ modkey }, "r", obvious.popup_run_prompt.run_prompt), + awful.key({ modkey, }, "c", function() awful.util.spawn(lock) end), + awful.key({}, "XF86MonBrightnessUp", function () awful.util.spawn(brilloup) end), + awful.key({}, "XF86MonBrightnessDown", function () awful.util.spawn(brillodown) end), +-- Prompt + awful.key({ modkey }, "F1", function () mypromptbox[mouse.screen]:run() end), + + -- Prompt + --awful.key({ modkey }, "F2", function () awful.prompt({ prompt = "Run: ", cursor_fg = fg_focus, cursor_bg = bg_focus }, mypromptbox, awful.spawn, awful.completion.bash) + -- end), + + awful.key({ modkey }, "F2", + function () + awful.prompt.run({ prompt = "Run: " }, + mypromptbox[mouse.screen].widget, + awful.util.spawn, + awful.completion.bash, + awful.util.getdir("cache") .. "/history") + 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) +) + +-- Client awful tagging: this is useful to tag some clients and then do stuff like move to tag on them +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", awful.client.togglemarked), + 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 + +for i = 1, keynumber do + globalkeys = awful.util.table.join(globalkeys, + awful.key({ modkey }, i, + function () + local screen = mouse.screen + if tags[screen][i] then + awful.tag.viewonly(tags[screen][i]) + end + end), + awful.key({ modkey, "Control" }, i, + function () + local screen = mouse.screen + if tags[screen][i] then + tags[screen][i].selected = not tags[screen][i].selected + end + end), + awful.key({ modkey, "Shift" }, i, + 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, + function () + if client.focus and tags[client.focus.screen][i] then + awful.client.toggletag(tags[client.focus.screen][i]) + end + end), + awful.key({ modkey, "Shift" }, "F" .. i, + function () + local screen = mouse.screen + if tags[screen][i] then + for k, c in pairs(awful.client.getmarked()) do + awful.client.movetotag(tags[screen][i], c) + end + end + end)) +end + +-- Set keys +root.keys(globalkeys) +-- }}} + +-- {{{ Hooks +-- Hook function to execute when focusing a client. +awful.hooks.focus.register(function (c) + if not awful.client.ismarked(c) then + c.border_color = beautiful.border_focus + end +end) + +-- Hook function to execute when unfocusing a client. +awful.hooks.unfocus.register(function (c) + if not awful.client.ismarked(c) then + c.border_color = beautiful.border_normal + end +end) + +-- Hook function to execute when marking a client +awful.hooks.marked.register(function (c) + c.border_color = beautiful.border_marked +end) + +-- Hook function to execute when unmarking a client. +awful.hooks.unmarked.register(function (c) + c.border_color = beautiful.border_focus +end) + +-- Hook function to execute when the mouse enters a client. +awful.hooks.mouse_enter.register(function (c) + -- Sloppy focus, but disabled for magnifier layout + if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier + and awful.client.focus.filter(c) then + client.focus = c + end +end) + +-- Hook function to execute when a new client appears. +awful.hooks.manage.register(function (c, startup) + -- If we are not managing this application at startup, + -- move it to the screen where the mouse is. + -- We only do it for filtered windows (i.e. no dock, etc). + if not startup and awful.client.focus.filter(c) then + c.screen = mouse.screen + end + + if use_titlebar then + -- Add a titlebar + awful.titlebar.add(c, { modkey = modkey }) + end + -- Add mouse bindings + c:buttons(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) + )) + -- New client may not receive focus + -- if they're not focusable, so set border anyway. + c.border_width = beautiful.border_width + c.border_color = beautiful.border_normal + + -- Check if the application should be floating. + local cls = c.class + local inst = c.instance + if floatapps[cls] ~= nil then + awful.client.floating.set(c, floatapps[cls]) + elseif floatapps[inst] ~= nil then + awful.client.floating.set(c, floatapps[inst]) + end + + -- Check application->screen/tag mappings. + local target + if apptags[cls] then + target = apptags[cls] + elseif apptags[inst] then + target = apptags[inst] + end + if target then + c.screen = target.screen + awful.client.movetotag(tags[target.screen][target.tag], c) + end + + -- Do this after tag mapping, so you don't see it on the wrong tag for a split second. + client.focus = c + + -- Set key bindings + c:keys(clientkeys) + + -- Set the windows at the slave, + -- i.e. put it at the end of others instead of setting it master. + -- 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 +end) + +-- Hook function to execute when arranging the screen. +-- (tag switch, new client, etc) +awful.hooks.arrange.register(function (screen) + local layout = awful.layout.getname(awful.layout.get(screen)) + if layout and beautiful["layout_" ..layout] then + mylayoutbox[screen].image = image(beautiful["layout_" .. layout]) + else + mylayoutbox[screen].image = nil + end + + -- Give focus to the latest client in history if no window has focus + -- or if the current window is a desktop or a dock one. + if not client.focus then + local c = awful.client.focus.history.get(screen, 0) + if c then client.focus = c end + end +end) + +-- Hook called every minute +awful.hooks.timer.register(60, function () + mytextbox.text = os.date(" %a %b %d, %H:%M ") +end) +-- }}} diff --git a/rc.lua.dual b/rc.lua.dual new file mode 100644 index 0000000..8a8416e --- /dev/null +++ b/rc.lua.dual @@ -0,0 +1,598 @@ +-- Standard awesome library +require("awful") +-- Theme handling library +require("beautiful") +-- Notification library +require("naughty") +require("wicked") +-- Load Debian menu entries +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" +-- Uncommment this for a lighter theme +-- theme_path = "/usr/share/awesome/themes/sky/theme.lua" + + +-- Actually load theme +beautiful.init(theme_path) + +-- This is used later as the default terminal and editor to run. +terminal = "x-terminal-emulator" +editor = os.getenv("EDITOR") or "editor" +editor_cmd = terminal .. " -e " .. editor +browser = "nautilus --no-desktop --browser" +initawesome = "sh /home/guerre/.awesomestart" + +os.execute("/home/guerre/.awesomestart") +wallpaper_cmd = { "awsetbg -f /home/guerre/Imágenes/San_Diego_Reflecting_Pond-1280x800.jpg" } + +-- Widgets using wicked, modified by Comtom +-- Widgets using wicked +-- Merory usage +memwidget = widget({ + type = 'textbox', + name = 'memwidget', + align = "right" +}) +wicked.register(memwidget, wicked.widgets.mem, + ' RAM: $1% ($2Mb/$3Mb) || ') + +--date +datewidget = widget({ + type = 'textbox', + name = 'datewidget', +}) +wicked.register(datewidget, wicked.widgets.date, + ' %c') + +-- file system +fswidget = widget({ + type = 'textbox', + name = 'fswidget', + align = "right" +}) +wicked.register(fswidget, wicked.widgets.fs, + ' DiskUsage: /root ${/ usep}% , /home ${/home usep}% (${/home used}/${/home size}) || ', 30) + +-- cpu +cpuwidget = widget({ + type = 'textbox', + name = 'cpuwidget', + align = "right" +}) +wicked.register(cpuwidget, wicked.widgets.cpu, + ' CPU: $1% $2% || ') + +-- net +netwidget = widget({ + type = 'textbox', + name = 'netwidget', + align = "right" +}) +wicked.register(netwidget, wicked.widgets.net, + ' NET: ${wlan0 down}/${wlan0 up} (${wlan0 rx}/${wlan0 tx})', +nil, nil, 3) + +-- statebar in the bottom +mystatebar = wibox( {position = "bottom", fg = beautiful.fg_normal, bg = beautiful.bg_normal} ) +mystatebar.widgets = { + datewidget, + fswidget, + cpuwidget, + memwidget, + netwidget, +} +mystatebar.screen = 1 + + + +-- Grafico de uso de RAM +membarwidget = widget({ + type = 'progressbar', + name = 'membarwidget', + align = 'right' +}) + +membarwidget:bar_properties_set('mem', { +width = 40, +height = 0.65, +gap = 0, +border_padding = 1, +border_width = 1, +ticks_count = 0, +ticks_gap = 0, +vertical = false +}) + +membarwidget:bar_properties_set('mem', { +bg = '#333333', +fg = '#525C6B', +fg_center = '#525C6B', +fg_end = '#525C6B', +fg_off = '#333333', +border_color = '#0a0a0a', +reverse = false, +min_value = 0, +max_value = 100 +}) + +wicked.register(membarwidget, wicked.widgets.mem, '$1', 2, 'mem') + +-- Grafico de CPU +cpugraphwidget = widget({ + type = 'graph', + name = 'cpugraphwidget', + align = 'right' +}) + +cpugraphwidget.height = 0.85 +cpugraphwidget.width = 45 +cpugraphwidget.bg = '#333333' +cpugraphwidget.border_color = '#0a0a0a' +cpugraphwidget.grow = 'left' + +cpugraphwidget:plot_properties_set('cpu', { + fg = '#AEC6D8', + fg_center = '#285577', + fg_end = '#285577', + vertical_gradient = false +}) + +wicked.register(cpugraphwidget, wicked.widgets.cpu, '$1', 2, 'cpu') + +-- file system +fswidget = widget({ + type = 'textbox', + name = 'fswidget', + align = "right" +}) +wicked.register(fswidget, wicked.widgets.fs, + ' Disk / ${/ usep}% ', 30) + +-- 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.max, + 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 +-- the application class or instance. The instance is useful when running +-- a console app in a terminal like (Music on Console) +-- x-terminal-emulator -name mocp -e mocp +floatapps = +{ + -- by class + ["wicd-client.py"] = true, + ["MPlayer"] = true, + ["pinentry"] = true, + ["gimp"] = true, + -- by instance + ["mocp"] = true +} + +-- Applications to be moved to a pre-defined tag by class or instance. +-- Use the screen and tags indices. +apptags = +{ + ["Navigator"] = { screen = 1, tag = 2 }, + -- ["mocp"] = { screen = 2, tag = 4 }, + ["pidgin"] = { screen = 1, tag = 3 }, + ["xchat"] = { screen = 1, tag = 4 }, + ["xterm"] = { screen = 1, tag = 1 } + +} + +-- Define if we want to use titlebar on all applications. +use_titlebar = false +-- }}} + +-- {{{ Tags +tags_names = {"xterm", "www", "im", "irc", "media", "misc", "doc", "prog", "sys"} + + +-- Define tags table. +tags = {} +for s = 1, screen.count() do + -- Each screen has its own tag table. + tags[s] = {} + -- Create 9 tags per screen. + for tagnumber = 1, 9 do + --tags[s][tagnumber] = tag(tagnumber) version mas vieja ! + tags[s][tagnumber] = tag(tags_names[tagnumber]) + -- Add tags to screen one by one + tags[s][tagnumber].screen = s + awful.layout.set(layouts[1], tags[s][tagnumber]) + end + -- I'm sure you want to see at least one tag. + tags[s][1].selected = true + -- layout 5 para la tag 1 + awful.layout.set(layouts[5], tags[s][1]) +end +-- }}} + +-- {{{ Wibox +-- Create a textbox widget +mytextbox = widget({ type = "textbox", align = "right" }) +-- Set the default text in textbox +mytextbox.text = " " .. awesome.release .. " " + +-- 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.new({ items = { { "awesome", myawesomemenu, beautiful.awesome_icon }, + { "open terminal", terminal }, + { "Debian", debian.menu.Debian_menu.Debian }, + { "Nautilus", browser } + } + }) + +mylauncher = awful.widget.launcher({ image = image(beautiful.awesome_icon), + menu = mymainmenu }) + +-- Create a systray +mysystray = widget({ type = "systray", align = "right" }) + +-- 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, function (tag) tag.selected = not tag.selected end), + 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 + -- Create a promptbox for each screen + mypromptbox[s] = awful.widget.prompt({ align = "left" }) + -- Create an imagebox widget which will contains an icon indicating which layout we're using. + -- We need one layoutbox per screen. + mylayoutbox[s] = widget({ type = "imagebox", align = "right" }) + 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] = wibox({ position = "top", fg = beautiful.fg_normal, bg = beautiful.bg_normal }) + -- Add widgets to the wibox - order matters + mywibox[s].widgets = { mylauncher, + mytaglist[s], + mytasklist[s], + mypromptbox[s], + fswidget, + cpugraphwidget, + membarwidget, + mytextbox, + mylayoutbox[s], + s == 1 and mysystray or nil } + mywibox[s].screen = s +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(true) end), + + -- Layout manipulation + awful.key({ modkey, "Shift" }, "j", function () awful.client.swap.byidx( 1) end), + awful.key({ modkey, "Shift" }, "k", function () awful.client.swap.byidx( -1) end), + awful.key({ modkey, "Control" }, "j", function () awful.screen.focus( 1) end), + awful.key({ modkey, "Control" }, "k", function () awful.screen.focus(-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, }, "b", function() awful.util.spawn(browser) end), + awful.key({ modkey, }, "i", function() awful.util.spawn(initawesome) end), + -- Prompt + awful.key({ modkey }, "F1", function () mypromptbox[mouse.screen]:run() end), + + -- Prompt + --awful.key({ modkey }, "F2", function () awful.prompt({ prompt = "Run: ", cursor_fg = fg_focus, cursor_bg = bg_focus }, mypromptbox, awful.spawn, awful.completion.bash) + -- end), + + awful.key({ modkey }, "F2", + function () + awful.prompt.run({ prompt = "Run: " }, + mypromptbox[mouse.screen].widget, + awful.util.spawn, + awful.completion.bash, + awful.util.getdir("cache") .. "/history") + 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) +) + +-- Client awful tagging: this is useful to tag some clients and then do stuff like move to tag on them +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", awful.client.togglemarked), + 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 + +for i = 1, keynumber do + globalkeys = awful.util.table.join(globalkeys, + awful.key({ modkey }, i, + function () + local screen = mouse.screen + if tags[screen][i] then + awful.tag.viewonly(tags[screen][i]) + end + end), + awful.key({ modkey, "Control" }, i, + function () + local screen = mouse.screen + if tags[screen][i] then + tags[screen][i].selected = not tags[screen][i].selected + end + end), + awful.key({ modkey, "Shift" }, i, + 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, + function () + if client.focus and tags[client.focus.screen][i] then + awful.client.toggletag(tags[client.focus.screen][i]) + end + end), + awful.key({ modkey, "Shift" }, "F" .. i, + function () + local screen = mouse.screen + if tags[screen][i] then + for k, c in pairs(awful.client.getmarked()) do + awful.client.movetotag(tags[screen][i], c) + end + end + end)) +end + +-- Set keys +root.keys(globalkeys) +-- }}} + +-- {{{ Hooks +-- Hook function to execute when focusing a client. +awful.hooks.focus.register(function (c) + if not awful.client.ismarked(c) then + c.border_color = beautiful.border_focus + end +end) + +-- Hook function to execute when unfocusing a client. +awful.hooks.unfocus.register(function (c) + if not awful.client.ismarked(c) then + c.border_color = beautiful.border_normal + end +end) + +-- Hook function to execute when marking a client +awful.hooks.marked.register(function (c) + c.border_color = beautiful.border_marked +end) + +-- Hook function to execute when unmarking a client. +awful.hooks.unmarked.register(function (c) + c.border_color = beautiful.border_focus +end) + +-- Hook function to execute when the mouse enters a client. +awful.hooks.mouse_enter.register(function (c) + -- Sloppy focus, but disabled for magnifier layout + if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier + and awful.client.focus.filter(c) then + client.focus = c + end +end) + +-- Hook function to execute when a new client appears. +awful.hooks.manage.register(function (c, startup) + -- If we are not managing this application at startup, + -- move it to the screen where the mouse is. + -- We only do it for filtered windows (i.e. no dock, etc). + if not startup and awful.client.focus.filter(c) then + c.screen = mouse.screen + end + + if use_titlebar then + -- Add a titlebar + awful.titlebar.add(c, { modkey = modkey }) + end + -- Add mouse bindings + c:buttons(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) + )) + -- New client may not receive focus + -- if they're not focusable, so set border anyway. + c.border_width = beautiful.border_width + c.border_color = beautiful.border_normal + + -- Check if the application should be floating. + local cls = c.class + local inst = c.instance + if floatapps[cls] ~= nil then + awful.client.floating.set(c, floatapps[cls]) + elseif floatapps[inst] ~= nil then + awful.client.floating.set(c, floatapps[inst]) + end + + -- Check application->screen/tag mappings. + local target + if apptags[cls] then + target = apptags[cls] + elseif apptags[inst] then + target = apptags[inst] + end + if target then + c.screen = target.screen + awful.client.movetotag(tags[target.screen][target.tag], c) + end + + -- Do this after tag mapping, so you don't see it on the wrong tag for a split second. + client.focus = c + + -- Set key bindings + c:keys(clientkeys) + + -- Set the windows at the slave, + -- i.e. put it at the end of others instead of setting it master. + -- 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 +end) + +-- Hook function to execute when arranging the screen. +-- (tag switch, new client, etc) +awful.hooks.arrange.register(function (screen) + local layout = awful.layout.getname(awful.layout.get(screen)) + if layout and beautiful["layout_" ..layout] then + mylayoutbox[screen].image = image(beautiful["layout_" .. layout]) + else + mylayoutbox[screen].image = nil + end + + -- Give focus to the latest client in history if no window has focus + -- or if the current window is a desktop or a dock one. + if not client.focus then + local c = awful.client.focus.history.get(screen, 0) + if c then client.focus = c end + end +end) + +-- Hook called every minute +awful.hooks.timer.register(60, function () + mytextbox.text = os.date(" %a %b %d, %H:%M ") +end) +-- }}} diff --git a/rc.lua.new b/rc.lua.new new file mode 100644 index 0000000..6f20b14 --- /dev/null +++ b/rc.lua.new @@ -0,0 +1,436 @@ +-- Standard awesome library +require("awful") +-- Theme handling library +require("beautiful") +-- Notification library +require("naughty") + +-- Load Debian menu entries +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" +-- Uncommment this for a lighter theme +-- theme_path = "/usr/share/awesome/themes/sky/theme.lua" + +-- Actually load theme +beautiful.init(theme_path) + +-- This is used later as the default terminal and editor to run. +terminal = "x-terminal-emulator" +editor = os.getenv("EDITOR") or "editor" +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.max, + 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 +-- the application class or instance. The instance is useful when running +-- a console app in a terminal like (Music on Console) +-- x-terminal-emulator -name mocp -e mocp +floatapps = +{ + -- by class + ["MPlayer"] = true, + ["pinentry"] = true, + ["gimp"] = true, + -- by instance + ["mocp"] = true +} + +-- Applications to be moved to a pre-defined tag by class or instance. +-- Use the screen and tags indices. +apptags = +{ + -- ["Firefox"] = { screen = 1, tag = 2 }, + -- ["mocp"] = { screen = 2, tag = 4 }, +} + +-- Define if we want to use titlebar on all applications. +use_titlebar = false +-- }}} + +-- {{{ Tags +-- Define tags table. +tags = {} +for s = 1, screen.count() do + -- Each screen has its own tag table. + tags[s] = {} + -- Create 9 tags per screen. + for tagnumber = 1, 9 do + tags[s][tagnumber] = tag(tagnumber) + -- Add tags to screen one by one + tags[s][tagnumber].screen = s + awful.layout.set(layouts[1], tags[s][tagnumber]) + end + -- I'm sure you want to see at least one tag. + tags[s][1].selected = true +end +-- }}} + +-- {{{ Wibox +-- Create a textbox widget +mytextbox = widget({ type = "textbox", align = "right" }) +-- Set the default text in textbox +mytextbox.text = " " .. awesome.release .. " " + +-- 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.new({ items = { { "awesome", myawesomemenu, beautiful.awesome_icon }, + { "open terminal", terminal }, + { "Debian", debian.menu.Debian_menu.Debian } + } + }) + +mylauncher = awful.widget.launcher({ image = image(beautiful.awesome_icon), + menu = mymainmenu }) + +-- Create a systray +mysystray = widget({ type = "systray", align = "right" }) + +-- 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, function (tag) tag.selected = not tag.selected end), + 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 + -- Create a promptbox for each screen + mypromptbox[s] = awful.widget.prompt({ align = "left" }) + -- Create an imagebox widget which will contains an icon indicating which layout we're using. + -- We need one layoutbox per screen. + mylayoutbox[s] = widget({ type = "imagebox", align = "right" }) + 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] = wibox({ position = "top", fg = beautiful.fg_normal, bg = beautiful.bg_normal }) + -- Add widgets to the wibox - order matters + mywibox[s].widgets = { mylauncher, + mytaglist[s], + mytasklist[s], + mypromptbox[s], + mytextbox, + mylayoutbox[s], + s == 1 and mysystray or nil } + mywibox[s].screen = s +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(true) end), + + -- Layout manipulation + awful.key({ modkey, "Shift" }, "j", function () awful.client.swap.byidx( 1) end), + awful.key({ modkey, "Shift" }, "k", function () awful.client.swap.byidx( -1) end), + awful.key({ modkey, "Control" }, "j", function () awful.screen.focus( 1) end), + awful.key({ modkey, "Control" }, "k", function () awful.screen.focus(-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) +) + +-- Client awful tagging: this is useful to tag some clients and then do stuff like move to tag on them +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", awful.client.togglemarked), + 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 + +for i = 1, keynumber do + globalkeys = awful.util.table.join(globalkeys, + awful.key({ modkey }, i, + function () + local screen = mouse.screen + if tags[screen][i] then + awful.tag.viewonly(tags[screen][i]) + end + end), + awful.key({ modkey, "Control" }, i, + function () + local screen = mouse.screen + if tags[screen][i] then + tags[screen][i].selected = not tags[screen][i].selected + end + end), + awful.key({ modkey, "Shift" }, i, + 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, + function () + if client.focus and tags[client.focus.screen][i] then + awful.client.toggletag(tags[client.focus.screen][i]) + end + end), + awful.key({ modkey, "Shift" }, "F" .. i, + function () + local screen = mouse.screen + if tags[screen][i] then + for k, c in pairs(awful.client.getmarked()) do + awful.client.movetotag(tags[screen][i], c) + end + end + end)) +end + +-- Set keys +root.keys(globalkeys) +-- }}} + +-- {{{ Hooks +-- Hook function to execute when focusing a client. +awful.hooks.focus.register(function (c) + if not awful.client.ismarked(c) then + c.border_color = beautiful.border_focus + end +end) + +-- Hook function to execute when unfocusing a client. +awful.hooks.unfocus.register(function (c) + if not awful.client.ismarked(c) then + c.border_color = beautiful.border_normal + end +end) + +-- Hook function to execute when marking a client +awful.hooks.marked.register(function (c) + c.border_color = beautiful.border_marked +end) + +-- Hook function to execute when unmarking a client. +awful.hooks.unmarked.register(function (c) + c.border_color = beautiful.border_focus +end) + +-- Hook function to execute when the mouse enters a client. +awful.hooks.mouse_enter.register(function (c) + -- Sloppy focus, but disabled for magnifier layout + if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier + and awful.client.focus.filter(c) then + client.focus = c + end +end) + +-- Hook function to execute when a new client appears. +awful.hooks.manage.register(function (c, startup) + -- If we are not managing this application at startup, + -- move it to the screen where the mouse is. + -- We only do it for filtered windows (i.e. no dock, etc). + if not startup and awful.client.focus.filter(c) then + c.screen = mouse.screen + end + + if use_titlebar then + -- Add a titlebar + awful.titlebar.add(c, { modkey = modkey }) + end + -- Add mouse bindings + c:buttons(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) + )) + -- New client may not receive focus + -- if they're not focusable, so set border anyway. + c.border_width = beautiful.border_width + c.border_color = beautiful.border_normal + + -- Check if the application should be floating. + local cls = c.class + local inst = c.instance + if floatapps[cls] ~= nil then + awful.client.floating.set(c, floatapps[cls]) + elseif floatapps[inst] ~= nil then + awful.client.floating.set(c, floatapps[inst]) + end + + -- Check application->screen/tag mappings. + local target + if apptags[cls] then + target = apptags[cls] + elseif apptags[inst] then + target = apptags[inst] + end + if target then + c.screen = target.screen + awful.client.movetotag(tags[target.screen][target.tag], c) + end + + -- Do this after tag mapping, so you don't see it on the wrong tag for a split second. + client.focus = c + + -- Set key bindings + c:keys(clientkeys) + + -- Set the windows at the slave, + -- i.e. put it at the end of others instead of setting it master. + -- 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 +end) + +-- Hook function to execute when arranging the screen. +-- (tag switch, new client, etc) +awful.hooks.arrange.register(function (screen) + local layout = awful.layout.getname(awful.layout.get(screen)) + if layout and beautiful["layout_" ..layout] then + mylayoutbox[screen].image = image(beautiful["layout_" .. layout]) + else + mylayoutbox[screen].image = nil + end + + -- Give focus to the latest client in history if no window has focus + -- or if the current window is a desktop or a dock one. + if not client.focus then + local c = awful.client.focus.history.get(screen, 0) + if c then client.focus = c end + end +end) + +-- Hook called every minute +awful.hooks.timer.register(60, function () + mytextbox.text = os.date(" %a %b %d, %H:%M ") +end) +-- }}} diff --git a/rc.lua~ b/rc.lua~ new file mode 100644 index 0000000..7b06081 --- /dev/null +++ b/rc.lua~ @@ -0,0 +1,467 @@ +-- Standard awesome library +require("awful") +-- Theme handling library +require("beautiful") +-- Notification library +require("naughty") + +-- Load Debian menu entries +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" +-- Uncommment this for a lighter theme +-- theme_path = "/usr/share/awesome/themes/sky/theme.lua" + +-- Actually load theme +beautiful.init(theme_path) + +-- This is used later as the default terminal and editor to run. +terminal = "x-terminal-emulator" +editor = os.getenv("EDITOR") or "editor" +editor_cmd = terminal .. " -e " .. editor +browser = "nautilus --no-desktop --browser" +initawesome = "sh /home/guerre/.awesomestart" + +-- 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.max, + 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 +-- the application class or instance. The instance is useful when running +-- a console app in a terminal like (Music on Console) +-- x-terminal-emulator -name mocp -e mocp +floatapps = +{ + -- by class + ["wicd-client.py"] = true, + ["MPlayer"] = true, + ["pinentry"] = true, + ["gimp"] = true, + -- by instance + ["mocp"] = true +} + +-- Applications to be moved to a pre-defined tag by class or instance. +-- Use the screen and tags indices. +apptags = +{ + ["Navigator"] = { screen = 1, tag = 2 }, + -- ["mocp"] = { screen = 2, tag = 4 }, + ["pidgin"] = { screen = 1, tag = 3 }, + ["xchat"] = { screen = 1, tag = 4 }, + ["xterm"] = { screen = 1, tag = 1 } + +} + +-- Define if we want to use titlebar on all applications. +use_titlebar = false +-- }}} + +-- {{{ Tags +tags_names = {"xterm", "www", "im", "irc", "media", "misc", "doc", "prog", "sys"} + + +-- Define tags table. +tags = {} +for s = 1, screen.count() do + -- Each screen has its own tag table. + tags[s] = {} + -- Create 9 tags per screen. + for tagnumber = 1, 9 do + --tags[s][tagnumber] = tag(tagnumber) + tags[s][tagnumber] = tag(tags_names[tagnumber]) + -- Add tags to screen one by one + tags[s][tagnumber].screen = s + awful.layout.set(layouts[1], tags[s][tagnumber]) + end + -- I'm sure you want to see at least one tag. + tags[s][1].selected = true + -- layout 5 para la tag 1 + awful.layout.set(layouts[5], tags[s][1]) +end +-- }}} + +-- {{{ Wibox +-- Create a textbox widget +mytextbox = widget({ type = "textbox", align = "right" }) +-- Set the default text in textbox +mytextbox.text = " " .. awesome.release .. " " + +-- 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.new({ items = { { "awesome", myawesomemenu, beautiful.awesome_icon }, + { "open terminal", terminal }, + { "Debian", debian.menu.Debian_menu.Debian }, + { "Nautilus", browser } + } + }) + +mylauncher = awful.widget.launcher({ image = image(beautiful.awesome_icon), + menu = mymainmenu }) + +-- Create a systray +mysystray = widget({ type = "systray", align = "right" }) + +-- 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, function (tag) tag.selected = not tag.selected end), + 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 + -- Create a promptbox for each screen + mypromptbox[s] = awful.widget.prompt({ align = "left" }) + -- Create an imagebox widget which will contains an icon indicating which layout we're using. + -- We need one layoutbox per screen. + mylayoutbox[s] = widget({ type = "imagebox", align = "right" }) + 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] = wibox({ position = "top", fg = beautiful.fg_normal, bg = beautiful.bg_normal }) + -- Add widgets to the wibox - order matters + mywibox[s].widgets = { mylauncher, + mytaglist[s], + mytasklist[s], + mypromptbox[s], + mytextbox, + mylayoutbox[s], + s == 1 and mysystray or nil } + mywibox[s].screen = s +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(true) end), + + -- Layout manipulation + awful.key({ modkey, "Shift" }, "j", function () awful.client.swap.byidx( 1) end), + awful.key({ modkey, "Shift" }, "k", function () awful.client.swap.byidx( -1) end), + awful.key({ modkey, "Control" }, "j", function () awful.screen.focus( 1) end), + awful.key({ modkey, "Control" }, "k", function () awful.screen.focus(-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, }, "b", function() awful.util.spawn(browser) end), + awful.key({ modkey, }, "i", function() awful.util.spawn(initawesome) end), + -- Prompt + awful.key({ modkey }, "F1", function () mypromptbox[mouse.screen]:run() end), + + -- Prompt + --awful.key({ modkey }, "F2", function () awful.prompt({ prompt = "Run: ", cursor_fg = fg_focus, cursor_bg = bg_focus }, mypromptbox, awful.spawn, awful.completion.bash) + -- end), + + awful.key({ modkey }, "F2", + function () + awful.prompt.run({ prompt = "Run: " }, + mypromptbox[mouse.screen].widget, + awful.util.spawn, + awful.completion.bash, + awful.util.getdir("cache") .. "/history") + 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) +) + +-- Client awful tagging: this is useful to tag some clients and then do stuff like move to tag on them +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", awful.client.togglemarked), + 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 + +for i = 1, keynumber do + globalkeys = awful.util.table.join(globalkeys, + awful.key({ modkey }, i, + function () + local screen = mouse.screen + if tags[screen][i] then + awful.tag.viewonly(tags[screen][i]) + end + end), + awful.key({ modkey, "Control" }, i, + function () + local screen = mouse.screen + if tags[screen][i] then + tags[screen][i].selected = not tags[screen][i].selected + end + end), + awful.key({ modkey, "Shift" }, i, + 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, + function () + if client.focus and tags[client.focus.screen][i] then + awful.client.toggletag(tags[client.focus.screen][i]) + end + end), + awful.key({ modkey, "Shift" }, "F" .. i, + function () + local screen = mouse.screen + if tags[screen][i] then + for k, c in pairs(awful.client.getmarked()) do + awful.client.movetotag(tags[screen][i], c) + end + end + end)) +end + +-- Set keys +root.keys(globalkeys) +-- }}} + +-- {{{ Hooks +-- Hook function to execute when focusing a client. +awful.hooks.focus.register(function (c) + if not awful.client.ismarked(c) then + c.border_color = beautiful.border_focus + end +end) + +-- Hook function to execute when unfocusing a client. +awful.hooks.unfocus.register(function (c) + if not awful.client.ismarked(c) then + c.border_color = beautiful.border_normal + end +end) + +-- Hook function to execute when marking a client +awful.hooks.marked.register(function (c) + c.border_color = beautiful.border_marked +end) + +-- Hook function to execute when unmarking a client. +awful.hooks.unmarked.register(function (c) + c.border_color = beautiful.border_focus +end) + +-- Hook function to execute when the mouse enters a client. +awful.hooks.mouse_enter.register(function (c) + -- Sloppy focus, but disabled for magnifier layout + if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier + and awful.client.focus.filter(c) then + client.focus = c + end +end) + +-- Hook function to execute when a new client appears. +awful.hooks.manage.register(function (c, startup) + -- If we are not managing this application at startup, + -- move it to the screen where the mouse is. + -- We only do it for filtered windows (i.e. no dock, etc). + if not startup and awful.client.focus.filter(c) then + c.screen = mouse.screen + end + + if use_titlebar then + -- Add a titlebar + awful.titlebar.add(c, { modkey = modkey }) + end + -- Add mouse bindings + c:buttons(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) + )) + -- New client may not receive focus + -- if they're not focusable, so set border anyway. + c.border_width = beautiful.border_width + c.border_color = beautiful.border_normal + + -- Check if the application should be floating. + local cls = c.class + local inst = c.instance + if floatapps[cls] ~= nil then + awful.client.floating.set(c, floatapps[cls]) + elseif floatapps[inst] ~= nil then + awful.client.floating.set(c, floatapps[inst]) + end + + -- Check application->screen/tag mappings. + local target + if apptags[cls] then + target = apptags[cls] + elseif apptags[inst] then + target = apptags[inst] + end + if target then + c.screen = target.screen + awful.client.movetotag(tags[target.screen][target.tag], c) + end + + -- Do this after tag mapping, so you don't see it on the wrong tag for a split second. + client.focus = c + + -- Set key bindings + c:keys(clientkeys) + + -- Set the windows at the slave, + -- i.e. put it at the end of others instead of setting it master. + -- 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 +end) + +-- Hook function to execute when arranging the screen. +-- (tag switch, new client, etc) +awful.hooks.arrange.register(function (screen) + local layout = awful.layout.getname(awful.layout.get(screen)) + if layout and beautiful["layout_" ..layout] then + mylayoutbox[screen].image = image(beautiful["layout_" .. layout]) + else + mylayoutbox[screen].image = nil + end + + -- Give focus to the latest client in history if no window has focus + -- or if the current window is a desktop or a dock one. + if not client.focus then + local c = awful.client.focus.history.get(screen, 0) + if c then client.focus = c end + end +end) + +-- Hook called every minute +awful.hooks.timer.register(60, function () + mytextbox.text = os.date(" %a %b %d, %H:%M ") +end) +-- }}} diff --git a/rc2410.lua b/rc2410.lua new file mode 100644 index 0000000..4b14b14 --- /dev/null +++ b/rc2410.lua @@ -0,0 +1,500 @@ +-- Standard awesome library +require("awful") +-- Theme handling library +require("beautiful") +-- Notification library +require("naughty") +require("wicked") +--require("obvious") +-- Load Debian menu entries +require("debian.menu") +--obvious +--require("obvious.popup_run_prompt") +--require("obvious.battery") +--require("obvious.wlan") +--require("obvious.clock") +--require("obvious.volume_alsa") +--require("obvious.net") +-- {{{ Variable definitions +-- Themes define colours, icons, and wallpapers +-- The default is a dark theme +theme_path = "/usr/share/awesome/themes/default/theme.lua" +-- Uncommment this for a lighter theme +-- theme_path = "/usr/share/awesome/themes/sky/theme.lua" + +-- Actually load theme +beautiful.init(theme_path) + +-- This is used later as the default terminal and editor to run. +terminal = "x-terminal-emulator" +editor = os.getenv("EDITOR") or "editor" +editor_cmd = terminal .. " -e " .. editor +browser = "nautilus --no-desktop --browser" +initawesome = "sh /home/guerre/.awesomestart" +icewe= "iceweasel" +lock= "sh /home/guerre/lock" +brilloup= "sh /home/guerre/scripts/video_brightnessup.sh" +brillodown= "sh /home/guerre/scripts/video_brightnessdown.sh" +-- Widgets using wicked, modified by Comtom + +os.execute("/home/guerre/.awesomestart") + + +-- 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.max, + 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 +-- the application class or instance. The instance is useful when running +-- a console app in a terminal like (Music on Console) +-- x-terminal-emulator -name mocp -e mocp +floatapps = +{ + -- by class + ["wicd-client.py"] = true, + ["MPlayer"] = true, + ["pinentry"] = true, + ["gimp"] = true, + ["nautilus"] = true, + -- by instance + ["mocp"] = true +} + +-- Applications to be moved to a pre-defined tag by class or instance. +-- Use the screen and tags indices. +apptags = +{ + ["Navigator"] = { screen = 1, tag = 2 }, + -- ["mocp"] = { screen = 2, tag = 4 }, + ["pidgin"] = { screen = 1, tag = 3 }, + --["xchat"] = { screen = 1, tag = 4 }, + -- ["xterm"] = { screen = 1, tag = 1 } + ["ocp"] = { screen = 1, tag = 1 }, + ["alsamixer"] = { screen = 1, tag = 1 }, + ["htop"] = { screen = 1, tag = 1 }, + ["screen"] = { screen = 1, tag = 1 }, + ["VirtualBox"] = { screen =1, tag = 9 } + + + +} + +-- Define if we want to use titlebar on all applications. +use_titlebar = false +-- }}} + +-- {{{ Tags +tags_names = {"xterm", "www", "im", "work", "media", "misc", "doc", "prog", "vbox"} + + +-- Define tags table. +tags = {} +for s = 1, screen.count() do + -- Each screen has its own tag table. + tags[s] = {} + -- Create 9 tags per screen. + for tagnumber = 1, 9 do + --tags[s][tagnumber] = tag(tagnumber) version mas vieja ! + tags[s][tagnumber] = tag(tags_names[tagnumber]) + -- Add tags to screen one by one + tags[s][tagnumber].screen = s + awful.layout.set(layouts[1], tags[s][tagnumber]) + end + -- I'm sure you want to see at least one tag. + tags[s][1].selected = true + -- layout 5 para la tag 1 + awful.layout.set(layouts[5], tags[s][1]) + -- awful.layou.set(layouts[10], tags[s][2]) +end +-- }}} + +-- {{{ Wibox +-- Create a textbox widget +mytextbox = widget({ type = "textbox", align = "right" }) +-- Set the default text in textbox +mytextbox.text = " " .. awesome.release .. " " + +-- 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.new({ items = { { "awesome", myawesomemenu, beautiful.awesome_icon }, + { "open terminal", terminal }, + { "Debian", debian.menu.Debian_menu.Debian }, + { "Nautilus", browser } + } + }) + +mylauncher = awful.widget.launcher({ image = image(beautiful.awesome_icon), + menu = mymainmenu }) + +-- Create a systray +mysystray = widget({ type = "systray", align = "right" }) + +-- 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, function (tag) tag.selected = not tag.selected end), + 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 + -- Create a promptbox for each screen + mypromptbox[s] = awful.widget.prompt({ align = "left" }) + -- Create an imagebox widget which will contains an icon indicating which layout we're using. + -- We need one layoutbox per screen. + mylayoutbox[s] = widget({ type = "imagebox", align = "right" }) + 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] = wibox({ position = "top", fg = beautiful.fg_normal, bg = beautiful.bg_normal }) + -- Add widgets to the wibox - order matters + mywibox[s].widgets = { mylauncher, + mytaglist[s], + mytasklist[s], + mypromptbox[s], + -- obvious.battery(), + --obvious.volume_alsa(), + --obvious.wlan(), + -- obvious.net(), + --obvious.clock(), + mytextbox, + mylayoutbox[s], + s == 1 and mysystray or nil } + mywibox[s].screen = s +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(true) end), + + -- Layout manipulation + awful.key({ modkey, "Shift" }, "j", function () awful.client.swap.byidx( 1) end), + awful.key({ modkey, "Shift" }, "k", function () awful.client.swap.byidx( -1) end), + awful.key({ modkey, "Control" }, "j", function () awful.screen.focus( 1) end), + awful.key({ modkey, "Control" }, "k", function () awful.screen.focus(-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, }, "b", function() awful.util.spawn(browser) end), + awful.key({ modkey, }, "i", function() awful.util.spawn(icewe) end), + awful.key({ modkey }, "r", obvious.popup_run_prompt.run_prompt), + awful.key({ modkey, }, "c", function() awful.util.spawn(lock) end), + awful.key({}, "XF86MonBrightnessUp", function () awful.util.spawn(brilloup) end), + awful.key({}, "XF86MonBrightnessDown", function () awful.util.spawn(brillodown) end), +-- Prompt + awful.key({ modkey }, "F1", function () mypromptbox[mouse.screen]:run() end), + + -- Prompt + --awful.key({ modkey }, "F2", function () awful.prompt({ prompt = "Run: ", cursor_fg = fg_focus, cursor_bg = bg_focus }, mypromptbox, awful.spawn, awful.completion.bash) + -- end), + + awful.key({ modkey }, "F2", + function () + awful.prompt.run({ prompt = "Run: " }, + mypromptbox[mouse.screen].widget, + awful.util.spawn, + awful.completion.bash, + awful.util.getdir("cache") .. "/history") + 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) +) + +-- Client awful tagging: this is useful to tag some clients and then do stuff like move to tag on them +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", awful.client.togglemarked), + 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 + +for i = 1, keynumber do + globalkeys = awful.util.table.join(globalkeys, + awful.key({ modkey }, i, + function () + local screen = mouse.screen + if tags[screen][i] then + awful.tag.viewonly(tags[screen][i]) + end + end), + awful.key({ modkey, "Control" }, i, + function () + local screen = mouse.screen + if tags[screen][i] then + tags[screen][i].selected = not tags[screen][i].selected + end + end), + awful.key({ modkey, "Shift" }, i, + 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, + function () + if client.focus and tags[client.focus.screen][i] then + awful.client.toggletag(tags[client.focus.screen][i]) + end + end), + awful.key({ modkey, "Shift" }, "F" .. i, + function () + local screen = mouse.screen + if tags[screen][i] then + for k, c in pairs(awful.client.getmarked()) do + awful.client.movetotag(tags[screen][i], c) + end + end + end)) +end + +-- Set keys +root.keys(globalkeys) +-- }}} + +-- {{{ Hooks +-- Hook function to execute when focusing a client. +awful.hooks.focus.register(function (c) + if not awful.client.ismarked(c) then + c.border_color = beautiful.border_focus + end +end) + +-- Hook function to execute when unfocusing a client. +awful.hooks.unfocus.register(function (c) + if not awful.client.ismarked(c) then + c.border_color = beautiful.border_normal + end +end) + +-- Hook function to execute when marking a client +awful.hooks.marked.register(function (c) + c.border_color = beautiful.border_marked +end) + +-- Hook function to execute when unmarking a client. +awful.hooks.unmarked.register(function (c) + c.border_color = beautiful.border_focus +end) + +-- Hook function to execute when the mouse enters a client. +awful.hooks.mouse_enter.register(function (c) + -- Sloppy focus, but disabled for magnifier layout + if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier + and awful.client.focus.filter(c) then + client.focus = c + end +end) + +-- Hook function to execute when a new client appears. +awful.hooks.manage.register(function (c, startup) + -- If we are not managing this application at startup, + -- move it to the screen where the mouse is. + -- We only do it for filtered windows (i.e. no dock, etc). + if not startup and awful.client.focus.filter(c) then + c.screen = mouse.screen + end + + if use_titlebar then + -- Add a titlebar + awful.titlebar.add(c, { modkey = modkey }) + end + -- Add mouse bindings + c:buttons(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) + )) + -- New client may not receive focus + -- if they're not focusable, so set border anyway. + c.border_width = beautiful.border_width + c.border_color = beautiful.border_normal + + -- Check if the application should be floating. + local cls = c.class + local inst = c.instance + if floatapps[cls] ~= nil then + awful.client.floating.set(c, floatapps[cls]) + elseif floatapps[inst] ~= nil then + awful.client.floating.set(c, floatapps[inst]) + end + + -- Check application->screen/tag mappings. + local target + if apptags[cls] then + target = apptags[cls] + elseif apptags[inst] then + target = apptags[inst] + end + if target then + c.screen = target.screen + awful.client.movetotag(tags[target.screen][target.tag], c) + end + + -- Do this after tag mapping, so you don't see it on the wrong tag for a split second. + client.focus = c + + -- Set key bindings + c:keys(clientkeys) + + -- Set the windows at the slave, + -- i.e. put it at the end of others instead of setting it master. + -- 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 +end) + +-- Hook function to execute when arranging the screen. +-- (tag switch, new client, etc) +awful.hooks.arrange.register(function (screen) + local layout = awful.layout.getname(awful.layout.get(screen)) + if layout and beautiful["layout_" ..layout] then + mylayoutbox[screen].image = image(beautiful["layout_" .. layout]) + else + mylayoutbox[screen].image = nil + end + + -- Give focus to the latest client in history if no window has focus + -- or if the current window is a desktop or a dock one. + if not client.focus then + local c = awful.client.focus.history.get(screen, 0) + if c then client.focus = c end + end +end) + +-- Hook called every minute +awful.hooks.timer.register(60, function () + mytextbox.text = os.date(" %a %b %d, %H:%M ") +end) +-- }}} diff --git a/scratchpad.lua b/scratchpad.lua new file mode 100644 index 0000000..72d546d --- /dev/null +++ b/scratchpad.lua @@ -0,0 +1,136 @@ +--------------------------------------------------------------- +-- Basic scratchpad manager for the awesome window manager +--------------------------------------------------------------- +-- Blame: Adrian C. +-- Licensed under the WTFPL version 2 +-- * http://sam.zoy.org/wtfpl/COPYING +--------------------------------------------------------------- +-- To use this module add: +-- require("scratchpad") +-- to the top of your rc.lua, and call: +-- scratchpad.set(c, width, height, sticky, screen) +-- from a clientkeys binding, and: +-- scratchpad.toggle(screen) +-- from a globalkeys binding. +-- +-- Parameters: +-- c - Client to scratch or un-scratch +-- width - Width in absolute pixels, or width percentage +-- when <= 1 (0.50 (50% of the screen) by default) +-- height - Height in absolute pixels, or height percentage +-- when <= 1 (0.50 (50% of the screen) by default) +-- sticky - Visible on all tags, false by default +-- screen - Screen (optional), mouse.screen by default +--------------------------------------------------------------- + +-- Grab environment +local awful = require("awful") +local capi = { + mouse = mouse, + client = client, + screen = screen +} + +-- Scratchpad: Basic scratchpad manager for the awesome window manager +module("scratchpad") + +local scratch = {} + +-- Scratch the focused client, or un-scratch and tile it. If another +-- client is already scratched, replace it with the focused client. +function set(c, width, height, sticky, screen) + local width = width or 0.50 + local height = height or 0.50 + local sticky = sticky or false + local screen = screen or capi.mouse.screen + + local function setscratch(c) + -- Scratchpad is floating + awful.client.floating.set(c, true) + + -- Scratchpad geometry and placement + local screengeom = capi.screen[screen].workarea + + if width <= 1 then width = screengeom.width * width end + if height <= 1 then height = screengeom.height * height end + + c:geometry({ -- Client is always centered on screen + x = screengeom.x + (screengeom.width - width) / 2, + y = screengeom.y + (screengeom.height - height) / 2, + width = width, height = height + }) + + -- Scratchpad properties + c.ontop = true + c.above = true + c.skip_taskbar = true + if sticky then c.sticky = true end + if c.titlebar then awful.titlebar.remove(c) end + + -- Scratchpad should not loose focus + c:raise() + capi.client.focus = c + end + + -- Prepare a table for storing clients, + if not scratch.pad then scratch.pad = {} + -- add unmanage signal for scratchpad clients + capi.client.add_signal("unmanage", function (c) + local oc = scratch.pad[screen] + if oc == c then + scratch.pad[screen] = nil + end + end) + end + + -- If the scratcphad is emtpy, store the client, + if not scratch.pad[screen] then + scratch.pad[screen] = c + -- then apply geometry and properties + setscratch(c) + else -- If a client is already scratched, + local oc = scratch.pad[screen] + -- compare it with the focused client + if oc == c then + -- If it matches then unscratch and clear the table + awful.client.floating.toggle(oc); oc.sticky = false + oc.ontop = false; oc.above = false + scratch.pad[screen] = nil + else -- If they don't match, unscratch and replace it + oc.hidden = false; oc.sticky = false + oc.ontop = false; oc.above = false + awful.client.floating.toggle(oc) + scratch.pad[screen] = c + setscratch(c) + end + end +end + +-- Move the scratchpad to the current workspace, focus and raise it +-- when it's hidden, or hide it when it's visible. +function toggle(screen) + local screen = screen or capi.mouse.screen + + -- Check if we have a client on storage, + if scratch.pad and + scratch.pad[screen] ~= nil + then -- and get it out, to play + local c = scratch.pad[screen] + + -- If it's visible on another tag hide it, + if c:isvisible() == false then c.hidden = true; + -- and move it to the current worskpace + awful.client.movetotag(awful.tag.selected(screen), c) + end + + -- Focus and raise if it's hidden, + if c.hidden then + awful.placement.centered(c) + c.hidden = false + c:raise() + capi.client.focus = c + else -- hide it if it's not + c.hidden = true + end + end +end diff --git a/teardrop.lua b/teardrop.lua new file mode 100644 index 0000000..8645154 --- /dev/null +++ b/teardrop.lua @@ -0,0 +1,128 @@ +---------------------------------------------------------------- +-- Drop-down applications manager for the awesome window manager +---------------------------------------------------------------- +-- Blame: Adrian C. +-- Licensed under the WTFPL version 2 +-- * http://sam.zoy.org/wtfpl/COPYING +---------------------------------------------------------------- +-- To use this module add: +-- require("teardrop") +-- to the top of your rc.lua, and call it from a keybinding: +-- teardrop(prog, vert, horiz, width, height, sticky, screen) +-- +-- Parameters: +-- prog - Program to run; "urxvt", "gmrun", "thunderbird" +-- vert - Vertical; "bottom", "center" or "top" (default) +-- horiz - Horizontal; "left", "right" or "center" (default) +-- width - Width in absolute pixels, or width percentage +-- when <= 1 (1 (100% of the screen) by default) +-- height - Height in absolute pixels, or height percentage +-- when <= 1 (0.25 (25% of the screen) by default) +-- sticky - Visible on all tags, false by default +-- screen - Screen (optional), mouse.screen by default +---------------------------------------------------------------- + +-- Grab environment +local pairs = pairs +local awful = require("awful") +local setmetatable = setmetatable +local capi = { + mouse = mouse, + client = client, + screen = screen +} + +-- Teardrop: Drop-down applications manager for the awesome window manager +module("teardrop") + +local dropdown = {} + +-- Create a new window for the drop-down application when it doesn't +-- exist, or toggle between hidden and visible states when it does +function toggle(prog, vert, horiz, width, height, sticky, screen) + local vert = vert or "top" + local horiz = horiz or "center" + local width = width or 1 + local height = height or 0.25 + local sticky = sticky or false + local screen = screen or capi.mouse.screen + + if not dropdown[prog] then + dropdown[prog] = {} + + -- Add unmanage signal for teardrop programs + capi.client.add_signal("unmanage", function (c) + for scr, cl in pairs(dropdown[prog]) do + if cl == c then + dropdown[prog][scr] = nil + end + end + end) + end + + if not dropdown[prog][screen] then + spawnw = function (c) + dropdown[prog][screen] = c + + -- Teardrop clients are floaters + awful.client.floating.set(c, true) + + -- Client geometry and placement + local screengeom = capi.screen[screen].workarea + + if width <= 1 then width = screengeom.width * width end + if height <= 1 then height = screengeom.height * height end + + if horiz == "left" then x = screengeom.x + elseif horiz == "right" then x = screengeom.width - width + else x = screengeom.x+(screengeom.width-width)/2 end + + if vert == "bottom" then y = screengeom.height + screengeom.y - height + elseif vert == "center" then y = screengeom.y+(screengeom.height-height)/2 + else y = screengeom.y - screengeom.y end + + -- Client properties + c:geometry({ x = x, y = y, width = width, height = height }) + c.ontop = true + c.above = true + c.skip_taskbar = true + if sticky then c.sticky = true end + if c.titlebar then awful.titlebar.remove(c) end + + c:raise() + capi.client.focus = c + capi.client.remove_signal("manage", spawnw) + end + + -- Add manage signal and spawn the program + capi.client.add_signal("manage", spawnw) + awful.util.spawn(prog, false) + else + -- Get a running client + c = dropdown[prog][screen] + + -- Switch the client to the current workspace + if c:isvisible() == false then c.hidden = true; + awful.client.movetotag(awful.tag.selected(screen), c) + end + + -- Focus and raise if hidden + if c.hidden then + -- Make sure it is centered + if vert == "center" then awful.placement.center_vertical(c) end + if horiz == "center" then awful.placement.center_horizontal(c) end + c.hidden = false + c:raise() + capi.client.focus = c + else -- Hide and detach tags if not + c.hidden = true + local ctags = c:tags() + for i, t in pairs(ctags) do + ctags[i] = nil + end + c:tags(ctags) + end + end +end + +setmetatable(_M, { __call = function(_, ...) return toggle(...) end }) diff --git a/vicious b/vicious new file mode 160000 index 0000000..e252fd9 --- /dev/null +++ b/vicious @@ -0,0 +1 @@ +Subproject commit e252fd955ab7da046e83910f1909ab9deed0dc81 diff --git a/zenburn.lua b/zenburn.lua new file mode 100644 index 0000000..5648764 --- /dev/null +++ b/zenburn.lua @@ -0,0 +1,143 @@ +------------------------------- +-- "Zenburn" awesome theme -- +-- By Adrian C. (anrxc) -- +-- License: GNU GPL v2 -- +------------------------------- + + +-- {{{ Main +theme = {} +theme.confdir = awful.util.getdir("config") +theme.wallpaper_cmd = { "/usr/bin/nitrogen --restore" } +--theme.wallpaper_cmd = { "awsetbg /usr/share/awesome/themes/zenburn/zenburn-background.png" } +-- }}} + + +-- {{{ Styles +theme.font = "Profont 8" + +-- {{{ Colors +theme.fg_normal = "#DCDCCC" +theme.fg_focus = "#F0DFAF" +theme.fg_urgent = "#CC9393" +theme.bg_normal = "#3F3F3F" +theme.bg_focus = "#1E2320" +theme.bg_urgent = theme.bg_normal +-- }}} + +-- {{{ Borders +theme.border_width = 1 +theme.border_focus = "#6F6F6F" +theme.border_normal = theme.bg_normal +theme.border_marked = theme.fg_urgent +-- }}} + +-- {{{ Titlebars +theme.titlebar_bg_focus = theme.bg_normal +theme.titlebar_bg_normal = theme.bg_normal +-- theme.titlebar_[normal|focus] +-- }}} + +-- {{{ Widgets +theme.fg_widget = "#AECF96" +theme.fg_center_widget = "#88A175" +theme.fg_end_widget = "#FF5656" +theme.fg_off_widget = "#494B4F" +theme.fg_netup_widget = "#7F9F7F" +theme.fg_netdn_widget = theme.fg_urgent +theme.bg_widget = theme.bg_normal +theme.border_widget = theme.bg_normal +-- }}} + +-- {{{ Mouse finder +theme.mouse_finder_color = theme.fg_urgent +-- theme.mouse_finder_[timeout|animate_timeout|radius|factor] +-- }}} + +-- {{{ Tooltips +-- theme.tooltip_[font|opacity|fg_color|bg_color|border_width|border_color] +-- }}} + +-- {{{ Taglist and Tasklist +-- theme.[taglist|tasklist]_[bg|fg]_[focus|urgent] +-- }}} + +-- {{{ Menu +-- theme.menu_[bg|fg]_[normal|focus] +-- theme.menu_[height|width|border_color|border_width] +-- }}} +-- }}} + + +-- {{{ Icons +-- +-- {{{ Taglist icons +theme.taglist_squares_sel = theme.confdir .. "/icons/taglist/squarefz.png" +theme.taglist_squares_unsel = theme.confdir .. "/icons/taglist/squareza.png" +--theme.taglist_squares_resize = "false" +-- }}} + +-- {{{ Misc icons +--theme.awesome_icon = theme.confdir .. "/icons/awesome.png" +--theme.menu_submenu_icon = "/usr/share/awesome/themes/default/submenu.png" +--theme.tasklist_floating_icon = "/usr/share/awesome/themes/default/tasklist/floatingw.png" +-- }}} + +-- {{{ Layout icons +theme.layout_tile = theme.confdir .. "/icons/layouts/tile.png" +theme.layout_tileleft = theme.confdir .. "/icons/layouts/tileleft.png" +theme.layout_tilebottom = theme.confdir .. "/icons/layouts/tilebottom.png" +theme.layout_tiletop = theme.confdir .. "/icons/layouts/tiletop.png" +theme.layout_fairv = theme.confdir .. "/icons/layouts/fairv.png" +theme.layout_fairh = theme.confdir .. "/icons/layouts/fairh.png" +theme.layout_spiral = theme.confdir .. "/icons/layouts/spiral.png" +theme.layout_dwindle = theme.confdir .. "/icons/layouts/dwindle.png" +theme.layout_max = theme.confdir .. "/icons/layouts/max.png" +theme.layout_fullscreen = theme.confdir .. "/icons/layouts/fullscreen.png" +theme.layout_magnifier = theme.confdir .. "/icons/layouts/magnifier.png" +theme.layout_floating = theme.confdir .. "/icons/layouts/floating.png" +-- }}} + +-- {{{ Widget icons +theme.widget_cpu = theme.confdir .. "/icons/cpu.png" +theme.widget_bat = theme.confdir .. "/icons/bat.png" +theme.widget_mem = theme.confdir .. "/icons/mem.png" +theme.widget_fs = theme.confdir .. "/icons/disk.png" +theme.widget_net = theme.confdir .. "/icons/down.png" +theme.widget_netup = theme.confdir .. "/icons/up.png" +theme.widget_wifi = theme.confdir .. "/icons/wifi.png" +theme.widget_mail = theme.confdir .. "/icons/mail.png" +theme.widget_vol = theme.confdir .. "/icons/vol.png" +theme.widget_org = theme.confdir .. "/icons/cal.png" +theme.widget_date = theme.confdir .. "/icons/time.png" +theme.widget_crypto = theme.confdir .. "/icons/crypto.png" +-- }}} + +-- {{{ Titlebar icons +theme.titlebar_close_button_focus = theme.confdir .. "/icons/titlebar/close_focus.png" +theme.titlebar_close_button_normal = theme.confdir .. "/icons/titlebar/close_normal.png" + +theme.titlebar_ontop_button_focus_active = theme.confdir .. "/icons/titlebar/ontop_focus_active.png" +theme.titlebar_ontop_button_normal_active = theme.confdir .. "/icons/titlebar/ontop_normal_active.png" +theme.titlebar_ontop_button_focus_inactive = theme.confdir .. "/icons/titlebar/ontop_focus_inactive.png" +theme.titlebar_ontop_button_normal_inactive = theme.confdir .. "/icons/titlebar/ontop_normal_inactive.png" + +theme.titlebar_sticky_button_focus_active = theme.confdir .. "/icons/titlebar/sticky_focus_active.png" +theme.titlebar_sticky_button_normal_active = theme.confdir .. "/icons/titlebar/sticky_normal_active.png" +theme.titlebar_sticky_button_focus_inactive = theme.confdir .. "/icons/titlebar/sticky_focus_inactive.png" +theme.titlebar_sticky_button_normal_inactive = theme.confdir .. "/icons/titlebar/sticky_normal_inactive.png" + +theme.titlebar_floating_button_focus_active = theme.confdir .. "/icons/titlebar/floating_focus_active.png" +theme.titlebar_floating_button_normal_active = theme.confdir .. "/icons/titlebar/floating_normal_active.png" +theme.titlebar_floating_button_focus_inactive = theme.confdir .. "/icons/titlebar/floating_focus_inactive.png" +theme.titlebar_floating_button_normal_inactive = theme.confdir .. "/icons/titlebar/floating_normal_inactive.png" + +theme.titlebar_maximized_button_focus_active = theme.confdir .. "/icons/titlebar/maximized_focus_active.png" +theme.titlebar_maximized_button_normal_active = theme.confdir .. "/icons/titlebar/maximized_normal_active.png" +theme.titlebar_maximized_button_focus_inactive = theme.confdir .. "/icons/titlebar/maximized_focus_inactive.png" +theme.titlebar_maximized_button_normal_inactive = theme.confdir .. "/icons/titlebar/maximized_normal_inactive.png" +-- }}} +-- }}} + + +return theme