Tiny Core Extensions > TCE Q&A Forum

PPI question-where does what file go in original apps.

<< < (3/3)

softwaregurl:
I have posted more details of the problems on my own forum because it is lengthy and more to do with my own projects then TCL. Feel free to copy and paste anything back here that you would like.
I just started http://softwaregurl.com/forum/index.php/topic,7.0.html with details.

mikshaw:
I know naught about fifo, so I probably can't help with your problem.  I can, however, be an annoyance by suggesting some code cleanup =o)


--- Quote from: softwaregurl ---[ -f /tmp/.mediaswg ] || mkdir -p /tmp/.mediaswg
--- End quote ---
There is a test specific to directories.  You can also set the mode when the directory is created:

--- Code: ---[ -d /tmp/.mediaswg ] || mkdir -p /tmp/.mediaswg -m 777
--- End code ---
The -d test may cause trouble for mkdir if there is already a regular file of that name, although my guess is there shouldn't be one.


--- Quote ---cat /home/"$USER"/.jwmrc-tray  | sed ...
--- End quote ---
You don't need to cat the file and pipe to sed.  You can use sed -i expression filename to edit the file in place with a single process.


--- Quote ---sed blanks the line but leaves a newline
--- End quote ---
This is because you are substituting (s/old/new/) rather than deleting (/pattern/d).  Not tested, but I think it should work:

--- Code: ---sed -i '/watcher2h/d;/adjvolumefifo/d' /home/"$USER"/.jwmrc-tray
--- End code ---
The patterns may need adjusting if you have them in other lines that you need to keep.

softwaregurl:
Thanks JLS for the link.  It helped a lot.
and thanks mikshaw for the cleanup tips.
and thanks curaga and roberts and jasonw and ... and ... and ...
the fifo problem disappeared suddenly and I have no clue why other then i changed keyboards.   ???  Maybe its been too long since it had a cold boot.
i stumbled on the symlink problem.  on boot $HOME is / but using appbrowser $USER is root so i was linking to /home/root/......
this fixed that for now but i will still hard code in for the app to find home later.
--- Code: ---#link to local data
if [ ! -L /usr/local/mediaswg/localdata ]; then
  if [ "$USER" != "root" ]; then
    sudo ln -s /home/"$USER"/.mediaswg/localdata /usr/local/mediaswg/
  else
        sudo ln -s "$HOME"/.mediaswg/localdata /usr/local/mediaswg/
  fi
fi

--- End code ---
anyway the first version is released on my site and submitted.
ttyl
-SG

Navigation

[0] Message Index

[*] Previous page

Go to full version