clonewindow.sh 878 B

12345678910111213141516171819202122232425
  1. #!/bin/bash
  2. ##############################################################################
  3. # CloneWindow.sh
  4. # Script to duplicate a mouse selected window
  5. # So one can show the cloned window on other monitor
  6. # Really useful for slideshows where one extends the desktop
  7. #
  8. # Dependecies (names are based on ArchLinux): x11vnc and gtk-vnc
  9. #
  10. # <2013> <Gabriel B. Casella> <gbc921 at gmail.com>
  11. # Thanks to: progandy <https://bbs.archlinux.org/profile.php?id=60261>
  12. ##############################################################################
  13. # Get the window id from the window selected by the mouse click
  14. windowId=$(xwininfo | grep -Eo -m1 '0x[[:alnum:]]*')
  15. # start VNC session in background to automagically wait server start
  16. # calling client just after everything is loaded
  17. x11vnc -localhost -viewonly -id "$windowId" -q -bg
  18. gvncviewer localhost:0
  19. # vim:set ts=2 sw=2 et: