[mdlug] Adding a shell script to run after boot.

Adam Behnke abehnke at gmail.com
Wed Apr 17 09:26:24 EDT 2013


the script currently, works in terminal, fails on startup

#!/bin/bash -l
echo "initializing"
if [ "$(ls -A /media/videowall9)" ]; then
umount /media/videowall9
rmdir /media/videowall9
fi
if [ "$(ls -A /media)" ]; then
echo "Found USB Drives"
else
echo "Mounting USB Drives"
mkdir /media/videowall9
mount -t vfat /dev/disk/by-label/VIDWALL /media/videowall9 -o
uid=1000,gid=1000,utf8,dmask=027,fmask=137
echo "Found USB Drives"
fi
echo "scanning drives and creating the playlist"
find /media/* -type f -iname "*.mp4" > /home/user/playlist.txt
find /media/* -type f -iname "*.avi" >> /home/user/playlist.txt
find /media/* -type f -iname "*.mov" >> /home/user/playlist.txt
find /media/* -type f -iname "*.mpg" >> /home/user/playlist.txt
find /media/* -type f -iname "*.ogg" >> /home/user/playlist.txt
echo "--------------------------"
echo "launching playlist"
mplayer -vo xv -fs -stop-xscreensaver -loop 0 -zoom -playlist
/home/user/playlist.txt



------

the xsession-errors

openConnection: connect: No such file or directory
cannot connect to brltty at :0
ls: cannot access /media/videowall9: No such file or directory
find: `/media/VIDWALL': Permission denied
find: `/media/VIDWALL': Permission denied
find: `/media/VIDWALL': Permission denied
find: `/media/VIDWALL': Permission denied
find: `/media/VIDWALL': Permission denied

(polkit-gnome-authentication-agent-1:1467): GLib-CRITICAL **:
g_variant_new_string: assertion `string != NULL' failed

(polkit-gnome-authentication-agent-1:1467): polkit-gnome-1-WARNING **:
Failed to register client:
GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name
org.gnome.SessionManager was not provided by any .service files

(xfce4-settings-helper:1493): xfce4-settings-helper-WARNING **: Failed to
get the _NET_NUMBER_OF_DESKTOPS property.
** Message: applet now removed from the notification area
** Message: using fallback from indicator to GtkStatusIcon
** Message: applet now embedded in the notification area

(xfce4-indicator-plugin:1655): libindicator-WARNING **: IndicatorObject
class does not have an accessible description.

(xfce4-indicator-plugin:1655): libindicator-WARNING **: IndicatorObject
class does not have an accessible description.
** Message: moving back from GtkStatusIcon to indicator
** Message: applet now removed from the notification area

(xfce4-indicator-plugin:1655): Gtk-CRITICAL **: IA__gtk_widget_realize:
assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed
Error while parsing playlist
Warning: empty playlist
Error parsing option on the command line: -playlist


------

i think i need to brew some coffee and ponder these for a while.


On Tue, Apr 16, 2013 at 1:23 PM, Adam Behnke <abehnke at gmail.com> wrote:

> i just tried sudo mount -a in terminal and it didn't mount the usb drive,
> it seems the usb drives don't automount on this system. right clicking and
> mounting from the gui works fine.
>
> i'll configure the automount and i'm reading up on d-feet
>
>
> On Tue, Apr 16, 2013 at 12:59 PM, Adam Tauno Williams <
> awilliam at whitemice.org> wrote:
>
>> On Tue, 2013-04-16 at 12:42 -0400, Adam Behnke wrote:
>> > i'm starting to see my issue, it's timing. i should make it mount
>> whatever
>> > usb drives are present before it searches for the content. to
>> google.... lol
>>
>> Why waste time beating a search engine for this issue and sorting
>> through the resulting swill?
>>
>> Just "mount -a" [as root] will mount all defined volumes.
>>
>> Devices can also be set to automount.  A dbus service will notify you
>> when such an event occurs [use "d-feet" and you should be able to see
>> the event happen or the service to register with].
>>
>>   gsettings set org.gnome.desktop.media-handling automount true
>>
>> Listening for the signal with Python is trivial, then when you see an
>> automount, just do whatever you need to do.  Being event driven is the
>> only solution that is going to be reliable.
>>
>> For example - to query for network connectivity [in a reliable d-bus way
>> -
>> <http://www.whitemiceconsulting.com/2011/12/querying-connectivity.html>
>>
>>
>> _______________________________________________
>> mdlug mailing list
>> mdlug at mdlug.org
>> http://mdlug.org/mailman/listinfo/mdlug
>>
>
>


More information about the mdlug mailing list