Tiny Core Base > TCB Tips & Tricks

Quick tricks, calendar, dirty image viewer

(1/3) > >>

MakodFilu:
a) Just click anywhere in your desktop for the pop-up menu, select Run command and input the following:

aterm -title Calendar --geometry 40x18 -e dialog --no-cancel --calendar "Use cursor keys to navigate" 0 38

Voilá! A browsable calendar.


b)  Create a text file named background-viewer.sh somewhere (i. e. your home directory):

--- Code: ---#!/bin/sh
for x in /opt/.backgrounds/*.[jJ][pP]*[gG]
do
  echo \<img src=\"$x\" /\> >> ~/backgrounds.htm
done
help ~/backgrounds.htm

--- End code ---

cp your photos to /opt/.backgrounds  (note the dot) and you are set, an image viewer, gmail style. Works with .bmp and .png too, just edit the dedicated line.


c) rm /usr/bin/unlzma    # The unlzma applet is not in busybox anymore.

d) update syslinux. The bundled version behave funny when splash screens are present.

mikshaw:
I had no idea there was a built-in calendar in dialog.  Nice.

I've been using a similar (less dirty) html generator to list and view animated gifs, since most Linux image viewers don't show the animation. Note it relies on CSS and iframe support, and has a couple of minor things customized to my system.

--- Code: ---cat << EOF > Gifs.html

<html>
<head>
<title>GIF Images</title>
</head>
<style type="text/css">
a { font-family: verdana, arial, helvetica, sans-serif; font-size: 10;
color: #000000; text-decoration: none; padding: 2px; line-height: 2em;
border-style: solid; border-width: 1px; border-color: #DDDDDD }
a:hover { border-color: #000000 }
</style>
<body>
<iframe name="picture" frameborder="0" width="100%" height="360" src="000.jpg"></iframe>
<hr/>

EOF

for i in *.[Gg][Ii][Ff]; do
name=`echo "$i"|sed 's/\.[Gg][Ii][Ff]$//'`
size=`ls -lh "$i" | awk '{print $5}'`
echo "<a href=\"$i\" target=\"picture\" title=\"$i - $size\">$name</a>" >>Gifs.html
done
echo "</body></html>" >>Gifs.html
--- End code ---

tobiaus:
using the help viewer is inspired, though :) i just noticed it yesterday.

MakodFilu:
That's it, that is the trick. No .tce nor .tcz needed.

Unfortunately, animated gif don't work, not even CSS. However, borrowing from mikshaw script:


--- Code: ---#!/bin/sh
cat << EOF > ~/backgrounds.html
<html><head><title>Available backgrounds</title>
</head>
<body>
EOF

for x in /opt/.backgrounds/*.[gGpPbBjJ][iInNmMpP]*[fFpPgG]
do
  echo \<img src=\"$x\" /\>\<hr /\> >> ~/backgrounds.html
done
echo "</body></html>" >>~/backgrounds.html

help ~/backgrounds.html

--- End code ---

Now it can show all your available wallpapers for you to choose. Beware, the code as it is would also load .pig files, so take care not to make this code look even dirtier by misplacing files in /opt/.backgrounds (((:

^thehatsrule^:
If you are worried about that, you could use something like this instead:

--- Code: ---for x in `ls -1 /opt/.backgrounds/ | grep -i  "\.\(gif\|png\|bmp\|jpg\|jpeg\)" `
--- End code ---

Navigation

[0] Message Index

[#] Next page

Go to full version