{"id":104,"date":"2024-10-22T07:45:00","date_gmt":"2024-10-22T05:45:00","guid":{"rendered":"https:\/\/linuxundich.de\/en\/?p=104"},"modified":"2026-10-03T23:04:43","modified_gmt":"2026-10-03T21:04:43","slug":"text-to-clipboard-for-the-nautilus-files-file-manager","status":"publish","type":"post","link":"https:\/\/linuxundich.de\/en\/gnu-linux\/text-to-clipboard-for-the-nautilus-files-file-manager\/","title":{"rendered":"Text-to-Clipboard for the Nautilus\/Files File Manager"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">The file manager of the GNOME desktop environment, formerly known as Nautilus and now called &#8220;Files&#8221; (\u201cDateien\u201d in German), isn&#8217;t exactly famous for its huge feature set. Some useful features, like opening a terminal window in the current folder, can be added with extensions. An alternative to the well-known <em>nautilus-open-terminal<\/em> extension is the newer <a href=\"https:\/\/github.com\/Stunkymonkey\/nautilus-open-any-terminal\">nautilus-open-any-terminal<\/a>, which lets you configure almost any Linux terminal.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The extension <a href=\"https:\/\/github.com\/EuCaue\/nautilus-extension-copy-file-contents\">Copy File Contents<\/a> was just released. It lets you copy the contents of a file straight from the file manager to the system clipboard, without first having to open the file in an editor or in preview mode (via the space bar). Especially for users who work with text files regularly, this extension is a real relief.<\/p>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;6ac1924d6a7be&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"6ac1924d6a7be\" class=\"wp-block-image wp-lightbox-container\"><img decoding=\"async\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on--pointerdown=\"actions.preloadImage\" data-wp-on--pointerenter=\"actions.preloadImageWithDelay\" data-wp-on--pointerleave=\"actions.cancelPreload\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/linuxundich.de\/wp-content\/uploads\/2024\/10\/nautilus-copy-file-contents-1280x913.webp\" alt=\"Copy File Contents copies the contents of text files to the clipboard.\" style=\"width:100%\"\/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\tdata-wp-bind--aria-label=\"state.thisImage.triggerButtonAriaLabel\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.thisImage.buttonRight\"\n\t\t\tdata-wp-style--top=\"state.thisImage.buttonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><figcaption class=\"wp-element-caption\">Copy File Contents copies the contents of text files to the clipboard.<\/figcaption><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"voraussetzungen\">Requirements<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Before you can install the extension, make sure the <em>nautilus-python<\/em> package is present on your system. It is available in the repositories of most common distributions. Depending on the distribution you use, the installation looks like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ &lt;strong&gt;sudo apt install nautilus-python&lt;\/strong&gt;   # Ubuntu, Debian und Co.\n$ &lt;strong&gt;sudo dnf install nautilus-python&lt;\/strong&gt;   # Fedora\n$ &lt;strong&gt;sudo pacman -S python-nautilus&lt;\/strong&gt;     # Arch Linux und Co.<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"installation-der-erweiterung\">Installing the extension<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">The extension itself isn&#8217;t in the repositories yet, but you can easily install it with a Makefile or manually. First, clone the repository and change into the directory:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ &lt;strong&gt;git clone https:\/\/github.com\/EuCaue\/nautilus-extension-copy-file-contents.git&lt;\/strong&gt;\n$ &lt;strong&gt;cd nautilus-extension-copy-file-contents&lt;\/strong&gt;<\/code><\/pre>\n\n\n\n<h5 class=\"wp-block-heading\" id=\"installation-\u00fcber-makefile\">Installing with the Makefile<\/h5>\n\n\n\n<p class=\"wp-block-paragraph\">Use the following command to install the extension:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ &lt;strong&gt;make install&lt;\/strong&gt;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This installs the extension to <code>~\/.local<\/code> in your home directory, so you don&#8217;t need administrative privileges.<\/p>\n\n\n\n<h5 class=\"wp-block-heading\" id=\"manuelle-installation\">Manual installation<\/h5>\n\n\n\n<p class=\"wp-block-paragraph\">Alternatively, you can install the extension manually. Simply copy the Python script into the Nautilus extensions folder:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ &lt;strong&gt;mkdir -p ~\/.local\/share\/nautilus-python\/extensions\/&lt;\/strong&gt;\n$ &lt;strong&gt;cp .\/src\/nautilus_copy_file_contents.py ~\/.local\/share\/nautilus-python\/extensions\/&lt;\/strong&gt;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">After the installation, you generally need to restart Nautilus. You can do that with the following command in the terminal. There is no &#8220;real&#8221; entry in the file manager&#8217;s menus.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ &lt;strong&gt;nautilus -q&lt;\/strong&gt;<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"deinstallation-der-erweiterung\">Uninstalling the extension<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">If you want to uninstall the extension, you again have two options:<\/p>\n\n\n\n<h5 class=\"wp-block-heading\" id=\"deinstallation-\u00fcber-makefile\">Uninstalling with the Makefile<\/h5>\n\n\n\n<pre class=\"wp-block-code\"><code>$ &lt;strong&gt;make uninstall&lt;\/strong&gt;<\/code><\/pre>\n\n\n\n<h5 class=\"wp-block-heading\" id=\"manuelle-deinstallation\">Manual uninstallation<\/h5>\n\n\n\n<p class=\"wp-block-paragraph\">Change into the Nautilus extensions directory and delete the file:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ &lt;strong&gt;cd ~\/.local\/share\/nautilus-python\/extensions\/&lt;\/strong&gt;\n$ &lt;strong&gt;rm nautilus_copy_file_contents.py&lt;\/strong&gt;<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"entwicklung-und-debugging\">Development and debugging<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">If you want to modify the extension or debug it, you can enable debug mode by setting an environment variable in the terminal. To update, just repeat the installation:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ &lt;strong&gt;export NAUTILUS_PYTHON_DEBUG=misc&lt;\/strong&gt;\n$ &lt;strong&gt;make install &amp;&amp; nautilus -q&lt;\/strong&gt;\n$ &lt;strong&gt;nautilus&lt;\/strong&gt;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Now the extension is ready and helps you copy the contents of files quickly and easily.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The Copy File Contents extension copies the contents of a text file straight from the Nautilus file manager to the clipboard, no detour through an editor needed.<\/p>\n","protected":false},"author":2,"featured_media":103,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"lui_source_id":42396,"lui_source_hash":"773206c3916d4ac29302f70bf52c14befccf474fb44f6f5c61a201f677d71545","lui_source_translated":"2026-10-03","lui_source_reviewed":true,"lui_via_url":"","lui_via_label":"","lui_source_url":"","lui_source_label":"","footnotes":""},"categories":[2],"tags":[],"class_list":["post-104","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-gnu-linux"],"_links":{"self":[{"href":"https:\/\/linuxundich.de\/en\/wp-json\/wp\/v2\/posts\/104","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxundich.de\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxundich.de\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxundich.de\/en\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxundich.de\/en\/wp-json\/wp\/v2\/comments?post=104"}],"version-history":[{"count":1,"href":"https:\/\/linuxundich.de\/en\/wp-json\/wp\/v2\/posts\/104\/revisions"}],"predecessor-version":[{"id":108,"href":"https:\/\/linuxundich.de\/en\/wp-json\/wp\/v2\/posts\/104\/revisions\/108"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxundich.de\/en\/wp-json\/wp\/v2\/media\/103"}],"wp:attachment":[{"href":"https:\/\/linuxundich.de\/en\/wp-json\/wp\/v2\/media?parent=104"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxundich.de\/en\/wp-json\/wp\/v2\/categories?post=104"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxundich.de\/en\/wp-json\/wp\/v2\/tags?post=104"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}