0

I'm trying to run a script right after my Raspberry pi's X server is on, because it runs with a GUI.

After a lot of search, I found out that I could make a script run in the following file

.config/lxsession/LXDE-pi/autostart

and voi-la! It would run automatically when the OS finished loading the UI. My idea was to run a shell that would run a script for me at that moment.

I modified the original code in autostart to the following (just inserted the PULSEOX part):

@lxpanel --profile LXDE-pi
@pcmanfm --desktop --profile LXDE-pi
@xscreensaver -no-splash
@point-rpi

@echo !======================PULSEOX SERVICE START===========================!
@lxterminal --command="/bin/bash -c '/home/pi/Desktop/start-pulseox.sh;/bin/bash'"
@echo !=======================PULSEOX SERVICE  END ===========================

However, when I reboot my Pi, I couldnt see neither the lxterminal, nor my application. After a lot of research, I found out that the log of the autostart session was stored in

sudo nano .cache/lxsession/LXDE-pi/run.log

and when I read it, it seems that it printed out lxterminal usage , what should mean that I didn't pass the right syntax.

<Other Useless stuff......>
!======================PULSEOX SERVICE $
** Message: app.vala:76: Launching lxterminal
** Message: app.vala:76: Launching echo
!=======================PULSEOX SERVICE  END ===========================
** Message: options.vala:107: Create build-in Clipboard
** Message: main.vala:442: Check keymap_mode (null)
** Message: app.vala:76: Launching /usr/bin/ssh-agent
SSH_AUTH_SOCK=/tmp/ssh-pkJCZSNHXNME/agent.487; export SSH_AUTH_SOCK;
SSH_AGENT_PID=489; export SSH_AGENT_PID;
echo Agent pid 489;
** Message: app.vala:130: point-rpi exit with this type of exit: 0
** Message: app.vala:139: Exit normal, don't reload
** Message: app.vala:130: echo exit with this type of exit: 0
** Message: app.vala:139: Exit normal, don't reload
** Message: app.vala:130: echo exit with this type of exit: 0
**Usage:
  lxterminal [Options...] - LXTerminal is a terminal emulator
Options:
  -e, --command=STRING             Execute the argument to this option inside the$
  --geometry=COLUMNSxROWS          Set the terminal's size
  -l, --loginshell                 Execute login shell
  -t, -T, --title=,
    --tabs=NAME[,NAME[,NAME[...]]] Set the terminal's title
  --working-directory=DIRECTORY    Set the terminal's working directory
  --no-remote                      Do not accept or send remote commands
  -v, --version                    Version information**

** Message: app.vala:130: lxterminal exit with this type of exit: 0
** Message: app.vala:139: Exit normal, don't reload
** Message: x-terminal-emulator has very limited support, consider choose another
** Message: x-terminal-emulator has very limited support, consider choose another$
Openbox-Message: Unable to find a valid menu file "/usr/share/lxde/openbox/menu.x$
** Message: Connecting ...
** Message: Status changed to down

** (lxpanel:474): CRITICAL **: dhcpcd_open: Inappropriate ioctl for device
Unit pt-device-manager.service could not be found.

** (lxpanel:474): WARNING **: Battery 0 not found
** (lxpanel:474): WARNING **: Battery 0 not found

** (lxpanel:474): WARNING **: lxpanel: can't load ptbatt plugin
** Message: Status changed to opened
** Message: Connected to dhcpcd-6.11.5
** Message: Status changed to connected
** Message: eth0: CARRIER
** Message: eth0: Configured 10.42.0.73/24
** Message: bt: Name org.bluez unowned on DBus
** Message: va: Name org.bluez unowned on DBus

Could someone help me find out whats wrong?

Thanks!


EDIT

I can run call lxterminal on another terminal the same way I did, and it works. However, inside autostart, I can't =(

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.