On 11/20/12 01:49, Adrian wrote:
> Hello,
> 
> Is it possible (and suitable) to use FLTK for building a graphical desktop 
> environment for Linux (like LXDE, for example). If so, should it be on top of 
> X Window, or can it be done without using X at all?


        I run flwm as my desktop on linux; been using it for years.
        I've modified slightly to have an SGI look.

        FLWM is basically a small FLTK app that just happens to be a
        window manager, and it runs on top of X as you describe.

        There is some direct coding in X calls, which I guess if the app
        is a window manager, is unavoidable.

        I think flwm's code is still on the net somewhere..
        if not, I can upload my modified version.

        It's probably a good starting point for anyone wanting to start
        with a 'blank slate' window manager; no frills.

        In my version, the 'desktop' does not try to represent a directory 
browser
        the way most window managers do; I never liked that paradigm.
        There is only a right click menu off the 'desktop' for accessing and 
stowing windows,
        and opening common apps I need the most; terminal/mail/firefox/gvim.
        I've hard coded these into the flwm code as an Fl_Menu, preferring that
        to config files. SGI style function keys for pushing/popping/closing 
windows
        are hard wired in as well.

        I have a small start script that brings up X and then runs flwm;
        it's called 'start-flwm' and I run it from the linux text mode terminal
        (my linux systems all boot into text mode) by logging in and running
        'start-flwm'.

        'start-flwm' could be a two line script that just does this:

_________________________________________________________________________ snip
#!/bin/csh -f
exec xinit /usr/local/src/flwm/flwm --  # start X and my version of flwm
_________________________________________________________________________ snip

        ..but if you want it to automatically open some apps on startup,
        then it's better if the script does something more like this:

_________________________________________________________________________ snip
#!/bin/csh -f
cd /usr/local/src/flwm                   # where I have flwm installed

switch ( "$1" )
    case '':                             # no args? start X and tell it to run 
this script on start
        exec xinit $0 -xinit --          # recurse ourself with the -xinit flag 
(parsed below)
        exit 1

    case '-xinit':                       # arg is '-xinit'?
        # X is now running.
        #     Start some apps and then exec flwm
        #

        # START TWO GNOME TERMINALS
        #     Put small timing delay between them so if it's a new OS,
        #     they don't both try to write config files at the same time..
        #
        ( sleep 0; /usr/bin/gnome-terminal --hide-menubar --geometry +150+100 ) 
&
        ( sleep 1; /usr/bin/gnome-terminal --hide-menubar --geometry +250+200 ) 
&

        # START A NIXIE CLOCK AT THE LOWER RIGHT CORNER OF SCREEN
        #    I like to have a clock at all times..
        #
        /usr/local/bin/nixieclock -geometry -5-5 &

        # YOU COULD OPEN FIREFOX AND MAIL HERE
        #     But I'd rather open these manually if I need them
        #     from the right-click menu..
        #
        #firefox & thunderbird &

        # SET BACKGROUND IMAGE FOR X
        #    This is optional, but shows how to do it if you have
        #    a nice desktop image. In my case it's just a blue background
        #    with the machine's hostname + ip address in a subtle shade of 
blue..
        #
        if ( -x /usr/bin/xsetbg ) then
            /usr/bin/xsetbg /usr/local/src/flwm/tahoe-desktop.jpg   # my X bg 
image
        else
            xsri --emblem /usr/local/src/flwm/tahoe-desktop.jpg     # my X bg 
image
        endif

        # SET UP 10 MINUTE SCREEN SAVER
        #     Even LCD screens suffer from 'image burn', and powering down
        #     the monitor at lunch and at night saves power..
        #
        /usr/bin/xset +dpms dpms 600 600 600            # 10 minute powerdown 
screensaver

        # NOW START FLWM
        #     ..by exec'ing it, so the copy of this shell is replaced with flwm
        #
        exec /usr/local/src/flwm/flwm

        exit 0
endsw
_________________________________________________________________________ snip

        
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to