A trick to avoid being tracked by Youtube using xclip and xbindkeys
Sometimes you need to avoid being tracked by Youtube. So you want to watch a certain video but you don't want Youtube to show you suggestions related to it or you don't want the video to be added to your Youtube history.
A very quick and simple solution is to have a key binding to a command that will open for you the video url from the clipboard.
- You right click the video
- Copy link address
- Press the shortcut keys to open the video using
We are going to use Xclip and Xbindkeys to achieve this.
- Xclip is command line interface to the X11 clipboard.
- Xbindkeys is a program that allows to bind commands to certain keys or key combinations on the keyboard.
A quick and interesting note
For X11 based systems like Linux there are two clipboards:
- Primary: Which is copy-on-select, you select a text and paste it using the middle mouse button!
- Clipboard: This is the normal one we all know (Ctrl+c and Ctrl+p)
For macOS and Windows we only have one clipboard.
🌟 The primary clipboard is very useful for Linux terminal users. We can call it a Quick-Copy. So you select what you want to copy, and press the middle mouse button to paste it without the need to explicitly do copy-paste operations.
sudo pacman -S xclip xbindkeys
Or from AUR
yay -S xclip xbindkeys
For other linux distro users you know what you need to do :)
I have chosen the (Super+Alt+p) to be my shortcut keys. You can choose whatever you like.
xbindkeys --keyin terminal and press the keys combinations you want to choose and copy one of the two lines that will appear.
$ xbindkeys --key Press combination of keys or/and click under the window. You can use one of the two lines after "NoCommand" in $HOME/.xbindkeysrc to bind a key. "(Scheme function)" m:0x58 + c:33 Alt+Mod2+Mod4 + p
vim ~/.xbindkeysrcand add those lines
Here I am using
"vlc `xclip -o`" Alt+Mod2+Mod4 + p
vlcto open videos. you can choose any video player you like. Another alternative would be mpv.
- Make sure configs are reloaded
# Make xbindkeys reload config
killall -s1 xbindkeys # SIGHUP signal
# Start xbindkeys daemon
xbindkeys -f ~/.xbindkeysrc