Last active
December 4, 2024 09:09
-
-
Save ZiTAL/9d6a967e46b405b9250b756ec590cf75 to your computer and use it in GitHub Desktop.
gnu/linux: sync clipboard
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
#!/bin/bash | |
# /usr/local/bin/xclip-sync | |
while true; do | |
xclip -o -selection primary | xclip -selection clipboard | |
sleep 0.5 | |
done |
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
# /etc/systemd/system/xclip-sync.service | |
[Unit] | |
Description=xclip: Sync Primary and Clipboard Selections | |
After=display-manager.service | |
Requires=display-manager.service | |
[Service] | |
ExecStart=/usr/local/bin/xclip-sync | |
Restart=always | |
User=zital | |
# echo $DISPLAY | |
Environment=DISPLAY=:1.0 | |
Environment=XAUTHORITY=/home/zital/.Xauthority | |
[Install] | |
WantedBy=default.target |
Author
ZiTAL
commented
Dec 4, 2024
echo $DISPLAY
:1.0
beraz:
Environment=DISPLAY=:1.0
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment