Tiny < 100b Apps - text editor, image viewer, calendar....
- technosaurus
- Posts: 4853
- Joined: Mon 19 May 2008, 01:24
- Location: Blue Springs, MO
- Contact:
Tiny < 100b Apps - text editor, image viewer, calendar....
Here is a simple gtkdialog3 script that I wrote
#! /bin/sh
export PV='<window><button><input file>'$1'</input></button></window>'
gtkdialog3 --program=PV
I can make a pet if anyone is interested.
in the mean time just save it as a text file, change the permissions and drag an image file to it
or by command line
./whatever_ you_name_it /path/to/image
#! /bin/sh
export PV='<window><button><input file>'$1'</input></button></window>'
gtkdialog3 --program=PV
I can make a pet if anyone is interested.
in the mean time just save it as a text file, change the permissions and drag an image file to it
or by command line
./whatever_ you_name_it /path/to/image
Last edited by technosaurus on Sun 29 Mar 2009, 00:47, edited 1 time in total.
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].
hi technosaurus,
i think alternatively you could use
instead of <button> (as there is no aktion to define). Like this:
A question (i'm not running puppy right now): What does happen, if the pic is larger than the screen?
aragon
i think alternatively you could use
Code: Select all
<pixmap>...</pixmap>
Code: Select all
#! /bin/sh
export PV='<window><pixmap><input file>'$1'</input></pixmap></window>'
gtkdialog3 --program=PV
aragon
PUPPY SEARCH: http://wellminded.com/puppy/pupsearch.html
You only see what fits on the screen (with either the pixmap or button version. If you then maximise the window you can see the whole picture.A question (i'm not running puppy right now): What does happen, if the pic is larger than the screen?
Interestingly, on a slow computer, with a large picture, the button version seems to take about 3-4 times as long to load the picture.
Also, I notice that by clicking (or clicking and dragging, or something) on the picture I can crash the button version, but not the pixmap version.
I have previously wondered whether I could build an image browser that displays exif thumbnails using jhead and gtkdialog, but I couldn't get gtkdialog to display the output of a command... I still wonder if it is possible.
Do you know a good gtkdialog program? Please post a link here
Classic Puppy quotes
ROOT FOREVER
GTK2 FOREVER
Classic Puppy quotes
ROOT FOREVER
GTK2 FOREVER
To scale picture to fit screen you can use 'resizepng'.
Fullscreen view would be something like:
Fullscreen view would be something like:
Code: Select all
WIDTH=`xrandr -q | grep '*' | egrep "[0-9]+[ ]*x[ ]*[0-9]+" -o | cut -d "x" -f 1`
HEIGHT=`xrandr -q | grep '*' | egrep "[0-9]+[ ]*x[ ]*[0-9]+" -o | cut -d "x" -f 2`
resizepng $1 /tmp/pv.png $WIDTH $HEIGHT 50
export PV='<window><pixmap><input file>/tmp/pv.png</input></pixmap></window>'
gtkdialog3 --program=PV
Does that only work with png files? I guess there are other programs anywayTo scale picture to fit screen you can use 'resizepng'.
You can also specify window geometry with gtkdialog can't you?
Yes I know, but I don't want toIf you redirect the output to a file, you can.
Do you know a good gtkdialog program? Please post a link here
Classic Puppy quotes
ROOT FOREVER
GTK2 FOREVER
Classic Puppy quotes
ROOT FOREVER
GTK2 FOREVER
This works for jpeg... may be inefficient
Scale2pics must be presenthttp://murga-linux.com/puppy/viewtopic.php?t=29184
Code: Select all
#! /bin/bash
WIDTH=`xrandr -q | grep '*' | egrep "[0-9]+[ ]*x[ ]*[0-9]+" -o | cut -d "x" -f 1`
HEIGHT=`xrandr -q | grep '*' | egrep "[0-9]+[ ]*x[ ]*[0-9]+" -o | cut -d "x" -f 2`
Scale2pic $1 /tmp/pv.jpg $WIDTH $HEIGHT 50
export PV='<window><pixmap><input file>/tmp/pv.png</input></pixmap></window>'
gtkdialog3 --program=PV
Puppy Linux Blog - contact me for access
Dear Puppians,
I have been using the following code as my standard gif viewer for about a year:
What is nice about this general solution is that GTK's pixbuf function is much faster than most dedicated animated gif viewers. I added a little info screen that calls "file" to retrieve a bit of information about the pixmap. The little script is attached. I made an association in rox to use this viewer by default for gifs.
With kind regards,
vovchik
I have been using the following code as my standard gif viewer for about a year:
Code: Select all
#! /bin/bash
# -----------------
# get pic info
# -----------------
mypic=$1
mypicinfo=`file "$mypic"`
mypicbase=`basename $mypic`
# -----------------
# make pic gui
# -----------------
export show_pic='
<window title="PShowPic: '$mypicbase'" icon-name="gtk-refresh">
<vbox>
<frame>
<pixmap>
<input file>'$mypic'</input>
</pixmap>
</frame>
<hbox>
<button help>
<action>"gtkdialog3 --program=show_pic_help --center"</action>
</button>
</hbox>
</vbox>
</window>
'
# -----------------
# make help gui
# -----------------
export show_pic_help='
<window title="PshowPic Info" icon-name="gtk-about">
<vbox>
<frame>
<text use-markup="true">
<label>"<b>'$mypicinfo'</b>"</label>
</text>
<hbox>
<button cancel></button>
</hbox>
</frame>
</vbox>
</window>
'
# ---------------
# display main gui
# ---------------
gtkdialog3 --program=show_pic --center
With kind regards,
vovchik
- Attachments
-
- pshowpic.tar.gz
- (458 Bytes) Downloaded 578 times
You're using this for a year and now u post it?
Shame on u!
LOL, I'm kiding, this is great guys, maybe for some lightweight/striped puplets, or we can make rox right click -> View image or smtng like that
gtkview LOL
Anyway, where can I find examples for gtk dialogs or some basic structure?
Shame on u!
LOL, I'm kiding, this is great guys, maybe for some lightweight/striped puplets, or we can make rox right click -> View image or smtng like that
gtkview LOL
Anyway, where can I find examples for gtk dialogs or some basic structure?
puppy.b0x.me stuff mirrored [url=https://drive.google.com/open?id=0B_Mb589v0iCXNnhSZWRwd3R2UWs]HERE[/url] or [url=http://archive.org/details/Puppy_Linux_puppy.b0x.me_mirror]HERE[/url]
- technosaurus
- Posts: 4853
- Joined: Mon 19 May 2008, 01:24
- Location: Blue Springs, MO
- Contact:
there are examples in the devx.sfs but you really don't need it to make a gtkdialog3 program - go here instead
http://xpt.sourceforge.net/techdocs/lan ... gExamples/
I tried to make a simple text editor but the "default text" doesn't seem to like carriage returns... turned out to be a 200b line editor/notepad ... guess it would be ok for adding/changing things to end of files like the registry in wine
http://xpt.sourceforge.net/techdocs/lan ... gExamples/
I tried to make a simple text editor but the "default text" doesn't seem to like carriage returns... turned out to be a 200b line editor/notepad ... guess it would be ok for adding/changing things to end of files like the registry in wine
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].
Dear dejean555,
Sorry for not posting that script sooner. Turns out I actually did it about two years ago (yes, shame on me)
In order to test the other gif/pic viewers you might have on your machine, try downloading the following gif sample (an interesting optical illusion where the woman spins either clockwise or counterclockwise, depending on your mood).
Most of the other dedicated viewers that I have tried stutter on this one - but not the script. Not only is small sometimes beautiful, it is sometimes better in all respects - perhaps a little like Puppy itself.
With kind regards,
vovchik
Sorry for not posting that script sooner. Turns out I actually did it about two years ago (yes, shame on me)
In order to test the other gif/pic viewers you might have on your machine, try downloading the following gif sample (an interesting optical illusion where the woman spins either clockwise or counterclockwise, depending on your mood).
Most of the other dedicated viewers that I have tried stutter on this one - but not the script. Not only is small sometimes beautiful, it is sometimes better in all respects - perhaps a little like Puppy itself.
With kind regards,
vovchik
- ttuuxxx
- Posts: 11171
- Joined: Sat 05 May 2007, 10:00
- Location: Ontario Canada,Sydney Australia
- Contact:
[quote="vovchik"]Dear Puppians,
I have been using the following code as my standard gif viewer for about a year:
I usually right click on gif images, then select open with -->mozilla and it opens in Seamonkey animated, When I tried it with the gif image you supplied it was much slower on mozilla that that code you posted. ever think of somehow adding that code to GPicView, since it doesn't do gif images.
ttuuxxx
I have been using the following code as my standard gif viewer for about a year:
I usually right click on gif images, then select open with -->mozilla and it opens in Seamonkey animated, When I tried it with the gif image you supplied it was much slower on mozilla that that code you posted. ever think of somehow adding that code to GPicView, since it doesn't do gif images.
ttuuxxx
http://audio.online-convert.com/ <-- excellent site
http://samples.mplayerhq.hu/A-codecs/ <-- Codec Test Files
http://html5games.com/ <-- excellent HTML5 games :)
http://samples.mplayerhq.hu/A-codecs/ <-- Codec Test Files
http://html5games.com/ <-- excellent HTML5 games :)
- technosaurus
- Posts: 4853
- Joined: Mon 19 May 2008, 01:24
- Location: Blue Springs, MO
- Contact:
Don't forget about Xdialog
Here is a very simple text editor using Xdialog... only 60b
and an image viewer... only 43b
and a calendar... only 41b
almost any command line utility (or combination) can be made into a gui this way
For more info on Xdialog see
http://www.gnu-darwin.org/ProgramDocume ... g/box.html
Here is a very simple text editor using Xdialog... only 60b
Code: Select all
#!/bin/sh
echo -e "`Xdialog --stdout --editbox $1 0 0`" > $1
and an image viewer... only 43b
Code: Select all
#!/bin/sh
Xdialog --icon $1 --msgbox "" 0 0
and a calendar... only 41b
Code: Select all
#!/bin/sh
Xdialog --calendar "" 0 0 0 0 0
For more info on Xdialog see
http://www.gnu-darwin.org/ProgramDocume ... g/box.html
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].
@techno
These look good for my 486... sick of waiting for mtpaint to load just to view an image... that works fine.... the calendar is ok on my main box but I get the Xdialog help when I run it on the 486. With the editor I get that result on both machines (Xdialog help).
The 486 runs fat_free2.16dillo and my fast box is on 4.2.
Any ideas? (And I checked that all spaces were correct)
Cheers
Mick
These look good for my 486... sick of waiting for mtpaint to load just to view an image... that works fine.... the calendar is ok on my main box but I get the Xdialog help when I run it on the 486. With the editor I get that result on both machines (Xdialog help).
The 486 runs fat_free2.16dillo and my fast box is on 4.2.
Any ideas? (And I checked that all spaces were correct)
Cheers
Mick
Puppy Linux Blog - contact me for access
- technosaurus
- Posts: 4853
- Joined: Mon 19 May 2008, 01:24
- Location: Blue Springs, MO
- Contact:
Some of the ' ` and " are easy to mistype - I'll upload them
the editor requires a filename to be passed to it - it can be a blank file
you can either drag a file to it or (using the name I gave it)... in a terminal type
the calendar can take text for a name in the "" <---double quotes
for a bonus I added in my webcam recorder
#!/bin/sh
rxvt -e ffmpeg -f video4linux2 -s 320x240 -i /dev/video0 -f avi cam.avi
the editor requires a filename to be passed to it - it can be a blank file
you can either drag a file to it or (using the name I gave it)... in a terminal type
Code: Select all
Xedit <filename>
for a bonus I added in my webcam recorder
#!/bin/sh
rxvt -e ffmpeg -f video4linux2 -s 320x240 -i /dev/video0 -f avi cam.avi
- Attachments
-
- Xprogs.tar.bz2
- (374 Bytes) Downloaded 395 times
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].
Thanks technosaurus
Yeah I tried the 'drag to' method... funny, named mine Xeditor
Anyhoo I'll see how I go with your packaged versions.
Cheers
Mick
Yeah I tried the 'drag to' method... funny, named mine Xeditor
Anyhoo I'll see how I go with your packaged versions.
Cheers
Mick
Puppy Linux Blog - contact me for access
- technosaurus
- Posts: 4853
- Joined: Mon 19 May 2008, 01:24
- Location: Blue Springs, MO
- Contact:
oops - forgot the audio for the webcam recorder
#!/bin/sh
rxvt -e ffmpeg -f oss -i /dev/audio -f video4linux2 -s qvga -i /dev/video0 a.avi
#!/bin/sh
rxvt -e ffmpeg -f oss -i /dev/audio -f video4linux2 -s qvga -i /dev/video0 a.avi
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].