Skip to content

Commit

Permalink
update to the new way of running tasks on startup in MiSTer
Browse files Browse the repository at this point in the history
  • Loading branch information
sigboe committed Nov 22, 2021
1 parent 6bd1059 commit be0be8a
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions mistress.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# Dialog
locale.setlocale(locale.LC_ALL, '')
d = Dialog(dialog="dialog", autowidgetsize=True)
d.set_background_title("RSS Wallpaper v0.1")
d.set_background_title("MiSTress RSS Wallpaper v0.2")
# Parse command line options (ie. -u)
parser = argparse.ArgumentParser(description='enable/disable daemon that writes an rss feed to the wallpaper.')
parser.add_argument('--updaterss', '-u', help='update wallpaper with latest rss', action='store_true')
Expand All @@ -40,8 +40,8 @@
shadowcolor = "white"
(x, y) = (24, 200)
# init system
inittab = '/etc/inittab'
initline = '::sysinit:/media/fat/Scripts/mistress -u'
inittab = '/media/fat/linux/user-startup.sh'
initline = '/media/fat/Scripts/mistress -u'
# mister api
mistercmd = '/dev/MiSTer_cmd'
corename = '/tmp/CORENAME'
Expand Down Expand Up @@ -76,13 +76,15 @@
# Exit
sys.exit()

#enabling this will make it run via init system
# https://buildroot.org/downloads/manual/manual.html#_init_system
#enabling this will make it run via startup script

if ( not os.path.isfile(inittab)):
os.close(os.open(inittab, os.O_CREAT))

serviceenabled = False
with open(inittab) as origin:
for line in origin:
if not initline in line:
serviceenabled = False
continue
try:
serviceenabled = True
Expand Down

0 comments on commit be0be8a

Please sign in to comment.