Click to copy to clipboard?

@igormpc
What I used is not a clipboard manager, but a keystroke functionality.
On Ubuntu, wayland is already installed, but ydotool and ydotoold are needed for the same task, but there is no ydotoold on the system, even though ydotool is installed.

I cannot find a general solution for implementing the functionality on Linux. Sorry about that.

@boxnumber here is my revision:

(
Document.current.mouseDownAction = { |... args|
	if(args[5] == 2) {
		Platform.case(
			\osx,       {
				(
					"osascript -e 'tell application" +
					"\"System Events\"" +
					"to keystroke return using shift down' &&" +
					"sleep 0.01 &&" +
					"osascript -e 'tell application" +
					"\"System Events\"" +
					"to keystroke \"c\" using command down'"
				).unixCmd;
			},
			\linux,     {
				"xdotool key shift+Return && sleep 0.01 && xdotool key ctrl+c".unixCmd;
			},
			\windows,   {
				(
					"echo CreateObject(\"WScript.Shell\").SendKeys \"+{ENTER}\" :" +
					"WScript.Sleep 10 :" +
					"CreateObject(\"WScript.Shell\").SendKeys \"^c\"" +
					"> sendkeys.vbs && cscript //nologo sendkeys.vbs && del sendkeys.vbs").unixCmd;
			}
		)
	}
}
)
1 Like