lxqt/lxqt-config

[Feature request] Allow more complex commands in Autostart

ceever opened this issue · 5 comments

Whenever adding a autostart command via the "LXQt Session Settings", it will only allow simple types of commands such that everything more complex must be put into some script stored somewhere else and then the script needs to be provided as command in the autostart command.

Autostart will fail on complex comnands like:

dbus-monitor --session "type=signal,interface=org.gtk.Actions" | while read i; do [[ -n "$(echo "$i" | grep libreoffice)" ]] && sleep 5 && touch ~/libre.chk; done

or even

bash -c 'dbus-monitor --session "type=signal,interface=org.gtk.Actions" | while read i; do [[ -n "$(echo "$i" | grep libreoffice)" ]] && sleep 5 && touch ~/libre.chk; done'
Expected Behavior

Accept any command that would also execute in the terminal.

Current Behavior

Autostart will not execute such a complex command as above.

Steps to Reproduce (for bugs)
  1. Create a more complex autostart command with pipes, quotes, semicolons and *&*s
  2. Log off, log on
  3. Check whether the command was executed
Context

Due to this limitation, users will often have to come up with additional places to store such scripts with more complex commands. This kind of diminishes the usefulness of the Autostart settings GUI/tool.

System Information
  • Distribution & Version: Ubuntu 22.10
  • Kernel: lubuntu 5.19.0-21-generic
  • Qt Version: 5.15.6
  • liblxqt Version: ?
  • lxqt-build-tools Version: ?
  • Package version: ?

Afaik what is forbidden is && in .desktop files , commands like Exec=bash -c "if [ $wayland_compositor = "wayfire" ];then /home/stef/bin/alpha-script.py;fi" do work.

🤔 Mhhh, but why base the whole thing onto .desktop files? This way one carries along the shortcoming of the .desktop specification.

I maybe wrong, the specs are here: https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html#exec-variables

Mhhh, but why base the whole thing onto .desktop files?

Autostart feature is shared between DE's, it's not our invention.

🤷🙏

but why base the whole thing onto .desktop files?

Auto-start is nothing but a desktop file inside ~/.config/autostart/.