11

I've been reading as much as I can online, but none of it seems to work (i.e. changing ~/.config/awesome/rc.lua).

I've installed awesome window manager from the repos, and I log into it via GDM, and now I'd like to get it to start a few applications every time I log into the session.

fossfreedom
  • 172,746
Jonathan
  • 7,450

5 Answers5

12
awful.util.spawn("conky")
awful.util.spawn("nm-applet")

Lines like these at the bottom of your .config/awseome/rc.lua will do the trick. If you want it simple. At least, that's what the awesome-wiki calls simple.

9

Starting from a template

First you'll need to copy the template rc.lua file into your home folder

mkdir ~/.config/awesome
cp /etc/xdg/awesome/rc.lua ~/.config/awesome/

Defining applications to start

Now using awesome - edit config copy the following code at the bottom of your new rc.lua file

do
  local cmds =
  {
    "firefox",
    "xedit"
  }

  for _,i in pairs(cmds) do
    awful.util.spawn(i)
  end
end

In this example - firefox and xedit are run on startup.

An excellent wiki page describing this and much more can be found on ArchLinux

fossfreedom
  • 172,746
3

you can use single_instance or once and pass them rules like this

awful.spawn.single_instance("firefox", awful.rules.rules)
0

to prevent double launch:

do
  local autostarts =
  {
    "safeeyes",
  }

  for _,i in pairs(autostarts) do
    awful.spawn.easy_async_with_shell(
      'ps -C '.. i ..' |wc -l',
      function(stdout, stderr, reason, exit_code) 
        gears.debug.dump(stdout)
        if tonumber(stdout) or 0 < 2 then
          awful.spawn(i)
        end
      end
    )
  end
end
Codebling
  • 239
0xdeface
  • 101
0

After an upgrade of Awesome, the solution:

awful.util.spawn("nm-applet &")

make it crash (return to the login prompt).

However, it works great with:

os.execute("nm-applet &")

Related ticket: awesome crashes when using awful.util.spawn() on startup

Maxime
  • 312