[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Monitors in vertical orientation



On Wed, Mar 20, 2013 at 06:57:30AM +0100, Florian Bruhin wrote:
> * Pawel Kasperek <pmappix _at_ gmail _dot_ com> [2013-03-19 23:18:36 +0100]:
> > I need run Web Browser application in "Kiosk" mode (disable statusbar,
> > notification, etc.) on 2 monitors. These should be set in vertical
> > orientation. The Web Browser should be stretched on these monitors. Is
> > possible configuraion the herbstluftwm manager as will posible run the
> > browser in these monitors mode ?
> 
> Both of your questions don't have much to do with herbstluftwm itself.
> 
> You might also want to configure hlwm in a way it doesn't show a
> panel, and maybe (in case you plan to have a keyboard attached)
> without any keybindings.

As Florian already told, the only configuration regarding hlwm is "Don't
do anything except showing the browser". Configuring this is quite easy:
create an autostart that does not do anything else than starting the
browser:

    hc() { herbstclient "$@" ; }
    # enforce the simple layout
    hc load '(clients grid:0)'
    hc emit_hook reload
    # do some xrandr things here
    # also set it with hc:
    hc set_monitors 1920x$((2*1200))
    # remove things, just to be sure
    hc keyunbind --all  # remove all key bindings
    hc mouseunbind      # remove all mouse bindings
    hc unrule --all     # remove all rules
    # start the browser:
    if [ "$(hc dump| wc -w)" -le 2 ] ; then
        # if there are less or equal than 2 words, then there is no
        # window yet, so start the browser:
        yourbrowsercommand &
    fi

Note that this is racy, because two browsers are started if you reload
again before the first browser window appears. A different solution is:

    hc() { herbstclient "$@" ; }
    # enforce the simple layout
    hc load '(clients grid:0)'
    hc emit_hook reload
    # do some xrandr things here
    # also set it with hc:
    hc set_monitors 1920x$((2*1200))
    # remove things, just to be sure
    hc keyunbind --all  # remove all key bindings
    hc mouseunbind      # remove all mouse bindings
    hc unrule --all     # remove all rules
    # start the browser:
    {
        pids=( )
        # start the browser, remember it's pid
        yourbrowsercommand &
        pids+=( $! )
        herbstclient -w 'reload' # wait for the next reload
        kill ${pids[ _at_ ]}
    } &

But this forces you to start the browser only via the autostart. It also
restarts the browser on each reload. And it might let two browser
windows appear shortly (if the new browser starts faster than the old
one quits).

If you have any questions on these two versions, just ask.

Regards,
Thorsten

Attachment: pgpGrTVvyZlfq.pgp
Description: PGP signature