{"id":1619,"date":"2019-05-08T20:41:46","date_gmt":"2019-05-08T11:41:46","guid":{"rendered":"https:\/\/yuis-programming.com\/?p=1619"},"modified":"2021-07-21T09:58:41","modified_gmt":"2021-07-21T00:58:41","slug":"windows-10%e3%81%ae%e3%82%af%e3%83%aa%e3%83%83%e3%83%97%e3%83%9c%e3%83%bc%e3%83%89%e3%82%92wsl-bash%e3%81%ab%e5%90%8c%e6%9c%9f%e3%81%99%e3%82%8b","status":"publish","type":"post","link":"https:\/\/yuis-programming.com\/?p=1619","title":{"rendered":"Windows 10\u306e\u30af\u30ea\u30c3\u30d7\u30dc\u30fc\u30c9\u3092WSL bash\u306b\u540c\u671f\u3059\u308b"},"content":{"rendered":"<p>Windows 10\u306e\u30af\u30ea\u30c3\u30d7\u30dc\u30fc\u30c9\u3092WSL bash\u306b\u540c\u671f\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n<p>Windows\u306e\u30af\u30ea\u30c3\u30d7\u30dc\u30fc\u30c9\u3092WSL bash\u306b\u540c\u671f\u3059\u308b\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u66f8\u304d\u307e\u3057\u305f\u3002<\/p>\n\n<p>Windows\u3068WSL\u9593\u3067\u30af\u30ea\u30c3\u30d7\u30dc\u30fc\u30c9\u304c\u5171\u6709\u3067\u304d\u305f\u3089\u3044\u3044\u306a\u3041\u3068\u306f\u3044\u3064\u3082\u601d\u3046\u3053\u3068\u3067\u3059\u304c\u3001\u65b9\u6cd5\u306f\u3044\u304f\u3089\u304b\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u307e\u305a\u3001xming\u306a\u3069\u306ex\u30b5\u30fc\u30d0\u30fc\u30b7\u30b9\u30c6\u30e0\u7d4c\u7531\u3067\u30af\u30ea\u30c3\u30d7\u30dc\u30fc\u30c9\u3092\u5171\u6709\u3059\u308b\u65b9\u6cd5\u3002\u3053\u3061\u3089\u306f\u3001\u50d5\u306e\u5834\u5408\u306f\u3060\u3081\u3067\u3057\u305f\u3002\u8b0e\u306e\u30a8\u30e9\u30fc\u304c\u51fa\u307e\u3059\u3002\u3080\u3057\u308dxming\u306f\u30af\u30ea\u30c3\u30d7\u30dc\u30fc\u30c9\u5171\u6709\u6a5f\u80fd\u3092\u30c7\u30a3\u30b9\u30a8\u30a4\u30d6\u30eb\u3057\u306a\u3044\u3068\u4f7f\u3044\u7269\u306b\u306a\u308a\u307e\u305b\u3093\u3002<\/p>\n<p>\u6b21\u306b\u3001\u30b5\u30fc\u30c9\u30d1\u30fc\u30c6\u30a3\u88fd\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u3092\u4f7f\u3046\u65b9\u6cd5\u3002\u50d5\u304c\u4f7f\u3063\u305f\u3053\u3068\u304c\u3042\u308b\u306e\u306f\u3001chrome\u62e1\u5f35\u6a5f\u80fd\u306e<a href=\"https:\/\/chrome.google.com\/webstore\/detail\/clipbrd-beta\/febnkhppinonnjgfjdigiipdajophkkk\">Clipbrd Beta &#8211; Chrome Web Store<\/a>\u3002<\/p>\n<p>\u3053\u3061\u3089\u3067\u3042\u308c\u3070\u3001chrome\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u3044\u308c\u3070\u3001android\u3001linux\u3001windows,mac\u3067\u30af\u30ea\u30c3\u30d7\u30dc\u30fc\u30c9\u306e\u76f8\u4e92\u540c\u671f\u304c\u53ef\u80fd\u3067\u3059\u3002\u4fbf\u5229\u3002<\/p>\n<p>\u305f\u30fc\u3060\u3057\u3002<br \/>\n\u30c7\u30d9\u30ed\u30c3\u30d1\u30fc\u304c\u826f\u3044\u65b9\u3060\u3068\u60aa\u3044\u3067\u3059\u304c\u3001\u50d5\u306f\u3053\u3046\u3044\u3046\u306e\u4fe1\u7528\u3057\u3066\u3044\u306a\u3044\u306e\u3067\u3001\u57fa\u672c\u7684\u306b\u30aa\u30d5\u306b\u3057\u3066\u3044\u307e\u3059\u3002\u3064\u3063\u3066\u3082\u4f7f\u308f\u306a\u3044\u5ea6\u306b\u62e1\u5f35\u6a5f\u80fd\u3092\u30a2\u30f3\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u305f\u3089\u304d\u308a\u7121\u3044\u306e\u3067\u3001<a href=\"https:\/\/chrome.google.com\/webstore\/detail\/extensions-manager-aka-sw\/lpleipinonnoibneeejgjnoeekmbopbc\">Extensions Manager (aka Switcher) &#8211; Chrome Web Store<\/a>\u3068\u3044\u3063\u305f\u62e1\u5f35\u6a5f\u80fd\u7ba1\u7406\u30a8\u30af\u30b9\u30c6\u30f3\u30b7\u30e7\u30f3\u3092\u4f7f\u3046\u3053\u3068\u3092\u304a\u3059\u3059\u3081\u3002<br \/>\n\u3068\u3044\u3046\u306e\u3082\u3001\u4ef2\u4ecb\u30b5\u30fc\u30d0\u30fc\u3067\u3069\u3046\u3044\u3046\u51e6\u7406\u3092\u3057\u3066\u3044\u308b\u304b\u30d6\u30e9\u30c3\u30af\u30dc\u30c3\u30af\u30b9\u306a\u306e\u3067\u3001\u6016\u3044\u3067\u3059\u304b\u3089\u3002\u306f\u3063\u304d\u308a\u3044\u3063\u3066\u3001\u30b3\u30d4\u30fc\u3057\u305f\u30c6\u30ad\u30b9\u30c8\u30c7\u30fc\u30bf(e.g.\u30d1\u30b9\u30ef\u30fc\u30c9)\u5168\u90e8\u7b52\u629c\u3051\u3066\u308b\u3053\u3068\u3082\u8003\u3048\u305f\u307b\u3046\u304c\u3044\u3044\u308f\u3051\u3067\u3059\u3002\u3053\u3061\u3089\u306e\u62e1\u5f35\u6a5f\u80fd\u81ea\u4f53\u3061\u3087\u3063\u3068\u81ed\u3046\u90e8\u5206\u304c\u3042\u308b\u306e\u3067\u3001\u307e\u3041\u3002\u4f7f\u3046\u304b\u3069\u3046\u304b\u306f\u4efb\u305b\u307e\u3059\u3002<\/p>\n<p>\u3067\u3001\u3082\u3046\u4e00\u3064\u304c\u3001\u81ea\u5206\u3067\u66f8\u3044\u3066\u3057\u307e\u3046\u65b9\u6cd5\u3067\u3059\u306d\u3002\u3068\u3044\u3063\u3066\u3082\u3053\u3061\u3089\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3067\u306f\u76f8\u4e92\u540c\u671f\u306f\u96e3\u3057\u304b\u3063\u305f\u306e\u3067\u3001windows\u304b\u3089wsl\u3078\u306e\u4e00\u65b9\u901a\u884c\u540c\u671f\u3067\u3059\u3002windows\u306e\u30af\u30ea\u30c3\u30d7\u30dc\u30fc\u30c9\u304c\u66f4\u65b0\u3055\u308c\u305f\u3089wsl\u3078\u30b3\u30d4\u30fc\u3057\u307e\u3059\u3002<\/p>\n<div id=\"toc_container\" class=\"no_bullets\"><p class=\"toc_title\">Contents<\/p><ul class=\"toc_list\"><li><a href=\"#i\"><span class=\"toc_number toc_depth_1\">1<\/span> \u5fc5\u8981\u6e96\u5099<\/a><ul><li><a href=\"#ditto\"><span class=\"toc_number toc_depth_2\">1.1<\/span> ditto\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/a><\/li><\/ul><\/li><li><a href=\"#i-2\"><span class=\"toc_number toc_depth_1\">2<\/span> \u30b9\u30af\u30ea\u30d7\u30c8<\/a><\/li><li><a href=\"#i-3\"><span class=\"toc_number toc_depth_1\">3<\/span> \u8ffd\u8a18<\/a><\/li><\/ul><\/div>\n<h2><span id=\"i\">\u5fc5\u8981\u6e96\u5099<\/span><\/h2>\n<h3><span id=\"ditto\">ditto\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/span><\/h3>\n<p>\u3053\u306e\u95a2\u6570\u3067\u306fditto\u3068\u3044\u3046\u30af\u30ea\u30c3\u30d7\u30dc\u30fc\u30c9\u30de\u30cd\u30fc\u30b8\u30e3\u30fc\u304b\u3089\u751f\u6210\u3055\u308c\u305fsqlite\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30d5\u30a1\u30a4\u30eb\u3092\u4f7f\u7528\u3057\u3066\u3044\u307e\u3059\u3002\u306a\u306e\u3067\u30a4\u30f3\u30b9\u30b3\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p><a href=\"https:\/\/sourceforge.net\/projects\/ditto-cp\/\">Ditto download | SourceForge.net<\/a><\/p>\n<h2><span id=\"i-2\">\u30b9\u30af\u30ea\u30d7\u30c8<\/span><\/h2>\n<pre><code>\nsyncWindowsClipboardToWSL(){\n\nwhile [ true ];\ndo\n\nWSLClipboardText=\"$(xclip -o -selection clipboard)\"\n\nWindowsClipboardText=\"$(sqlite3 \/mnt\/c\/Users\/${WINUSER}\/AppData\/Roaming\/Ditto\/Ditto.db \"$(cat &lt;&lt;'EOT'\nSELECT mText from Main\norder by clipOrder desc\nLIMIT 1 OFFSET 0\nEOT\n)\")\"\n\n[[ \"${WSLClipboardText}\" != \"${WindowsClipboardText}\" ]] &amp;&amp; { echo \"${WindowsClipboardText}\" | xclip -sel clip ; printf \"Copied Windows clipboard to WSL.\" ; } || echo -ne \"$(isodate)\\tNothing updated on the clipboard.\\033[0K\\r\"\n\nsleep 2s\n\ndone\n\n}\n\nalias synccltowsl=\"syncWindowsClipboardToWSL\"\n\n<\/code><\/pre>\n<p>\u66f8\u304d\u63db\u3048\u308c\u3070wsl to windows\u3082\u3067\u304d\u308b\u306f\u305a\u3067\u3059\u3002\u305f\u3060\u3057\u76f8\u4e92\u540c\u671f\u3068\u306a\u308b\u3068\u3061\u3087\u3063\u3068\u6642\u9593\u304c\u5fc5\u8981\u305d\u3046\u3002<\/p>\n<p>\u76f8\u4e92\u540c\u671f\u3057\u3066\u304f\u308c\u308b\u30b3\u30fc\u30c9\u3068\u304b\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u304c\u3042\u3063\u305f\u3089\u30b3\u30e1\u30f3\u30c8\u3067\u6559\u3048\u3066\u304f\u3060\u3055\u308b\u3068\u5b09\u3057\u3044\u3067\u3059\u3002<\/p>\n<h2><span id=\"i-3\">\u8ffd\u8a18<\/span><\/h2>\n<p>\u30d0\u30b0\u76f4\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u76f4\u63a5\u5f04\u308b\u3068ditto\u304c\u305f\u307e\u306b\u30af\u30e9\u30c3\u30b7\u30e5\u3059\u308b\u306e\u3067\u3001\u4e00\u5ea6\u30b3\u30d4\u30fc\u3057\u3066\u304b\u3089\u30b3\u30d4\u30fc\u3057\u305f\u3082\u306e\u3092\u5f04\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n<pre><code>syncWindowsClipboardToWSL(){\n\nwhile [ true ];\ndo\n\ncp \/mnt\/c\/Users\/ifgm2\/AppData\/Roaming\/Ditto\/Ditto.db $TMPDIR\/Ditto.db\n\nWSLClipboardText=\"$(xclip -o -selection clipboard)\"\n\n# WindowsClipboardText=\"$(sqlite3 \/mnt\/c\/Users\/${WINUSER}\/AppData\/Roaming\/Ditto\/Ditto.db \"$(cat &lt;&lt;'EOT'\n# SELECT mText from Main\n# order by clipOrder desc\n# LIMIT 1 OFFSET 0\n# EOT\n# )\")\"\nWindowsClipboardText=\"$(sqlite3 $TMPDIR\/Ditto.db \"$(cat &lt;&lt;'EOT'\nSELECT mText from Main\norder by clipOrder desc\nLIMIT 1 OFFSET 0\nEOT\n)\")\"\n\n[[ \"${WSLClipboardText}\" != \"${WindowsClipboardText}\" ]] &amp;&amp; { echo \"${WindowsClipboardText}\" | xclip -sel clip ; printf \"Copied Windows clipboard to WSL.\" ; } || echo -ne \"$(isodate)\\tNothing updated on the clipboard.\\033[0K\\r\"\n# [[ \"${WSLClipboardText}\" != \"${WindowsClipboardText}\" ]] &amp;&amp; { printf \"$(isodate|chomp)\\t${WSLClipboardText}\\n\" &gt;&gt; ~\/WSLClipboardText.log ; printf \"$(isodate|chomp)\\t${WindowsClipboardText}\\n\" &gt;&gt; ~\/WindowsClipboardText.log ; \\\n#    } || echo same.\n#\n# hgoe fuga\n# hoge foo\n\nsleep 2s\n\ndone\n\n: &lt;&lt;'NOTE'\n\nError: database disk image is malformed on the clipboard.\n\nNOTE\n\n}\n\nalias synccltowsl=\"syncWindowsClipboardToWSL\"\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Windows 10\u306e\u30af\u30ea\u30c3\u30d7\u30dc\u30fc\u30c9\u3092WSL bash\u306b\u540c\u671f\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u7d39\u4ecb\u3057\u307e\u3059\u3002 Windows\u306e\u30af\u30ea [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false},"categories":[1],"tags":[],"acf":[],"jetpack_featured_media_url":"","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8Rxwo-q7","_links":{"self":[{"href":"https:\/\/yuis-programming.com\/index.php?rest_route=\/wp\/v2\/posts\/1619"}],"collection":[{"href":"https:\/\/yuis-programming.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/yuis-programming.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/yuis-programming.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/yuis-programming.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1619"}],"version-history":[{"count":2,"href":"https:\/\/yuis-programming.com\/index.php?rest_route=\/wp\/v2\/posts\/1619\/revisions"}],"predecessor-version":[{"id":2814,"href":"https:\/\/yuis-programming.com\/index.php?rest_route=\/wp\/v2\/posts\/1619\/revisions\/2814"}],"wp:attachment":[{"href":"https:\/\/yuis-programming.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1619"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/yuis-programming.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1619"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/yuis-programming.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1619"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}