Lots of times I need to Ctrl+C (or Ctrl+Insert) multiple times to copy something. I would appreciate visual feedback that says "a new thing has been copied" or something like that. Is there someway to add this to Ubuntu?
Lots of times I need to Ctrl+C (or Ctrl+Insert) multiple times to copy something. I would appreciate visual feedback that says "a new thing has been copied" or something like that. Is there someway to add this to Ubuntu?
I adapted my script to react on clipboard changes from here so that it shows a native notification bubble whenever you copy something:
Save that somewhere (e.g. as
/usr/local/bin/clipboard-notifier
- you needsudo
to be allowed to write in that location though, alternatively put it in~/bin
) and make it executable using the commandchmod +x FILENAME
.My script uses the Python 3 package
notify2
to display the native notification bubbles. This package is normally not installed by default, you have to add it first with the command below:If you want, you can modify the values of the capitalized variables near the beginning of the script to your needs, especially
TITLE
andMAXLENGTH
might be useful to change.Then simply add it to your startup applications and it will launch automatically when you log in the next time. You can also launch the script manually from e.g. the Alt+F2 HUD in Unity.
I've created a more standard solution using bash scripting only without extra libraries:
Here is how I did it:
Create a file called:
clp-notify
and make it executable.Save the file to:
/home/$USER/add-ons/scripts/clp-notify
Next, I created a second file called
start-clipboard-polling
that invokes the above script and it is this second file that gets added to start-up:The purpose of this second file is to prevent the original
clp-notify
from starting multiple times because theclp-notify
script will continue to run even if you log out and in or restart the X server.Then you need to add this
start-clipboard-polling
to your start-up applications.There is only one problem with this. Although, the second script takes care of preventing
clp-notify
from starting multiple times when you log out and in (because the original instance would be still running from the previous session), the second time you log in, for some reason, the following condition fails:and that means notifications will not work. The work around for this is to end the original instance from within
start-clipboard-polling
and restartclp-notify
as a fresh instance and that's it and then you can delete the section that checks whetherclp-notify
is running but I don't want to use the work around, I am more interested of why it fails.Otherwise it will continue to work just fine until you log out.
BTW, you need to: