LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   How can I display the weather info. (graphics)on a /dev/tty7 ? (no win.manager) (https://www.linuxquestions.org/questions/linux-general-1/how-can-i-display-the-weather-info-graphics-on-a-dev-tty7-no-win-manager-591676/)

frenchn00b 10-14-2007 07:05 AM

How can I display the weather info. (graphics)on a /dev/tty7 ? (no win.manager)
 
Hi,

I have an idea, to do like boot splash, or this kind of stuffs.
I am using an old machine to play the music (sort of ipod :) ) without X.
I would like to make it show the weather with a graphic and would not want to use any startx or windows manager.

Is that possible ? (I am sure it could be)

svga; I would have idea to use some kind of zgv and refresh it every few minutes, as alternative. (with dowloading the info. links/lynx on the web weather.com)

thanks for any infos

PatrickNew 10-15-2007 12:12 AM

Well, I should say that the links2 graphical mode on svgalib or directfb is really quite good. You could just write a script that loads "links2 -g http:://weather.page.whatever" every few minutes.

frenchn00b 10-15-2007 01:08 AM

Quote:

Originally Posted by PatrickNew (Post 2924370)
Well, I should say that the links2 graphical mode on svgalib or directfb is really quite good. You could just write a script that loads "links2 -g http:://weather.page.whatever" every few minutes.

Cool idea indeed;
links2 -g http:://weather.page.whatever -driver sgvalib
cant get io permissions

I will try harder today.
Sounds good

thank you !

PatrickNew 10-15-2007 01:16 AM

Indeed, svgalib requires root permissions. You'll need to give it sufficient permissions - specifically root.

P.S. I should add that svgalib drops its root permissions after accessing the hardware, so you don't actually wind up with a web-connected browser running as root.

frenchn00b 10-15-2007 12:53 PM

Quote:

Originally Posted by PatrickNew (Post 2924414)
Indeed, svgalib requires root permissions. You'll need to give it sufficient permissions - specifically root.

P.S. I should add that svgalib drops its root permissions after accessing the hardware, so you don't actually wind up with a web-connected browser running as root.

from itself : http://www.svgalib.org/svgalib.user.faq.html

Code:

Why does a programs terminate immediatelly with "svgalib: Cannot get I/O permissions."?

svgalib programs need to be run as root. This means that either the user that runs them is root, or, if running by normal users is desirable, the program needs to be 'suid root', which means: the program must be owned by root (chown 0 program) and the suid bit needs to be set (chmod u+s program).

chmod +s is not working anymore (in 2007; taht was security problems)

Would not it be other alternative ? hmmm
of
Code:

chmod 666 /dev/ somethign ?
maybe.... (?)

frenchn00b 10-15-2007 02:09 PM

I found alternative

curl to get the page, then,
convert page.htm page.jpg

but resolution is crap and you get 10-15 jpeg files ... which one is the one, or maybe a mergign ... hmm

frenchn00b 10-15-2007 02:40 PM

That s cool !

http://www.terminally-incoherent.com...day-without-x/

shitty for twin : http://jrandomhacker.info/Twin

frenchn00b 10-15-2007 03:00 PM

Code:

Chmod 666 /dev/fb0
says not found ...

hm hm
Quote:


rm -f /dev/fb0autodetect
rm -f /dev/fb1
mknod /dev/fb1 c 29 1
chmod 666 /dev/fb1

PatrickNew 10-15-2007 03:06 PM

Well, if you use the directFB backend instead of the svgalib backend, I don't think you'll have any problems - I don't think it needs root privileges. But then you need to set up a framebuffer.

If you want to suid root, there are a couple things to check. First, do a 'ls -l' to ensure that links2 is owned by root. Suid will have it run with the permissions of its owner, but the owner ought to be root. However, are you sure you wouldn't want it run as a cron job running as root? A setuid browser is rather insecure to have laying around.

frenchn00b 10-15-2007 03:12 PM

try this sounds good, but but
Code:

apt-get install libggi-target-fbdev
Code:

rm -f /dev/fb0autodetect
rm -f /dev/fb1
mknod /dev/fb1 c 29 1
chmod 666 /dev/fb1


not working

frenchn00b 10-15-2007 03:16 PM

Update:

ZGV can write in the ttyX consoles
but not LINKS2 ...

hmmmm

working hard on it;...

frenchn00b 10-15-2007 03:19 PM

FBDEV(4)
NAME
fbdev - video driver for framebuffer device

SYNOPSIS
Section "Device"
Identifier "devname"
Driver "fbdev"
BusID "pci:bus:dev:func"
...
EndSection

DESCRIPTION
fbdev is an Xorg driver for framebuffer devices. This is a non-accel-
erated driver, the following framebuffer depths are supported: 8, 15,
16, 24. All visual types are supported for depth 8, and TrueColor
visual is supported for the other depths. Multi-head configurations
are supported.

SUPPORTED HARDWARE
The fbdev driver supports all hardware where a framebuffer driver is
available. fbdev uses the os-specific submodule fbdevhw(4) to talk to
the kernel device driver. Currently a fbdevhw module is available for
linux.

CONFIGURATION DETAILS
Please refer to xorg.conf(5) for general configuration details. This
section only covers configuration details specific to this driver.

For this driver it is not required to specify modes in the screen sec-
tion of the config file. The fbdev driver can pick up the currently
used video mode from the framebuffer driver and will use it if there
are no video modes configured.

For PCI boards you might have to add a BusID line to the Device sec-
tion. See above for a sample line. You can use " -scanpci" to figure
out the correct values.

The following driver Options are supported:

Option "fbdev" "string"
The framebuffer device to use. Default: /dev/fb0.

Option "ShadowFB" "boolean"
Enable or disable use of the shadow framebuffer layer. Default:
on.

Option "Rotate" "string"
Enable rotation of the display. The supported values are "CW"
(clockwise, 90 degrees), "UD" (upside down, 180 degrees) and
"CCW" (counter clockwise, 270 degrees). Implies use of the
shadow framebuffer layer. Default: off.

SEE ALSO
Xorg(1), xorg.conf(5), xorgconfig(1), Xserver(1), X(7), fbdevhw(4)

AUTHORS
Authors include: Gerd Knorr, Michel Dänzer, Geert Uytterhoeven



X Version 11 xf86-video-fbdev 0.3.1

frenchn00b 10-15-2007 03:22 PM

Xorg.conf to be modified??


I found this
here
Code:


Section "Device"
        Identifier        "Builtin Default fbdev Device 0"
        Driver        "ati"
EndSectionSection "Device"
        Identifier        "Builtin Default fbdev Device 0"
        Driver        "ati"
EndSectionSection "Device"
        Identifier        "Builtin Default fbdev Device 0"
        Driver        "ati"
EndSection


frenchn00b 10-15-2007 03:24 PM

Video
If you want to the hardware acceleration, who does not, please enable the following options
Code:

Character device
<*> Direct Rendering Manager (XFree86 4.1.0 and higher DRI support)
<*> Intel 830M, 845G, 852GM, 855GM, 865G (i915 driver) --->


[TODO]
In Dell 700m specification, this machince can be configured as 64 MB shared video memory. Anybody knows HOW?

Framebuffer and Fbsplash
Please refer to fbsplash howto:
If you want the splash eye-candy, we need to patch the kernel manually:
Code:

$ wget http://dev.gentoo.org/~spock/project...6.12-rc3.patch ./
$ cd /usr/src/linux
$ patch -p1 --dry-run < /path/to/fbsplash-0.9.2-r3-2.6.12-rc3.patch
# if everything is OK,
$ patch -p1 < /path/to/fbsplash-0.9.2-r3-2.6.12-rc3.patch


For Dell 700m users, we can use vesafb, vesafb-tng, intelfb or i810fb as well,
UPDATE: We are going to use intelfb, since it is the developed to support 855GM chipset.
Code:

<*> VESA VGA graphics support
VESA driver type (vesafb-tng) --->
(1024x768-24@72) VESA default mode
<*> Intel 830M/845G/852GM/855GM/865G support (EXPERIMENTAL)[*] Support for the framebuffer splash


After you upgrade your kernel, remember to re-emerge the splashutils.
And enable them when booting:
Code:

# cat /boot/grub/grub.conf
root@getnoo bookstack # cat /boot/grub/grub.conf
splashimage=(hd0,0)/grub/gentoo.xpm.gz
# For booting GNU/Linux
title GNU/Linux
root (hd0,0)
kernel (hd0,0)/kernel-2.6.12-love1 root=/dev/hda2 video=intelfb:ywrap,mtrr 1024x768-16@70 splash=silent,fadein,theme:emergence CONSOLE=/dev/tty1 resume2=swap:/dev/hda5
initrd (hd0,0)/fbsplash-emergence-1024x768


Now, reboot the machine and enjoy the beauty of frame buffer.
If you build the links and mplayer with "directfb fbcon" enabled, you could surf the web and play video in the console mode:
Code:

# USE="fbcon directfb" emerge links mplayer
# /etc/init.d/gpm start
$ links2 -g www.google.com
$ mplayer -vo fbdev foo.avi

[TODO]
links would crash in some website, if you can figure it out, please let me know.
How to zoom the mplayer's video to full screen?

frenchn00b 10-15-2007 03:41 PM

you can note the fight :
now here : http://links.twibright.com/user_en.html

PatrickNew 10-15-2007 03:42 PM

Okay, unfortunately fbdev is a dead end - it's a way of running X, it cannot be used without X. I think one point needs clarifying. SVGAlib and directFB are two distinct things that should not be mixed. SVGAlib is a venerable old library that handles graphics, more or less by directly interfacing with the graphics through svga standards. DirectFB is a library that makes use of the /dev/fbX devices provided by the operating system. The advantages and disadvantages are listed below.

SVGAlib
-plays to the lowest common denominator of hardware support
-does not require kernel support

DirectFB
-Allows better accelleration
-Requires no special (root) privileges

If kernel support is not a problem, I'd recommend directfb backends. Links2 provides svgalib and directfb, as does mplayer. I am uncertain, but I think zgb supports only svgalib.

frenchn00b 10-15-2007 03:55 PM

Quote:

Originally Posted by PatrickNew (Post 2925256)
Okay, unfortunately fbdev is a dead end - it's a way of running X, it cannot be used without X. I think one point needs clarifying. SVGAlib and directFB are two distinct things that should not be mixed. SVGAlib is a venerable old library that handles graphics, more or less by directly interfacing with the graphics through svga standards. DirectFB is a library that makes use of the /dev/fbX devices provided by the operating system. The advantages and disadvantages are listed below.

SVGAlib
-plays to the lowest common denominator of hardware support
-does not require kernel support

DirectFB
-Allows better accelleration
-Requires no special (root) privileges

If kernel support is not a problem, I'd recommend directfb backends. Links2 provides svgalib and directfb, as does mplayer. I am uncertain, but I think zgb supports only svgalib.

Thanks a lot !


I found this but for X / gtk : http://www.directfb.org/wiki/index.p...TK_on_DirectFB
sounds fast indeed directfb

(zgv works in ttyX)

I can compile easily the kernel ... to let fb there if it is the case...

digging digging ...

frenchn00b 10-15-2007 03:59 PM

that's wicked what he can do with the windows with directfb:

http://www.directfb.org/screenshots/...D_Windows2.png

frenchn00b 10-15-2007 04:01 PM

Then, let's go for it, fbdev ! ;-) ;-)

I am now compiling the tar.gz :
http://www.directfb.org/downloads/Co...B-1.1.0.tar.gz

OK

frenchn00b 10-15-2007 04:09 PM

Quote:

Originally Posted by frenchn00b (Post 2925278)
Then, let's go for it, fbdev ! ;-) ;-)

I am now compiling the tar.gz :
http://www.directfb.org/downloads/Co...B-1.1.0.tar.gz

OK

Ok, just compiled.
I made a package for who is interested (debian stable).
http://yellowprotoss.ye.funpic.org/deb/ => directfb

Now, getting it work .. ugrr :)

PatrickNew 10-15-2007 04:09 PM

From what you said you wanted, I still recommend just adding a cron job. I think it would be much easier to write a tiny script that kills the last instance of links2 from the pid you stashed in a file, theb launch links2 again, storing its pid in the file.

frenchn00b 10-15-2007 04:18 PM

I got the links vers 2.1, ./conf...bla ; make ; make install with directfb
but get this now:
Code:

links-2.1pre30$ ./links
./links: error while loading shared libraries: libdirectfb-1.1.so.0: cannot open shared object file: No such file or directory

what a fight

frenchn00b 10-15-2007 04:19 PM

Quote:

Originally Posted by PatrickNew (Post 2925286)
From what you said you wanted, I still recommend just adding a cron job. I think it would be much easier to write a tiny script that kills the last instance of links2 from the pid you stashed in a file, theb launch links2 again, storing its pid in the file.

Oups', sorry, I do not understand .. (I am newbie)

frenchn00b 10-15-2007 04:24 PM

Quote:

Originally Posted by frenchn00b (Post 2925294)
I got the links vers 2.1, ./conf...bla ; make ; make install with directfb
but get this now:
Code:

links-2.1pre30$ ./links
./links: error while loading shared libraries: libdirectfb-1.1.so.0: cannot open shared object file: No such file or directory

what a fight


pretty weird, ... looks like this :libdirectfb-1.1.so.0
is nowhere ... hmm

seeked there: http://packages.debian.org/etch/links2

frenchn00b 10-15-2007 04:28 PM

weird after apt-get install links,

it gives me that links:
Code:

$links --version
ELinks 0.11.1 (built on Nov 27 2006 10:22:51)

Features:
Standard, Fastmem, IPv6, gzip, bzip2, Periodic Saving, Timer, Cascading Style Sheets,
Protocol (File, FTP, HTTP, NNTP, URI rewrite, User protocols), SSL (GnuTLS),
MIME (Option system, Mailcap, Mimetypes files), LED indicators, Bookmarks,
Cookies, Form History, Global History, Scripting (Lua, Perl), Goto URL History,
Search History

OK, I got it now :

links2 -version
Links 2.1pre26



Now, permissions with directfb...
http://www.directfb.org/index.php/ma.../msg00119.html

frenchn00b 10-15-2007 04:41 PM

Quote:

Originally Posted by frenchn00b (Post 2925298)
pretty weird, ... looks like this :libdirectfb-1.1.so.0
is nowhere ... hmm

seeked there: http://packages.debian.org/etch/links2

found the dude !

let's ln -s ...

Code:

/usr# find /usr/local/ -iname "*directfb-1.1*"
/usr/local/share/directfb-1.1.0
/usr/local/lib/libdirectfb-1.1.so.0.0.0
/usr/local/lib/libdirectfb-1.1.so.0
/usr/local/lib/directfb-1.1-0


frenchn00b 10-15-2007 04:47 PM

beware if you compile the links .tar.gz you've to put /usr/local stuff in appropriate debian place locations

/usr/local/bin/links is my just compiled links last stable versino

but still no directfb ...

pff
done for today :)

PatrickNew 10-15-2007 04:48 PM

Try a script like this, run as root:

Code:

#!/bin/sh
kill `cat /tmp/weatherpid`
rm ~/.links2/socket
echo $! > /tmp/weatherpid
links2 -g www.weather.whatever

Have cron run this script every time you want to refresh the display, say every 1/2 hour or whatever. The second line takes care of a socket that's not being cleaned up since we kill links2, instead of letting it clean itself up.

To any gurus, how do you/can you instruct cron to run this on a specific tty.

It may be a less techincal solution, but you can always just run it as root and use control-r to refresh. Could save you some trouble.

frenchn00b 10-15-2007 04:51 PM

I just found that interesting ... http://www.directfb.org/wiki/index.php/XDirectFB:About

frenchn00b 10-15-2007 04:53 PM

Quote:

Originally Posted by PatrickNew (Post 2925331)
Try a script like this, run as root:

Code:

#!/bin/sh
kill `cat /tmp/weatherpid`
rm ~/.links2/socket
echo $! > /tmp/weatherpid
links2 -g www.weather.whatever

Have cron run this script every time you want to refresh the display, say every 1/2 hour or whatever. The second line takes care of a socket that's not being cleaned up since we kill links2, instead of letting it clean itself up.

To any gurus, how do you/can you instruct cron to run this on a specific tty.

It may be a less techincal solution, but you can always just run it as root and use control-r to refresh. Could save you some trouble.

thank you... I'll try that too in meanwhile as alternative of no solution to run links2 -g ... thnkx


All times are GMT -5. The time now is 01:30 AM.