mirror of
https://github.com/vincentbernat/i3wm-configuration.git
synced 2025-07-16 13:14:20 +02:00
start: start apps only when awesome is ready
This commit is contained in:
parent
f98ec2017f
commit
1367a9bad1
2 changed files with 30 additions and 7 deletions
|
@ -10,20 +10,17 @@ awful.rules.rules = {
|
||||||
buttons = config.mouse.client }},
|
buttons = config.mouse.client }},
|
||||||
-- Emacs
|
-- Emacs
|
||||||
{ rule = { class = "Emacs" },
|
{ rule = { class = "Emacs" },
|
||||||
properties = { tag = config.tags.emacs,
|
properties = { tag = config.tags.emacs }},
|
||||||
switchtotag = true }},
|
|
||||||
-- Browser stuff
|
-- Browser stuff
|
||||||
{ rule_any = { name = { "Iceweasel", "Firefox", "Chromium" } },
|
{ rule_any = { name = { "Iceweasel", "Firefox", "Chromium" } },
|
||||||
properties = { tag = config.tags.www,
|
properties = { tag = config.tags.www }},
|
||||||
switchtotag = true }},
|
|
||||||
{ rule = { instance = "plugin-container" },
|
{ rule = { instance = "plugin-container" },
|
||||||
properties = { floating = true }}, -- Flash with Firefox
|
properties = { floating = true }}, -- Flash with Firefox
|
||||||
{ rule = { instance = "exe", class="Exe", instance="exe" },
|
{ rule = { instance = "exe", class="Exe", instance="exe" },
|
||||||
properties = { floating = true }}, -- Flash with Chromium
|
properties = { floating = true }}, -- Flash with Chromium
|
||||||
-- Pidgin
|
-- Pidgin
|
||||||
{ rule = { class = "Pidgin" },
|
{ rule = { class = "Pidgin" },
|
||||||
properties = { tag = config.tags.im,
|
properties = { tag = config.tags.im }},
|
||||||
switchtotag = true }},
|
|
||||||
{ rule = { class = "Pidgin" },
|
{ rule = { class = "Pidgin" },
|
||||||
except = { role = "buddy_list" }, -- buddy_list is the master
|
except = { role = "buddy_list" }, -- buddy_list is the master
|
||||||
properties = { }, callback = awful.client.setslave },
|
properties = { }, callback = awful.client.setslave },
|
||||||
|
|
28
rc/start.lua
28
rc/start.lua
|
@ -2,6 +2,16 @@
|
||||||
|
|
||||||
-- run a command only if the client does not already exist
|
-- run a command only if the client does not already exist
|
||||||
xrun = function(name, cmd)
|
xrun = function(name, cmd)
|
||||||
|
-- Try first the list of clients from awesome
|
||||||
|
local clients = client.get()
|
||||||
|
local client
|
||||||
|
for _, client in pairs(clients) do
|
||||||
|
if client.name == name or client.class == name or client.instance == name then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Not found, let's check with xwininfo. We can only check name...
|
||||||
if os.execute("xwininfo -name '" .. name .. "' > /dev/null 2> /dev/null") == 0 then
|
if os.execute("xwininfo -name '" .. name .. "' > /dev/null 2> /dev/null") == 0 then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
@ -60,18 +70,34 @@ end
|
||||||
os.execute(table.concat(execute, ";"))
|
os.execute(table.concat(execute, ";"))
|
||||||
|
|
||||||
-- Spawn various X programs
|
-- Spawn various X programs
|
||||||
startapps = function()
|
startapps = function(now)
|
||||||
|
-- xrun can only be used when awesome has started
|
||||||
|
if not now then
|
||||||
|
local stimer = timer { timeout = 0 }
|
||||||
|
stimer:add_signal("timeout", function()
|
||||||
|
stimer:stop()
|
||||||
|
startapps(true)
|
||||||
|
end)
|
||||||
|
stimer:start()
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
xrun("polkit-gnome-authentication-agent-1",
|
xrun("polkit-gnome-authentication-agent-1",
|
||||||
"/usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1")
|
"/usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1")
|
||||||
xrun("Bluetooth Applet",
|
xrun("Bluetooth Applet",
|
||||||
"bluetooth-applet")
|
"bluetooth-applet")
|
||||||
xrun("Pidgin", "pidgin -n")
|
xrun("Pidgin", "pidgin -n")
|
||||||
|
xrun("emacs")
|
||||||
|
|
||||||
if config.hostname == "neo" then
|
if config.hostname == "neo" then
|
||||||
xrun("keepassx", "keepassx -min -lock")
|
xrun("keepassx", "keepassx -min -lock")
|
||||||
xrun("Transmission", "transmission-gtk -m")
|
xrun("Transmission", "transmission-gtk -m")
|
||||||
|
xrun("chromium")
|
||||||
elseif config.hostname == "guybrush" then
|
elseif config.hostname == "guybrush" then
|
||||||
xrun("keepassx", "keepassx -min -lock")
|
xrun("keepassx", "keepassx -min -lock")
|
||||||
xrun("NetworkManager Applet", "nm-applet")
|
xrun("NetworkManager Applet", "nm-applet")
|
||||||
|
xrun("chromium")
|
||||||
|
elseif config.hostname == "naruto" then
|
||||||
|
xrun("iceweasel")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue