I want to execute some commands after login if awesome-windowmanager starts. How can I add startup-commands to the awesome-config?

link|improve this question

77% accept rate
feedback

2 Answers

up vote 3 down vote accepted

According to this ArchLinux wiki you should just need to add the following to your rc.lua:

-- Autorun programs
autorun = true
autorunApps = 
{ 
   "swiftfox",
   "mutt",
   "consonance",
   "linux-fetion",
   "weechat-curses",
}
if autorun then
   for app = 1, #autorunApps do
       awful.util.spawn(autorunApps[app])
   end
end

The wiki also show a couple of other ways to achieve the same effect.

link|improve this answer
Works fine, thanks alot. – Mnementh Apr 14 '10 at 7:39
1  
What happens when you reload awesome? Is autorun set to false later in the config? – lkraav Aug 22 '11 at 21:51
@Ikraav's point is important. – Geoff Mar 16 at 21:36
feedback

I am going with dex, so far.

$ cat /etc/X11/Sessions/awesome 
#!/bin/sh
# Awesome Xsession starter, based on Xsession shipped by x11-apps/xinit-1.0.5-r1
...
zenity --title "Autostart" --timeout=30 --question --text="Launch autostart items?" && dex -a
exec ck-launch-session /usr/bin/awesome

Let's have some autostart items too then:

$ ls -1 ~/.config/autostart/
gol.desktop
KeePass 2.desktop
skype-skype.desktop
tomboy.desktop
wpa_gui-wpa_supplicant.desktop
xterm-logs.desktop

Example autostart item:

$ cat ~/.config/autostart/gol.desktop 

[Desktop Entry]
Type=Application
Terminal=false
Name=Growl For Linux
Comment=Growl Desktop Notification System For Linux
Categories=GNOME;GTK;Utility;
Exec=/usr/bin/gol
Icon=/usr/share/growl-for-linux/data/icon.png
X-GNOME-Autostart-enabled=true
X-KDE-autostart-after=panel
X-Desktop-File-Install-Version=0.18
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.