如何在启动时以真棒方式执行命令?

Mne*_*nth 10 boot awesome-wm

如果 awesome-windowmanager 启动,我想在登录后执行一些命令。如何将启动命令添加到 awesome-config?

hea*_*vyd 10

根据这个ArchLinux wiki,您只需要将以下内容添加到您的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
Run Code Online (Sandbox Code Playgroud)

wiki 还展示了其他几种实现相同效果的方法。

  • 当你重新加载 awesome 时会发生什么?稍后在配置中将 autorun 设置为 false 吗? (6认同)

lkr*_*aav 8

到目前为止,我正在使用dex

$ 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
Run Code Online (Sandbox Code Playgroud)

让我们也有一些自动启动项目:

$ ls -1 ~/.config/autostart/
gol.desktop
KeePass 2.desktop
skype-skype.desktop
tomboy.desktop
wpa_gui-wpa_supplicant.desktop
xterm-logs.desktop
Run Code Online (Sandbox Code Playgroud)

示例自动启动项:

$ 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
Run Code Online (Sandbox Code Playgroud)