Advertisement
Guest User

p and xsel

a guest
Mar 12th, 2014
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. p
  2.  
  3. #!/bin/bash
  4. echo ${PWD}/$1
  5. echo -n ${PWD}/$1 | xsel -
  6. --------------------------------------
  7. xsel
  8.  
  9. #!/bin/bash
  10.  
  11. # For this to work, you have to install
  12. # klipper from KDE4
  13. # and libqt4, which brings in qdbus.
  14.  
  15. if [ -z "$1" ]; then # if no args, output the clipboard
  16. qdbus org.kde.klipper /klipper getClipboardContents
  17. elif [ "$1" = "-" ]; then # if arg is "-", load clipboard from stdin
  18. qdbus org.kde.klipper /klipper setClipboardContents "$(cat)"
  19. else # else load clipboard with args
  20. qdbus org.kde.klipper /klipper setClipboardContents "$*"
  21. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement