toornikee
Posts: 23
Joined: Mon Jun 05, 2017 11:47 am

schedule tasks

Wed Jun 07, 2017 12:43 pm

hello everyone,

i am begginer on raspbian. i installed raspbian, instaled VLC player and gnome schedule tasks. i want to run vlc player every time pc starts. i typed in schedule tasks tu open the code >>> vlc '/home/pi/Desktop/mu/' , but it did nothing. mus is the folder with music. when i type it in terminal >>>> vlc '/home/pi/Desktop/mu/' >> player starts and music starts.

can somebody help me with this task? maby you know much more cool app for schedule task? can anyone help me?

thanks

W. H. Heydt
Posts: 12783
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: schedule tasks

Wed Jun 07, 2017 1:37 pm

The usual way to run scheduled tasks in Linux is to use cron. You create the entries with the command "crontab -e". It is entirely possible that the Gnome scheduler is just a wrapper for crontab. The think the understand about running things under cron is that the normal environment, such as execution paths isn't available (no login shell has been created) so *everything* should be specified. The easiest way to do that is to embed your commands in a shell script, where you can set any environment variables needed, and then invoke the shell script using an absolute path. For an example, this is a set up and a shell script from my alarm clock:

Code: Select all

# Normal Saturday
00 08 * * 6 /home/pi/bin/runkdfc

Code: Select all

#!/bin/bash

PATH=/home/pi/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games
export DISPLAY=:0.0

lxterminal --geometry=58x6 -e mplayer -cache 512 -volume 100 -playlist http://playerservices.streamtheworld.com/pls/KDFCFMAAC.pls

User avatar
KLL
Posts: 1453
Joined: Wed Jan 09, 2013 3:05 pm
Location: thailand
Contact: Website

Re: schedule tasks

Wed Jun 07, 2017 1:42 pm

toornikee wrote:i want to run vlc player every time pc starts
pls search for
auto start after boot to desktop ...
i think "schedule tasks" not fits.

Martin Frezman
Posts: 1009
Joined: Mon Oct 31, 2016 10:05 am

Re: schedule tasks

Wed Jun 07, 2017 1:47 pm

What I'd like to know is why people want to run VLC instead of omxplayer.

Yes, VLC is better (on a machine capable of running it - i.e., x86), but running it on Pi has always been an exercise in futility for me. It almost, sort of, kind of works...

It seems like it is always the case that a hardware accelerated version of VLC, which is easily available and accessible to the general user public, is always "just around the corner" (but not quite there yet).
If this post appears in the wrong forums category, my apologies.

Martin Frezman
Posts: 1009
Joined: Mon Oct 31, 2016 10:05 am

Re: schedule tasks

Wed Jun 07, 2017 3:02 pm

Language!

Where are the mods???

(I remember back in the old days on this board/forum, if anyone used even a very mild off-color word, it spawned threads that went on for days...)
If this post appears in the wrong forums category, my apologies.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 26714
Joined: Sat Jul 30, 2011 7:41 pm

Re: schedule tasks

Wed Jun 07, 2017 3:09 pm

Martin Frezman wrote:Language!

Where are the mods???

(I remember back in the old days on this board/forum, if anyone used even a very mild off-color word, it spawned threads that went on for days...)
We spend all our time checking your posts, doesn't leave much time for anything else.

This is a reactively moderated forum - we don't read all the posts and rely on reports to take down ones that are unsuitable. This one was taken down as soon as I saw the report.

Now, back to our usual task of checking/deleting/reading reports on your posts.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

Martin Frezman
Posts: 1009
Joined: Mon Oct 31, 2016 10:05 am

Re: schedule tasks

Wed Jun 07, 2017 3:13 pm

See? I'm all about full employment for mods.
Wouldn't want any layoffs (I guess the UK version of that is "redundancies").
If this post appears in the wrong forums category, my apologies.

W. H. Heydt
Posts: 12783
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: schedule tasks

Wed Jun 07, 2017 4:39 pm

Martin Frezman wrote:See? I'm all about full employment for mods.
Wouldn't want any layoffs (I guess the UK version of that is "redundancies").
For some values of "employment". (For the benefit of those who haven't been around too long--this *is* the Beginners Forum--the forum moderators do it voluntarily. While some are otherwise employed by the RPF, most are not. Be kind to them.)

W. H. Heydt
Posts: 12783
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: schedule tasks

Wed Jun 07, 2017 4:44 pm

Further note for the OP... If you need the GUI desktop to be up before your program starts (and that's likely true of VLC) you can put the command to run it in ~/.config/lxsession/LXDE-pi/autostart. Just be aware that upgrades to Raspbian have been known to install new versions of this file that will wipe out your changes. Best to keep your changes simple enough to rebuild at need, and the check the file after upgrades.

Martin Frezman
Posts: 1009
Joined: Mon Oct 31, 2016 10:05 am

Re: schedule tasks

Thu Jun 08, 2017 3:05 am

Martin Frezman wrote:See? I'm all about full employment for mods..
And while we're on the subject, check out:

viewtopic.php?p=1171988#p1171988

which contains "the S word" (repeated, I might add, many times in that thread via the quoting mechanism). Interestingly enough, searching for that word gets an amazing 70 hits. FWIW, I get the impression that the word is considered more of a bad word in the US than in the UK. In the US, it is a first class bad word (alongside the "F word"), but (I think, based on things I've read) in the UK, it is more in the class of d**n and h**l, etc.

Yes, I've got too much time on my hands...
If this post appears in the wrong forums category, my apologies.

Return to “Beginners”