Skip to content

Instantly share code, notes, and snippets.

@antop-dev
Forked from lebedov/headless.sh
Created December 30, 2018 08:14
Show Gist options
  • Select an option

  • Save antop-dev/fc44e42aee7de1a917ff969412c0f6a4 to your computer and use it in GitHub Desktop.

Select an option

Save antop-dev/fc44e42aee7de1a917ff969412c0f6a4 to your computer and use it in GitHub Desktop.

Revisions

  1. @lebedov lebedov created this gist Aug 13, 2012.
    18 changes: 18 additions & 0 deletions headless.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,18 @@
    #!/bin/bash

    # Demonstrates how to create a headless display using xvfb.

    # Create the display:
    Xvfb :100 -ac &
    PID1=$!
    export DISPLAY=:100.0

    # Run the application that needs the display:
    xterm &
    PID2=$!

    # Kill the application:
    kill -9 $PID2

    # Remove the display:
    kill -9 $PID1