Tiny Core Base > TCB Tips & Tricks

Quick tricks, calendar, dirty image viewer

(1/3) > >>

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]
  echo \<img src=\"$x\" /\> >> ~/backgrounds.htm
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.

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

<title>GIF Images</title>
<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 }
<iframe name="picture" frameborder="0" width="100%" height="360" src="000.jpg"></iframe>


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
echo "</body></html>" >>Gifs.html
--- End code ---

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

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>

for x in /opt/.backgrounds/*.[gGpPbBjJ][iInNmMpP]*[fFpPgG]
  echo \<img src=\"$x\" /\>\<hr /\> >> ~/backgrounds.html
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 (((:

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 ---


[0] Message Index

[#] Next page

Go to full version