LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-01-2022, 03:12 AM   #1
sukritmt786
LQ Newbie
 
Registered: Dec 2022
Posts: 1

Rep: Reputation: 0
My Application (based on python tkinter) is not running at Boot time (autostart) in Raspberry Pi Os?


I have made executable file of python tkinter application. It runs well when clicked. But I want to run it at Boot time (AutoStart) in Raspberry Pi Os.

I have tried many methods but they didn't work.

One method which I tried will other applications:

>sudo nano /etc/xdg/lxsession/LXDE-pi/autostart

@/home/pi/Downloads/exes/project2/work/dist/homeP (@path_of_file/applicatin_name)
This didn't work with my Current application, Even no error is observed. Please help me ??

I have tried many methods but they didn't work.
 
Old 12-02-2022, 05:45 AM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,349

Rep: Reputation: 2331Reputation: 2331Reputation: 2331Reputation: 2331Reputation: 2331Reputation: 2331Reputation: 2331Reputation: 2331Reputation: 2331Reputation: 2331Reputation: 2331
Welcome to LQ, sukritmt786.

I'm no programmer but I can tell you you're probably missing stuff if you're programming on that. It only weighs in about 6G. It's very small with includes, docs, libs, & shares all cut down. I'm trying to slim slarm64 at the moment because I'm low on space on my 20G / partition.
 
Old 12-02-2022, 08:57 AM   #3
computersavvy
Senior Member
 
Registered: Aug 2016
Posts: 3,345

Rep: Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484
Does this file properly execute when the command is entered exactly as you have written it?
Code:
/home/pi/Downloads/exes/project2/work/dist/homeP
If so then may be a matter of entering a proper line for autostart.
If not then there is something wrong with the file itself. Maybe permissions, maybe file structure, ?

You did not state if this is a binary executable or script.
If script then the autostart would try to run it as an 'sh' script while your user likely uses 'bash'. This could present a problem since the shells are different and the script would need to have the shebang line to ensure it is properly executed for whatever shell language is used. The way you phrased this seems it may be a python script/app so it must be executed appropriately.

Note that clicking on a file is not the same as using a command line, and the first step to getting it to run with autostart is ensuring that it properly executes at the command line. If it requires the gui to start then it may not run with autostart.

Last edited by computersavvy; 12-02-2022 at 09:31 AM.
 
Old 12-05-2022, 06:42 AM   #4
floppy_stuttgart
Senior Member
 
Registered: Nov 2010
Location: EU mainland
Distribution: Debian like
Posts: 1,155
Blog Entries: 5

Rep: Reputation: 107Reputation: 107
Create a first file
Quote:
sudo nano /etc/xdg/autostart/bootthescript.desktop
#
#with following content
#
#[Desktop Entry]
#Name=lets boot
#Comment=this is an automatic start script
#Exec=bash /home/pi/myscript_appli.sh
create a second file

Quote:
sudo nano /home/pi/myscript_appli.sh
# then put following content inside it
#
##!/bin/bash
#echo "hahaha"
#wait 30
## or more complex commands
#wait 30
#
go out (store it) and make it executable (in a file manager)
thats it

Last edited by floppy_stuttgart; 12-05-2022 at 06:46 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
python Tkinter - writing a multi page application rhubarbdog Programming 1 12-08-2017 04:28 PM
Text widget in Tkinter(Python on Win 7) not getting updated simultaneously!!! B Akshay Programming 1 02-08-2013 10:49 AM
[SOLVED] python - tkinter application auto start on boot up - problems awn Linux - Newbie 2 05-03-2010 08:28 PM
tomboy autostart in xfce, though not on autostart list zlya Linux - Desktop 2 11-10-2009 10:49 AM
python, tkinter, command is executed when program is run not when button clicked deathalele Programming 5 06-15-2009 03:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:14 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration