2

In LXDE, is it correct that lxpanel is where we can invoke other programs?

How can I restart lxpanel using command line?

Will restarting lxpanel affect (e.g. kill, or send some signal to) processes invoked from lxpanel to run other programs? What processes will be affected and what not?

Although my question is specific to LXDE, I suspect it also applies to other desktop environments assuming they share the similar designs regarding their "panels".

Thanks.

Tim
  • 101,790

4 Answers4

3
  1. Yes, it is possible to invoke other programs with LXPanel. LXPanel is configurable, but generally includes a taskbar, a start menu (called the Main Menu in LXPanel), and a terminal-like "Run" dialog usually invoked with Alt+F2.
  2. To restart LXPanel, you will need to know the name of your LXPanel profile. It is probably either Lubuntu, if you're running Lubuntu, or LXDE otherwise, as these are the defaults and most people do not rename these default profile names. You can usually get a list of available profiles with this command:

    find ~/.config/lxpanel -maxdepth 1 -mindepth 1 -type d -print0 | xargs -0 basename --multiple
    

    Once you have your profile name, then enter the following in a terminal, replacing $LXPANEL_PROFILE with your profile name:

    killall lxpanel
    nohup lxpanel -p $LXPANEL_PROFILE &
    

    The nohup part ensures lxpanel won't quit when your terminal window is closed.

  3. Killing or restarting lxpanel has no effect on other programs that were launched through either the menu or the "Run" dialog. Programs continue to operate normally and task switching via Alt+Tab works fine.

3

You can use lxpanelctl to restart an existing LXPanel. If LXPanel is running, you can run the command from Alt+F2 prompt or a terminal:

lxpanelctl restart

This command will not work if LXPanel is not running, but it is useful if you want LXPanel to reload configuration. The restart does not affect programs started from LXPanel. For example, if you start LXTerminal from LXPanel menu and run the above command, LXTerminal will not terminate. But LXPanel widgets will be reloaded. For example, "CPU Usage Monitor" widget will start fresh.

1

I haven't tried it with LXDE, but in theory, it should not terminate those processes unless:

a. It is a session leader, which is unlikely. b. It voluntarily decides to kill them. c. Some other process terminates them as a result of the lxpanel (or other launcher) termination.

I don't think any of those is the case of lxpanel. In some more monolithic environment (e.g., Gnome Shell), some similar action might cause termination of whole shell and consequently all the apps.

Related answer: https://unix.stackexchange.com/a/158736/58388

v6ak
  • 365
1

lxpanel can be used as a place to start other apps, yes. For example, on my Debian LXDE system I have a top panel with an application bar. That application bar has a number of app short cuts on it. Clicking on the shortcut starts that app.

So I have one short cut that starts Quartus. When it's running...

% pstree -p -s 29439
systemd(1)---lightdm(915)---lightdm(2002)---lxsession(2027)---lxpanel(2103)---q+

% ps -p 29439 -o 'pid,pgid,ppid,cmd'
  PID  PGID  PPID CMD
29439  2027  2103 quartus

Note the process group leader is lxsession.

Let's kill lxpanel...

% kill 2103

% pstree -p -s 29439
systemd(1)---quartus(29439)---{quartus}(29468)

% ps -p 29439 -o 'pid,pgid,ppid,cmd'
  PID  PGID  PPID CMD
29439  2027     1 quartus

That looks like a traditional re-parenting.

We can restart it with

% lxpanel --profile LXDE

Note this is where things start to get annoying. This is a foreground process, so you will have problems closing the terminal. It also doesn't always (in my experience) show exactly the same stuff. So I try to never kill lxpanel and just restart it, if it's ever necessary, with lxpanelctl --restart