LoginSignup
0
0

More than 3 years have passed since last update.

簡易クリップボード

Last updated at Posted at 2020-05-20

概要

xrdpを使うと、GNOMEやKDEのようなデスクトップ環境とWindowsとの間でコピー&ペーストができます。
しかし、シンプルなウィンドウマネージャでxtermやkterm等を使っていると、標準では同じようにできません。
ここでは、そのような環境でも使える簡易的なクリップボードを紹介します。

必要なもの

  • Webブラウザ
    Windowsではなく、X Window Systemで動作するWebブラウザです。 firefoxで動作を確認しています。

HTMLコード

以下の内容のHTMLファイルを作成してブラウザから直接開きます。Webサーバーは不要です。

<!DOCTYPE html>
<html lang="ja">
<head>
    <meta charset="UTF-8">
    <title>CLIPBOARD</title>
</head>
<body>
<p>
<input type="button" value="Clear"
  onClick="document.getElementById('clipboard').value='';">
<input type="button" value="Copy"
  onClick="navigator.clipboard.writeText(document.getElementById('clipboard').value);">
</p>
<p><textarea cols="80" rows="20" id="clipboard"></textarea></p>
</body>
</html>

使い方

Windowsとブラウザ間はコンテキストメニューで「コピー」と「貼り付け」を使います。
ブラウザとxterm間はマウスの中ボタンでコピー&ペースします。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0