Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Auto Inject Clipboard

Script and systemd user service that pre-load strings into CopyQ (and the desktop clipboard history) right after login.

Requirements

  • Linux desktop with systemd user services enabled.
  • copyq installed (on Fedora: sudo dnf install -y copyq).

Configure your string list

Create ~/.config/auto-inject-clipboard/strings.txt (the directory will be created if it does not exist). Each line represents one clipboard item. Empty lines and lines starting with # are ignored.

Example:

# Sample entries
Account A
Account B
Temporary password

Install the script

Copy the script to /usr/local/bin and make it executable:

sudo install -m 0755 auto_inject_clipboard /usr/local/bin/auto_inject_clipboard

Install the systemd user service

Copy the unit file into ~/.config/systemd/user and enable the service:

mkdir -p ~/.config/systemd/user
cp auto_inject_clipboard.service ~/.config/systemd/user/
systemctl --user daemon-reload
systemctl --user enable --now auto_inject_clipboard.service

The service is Type=oneshot: after running it becomes inactive (dead), but the clipboard has already been populated.

Verify

systemctl --user status auto_inject_clipboard.service
journalctl --user -u auto_inject_clipboard.service -e -n 50
copyq list

Use Super + V on GNOME or the Klipper clipboard history on KDE to check that entries were added.

Update the list

  • Edit ~/.config/auto-inject-clipboard/strings.txt, then run:
systemctl --user restart auto_inject_clipboard.service
  • When you modify the script or service, update the files in the repo and repeat the install steps.

Notes

  • The script starts CopyQ if it is not already running. If the first clipboard entry is missing in desktop history, increase the delay ExecStartPre in the service or adjust the sleep inside the script.
  • To use a different config file, change the CONFIG_FILE variable in the script before installation.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages