kstart详细说明

kstart详细说明

我无法正常工作,因此我正在寻找比手册页更详细的行为描述。尽管手册页描述了所有参数,但关于其一般功能的说法只有“用于启动具有特殊窗口属性的应用程序的实用程序”。例如,调用 shell 何时重新获得控制权 - 立即还是在执行其他操作之后?和kstart之间的行为有何不同(如果有的话)?kstartkstart &

我想kstart在启动时在桌面 1、2 和 3 中启动 Firefox、konsole 和 kmail。(我正在运行 Kubuntu 14.10。)我尝试将其作为启动脚本:

kstart --desktop 1 firefox
kstart --desktop 2 konsole
kstart --desktop 3 kmail

(我使用系统设置/自动启动来安装它。)结果是我的系统挂起了。所以我尝试了这个:

#! /bin/sh
kstart --desktop 1 firefox &
kstart --desktop 2 konsole &
kstart --desktop 3 kmail &
exit

我尝试了其他几种变体,其中大多数都没有挂起,但却将所有三个程序放在了同一个桌面上。

我怎样才能让 kstart 自行运作?

答案1

&符号 &

特殊字符:http://uw714doc.sco.com/en/SDK_tools/_Special_Characters.html

使用 & 符号在后台运行命令

某些 shell 命令需要很长时间才能执行。使用与号(“&”)可在后台模式下执行命令,从而释放终端以执行其他任务。在后台模式下运行命令的一般格式为

命令 &

kstart --help

kstart 有帮助:

:~$ kstart --help
Usage: kstart [Qt-options] [KDE-options] [options] command 

Utility to launch applications with special window properties 
such as iconified, maximized, a certain virtual desktop, a special decoration
and so on.

Generic options:
  --help                    Show help about options
  --help-qt                 Show Qt specific options
  --help-kde                Show KDE specific options
  --help-all                Show all options
  --author                  Show author information
  -v, --version             Show version information
  --license                 Show license information
  --                        End of options

Arguments:
  command                   Command to execute

Options:
  --service <desktopfile>   Alternative to <command>: desktop file to start. D-Bus service will be printed to stdout
  --url <url>               Optional URL to pass <desktopfile>, when using --service
  --window <regexp>         A regular expression matching the window title
  --windowclass <class>     A string matching the window class (WM_CLASS property)
                            The window class can be found out by running
                            'xprop | grep WM_CLASS' and clicking on a window
                            (use either both parts separated by a space or only the right part).
                            NOTE: If you specify neither window title nor window class,
                            then the very first window to appear will be taken;
                            omitting both options is NOT recommended.
  --desktop <number>        Desktop on which to make the window appear
  --currentdesktop          Make the window appear on the desktop that was active
                            when starting the application
  --alldesktops             Make the window appear on all desktops
  --iconify                 Iconify the window
  --maximize                Maximize the window
  --maximize-vertically     Maximize the window vertically
  --maximize-horizontally   Maximize the window horizontally
  --fullscreen              Show window fullscreen
  --type <type>             The window type: Normal, Desktop, Dock, Toolbar, 
                            Menu, Dialog, TopMenu or Override
  --activate                Jump to the window even if it is started on a 
                            different virtual desktop
  --ontop, --keepabove      Try to keep the window above other windows
  --onbottom, --keepbelow   Try to keep the window below other windows
  --skiptaskbar             The window does not get an entry in the taskbar
  --skippager               The window does not get an entry on the pager

但正如 Bug 57575 - 多个异步“kstart --desktop”在随机桌面上启动应用程序时所指出的那样:https://bugs.kde.org/show_bug.cgi?id=57575应该更清楚地说,如果有多个窗口,则窗口/窗口类不是可选的。

这是在这里工作的:

#! /bin/sh
kstart --desktop 1 --windowclass Firefox firefox
kstart --desktop 2 --windowclass Konsole konsole
kstart --desktop 3 --windowclass Kmail kmail

相关内容