Permalink
Browse files

Run or Raise converted to summon

Just added client to current tag instead of going to it.
  • Loading branch information...
1 parent 7edcd71 commit d3511ed35353b4553033cb023b2a3fb3663031cf @AndrewRadev committed Sep 29, 2010
Showing with 11 additions and 15 deletions.
  1. 0 lib/gmail.lua
  2. +6 −10 lib/{ror.lua → summon.lua}
  3. +5 −5 rc.lua
View
No changes.
@@ -6,9 +6,9 @@ local table = table
local awful = awful
local client = client
-module("lib.ror")
+module("lib.summon")
-function run_or_raise(cmd, properties)
+function summon(cmd, properties)
local clients = client.get()
local focused = awful.client.next(0)
local findex = 0
@@ -32,15 +32,11 @@ function run_or_raise(cmd, properties)
if 0 < findex and findex < n then
c = matched_clients[findex+1]
end
+
local ctags = c:tags()
- if table.getn(ctags) == 0 then
- -- ctags is empty, show client on current tag
- local curtag = awful.tag.selected()
- awful.client.movetotag(curtag, c)
- else
- -- Otherwise, pop to first tag client is visible on
- awful.tag.viewonly(ctags[1])
- end
+ local curtag = awful.tag.selected()
+ awful.client.movetotag(curtag, c)
+
-- And then focus the client
client.focus = c
c:raise()
View
10 rc.lua
@@ -15,8 +15,8 @@ require("obvious.battery")
-- Vicious widgets
require("vicious")
-require ("lib.ror")
-local run_or_raise = lib.ror.run_or_raise
+require ("lib.summon")
+local summon = lib.summon.summon
require("revelation")
@@ -99,9 +99,9 @@ vicious.register(mpd, vicious.widgets.mpd, function(w, args)
return colorize('#ff0000', '--')
else
if state == "Pause" then
- state_string = colorize('#009000', '||')
+ state_string = colorize('#ff0000', '||')
else
- state_string = colorize('#009000', '>')
+ state_string = colorize('#ff0000', '>')
end
return "Playing: "..args['{Title}'].." "..state_string
@@ -273,7 +273,7 @@ globalkeys = awful.util.table.join(
-- quick spawning
-- awful.key({ modkey, "Shift" }, "f", function () spawn("firefox") end),
- awful.key({ modkey, "Shift" }, "f", function () run_or_raise("firefox", { class = "Namoroka" }) end),
+ awful.key({ modkey, "Shift" }, "f", function () summon("firefox", { class = "Namoroka" }) end),
awful.key({ modkey, "Shift" }, "m", function () spawn("firefox gmail.com") end),
awful.key({ modkey, "Shift" }, "t", function () spawn("thunar") end),

0 comments on commit d3511ed

Please sign in to comment.