复制到剪贴板并使用libnotify发送通知

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了复制到剪贴板并使用libnotify发送通知相关的知识,希望对你有一定的参考价值。

This nautilus script was written for Wuala to duplicate the "Copy Public Link" feature from Dropbox.
  1. #!/bin/bash
  2.  
  3. #||||||||||||||||||||||||||||||||
  4. #
  5. # ---- BASH SCRIPT FOR WUALA ----
  6. # ---- DOWNLOAD LINK ----
  7. # __by flexgrip at gmail dot com_
  8. # http://rayaguilar.net/portfolio
  9. #
  10. # predicts the wuala public files link and copies it to the clipboard (paste it with CTRL+v)
  11. # REMEMBER you must enter your username and name of your public folder.
  12. # required packages: (These are in the ubuntu repositories... use apt-get)
  13. # xclip (to copy ip to the clipboard)
  14. # notify-send (to send notifications)
  15.  
  16. uname='flex1grip'
  17. publicfolder='Public'
  18.  
  19.  
  20. # build the url
  21. buildurl='http://content.wuala.com/contents/'$uname'/'$publicfolder'/'$@'?dl=1'
  22.  
  23. if [ -n "$buildurl" ]; then
  24.  
  25. # copy url into clipboard
  26. echo $buildurl | xclip -selection clipboard
  27.  
  28. # echo wuala public link in console
  29. echo "Copied public Wuala link: $buildurl"
  30.  
  31. # confirm successful fetch of ip with notification
  32. notify-send --icon=/usr/share/icons/gnome/32x32/actions/edit-paste.png "Download link copied!" "$buildurl"
  33.  
  34. else
  35.  
  36. # echo wuala public link in console
  37. echo "Error... Wuala link not copied: $buildurl"
  38.  
  39. # confirm successful fetch of ip with notification
  40. notify-send --icon=/usr/share/icons/gnome/32x32/actions/gtk-stop.png "Error! Link was not copied..."
  41.  
  42. fi

以上是关于复制到剪贴板并使用libnotify发送通知的主要内容,如果未能解决你的问题,请参考以下文章

如何让应用程序复制文本并自动发送到我的联网数据库?

使用 libnotify 的 Python 3 脚本作为 cron 作业失败

vb.net 2008 我想用代码复制一个文件到剪贴板。 用户然后在QQ对话框中右击粘贴就可直接发送。 代码怎么写

python 简单的黑客使用gnome-screenshot和dropbox上传快速公开截图 - 需要libnotify-bin进行通知

电报中是不是可以通过按钮复制到剪贴板?

从不同的应用程序复制和粘贴剪贴板