Linux On Android - Adjust Resolution

Поділитися
Вставка
  • Опубліковано 8 лис 2024

КОМЕНТАРІ • 8

  • @ruthake
    @ruthake  4 місяці тому +2

    The UserLAnd Linux resolution setting is stored in the ~/.vncrc file. The support script /support/startVNCServerStep2.sh sets the resolution every time a session is started.
    First, prevent startVNCServerStep2.sh from setting the resolution by editing /support/startVNCServerStep2.sh with a plain text editor (ex. Nano or Mousepad)
    Comment out the line that updates ~/.vncrc be prefixing the line with a pound sign (#)
    Change the line from:
    echo $vncrc_line > /home/$INITIAL_USERNAME/.vncrc
    To:
    # echo $vncrc_line > /home/$INITIAL_USERNAME/.vncrc
    From a Terminal (1603x756 is an example resolution, resolution may differ across devices):
    cd ~
    cat .vncrc
    Take a screenshot.
    cp .vncrc .vncrc.bak
    cp .vncrc /usr/bin/gon
    chmod +x /usr/bin/gon
    Edit the /usr/bin/gon script:
    Prefix the line with echo ' (lower case echo space single quote)
    End the command with ' > ~/.vncrc (single quote space right angle bracket space tilde slash dot lowercase vncrc)
    Create the goh and gow scripts shown bellow. An example gon script is also shown.
    After executing any of the resolution scripts, restart Linux to apply the new resolution.
    ----------------------------
    /usr/bin/gon
    echo '$geometry = "1603x756";' > ~/.vncrc
    Copying and pasting the scripts below into a plain text editor and then saving them is highly recommended. Typos can result in an invalid resolution which can break Linux requiring a recovery process.
    /usr/bin/goh
    HEIGHT=1080
    WIDTH=2290
    NEW_HEIGHT=$1
    NEW_WIDTH=$(($NEW_HEIGHT*$WIDTH/$HEIGHT))
    NEW_VNC='$geometry = "'$NEW_WIDTH'x'$NEW_HEIGHT'";'
    echo 'New VNC Geometry'
    cat ~/.vncrc
    echo $NEW_VNC
    echo $NEW_VNC > ~/.vncrc
    /usr/bin/gow
    HEIGHT=1080
    WIDTH=2290
    NEW_WIDTH=$1
    NEW_HEIGHT=$(($NEW_WIDTH*$HEIGHT/$WIDTH))
    NEW_VNC='$geometry = "'$NEW_WIDTH'x'$NEW_HEIGHT'";'
    echo 'New VNC Geometry'
    cat ~/.vncrc
    echo $NEW_VNC
    echo $NEW_VNC > ~/.vncrc
    ----------------------------
    goh and gow scripts should be tested before using them by commenting out the echo $NEW_VNC > ~/.vncrc line with pound sign (#):
    echo $NEW_VNC > ~/.vncrc
    # echo $NEW_VNC > ~/.vncrc
    Now the scripts can be run without affecting anything. For example:
    gon
    gow 800
    New VNC Geometry
    $geometry = "1603x756";
    $geometry = "800x376";
    goh 400
    New VNC Geometry
    $geometry = "800x376";
    $geometry = "850x400";
    These scripts are unsupported, unofficial scripts that are based on a July 2023 UserLAnd fix. For more info:
    ua-cam.com/video/sJUGtln0RG4/v-deo.html
    ----------------------------
    RECOVERY PROCEDURE:
    Setting a session's resolution with an invalid value such as zero will break Linux. To fix this, the supporting files must be reinstalled. (Resolution changes will not take affect, until the session is restarted, so if you enter 0 in by mistake, execute the resolution script again before restarting the session):
    Stop the Session > close UserLAnd > power the device off and on > put the device online > open UserLAnd > from the UserLAnd dot menu (top right) > select Clear All Supporting Files (this will reload the /support files).
    If there is an issue with this, UserLAnd may be stuck on the current Session. To release the Session, Reboot the Android device > install another Distro from the Apps menu.
    It's worth repeating all the steps more than once if needed. This recovery process has yet to fail, however there is always a first time for everything.
    ----------------------------
    More scripts:
    Install: xterm, tmux, suckless-tools, x11-xserver-utils
    Be sure to make the scripts executable (chmod +x )
    /usr/bin/T
    xrdb -merge ~/.Xresources; xterm -maximized &
    /usr/bin/M (18 is the font size, set to the desired size):
    dmenu_run -fn 'Mono-18' &> /dev/null
    ~/.Xresources (20 is the font size, set to the desired size):
    xterm*saveLines: 2000
    xterm*loginShell: true
    xterm*selectToClipboard: true
    xterm*faceName: Monospace
    xterm*faceSize: 20
    xterm*Foreground: SlateBlue1
    xterm*Background: black
    xterm*pointerColor: red3
    xterm*curosrColor: red3
    For Not A Desktop, start a UserLAnd session, do not start gol, instead run the T script (just capital T). For this example, htop, neofetch, and cmatrix have been installed:
    T
    tmux
    htop
    Ctrl + B release then press %
    neofetch
    Ctrl + B release then press " double quotes
    Ctrl + B release then press the cursor Up key
    Ctrl + B + cursor Down key, repeat as needed
    Ctrl + B release then press the cursor Down key
    cmatrix
    There are several terminal multiplexers such as tmux.
    To start dmenu, execute the M script (just captial M) from a terminal:
    M
    Start typing any part of a program name, scroll left/right with cursor keys, Enter to launch the program, and Esc to exit dmenu.

  • @ritmo1130
    @ritmo1130 4 місяці тому

    Great content as usual. Thanks !!!🎉

  • @CoralySanchez
    @CoralySanchez 4 місяці тому

    Thank you Ruth, hope you are well.

  • @AhmetAgrbas-wm6xo
    @AhmetAgrbas-wm6xo 4 місяці тому +1

    🥰🌹

  • @johndank2209
    @johndank2209 4 місяці тому +4

    the CIA Glowies are getting creative

  • @Komod0d
    @Komod0d 4 місяці тому

    Your speech is very pleasant

  • @rihammuhammed1208
    @rihammuhammed1208 4 місяці тому

    Hello I keep getting this bash: goh: command not found

    • @ruthake
      @ruthake  4 місяці тому

      From a terminal (which shows where an executable is located, $PATH will show a list of search paths for executables):
      which goh
      which galculator
      echo $PATH
      If there is no output for the goh script, then it is not located in any of the paths listed in $PATH.
      For example, if goh is in the home directory, then the move command can be used to move it to /usr/bin:
      sudo mv ~/goh /usr/bin/goh
      ----------------------------
      An HTML ebook for BASH scripting available on any Debian system at no cost!
      It's a beginner book that, "assumes no previous knowledge of scripting or programming." It's great for learning the BASH command line and scripting!
      Advanced Bash-Scripting Guide install:
      abs-guide
      From a browser go to:
      file:///usr/share/doc/abs-guide/html/index.html