source: ogLive-Builder-Git/includes/usr/bin/launch_browser

main 3.9.1
Last change on this file was 1029ad0, checked in by Vadim Troshchinskiy <vtroshchinskiy@…>, 6 weeks ago

Re-add ignore-ssl flag

  • Property mode set to 100755
File size: 3.0 KB
Line 
1#!/bin/bash
2
3# Compatibilidad con los argumentos usados con el browser original:
4# browser -qws http://google.com
5#
6while getopts ":qwsDWX" opt ; do
7case $opt in
8    q)
9        echo "Ignoring option: -q"
10        ;;
11    w)
12        echo "Ignoring option: -w"
13        ;;
14    s)
15        echo "Ignoring option: -s"
16        ;;
17    D)
18        BROWSER_DEBUG=1
19        ;;
20    W)
21        DISABLE_WAYLAND=1
22        ;;
23    X)
24        DISABLE_X11=1
25        ;;
26    esac
27done
28
29shift $(expr $OPTIND - 1 )
30
31browser_args="$@"
32
33echo "Browser args: $browser_args"
34
35[ -n "$DISABLE_WAYLAND" ] && echo "WAYLAND DISABLED"
36[ -n "$DISABLE_X11"     ] && echo "X11 DISABLED"
37
38if [ -n "BROWSER_DEBUG" ] ; then
39    echo "DEBUG MODE ENABLED"
40    echo "* Terminal available via Win+Enter"
41    echo "* Session may be killed with Ctrl+Alt+Backspace"
42    echo ""
43fi
44
45
46
47[ -x "/usr/bin/kitty" ] && wl_terminal=/usr/bin/kitty
48[ -x "/usr/bin/foot" ]  && wl_terminal=/usr/bin/foot
49
50[ -x "/usr/bin/xterm" ]                 && x11_terminal=/usr/bin/kitty
51[ -x "/usr/bin/i3-sensible-terminal" ]  && x11_terminal=/usr/bin/i3-sensible-terminal
52
53# The admin page is hosted remotely but executes things on localhost
54QTWEBENGINE_CHROMIUM_FLAGS="--disable-web-security"
55
56[ "$UID" -eq "0" ] && QTWEBENGINE_CHROMIUM_FLAGS="${QTWEBENGINE_CHROMIUM_FLAGS} --no-sandbox"
57
58export QTWEBENGINE_CHROMIUM_FLAGS
59
60rm -rf "/run/sway.started" "/run/x11.started"
61
62mkdir -p $HOME/.config/sway
63echo "exec /usr/bin/OGBrowser --ignore-ssl-errors \"$browser_args\" || /usr/bin/browser -qws \"$browser_args\"" > $HOME/.config/sway/config
64
65if [ -n "BROWSER_DEBUG" ] ; then
66    echo "bindsym Mod4+Return exec $wl_terminal"  >> $HOME/.config/sway/config
67    echo "bindsym Control+Alt+Backspace exit"     >> $HOME/.config/sway/config
68fi
69
70echo "exec touch /run/sway.started"     >> $HOME/.config/sway/config
71
72
73mkdir -p $HOME/.config/i3
74echo "exec /usr/bin/OGBrowser --ignore-ssl-errors \"$browser_args\" || /usr/bin/browser -qws \"$browser_args\"" > $HOME/.config/i3/config
75
76if [ -n "BROWSER_DEBUG" ] ; then
77    echo "bindsym Mod4+Return exec i3-sensible-terminal"  >> $HOME/.config/i3/config
78    echo "bindsym Control+Mod1+BackSpace exit"            >> $HOME/.config/i3/config
79fi
80
81echo "exec touch /run/x11.started"                    >> $HOME/.config/i3/config
82
83echo "exec /usr/bin/i3"    > $HOME/.xinitrc
84echo "exec /usr/bin/xterm" >> $HOME/.xinitrc
85
86
87# Make sure libinput works
88/usr/bin/udevadm trigger
89
90
91if [ -x "/usr/bin/sway" -a -z "$DISABLE_WAYLAND" ] ; then
92    echo "*** Trying to launch Sway ***"
93    /usr/bin/sway
94else
95    echo Sway not installed in this image, skipping.
96fi
97
98if [ ! -f "/run/sway.started" -a -z "$DISABLE_X11" ] ; then
99    if [ -x "/usr/bin/startx" ] ; then
100        echo "*** Trying to launch X11 ***"
101        /usr/bin/startx
102    else
103        echo X11 not installed in this image, skipping.
104    fi
105else
106    echo "Sway was run before, not starting X11".
107fi
108
109if [ ! -f "/run/sway.started" -a ! -f "/run/x11.started" ] ; then
110    echo "Everything failed, dropping into a shell."
111    exec /usr/bin/bash
112else
113    echo "All done."
114fi
115
116
Note: See TracBrowser for help on using the repository browser.