Created
August 20, 2021 09:08
-
-
Save pineapples5972/38d877ac8fb2678e4f1db4e02caee5c9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# DIY clipboard manager | |
This was the part of larbs but i never able to get it working until now. | |
**Using xclip, xdotool and dmenu to fetch clipboard contents** | |
*Dependancies: | |
- xdotool | |
- xclip | |
- dmenu | |
- sxhkd (optional and depends on how you manage keybinds) | |
`xclip -sel c -o` will put selected clipboard content into file | |
using dmenu later we will get the list of copied texts | |
but this file need to updated everytime we copied something. | |
So we can either cron job it or use a trigger recognizing program like entr. | |
So i choose to create aliases instead | |
``` | |
alias \ | |
cc="{xclip -sel c -o -r; printf '\n'; } >> ~/.local/share/larbs/snippets" \ | |
cr=" : > ~/.local/share/larbs/snippets" | |
``` | |
`cc` will update the clipboard and `cr` will clear all the file | |
and this sxhkd hotkey will be use to get the list of content. | |
``` | |
super + Insert | |
xdotool type "$(dmenu -i -l 50 < ~/.local/share/clipboard/snippets)" | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment