summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/scripts/cclip21
-rwxr-xr-xbin/scripts/getpass16
-rwxr-xr-xbin/scripts/linkhandler_store11
3 files changed, 48 insertions, 0 deletions
diff --git a/bin/scripts/cclip b/bin/scripts/cclip
new file mode 100755
index 0000000..29320ad
--- /dev/null
+++ b/bin/scripts/cclip
@@ -0,0 +1,21 @@
+#!/usr/bin/env sh
+
+# Copy text from the standard input to the clipboard.
+# If connected from an ssh session, use clipper to send back to local computer.
+# Otherwise just use xclip.
+
+# The code block checks whether it is an ssh session or not.
+# If so, SESSION_TYPE is set to remote/ssh.
+if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then
+ SESSION_TYPE=remote/ssh
+else
+ case $(ps -o comm= -p "$PPID") in
+ sshd|*/sshd) SESSION_TYPE=remote/ssh;;
+ esac
+fi
+
+if [ "$SESSION_TYPE" = "remote/ssh" ]; then
+ nc -q 0 -U ~/.clipper.sock
+else
+ xclip -sel clip
+fi
diff --git a/bin/scripts/getpass b/bin/scripts/getpass
new file mode 100755
index 0000000..6c50680
--- /dev/null
+++ b/bin/scripts/getpass
@@ -0,0 +1,16 @@
+U2FsdGVkX18uijhkW4V0CvYL9ESOoL7NOO7DuJjk7IEFrsDENNfcymu+J/KkFTQq
+GZhgcjn5T4lh4Edmg9hdnxGWnGWM24mOQbPL44lIIijW1zpoBgWZZqFZCv4ufBCX
+k+GoAR8/JjqcufEdsdO9Gfkdehwnl6F4rFz29PrjUKZ6J3VI4lm8eohy8Kn7I8Il
+KhSdKKyZSlisBSM2CMIIa2tWgCPy3fxooGafwhSjm1P16TTdUyU2qasqBaT45HCw
+5Gh4smnpH9Oq4PO3Z+OhAvSwT0SSzWL5spVNLWbo8CJu/bzcfE/HbvLaze+wtomd
+dzLmaJ8Z22rEwlGSiW0rOFeX5TW4RqRabj1j3KgfeaUmgKv4VeSWaMIw85Lllip9
+HSur+GPSsFdwvErQi+SvHqgxCSCzJ48cK6n6ERI6uLc6nYjIpaMqtzz8TKM5Rvcq
+fifMGGB62pai/Ls35qGiOGZ0UjRefYhxaBCLLC+AlRa5YCd+q+4bXf0kw+68zZ0f
+uvlvzXnNM2Hjgt8xJ11UTDvKpKdT7Q+trrs8zJCB8DBRND0klXr3+Qe4CS+w7orB
+sZrFYeDk1KhRXoAq0qrjtbKcgTlimD49bFhQgQPPAl52MPvZkTprSvAe2q/ZaGo+
+7u3J1YvZwMN+ogpgPXc58JxGwg05kzdXQ7aGZ3N6Gdb9oBuh8C/YpuNan0FolXrT
+uSmRw1IpbhU1gcGMcvCLWBzCw8wNwx6W+sEwgJD/lSI4fYJpTayhDkV+i+kTPZm8
+Gd92F1Ma7rKeucivMSzulvKS5q7KNYxrjbze2gB7yA5uNAPFCVm0zF5CMQRTkKh8
+kOjB0vV3fh0qAMxxES9Qn1LXhctHEu5kALvyQewXTVaJWzO+OidBkmdcgu2k+Tv6
+AJD+zg8HjBQH8fM1ddQO/Y3HeBgAws12djhEyxXY6QV9I7ClXMS5lgjN4V3Ltt1l
+Qv5oTEDUJlnPrrgaPovlrBFyRVSATq3VWb6pjeAyCkQ95rUyT1mZHtpZ7WZdEqAC
diff --git a/bin/scripts/linkhandler_store b/bin/scripts/linkhandler_store
new file mode 100755
index 0000000..49b8516
--- /dev/null
+++ b/bin/scripts/linkhandler_store
@@ -0,0 +1,11 @@
+#!/usr/bin/env sh
+
+# Store the provided links in linkhandler's store_file.
+# The stored links will be prefixed next time linkhandler is run.
+
+cache_dir="${XDG_CACHE_DIR:-$HOME/.cache}/linkhandler"
+store_file="$cache_dir/store"
+[ -d "$cache_dir" ] || mkdir -p "$cache_dir"
+for url in "$@";
+do printf "%s\0" "$url"
+done >> "$store_file"