Skip to content

feat: Create script to automate virtual second screen#9

Open
rlrosa wants to merge 1 commit into
santiagofdezg:masterfrom
rlrosa:rr/script
Open

feat: Create script to automate virtual second screen#9
rlrosa wants to merge 1 commit into
santiagofdezg:masterfrom
rlrosa:rr/script

Conversation

@rlrosa
Copy link
Copy Markdown

@rlrosa rlrosa commented Sep 22, 2025

This commit introduces a comprehensive bash script, tablet-vnc.sh, that automates the entire process of creating, managing, and tearing down a virtual second screen as detailed in README.md.

The script is designed to be user-friendly, replacing the manual multi-step process with a single command. It includes features such as:

  • Named arguments for all options (resolution, display, position).

  • Automatic detection of the primary display.

  • Optional password protection for the VNC session.

  • Robust cleanup of all display modes and temporary files on exit, including

  • when interrupted with Ctrl+C.

====
Usage Examples

  1. Start the virtual screen with default settings (1920x1200 on DisplayPort-0):

./tablet-vnc.sh start

  1. To start a custom 1280x800 screen on HDMI-1 to the right of the primary display, protected with a password:

./tablet-vnc.sh start --width 1280 --height 800
--display HDMI-1 --position right-of --password "your_secret_password"

If you really want a "secret" password you'll want to modify the script to read it from CLI. As is right now it'll be saved in the bash history, so don't use an important password.

  1. To stop and clean up the virtual screen use ctrl+c or:

./tablet-vnc.sh stop

This commit introduces a comprehensive bash script, `tablet-vnc.sh`, that
automates the entire process of creating, managing, and tearing down a virtual
second screen as detailed in README.md.

The script is designed to be user-friendly, replacing the manual multi-step
process with a single command. It includes features such as:

* Named arguments for all options (resolution, display, position).

* Automatic detection of the primary display.

* Optional password protection for the VNC session.

* Robust cleanup of all display modes and temporary files on exit, including
* when interrupted with Ctrl+C.

====
Usage Examples
====

1. Start the virtual screen with default settings (1920x1200 on DisplayPort-0):

./tablet-vnc.sh start

2. To start a custom 1280x800 screen on HDMI-1 to the right of the primary
   display, protected with a password:

./tablet-vnc.sh start --width 1280 --height 800 \
    --display HDMI-1 --position right-of --password "your_secret_password"

If you really want a "secret" password you'll want to modify the script to read
it from CLI. As is right now it'll be saved in the bash history, so don't use an
important password.

3. To stop and clean up the virtual screen use `ctrl+c` or:

./tablet-vnc.sh stop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant