相关疑难解决方法(0)

桌面加载后执行脚本?

我想在启动时执行 bash 脚本,在不同的工作区中打开多个终端。如果我从终端调用脚本,脚本工作得很好,但如果使用 @reboot 从 crontab 执行,则脚本不起作用:

#!/usr/bin/env bash

#1 make sure we have enough workspaces
gconftool-2 --set -t int /apps/metacity/general/num_workspaces 7

#2. Launch programs in these terminals
wmctrl -s 6
gnome-terminal --full-screen --execute bash -c "tmux attach; bash"
wmctrl -s 5
gnome-terminal --full-screen --execute bash -c "weechat-curses; bash"
wmctrl -s 4
gnome-terminal --full-screen --execute bash -c "export TERM=xterm-256color; mutt; bash"
wmctrl -s 3 
gnome-terminal --full-screen
wmctrl -s 2
gnome-terminal --full-screen
wmctrl -s 1
gnome-terminal --full-screen
wmctrl -s 0
google-chrome …
Run Code Online (Sandbox Code Playgroud)

command-line bash crontab cron

5
推荐指数
1
解决办法
1万
查看次数

标签 统计

bash ×1

command-line ×1

cron ×1

crontab ×1