Advertisement
gbc921

CloneWindow.sh

Nov 1st, 2013
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.88 KB | None | 0 0
  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.  
  14. # Get the window id from the window selected by the mouse click
  15. windowId=$(xwininfo | grep -Eo -m1 '0x[[:alnum:]]*')
  16.  
  17. # start VNC session in background to automagically wait server start
  18. # calling client just after everything is loaded
  19. x11vnc -localhost -viewonly -id "$windowId" -q -bg
  20.  
  21. gvncviewer localhost:0
  22.  
  23. # vim:set ts=2 sw=2 et:
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement