<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Tips – Linux und Ich</title>
	<atom:link href="https://linuxundich.de/en/tag/tips/feed/" rel="self" type="application/rss+xml" />
	<link>https://linuxundich.de/en</link>
	<description>A German Linux blog, in English</description>
	<lastBuildDate>Wed, 16 Sep 2026 21:59:47 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1.3</generator>
	<item>
		<title>Tfm: A modern file manager for the terminal</title>
		<link>https://linuxundich.de/en/tfm-a-modern-file-manager-for-the-terminal/</link>
					<comments>https://linuxundich.de/en/tfm-a-modern-file-manager-for-the-terminal/#comments</comments>
		
		<dc:creator><![CDATA[Christoph Langner]]></dc:creator>
		<pubDate>Wed, 16 Sep 2026 21:59:47 +0000</pubDate>
				<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[File Manager]]></category>
		<category><![CDATA[Terminal]]></category>
		<category><![CDATA[Tips]]></category>
		<guid isPermaLink="false">https://linuxundich.de/en/?p=15</guid>

					<description><![CDATA[tfm brings a sidebar, tabs, dual-pane view and mouse support to the terminal – a file manager for everyone who prefers to work there anyway. It still has a few small beta quirks, but it's already worth a look.]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">While browsing the web recently, I stumbled across <code>tfm</code>. This terminal file manager wants to take its cues for operation less from classic command-line tools and more from graphical file managers like Dolphin or Nautilus. If you like working directly in the terminal anyway, this is a really interesting find.</p>



<p class="wp-block-paragraph">Among other things, tfm comes with a sidebar, tabs, a dual-pane view, and file previews. The usual file operations like copying, moving, renaming, and deleting are on board as well. What&#8217;s interesting: you don&#8217;t have to work exclusively with the keyboard. Tfm also supports the mouse, so you can select, move, and rename files by drag and drop, for example.</p>



<p class="wp-block-paragraph">That way, tfm combines typical features of graphical file managers with the terminal environment. If you spend a lot of time there anyway, you can manage files and directories without opening a separate graphical app.</p>



<figure data-wp-context="{&quot;imageId&quot;:&quot;6ae0589396a57&quot;}" data-wp-interactive="core/image" data-wp-key="6ae0589396a57" class="wp-block-image wp-lightbox-container"><img fetchpriority="high" decoding="async" height="967" sizes="(max-width: 781px) 100vw, 680px" srcset="https://linuxundich.de/wp-content/uploads/2026/09/tfm-archlinux-01-640x387.webp 640w, https://linuxundich.de/wp-content/uploads/2026/09/tfm-archlinux-01-768x464.webp 768w, https://linuxundich.de/wp-content/uploads/2026/09/tfm-archlinux-01-1280x774.webp 1280w, https://linuxundich.de/wp-content/uploads/2026/09/tfm-archlinux-01-1536x928.webp 1536w, https://linuxundich.de/wp-content/uploads/2026/09/tfm-archlinux-01.webp 1600w" width="1600" 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/2026/09/tfm-archlinux-01.webp" alt="tfm right after launch on Arch Linux, with the sidebar and file view. The interface is reminiscent of classic graphical file managers." style="width:100%"/><button
			class="lightbox-trigger"
			type="button"
			aria-haspopup="dialog"
			data-wp-bind--aria-label="state.thisImage.triggerButtonAriaLabel"
			data-wp-init="callbacks.initTriggerButton"
			data-wp-on--click="actions.showLightbox"
			data-wp-style--right="state.thisImage.buttonRight"
			data-wp-style--top="state.thisImage.buttonTop"
		>
			<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="none" viewBox="0 0 12 12">
				<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" />
			</svg>
		</button><figcaption class="wp-element-caption">tfm right after launch on Arch Linux, with the sidebar and file view. The interface is reminiscent of classic graphical file managers.</figcaption></figure>



<figure data-wp-context="{&quot;imageId&quot;:&quot;6ae0589396ee6&quot;}" data-wp-interactive="core/image" data-wp-key="6ae0589396ee6" class="wp-block-image wp-lightbox-container"><img decoding="async" height="967" sizes="(max-width: 781px) 100vw, 680px" srcset="https://linuxundich.de/wp-content/uploads/2026/09/tfm-archlinux-02-640x387.webp 640w, https://linuxundich.de/wp-content/uploads/2026/09/tfm-archlinux-02-768x464.webp 768w, https://linuxundich.de/wp-content/uploads/2026/09/tfm-archlinux-02-1280x774.webp 1280w, https://linuxundich.de/wp-content/uploads/2026/09/tfm-archlinux-02-1536x928.webp 1536w, https://linuxundich.de/wp-content/uploads/2026/09/tfm-archlinux-02.webp 1600w" width="1600" 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/2026/09/tfm-archlinux-02.webp" alt="You can open the settings with Esc. There you can adjust various options and the look of tfm." style="width:100%"/><button
			class="lightbox-trigger"
			type="button"
			aria-haspopup="dialog"
			data-wp-bind--aria-label="state.thisImage.triggerButtonAriaLabel"
			data-wp-init="callbacks.initTriggerButton"
			data-wp-on--click="actions.showLightbox"
			data-wp-style--right="state.thisImage.buttonRight"
			data-wp-style--top="state.thisImage.buttonTop"
		>
			<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="none" viewBox="0 0 12 12">
				<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" />
			</svg>
		</button><figcaption class="wp-element-caption">You can open the settings with Esc. There you can adjust various options and the look of tfm.</figcaption></figure>



<h2 class="wp-block-heading">Installing from the AUR</h2>



<p class="wp-block-paragraph">You can find Tfm in the AUR (Arch User Repository). If you use an AUR helper like <code>yay</code>, you can install the binary version right away. On Arch Linux, this command is all you need:</p>



<pre class="wp-block-code"><code>$ yay -S tfm-tui-bin</code></pre>



<p class="wp-block-paragraph">After that, start the file manager with:</p>



<pre class="wp-block-code"><code>$ tfm</code></pre>



<p class="wp-block-paragraph">If you use a different distribution, the <a href="https://github.com/clarkarch/tfm-tui">project page</a> has instructions for the install script provided there. With it, you install the current version independently of your distribution&#8217;s packages.</p>



<h2 class="wp-block-heading">Nerd Fonts for the icons</h2>



<p class="wp-block-paragraph">For tfm to show folders and files with the intended icons, you need a <a href="https://www.nerdfonts.com/">Nerd Font</a>. These fonts come with additional characters and icons that terminal apps use to display folders, files, and other elements.</p>



<p class="wp-block-paragraph">For this article, I&#8217;m using the Hack Nerd Font. On Arch Linux, the font is available directly in the official repositories and can be installed with <code>pacman</code>:</p>



<pre class="wp-block-code"><code>$ sudo pacman -S ttf-hack-nerd</code></pre>



<p class="wp-block-paragraph">For tfm to display the icons correctly, the Hack Nerd Font only has to be installed on your system. You don&#8217;t need to select the font in your terminal for that. You normally don&#8217;t need to refresh the font cache manually for a package from the Arch repositories either.</p>



<h2 class="wp-block-heading">Beta with a few rough edges</h2>



<p class="wp-block-paragraph">Tfm is still in beta, and you&#8217;ll notice it most in how icons are displayed. In my tests, the Nerd Font symbols didn&#8217;t show up reliably on every start. Folders and other elements sometimes appear without the icons they&#8217;re supposed to have.</p>



<p class="wp-block-paragraph">Restarting tfm or the terminal usually fixes it. What stands out: the icons come back on the next start even without any changes to the font cache, so the problems can&#8217;t be blamed solely on a broken installation of the font.</p>



<figure data-wp-context="{&quot;imageId&quot;:&quot;6ae0589397c70&quot;}" data-wp-interactive="core/image" data-wp-key="6ae0589397c70" class="wp-block-image wp-lightbox-container"><img decoding="async" height="967" sizes="(max-width: 781px) 100vw, 680px" srcset="https://linuxundich.de/wp-content/uploads/2026/09/tfm-archlinux-03-640x387.webp 640w, https://linuxundich.de/wp-content/uploads/2026/09/tfm-archlinux-03-768x464.webp 768w, https://linuxundich.de/wp-content/uploads/2026/09/tfm-archlinux-03-1280x774.webp 1280w, https://linuxundich.de/wp-content/uploads/2026/09/tfm-archlinux-03-1536x928.webp 1536w, https://linuxundich.de/wp-content/uploads/2026/09/tfm-archlinux-03.webp 1600w" width="1600" 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/2026/09/tfm-archlinux-03.webp" alt="tfm in dual-pane mode with two file panes. The view makes it easier to work with files and directories side by side." style="width:100%"/><button
			class="lightbox-trigger"
			type="button"
			aria-haspopup="dialog"
			data-wp-bind--aria-label="state.thisImage.triggerButtonAriaLabel"
			data-wp-init="callbacks.initTriggerButton"
			data-wp-on--click="actions.showLightbox"
			data-wp-style--right="state.thisImage.buttonRight"
			data-wp-style--top="state.thisImage.buttonTop"
		>
			<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="none" viewBox="0 0 12 12">
				<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" />
			</svg>
		</button><figcaption class="wp-element-caption">tfm in dual-pane mode with two file panes. The view makes it easier to work with files and directories side by side.</figcaption></figure>



<figure data-wp-context="{&quot;imageId&quot;:&quot;6ae05893980c3&quot;}" data-wp-interactive="core/image" data-wp-key="6ae05893980c3" class="wp-block-image wp-lightbox-container"><img loading="lazy" decoding="async" height="967" sizes="auto, (max-width: 781px) 100vw, 680px" srcset="https://linuxundich.de/wp-content/uploads/2026/09/tfm-archlinux-04-640x387.webp 640w, https://linuxundich.de/wp-content/uploads/2026/09/tfm-archlinux-04-768x464.webp 768w, https://linuxundich.de/wp-content/uploads/2026/09/tfm-archlinux-04-1280x774.webp 1280w, https://linuxundich.de/wp-content/uploads/2026/09/tfm-archlinux-04-1536x928.webp 1536w, https://linuxundich.de/wp-content/uploads/2026/09/tfm-archlinux-04.webp 1600w" width="1600" 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/2026/09/tfm-archlinux-04.webp" alt="The preview shows text and image files right inside tfm. For image thumbnails, though, you need a terminal with the Kitty Graphics Protocol." style="width:100%"/><button
			class="lightbox-trigger"
			type="button"
			aria-haspopup="dialog"
			data-wp-bind--aria-label="state.thisImage.triggerButtonAriaLabel"
			data-wp-init="callbacks.initTriggerButton"
			data-wp-on--click="actions.showLightbox"
			data-wp-style--right="state.thisImage.buttonRight"
			data-wp-style--top="state.thisImage.buttonTop"
		>
			<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="none" viewBox="0 0 12 12">
				<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" />
			</svg>
		</button><figcaption class="wp-element-caption">The preview shows text and image files right inside tfm. For image thumbnails, though, you need a terminal with the Kitty Graphics Protocol.</figcaption></figure>



<p class="wp-block-paragraph">For graphical image previews, tfm needs a terminal that supports the Kitty Graphics Protocol. On Linux, Ghostty is a good choice, for example, and its Linux interface is built on GTK4. Gnome Terminal can&#8217;t offer this feature, because the underlying VTE library doesn&#8217;t support the Kitty Graphics Protocol.</p>



<p class="wp-block-paragraph">The rest of the interface isn&#8217;t yet as stable or consistent as what you&#8217;re used to from established file managers, either. If you try tfm, start with files that don&#8217;t matter, and don&#8217;t trust important data to such young software on its own.</p>



<h2 class="wp-block-heading">The most important keyboard shortcuts</h2>



<p class="wp-block-paragraph">Despite the mouse support, the keyboard plays an important role in tfm. You&#8217;ll find the most important commands in the following overview:</p>



<figure class="wp-block-table"><table><thead><tr><th>Shortcut</th><th>Function</th></tr></thead><tbody><tr><td><code>Esc</code></td><td>Open menu</td></tr><tr><td><code>Enter</code></td><td>Open file or folder</td></tr><tr><td><code>Backspace</code></td><td>Go up one directory level</td></tr><tr><td><code>F2</code></td><td>Rename file or folder</td></tr><tr><td><code>Tab</code></td><td>Switch between the two file panes</td></tr><tr><td><code>F5</code></td><td>Copy selection to the other pane</td></tr><tr><td><code>F6</code></td><td>Move selection to the other pane</td></tr><tr><td><code>Strg</code>+<code>C</code> / <code>Strg</code>+<code>X</code> / <code>Strg</code>+<code>V</code></td><td>Copy / Cut / Paste</td></tr><tr><td><code>Strg</code>+<code>D</code></td><td>Duplicate selection</td></tr><tr><td><code>Entf</code></td><td>Move selection to the trash</td></tr><tr><td><code>Strg</code>+<code>Z</code> / <code>Strg</code>+<code>Y</code></td><td>Undo / Redo</td></tr><tr><td><code>Strg</code>+<code>T</code> / <code>Strg</code>+<code>W</code></td><td>Open / close tab</td></tr><tr><td><code>Strg</code>+<code>Tab</code></td><td>Switch between tabs</td></tr><tr><td><code>Alt</code>+<code>Enter</code></td><td>Show properties</td></tr><tr><td><code>Strg</code>+<code>H</code></td><td>Show hidden files</td></tr><tr><td><code>Strg</code>+<code>L</code></td><td>Open path bar</td></tr><tr><td><code>Strg</code>+<code>G</code></td><td>Switch between list and grid view</td></tr><tr><td><code>F9</code></td><td>Show or hide preview</td></tr><tr><td><code>F4</code></td><td>Open terminal in the current directory</td></tr><tr><td><code>Strg</code>+<code>Umschalt</code>+<code>S</code></td><td>Connect to a server</td></tr><tr><td><code>Strg</code>+<code>Q</code></td><td>Quit tfm</td></tr></tbody></table></figure>



<p class="wp-block-paragraph">All in all, tfm is a likable find for me, especially for anyone who spends all day in the terminal anyway. The sidebar, tabs, dual-pane view, preview and mouse control add a level of comfort you normally don&#8217;t get on the command line. If you like, you can even switch on animations – a <a href="https://www.reddit.com/r/tui/comments/1wh46e9/beta_release_tfm_terminal_file_manager_for_linux/">video on Reddit</a> shows what that looks like.</p>



<p class="wp-block-paragraph">Keep the quirks of the beta phase in mind, though, above all the icon rendering and the interface, which isn&#8217;t quite polished yet. I&#8217;ll keep following the development, and right now I&#8217;d mainly recommend tfm for trying it out – preferably with non-critical files until the software has matured a bit.</p>
<hr><p>☕ <strong>Support Linux und Ich</strong><br>Thanks for reading <a href="https://linuxundich.de/en/">Linux und Ich</a>. If you enjoy the blog and would like to support my work, you will find more information on the <a href="https://linuxundich.de/en/support/">donation page</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://linuxundich.de/en/tfm-a-modern-file-manager-for-the-terminal/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Mounting Network Shares Automatically: What Can Go Wrong with the NetworkManager Dispatcher</title>
		<link>https://linuxundich.de/en/mounting-network-shares-automatically-what-can-go-wrong-with-the-networkmanager-dispatcher/</link>
					<comments>https://linuxundich.de/en/mounting-network-shares-automatically-what-can-go-wrong-with-the-networkmanager-dispatcher/#respond</comments>
		
		<dc:creator><![CDATA[Christoph Langner]]></dc:creator>
		<pubDate>Fri, 21 Aug 2026 16:11:08 +0000</pubDate>
				<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[Arch Linux]]></category>
		<category><![CDATA[GNOME]]></category>
		<category><![CDATA[Homelab]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[NetworkManager]]></category>
		<category><![CDATA[Tips]]></category>
		<guid isPermaLink="false">https://linuxundich.de/en/?p=13</guid>

					<description><![CDATA[All my mount script was supposed to do was one thing: mount the Samba share when I'm at home. In the end it broke shutdown, resume and standby for me, and taught me a few things about D-state processes and the Linux freezer.]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">You may know the situation: at home you have a NAS or a cloud storage that you mount via Samba or WebDAV. But only when you are actually on your home network. Nobody wants to sit in a café waiting because the laptop is desperately trying to mount a share that is simply not reachable right now.</p>



<p class="wp-block-paragraph">The obvious solution: <code>/etc/fstab</code> plus a dispatcher script for NetworkManager that mounts automatically based on the SSID or on whether the server is reachable. Sounds like an evening project. It isn&#8217;t quite. I tripped over three pitfalls that you only notice when the machine shuts down, wakes up, or is supposed to go into standby. Those are the three I&#8217;ll walk you through here.</p>



<p class="wp-block-paragraph">I tested all of this on Arch Linux, but the setup is not Arch-specific. As long as your distro ships systemd and NetworkManager (so Fedora, Ubuntu, Debian or openSUSE, for example), everything here works one to one.</p>



<h3 class="wp-block-heading">The basic setup</h3>



<p class="wp-block-paragraph">Network shares traditionally get <code>noauto</code> in the fstab, so they are not mounted immediately at boot but only when needed:</p>



<pre class="wp-block-code"><code>//server/home /mnt/server/home cifs credentials=/etc/samba/server.credentials,rw,uid=1000,gid=100,noauto,_netdev 0 0
//server/data /mnt/server/data cifs credentials=/etc/samba/server.credentials,rw,uid=1000,gid=100,noauto,_netdev 0 0</code></pre>



<p class="wp-block-paragraph">For the mount type itself, the Arch Wiki has good guides depending on the protocol, for example on <a href="https://wiki.archlinux.org/title/Samba">Samba/CIFS</a> and on <a href="https://wiki.archlinux.org/title/Davfs2">davfs2 for WebDAV</a>. Both work on any distribution, as long as <em>cifs-utils</em> or <em>davfs2</em> are installed.</p>



<p class="wp-block-paragraph">The actual mounting is then handled by a script in <code>/etc/NetworkManager/dispatcher.d/</code>. NetworkManager calls such scripts on every connection change and passes along the interface and the status (up, down, pre-down and a few more). All the details are in the <a href="https://man.archlinux.org/man/NetworkManager-dispatcher.8.en">NetworkManager dispatcher man page</a>. A simple script checks the active Wi-Fi SSID and mounts if it matches:</p>



<pre class="wp-block-code"><code>#!/bin/bash
IFACE=&quot;$1&quot;
STATUS=&quot;$2&quot;

case &quot;$STATUS&quot; in
    up)
        SSID=$(nmcli -t -f active,ssid dev wifi | awk -F: '$1 == &quot;yes&quot; {print $2; exit}')
        if &amp;#91;&amp;#91; &quot;$SSID&quot; == &quot;MeinHeimnetz&quot; ]]; then
            mount /mnt/server/home
            mount /mnt/server/data
        fi
        ;;
    down)
        umount /mnt/server/home
        umount /mnt/server/data
        ;;
esac</code></pre>



<p class="wp-block-paragraph">Done, right? Not quite. As soon as you shut down the system, wake it from standby or put it into standby, it turns out that this approach has its catches.</p>



<h3 class="wp-block-heading">Why not just use GVfs?</h3>



<p class="wp-block-paragraph">You may now be wondering why I put myself through fstab and dispatcher scripts at all. GNOME offers “Connect to Server” in the file manager, which is a much easier way to mount network shares via SMB or WebDAV. That is exactly where my problem lies.</p>



<p class="wp-block-paragraph">Such mounts don&#8217;t go through the kernel but through GVfs, GNOME&#8217;s virtual file system. Programs that use the GIO library (almost all GTK apps, first and foremost the file manager itself) talk to shares directly through their own URIs like <code>smb://</code> or <code>dav://</code>, and accordingly display thumbnails and metadata correctly. For programs that can&#8217;t do that, GVfs additionally exposes the share as a perfectly normal path under <code>/run/user/&lt;uid&gt;/gvfs</code>. This bridge does run through FUSE. GVfs itself is not a classic FUSE file system but its own architecture with a daemon process per protocol, yet for exactly this case it provides a POSIX-compatible path via gvfsd-fuse.</p>



<p class="wp-block-paragraph">This very bridge is the sticking point for me: not every program copes with it reliably. In my case it shows up in a Markdown editor where I also embed images for articles. The file manager displays the images on the network drive just fine, because it speaks GVfs natively. The Markdown editor, on the other hand, shows only a placeholder for the same image. Access via the FUSE path simply doesn&#8217;t work reliably, even though the file is demonstrably there.</p>



<figure data-wp-context="{&quot;imageId&quot;:&quot;6ae05893bfcf7&quot;}" data-wp-interactive="core/image" data-wp-key="6ae05893bfcf7" class="wp-block-image wp-lightbox-container"><img loading="lazy" decoding="async" height="720" sizes="auto, (max-width: 781px) 100vw, 680px" srcset="https://linuxundich.de/wp-content/uploads/2026/08/apostrophe-webdav-bild-640x360.webp 640w, https://linuxundich.de/wp-content/uploads/2026/08/apostrophe-webdav-bild-768x432.webp 768w, https://linuxundich.de/wp-content/uploads/2026/08/apostrophe-webdav-bild-1280x720.webp 1280w, https://linuxundich.de/wp-content/uploads/2026/08/apostrophe-webdav-bild-1536x864.webp 1536w, https://linuxundich.de/wp-content/uploads/2026/08/apostrophe-webdav-bild-2048x1152.webp 2048w" width="1280" 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/2026/08/apostrophe-webdav-bild-1280x720.webp" alt="Two windows are open on a computer screen. On the left is a text editor with a file showing structured text with headings and paragraphs. On the right is a document viewer with a longer body of text that also contains paragraphs and a heading. In the background a desktop with a gradient of dark and purple tones is visible. At the top, the interface shows a menu bar with icons and the time." style="width:100%"/><button
			class="lightbox-trigger"
			type="button"
			aria-haspopup="dialog"
			data-wp-bind--aria-label="state.thisImage.triggerButtonAriaLabel"
			data-wp-init="callbacks.initTriggerButton"
			data-wp-on--click="actions.showLightbox"
			data-wp-style--right="state.thisImage.buttonRight"
			data-wp-style--top="state.thisImage.buttonTop"
		>
			<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="none" viewBox="0 0 12 12">
				<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" />
			</svg>
		</button></figure>



<p class="wp-block-paragraph">A classic kernel mount via CIFS or davfs2, as described in the rest of this article, shows up as a perfectly normal, stable POSIX path in the file system, with no special treatment and the same for every program. So the extra effort with fstab and dispatcher scripts pays off precisely when you want to use shares reliably not just in the file manager but in all kinds of apps.</p>



<h3 class="wp-block-heading">Problem 1: The computer doesn&#8217;t shut down cleanly anymore</h3>



<p class="wp-block-paragraph">If the fstab lacks the option _netdev, systemd doesn&#8217;t know that this is a network share. On shutdown, systemd may then try to unmount <em>after</em> the network is already gone. The umount blocks until the job timeout kicks in, and your system hangs on shutdown.</p>



<p class="wp-block-paragraph"><a href="https://wiki.archlinux.org/title/Fstab#Remote_filesystem">_netdev</a> fixes that, because systemd then knows the right order: unmount first, then cut the network. It is also important that a dispatcher script reacts not just to down but to pre-down. That status fires before the connection actually drops, while down comes afterward and is too late for a clean unmount. For this to work, you additionally need a symlink in the subfolder <code>pre-down.d/</code>.</p>



<h3 class="wp-block-heading">Problem 2: The file manager freezes after waking up</h3>



<p class="wp-block-paragraph">A mount call for CIFS or WebDAV runs in the kernel and can block for quite a while if the server is unreachable, especially right after waking up, when DNS or routing aren&#8217;t fully back yet. By default, NetworkManager waits synchronously until such a dispatcher script has finished before it carries on. If the mount call hangs, suddenly your file manager or the network indicator hangs too, because they depend on the connection state.</p>



<p class="wp-block-paragraph">The fix: just run the mount attempts in the background, so the dispatcher script itself returns immediately, no matter how long the actual mount takes.</p>



<pre class="wp-block-code"><code>run_async() {
    ( &quot;$@&quot; ) &amp;&gt;/dev/null &amp;
    disown
}</code></pre>



<h3 class="wp-block-heading">Problem 3: Suspend suddenly stops working</h3>



<p class="wp-block-paragraph">And this is where it gets interesting. With the fix from problem 2 you stumble into a new and much nastier problem, which in my case looked like this: the screen turns off, but the keyboard backlight and LEDs stay on, and you have to force a hard power-off. What happened?</p>



<p class="wp-block-paragraph">The mount syscall for CIFS or davfs blocks with an unreachable server in the so-called <a href="https://eklitzke.org/uninterruptible-sleep">D state (uninterruptible sleep)</a>, a state that no signal can interrupt, not even SIGKILL. Before the kernel actually goes to sleep, it tries to freeze all processes. A process in D state can&#8217;t be frozen, so the whole suspend hangs until the network operation in the kernel gives up on its own, which can easily take a few minutes.</p>



<p class="wp-block-paragraph">Because the mount attempts from problem 2 now keep running in the background for longer, the chance also goes up that such a blocking connection attempt is active at exactly the moment you want to suspend.</p>



<p class="wp-block-paragraph">The reliable way out: before every mount, first check with a real userspace connection test whether the server is reachable at all. That kind of test can actually be aborted with a timeout, for example via Bash&#8217;s built-in /dev/tcp:</p>



<pre class="wp-block-code"><code>tcp_reachable() {
    local HOST=&quot;$1&quot;
    local PORT=&quot;$2&quot;
    local TIMEOUT_SECONDS=&quot;${3:-2}&quot;
    timeout &quot;${TIMEOUT_SECONDS}s&quot; bash -c &quot;echo &gt;/dev/tcp/${HOST}/${PORT}&quot; &amp;&gt;/dev/null
}</code></pre>



<p class="wp-block-paragraph">Only if the test succeeds does the actual mount follow. That way you almost never end up in the risky, blocking kernel connect, because by then you already know the server is there.</p>



<h3 class="wp-block-heading">The combination that works for me</h3>



<p class="wp-block-paragraph">In the end, a robust setup needs four ingredients:</p>



<ul class="wp-block-list">

<li><strong>_netdev</strong> in the fstab, so systemd classifies network shares correctly on shutdown.</li>


<li><strong>pre-down handling</strong> plus a symlink in pre-down.d/, so the unmount is guaranteed to happen before the connection is torn down, with a timeout and lazy unmount as a backup in case the normal umount acts up.</li>


<li><strong>Asynchronous mounts</strong> on up, so NetworkManager and everything that depends on it doesn&#8217;t block.</li>


<li><strong>A reachability test</strong> before every mount, so the actual, potentially blocking kernel connect never happens in the first place.</li>

</ul>



<p class="wp-block-paragraph">On top of that, a small health check via a systemd timer that looks a few minutes after boot and regularly afterward to see whether the shares are really there, and nudges things along if needed. Handy in case the triggering network event comes too early or too late.</p>



<h3 class="wp-block-heading">All files at a glance</h3>



<figure data-wp-context="{&quot;imageId&quot;:&quot;6ae05893c12d3&quot;}" data-wp-interactive="core/image" data-wp-key="6ae05893c12d3" class="wp-block-image wp-lightbox-container"><img loading="lazy" decoding="async" height="884" sizes="auto, (max-width: 781px) 100vw, 680px" srcset="https://linuxundich.de/wp-content/uploads/2026/08/nm-dispatcher-helper-640x454.webp 640w, https://linuxundich.de/wp-content/uploads/2026/08/nm-dispatcher-helper-768x545.webp 768w, https://linuxundich.de/wp-content/uploads/2026/08/nm-dispatcher-helper.webp 1246w" width="1246" 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/2026/08/nm-dispatcher-helper.webp" alt="A computer screen shows a terminal window with a black background and white text. At the top is a tree structure of the directories and files under '/etc/NetworkManager/dispatcher.d'. The structure contains several subdirectories and shell scripts. On the left, timestamps and commands are visible, on the right the respective outputs. The window is framed by a gray menu bar." style="width:100%"/><button
			class="lightbox-trigger"
			type="button"
			aria-haspopup="dialog"
			data-wp-bind--aria-label="state.thisImage.triggerButtonAriaLabel"
			data-wp-init="callbacks.initTriggerButton"
			data-wp-on--click="actions.showLightbox"
			data-wp-style--right="state.thisImage.buttonRight"
			data-wp-style--top="state.thisImage.buttonTop"
		>
			<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="none" viewBox="0 0 12 12">
				<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" />
			</svg>
		</button><figcaption class="wp-element-caption">This is what it looks like on my machine: the NetworkManager dispatcher mounts shares automatically as soon as it finds the right server on the network or connects via Wi-Fi to a specific SSID.</figcaption></figure>



<p class="wp-block-paragraph">So you can rebuild all of this right away, here is the complete set of files. I replaced the example names from my own setup (a Samba server called bender, WebDAV via tuxedo) with generic placeholders. You&#8217;ll of course have to adapt them to your own environment.</p>



<p class="wp-block-paragraph"><strong>/etc/fstab</strong>: the two shares, one Samba, one WebDAV:</p>



<pre class="wp-block-code"><code>//server/home /mnt/server/home cifs credentials=/etc/samba/server.credentials,rw,uid=1000,gid=100,noauto,_netdev,x-systemd.mount-timeout=15s,soft 0 0
//server/data /mnt/server/data cifs credentials=/etc/samba/server.credentials,rw,uid=1000,gid=100,noauto,_netdev,x-systemd.mount-timeout=15s,soft 0 0
https://cloud.example.com/remote.php/dav/files/user /mnt/webdav davfs noauto,_netdev,uid=1000,gid=100,x-systemd.automount,x-systemd.idle-timeout=300,x-systemd.mount-timeout=15s 0 0</code></pre>



<p class="wp-block-paragraph">The fstab only references the credentials; they are stored in separate files, if only so the password doesn&#8217;t sit in plain text in a file that everyone can read.</p>



<p class="wp-block-paragraph"><strong>/etc/samba/server.credentials</strong>: credentials for the Samba share:</p>



<pre class="wp-block-code"><code>username=maxmuster
password=GeheimesPasswort123</code></pre>



<p class="wp-block-paragraph"><strong>/etc/davfs2/secrets</strong>: credentials for the WebDAV share. Here the mount point is referenced instead of an option in the fstab:</p>



<pre class="wp-block-code"><code>/mnt/webdav maxmuster GeheimesPasswort123</code></pre>



<p class="wp-block-paragraph">Both files belong to root and must not be readable by anyone else:</p>



<pre class="wp-block-code"><code>$ sudo chmod 600 /etc/samba/server.credentials /etc/davfs2/secrets
$ sudo chown root:root /etc/samba/server.credentials /etc/davfs2/secrets</code></pre>



<p class="wp-block-paragraph"><strong>/etc/NetworkManager/dispatcher.d/lib/mount-helpers.sh</strong>: the shared library that all the other scripts source:</p>



<pre class="wp-block-code"><code>#!/bin/bash
log() {
    &amp;#91;&amp;#91; &quot;$DEBUG&quot; == &quot;1&quot; ]] &amp;&amp; logger -t &quot;$LOG_TAG&quot; -- &quot;$1&quot;
}

run_async() {
    ( &quot;$@&quot; ) &amp;&gt;/dev/null &amp;
    disown
}

tcp_reachable() {
    local HOST=&quot;$1&quot;
    local PORT=&quot;$2&quot;
    local TIMEOUT_SECONDS=&quot;${3:-2}&quot;
    timeout &quot;${TIMEOUT_SECONDS}s&quot; bash -c &quot;echo &gt;/dev/tcp/${HOST}/${PORT}&quot; &amp;&gt;/dev/null
}

mount_with_retry() {
    local MOUNT=&quot;$1&quot;
    local MAX_ATTEMPTS=&quot;${2:-3}&quot;
    local SLEEP_SECONDS=&quot;${3:-2}&quot;
    local MOUNT_TIMEOUT=&quot;${4:-10}&quot;

    if mountpoint -q &quot;$MOUNT&quot;; then
        log &quot;$MOUNT ist bereits eingehängt&quot;
        return 0
    fi

    log &quot;Hänge $MOUNT ein&quot;

    local OUT ATTEMPT
    for ((ATTEMPT = 1; ATTEMPT &lt;= MAX_ATTEMPTS; ATTEMPT++)); do
        if OUT=$(timeout &quot;${MOUNT_TIMEOUT}s&quot; mount &quot;$MOUNT&quot; 2&gt;&amp;1); then
            log &quot;$MOUNT erfolgreich eingehängt&quot;
            return 0
        fi
        log &quot;Versuch $ATTEMPT/$MAX_ATTEMPTS für $MOUNT fehlgeschlagen (evtl. Timeout nach ${MOUNT_TIMEOUT}s): $OUT&quot;
        &amp;#91;&amp;#91; &quot;$ATTEMPT&quot; -lt &quot;$MAX_ATTEMPTS&quot; ]] &amp;&amp; sleep &quot;$SLEEP_SECONDS&quot;
    done

    log &quot;Alle Versuche für $MOUNT fehlgeschlagen&quot;
    return 1
}

umount_with_fallback() {
    local MOUNT=&quot;$1&quot;
    local TIMEOUT_SECONDS=&quot;${2:-5}&quot;

    if ! mountpoint -q &quot;$MOUNT&quot;; then
        log &quot;$MOUNT ist nicht eingehängt&quot;
        return 0
    fi

    log &quot;Hänge $MOUNT aus&quot;

    if timeout &quot;${TIMEOUT_SECONDS}s&quot; umount &quot;$MOUNT&quot;; then
        log &quot;$MOUNT erfolgreich ausgehängt&quot;
        return 0
    fi

    log &quot;Normaler Unmount von $MOUNT fehlgeschlagen, versuche Lazy Unmount&quot;
    if umount -l &quot;$MOUNT&quot;; then
        log &quot;$MOUNT per Lazy Unmount ausgehängt&quot;
        return 0
    fi

    log &quot;$MOUNT konnte nicht ausgehängt werden&quot;
    return 1
}</code></pre>



<p class="wp-block-paragraph"><strong>/etc/NetworkManager/dispatcher.d/90-server-mount</strong>: Samba share, bound to a specific Wi-Fi SSID or to the wired network:</p>



<pre class="wp-block-code"><code>#!/bin/bash

DEBUG=1
LOG_TAG=&quot;server-mount&quot;

LIB=&quot;/etc/NetworkManager/dispatcher.d/lib/mount-helpers.sh&quot;
if &amp;#91;&amp;#91; -r &quot;$LIB&quot; ]]; then
    source &quot;$LIB&quot;
else
    logger -t &quot;$LOG_TAG&quot; -- &quot;Bibliothek $LIB nicht gefunden, breche ab&quot;
    exit 1
fi

IFACE=&quot;$1&quot;
STATUS=&quot;$2&quot;

MOUNTS=(
    &quot;/mnt/server/home&quot;
    &quot;/mnt/server/data&quot;
)

mount_server() {
    if ! tcp_reachable server 445 2; then
        log &quot;server auf Port 445 nicht erreichbar, überspringe Mount-Versuch&quot;
        return 1
    fi

    for MOUNT in &quot;${MOUNTS&amp;#91;@]}&quot;; do
        mount_with_retry &quot;$MOUNT&quot; 3 2 10
    done
}

umount_server() {
    for MOUNT in &quot;${MOUNTS&amp;#91;@]}&quot;; do
        umount_with_fallback &quot;$MOUNT&quot; 5
    done
}

log &quot;Dispatcher gestartet: Interface=$IFACE, Status=$STATUS&quot;

case &quot;$STATUS&quot; in
    up)
        if &amp;#91;&amp;#91; &quot;$IFACE&quot; == wl* ]]; then
            SSID=$(nmcli -t -f active,ssid dev wifi |
                awk -F: '$1 == &quot;yes&quot; {print $2; exit}')

            log &quot;Aktive WLAN-SSID: $SSID&quot;

            if &amp;#91;&amp;#91; &quot;$SSID&quot; == &quot;MeinHeimnetz&quot; ]]; then
                run_async mount_server
            fi

        elif &amp;#91;&amp;#91; &quot;$IFACE&quot; == enp* || &quot;$IFACE&quot; == eth* ]]; then
            run_async mount_server
        fi
        ;;

    pre-down|vpn-pre-down)
        log &quot;Netzwerkverbindung wird beendet – Mounts aushängen&quot;
        umount_server
        ;;
esac

log &quot;Dispatcher beendet&quot;
exit 0</code></pre>



<p class="wp-block-paragraph"><strong>/etc/NetworkManager/dispatcher.d/90-webdav-mount</strong>: WebDAV share, which simply requires a reachable cloud server:</p>



<pre class="wp-block-code"><code>#!/bin/bash

DEBUG=1
LOG_TAG=&quot;webdav-mount&quot;

LIB=&quot;/etc/NetworkManager/dispatcher.d/lib/mount-helpers.sh&quot;
if &amp;#91;&amp;#91; -r &quot;$LIB&quot; ]]; then
    source &quot;$LIB&quot;
else
    logger -t &quot;$LOG_TAG&quot; -- &quot;Bibliothek $LIB nicht gefunden, breche ab&quot;
    exit 1
fi

IFACE=&quot;$1&quot;
STATUS=&quot;$2&quot;

MOUNTPOINT=&quot;/mnt/webdav&quot;
HOST=&quot;cloud.example.com&quot;

mount_webdav() {
    if ! tcp_reachable &quot;$HOST&quot; 443 3; then
        log &quot;$HOST auf Port 443 nicht erreichbar, überspringe Mount-Versuch&quot;
        return 1
    fi

    mount_with_retry &quot;$MOUNTPOINT&quot; 3 2 10
}

log &quot;Dispatcher gestartet: Interface=$IFACE, Status=$STATUS&quot;

case &quot;$STATUS&quot; in
    up)
        run_async mount_webdav
        ;;

    pre-down|vpn-pre-down)
        log &quot;Netzwerkverbindung wird beendet – Mount aushängen&quot;
        umount_with_fallback &quot;$MOUNTPOINT&quot; 5
        ;;
esac

log &quot;Dispatcher beendet&quot;
exit 0</code></pre>



<p class="wp-block-paragraph">For both scripts you also need the matching symlinks, so that pre-down is guaranteed to fire before the connection is torn down:</p>



<pre class="wp-block-code"><code>$ sudo ln -s /etc/NetworkManager/dispatcher.d/90-server-mount 
             /etc/NetworkManager/dispatcher.d/pre-down.d/90-server-mount
$ sudo ln -s /etc/NetworkManager/dispatcher.d/90-webdav-mount 
             /etc/NetworkManager/dispatcher.d/pre-down.d/90-webdav-mount</code></pre>



<p class="wp-block-paragraph"><strong>/usr/local/bin/mount-healthcheck.sh</strong>: the safety net that checks regularly:</p>



<pre class="wp-block-code"><code>#!/bin/bash
DEBUG=1
LOG_TAG=&quot;mount-healthcheck&quot;

LIB=&quot;/etc/NetworkManager/dispatcher.d/lib/mount-helpers.sh&quot;
if &amp;#91;&amp;#91; -r &quot;$LIB&quot; ]]; then
    source &quot;$LIB&quot;
else
    logger -t &quot;$LOG_TAG&quot; -- &quot;Bibliothek $LIB nicht gefunden, breche ab&quot;
    exit 1
fi

log &quot;Healthcheck gestartet&quot;

SSID=$(nmcli -t -f active,ssid dev wifi 2&gt;/dev/null |
    awk -F: '$1 == &quot;yes&quot; {print $2; exit}')

if &amp;#91;&amp;#91; &quot;$SSID&quot; == &quot;MeinHeimnetz&quot; ]] || ping -c 1 -W 1 server &gt;/dev/null 2&gt;&amp;1; then
    mount_with_retry &quot;/mnt/server/home&quot; 2 3
    mount_with_retry &quot;/mnt/server/data&quot; 2 3
else
    log &quot;server im aktuellen Netz nicht erreichbar, überspringe&quot;
fi

mount_with_retry &quot;/mnt/webdav&quot; 2 3

log &quot;Healthcheck beendet&quot;
exit 0</code></pre>



<p class="wp-block-paragraph"><strong>/etc/systemd/system/mount-healthcheck.service</strong> and <strong>mount-healthcheck.timer</strong>: systemd units that trigger the health check script 60 seconds after boot and every 10 minutes after that:</p>



<pre class="wp-block-code"><code>&amp;#91;Unit]
Description=Prueft und stellt Netzwerk-Mounts sicher
After=network-online.target
Wants=network-online.target

&amp;#91;Service]
Type=oneshot
TimeoutStartSec=120
ExecStart=/usr/local/bin/mount-healthcheck.sh</code></pre>



<pre class="wp-block-code"><code>&amp;#91;Unit]
Description=Fuehrt den Mount-Healthcheck 60s nach Boot und danach alle 10 Minuten aus

&amp;#91;Timer]
OnBootSec=60s
OnUnitActiveSec=10min
AccuracySec=30s

&amp;#91;Install]
WantedBy=timers.target</code></pre>



<p class="wp-block-paragraph">Don&#8217;t forget to enable it:</p>



<pre class="wp-block-code"><code>$ sudo systemctl daemon-reload
$ sudo systemctl enable --now mount-healthcheck.timer</code></pre>



<p class="wp-block-paragraph"><strong>/usr/lib/systemd/system-sleep/90-cancel-network-mounts</strong>: an optional safety net before suspend:</p>



<pre class="wp-block-code"><code>#!/bin/bash
case &quot;$1/$2&quot; in
    pre/*)
        logger -t sleep-mount-guard &quot;Breche evtl. laufende Netzwerk-Mount-Versuche vor Suspend ab&quot;
        pkill -9 -f 'mount.cifs' 2&gt;/dev/null
        pkill -9 -f 'mount.davfs' 2&gt;/dev/null
        ;;
esac

exit 0</code></pre>



<p class="wp-block-paragraph">All scripts have to be executable:</p>



<pre class="wp-block-code"><code>$ sudo chmod +x /etc/NetworkManager/dispatcher.d/lib/mount-helpers.sh 
              /etc/NetworkManager/dispatcher.d/90-server-mount 
              /etc/NetworkManager/dispatcher.d/90-webdav-mount 
              /usr/local/bin/mount-healthcheck.sh 
              /usr/lib/systemd/system-sleep/90-cancel-network-mounts</code></pre>



<h3 class="wp-block-heading">Long story short</h3>



<p class="wp-block-paragraph">Automatically mounting network shares via NetworkManager works well, but it is not a five-minute job, as the docs might make you think. If you just put the mount command into an up script, sooner or later one of the three problems will catch up with you, usually exactly when you&#8217;re on the road and have no log at hand.</p>



<p class="wp-block-paragraph">With _netdev, correct pre-down timing, asynchronous execution and a real reachability test before every mount, you&#8217;re on the safe side. And the pattern carries over one to one to other network-dependent automations, such as VPN connections or backup jobs that should only run on the right network.</p>
<hr><p>☕ <strong>Support Linux und Ich</strong><br>Thanks for reading <a href="https://linuxundich.de/en/">Linux und Ich</a>. If you enjoy the blog and would like to support my work, you will find more information on the <a href="https://linuxundich.de/en/support/">donation page</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://linuxundich.de/en/mounting-network-shares-automatically-what-can-go-wrong-with-the-networkmanager-dispatcher/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Spotify on GNOME: How to Fix the Blue Window Border</title>
		<link>https://linuxundich.de/en/spotify-on-gnome-how-to-fix-the-blue-window-border/</link>
					<comments>https://linuxundich.de/en/spotify-on-gnome-how-to-fix-the-blue-window-border/#respond</comments>
		
		<dc:creator><![CDATA[Christoph Langner]]></dc:creator>
		<pubDate>Fri, 28 Nov 2025 14:01:59 +0000</pubDate>
				<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[Arch Linux]]></category>
		<category><![CDATA[GNOME]]></category>
		<category><![CDATA[Spotify]]></category>
		<category><![CDATA[Tips]]></category>
		<guid isPermaLink="false">https://linuxundich.de/en/?p=58</guid>

					<description><![CDATA[A blue frame around Spotify on GNOME ruins the look, even though everything still works as it should. On Arch Linux, the fix is easy: either go through Flatpak or use a launch flag for the client from the AUR.]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">If you use Spotify on Linux with <a href="https://linuxundich.de/tag/gnome/" data-type="post_tag" data-id="1734">GNOME</a>, you may have noticed an ugly blue border around the app window over the last few days. I&#8217;m seeing the problem here on my machine under <a href="https://linuxundich.de/tag/arch/" data-type="post_tag" data-id="1762">Arch Linux</a>, but it should affect all distributions.</p>



<p class="wp-block-paragraph">The culprit is an update to the official Electron-based Linux client that messed up the GTK-style window decoration. <a href="https://linuxundich.de/tag/spotify/" data-type="post_tag" data-id="1480">Spotify</a> itself works just as before, but visually it looks anything but nice.</p>



<figure data-wp-context="{&quot;imageId&quot;:&quot;6ae05893cbab0&quot;}" data-wp-interactive="core/image" data-wp-key="6ae05893cbab0" class="wp-block-image wp-lightbox-container"><img loading="lazy" decoding="async" height="780" sizes="auto, (max-width: 781px) 100vw, 680px" srcset="https://linuxundich.de/wp-content/uploads/2025/11/spotify-aur-blue-640x390.webp 640w, https://linuxundich.de/wp-content/uploads/2025/11/spotify-aur-blue-768x468.webp 768w, https://linuxundich.de/wp-content/uploads/2025/11/spotify-aur-blue-1280x780.webp 1280w, https://linuxundich.de/wp-content/uploads/2025/11/spotify-aur-blue.webp 1491w" width="1280" 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/2025/11/spotify-aur-blue-1280x780.webp" alt="Spotify with a blue border. An update to the Linux client broke the GTK-style window decoration, so the window is framed in an ugly blue and isn't displayed correctly." style="width:100%"/><button
			class="lightbox-trigger"
			type="button"
			aria-haspopup="dialog"
			data-wp-bind--aria-label="state.thisImage.triggerButtonAriaLabel"
			data-wp-init="callbacks.initTriggerButton"
			data-wp-on--click="actions.showLightbox"
			data-wp-style--right="state.thisImage.buttonRight"
			data-wp-style--top="state.thisImage.buttonTop"
		>
			<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="none" viewBox="0 0 12 12">
				<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" />
			</svg>
		</button><figcaption class="wp-element-caption">Spotify with a blue border. An update to the Linux client broke the GTK-style window decoration, so the window is framed in an ugly blue and isn&#8217;t displayed correctly.</figcaption></figure>



<h2 class="wp-block-heading">Solutions for Spotify</h2>



<p class="wp-block-paragraph">There are two easy ways to fix the problem. The most convenient one is to install Spotify as a <a href="https://flathub.org/en/apps/com.spotify.Client">Flatpak</a>. The Flatpak version doesn&#8217;t show the blue frame, and you don&#8217;t have to worry about anything. No configuration changes are needed.</p>



<figure data-wp-context="{&quot;imageId&quot;:&quot;6ae05893cc104&quot;}" data-wp-interactive="core/image" data-wp-key="6ae05893cc104" class="wp-block-image wp-lightbox-container"><img loading="lazy" decoding="async" height="780" sizes="auto, (max-width: 781px) 100vw, 680px" srcset="https://linuxundich.de/wp-content/uploads/2025/11/spotify-flatpak-640x390.webp 640w, https://linuxundich.de/wp-content/uploads/2025/11/spotify-flatpak-768x468.webp 768w, https://linuxundich.de/wp-content/uploads/2025/11/spotify-flatpak-1280x780.webp 1280w, https://linuxundich.de/wp-content/uploads/2025/11/spotify-flatpak.webp 1491w" width="1280" 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/2025/11/spotify-flatpak-1280x780.webp" alt="The Flatpak version of Spotify doesn't show the blue frame. The GTK-style window decoration is rendered correctly, and after installation the window looks normal and error-free." style="width:100%"/><button
			class="lightbox-trigger"
			type="button"
			aria-haspopup="dialog"
			data-wp-bind--aria-label="state.thisImage.triggerButtonAriaLabel"
			data-wp-init="callbacks.initTriggerButton"
			data-wp-on--click="actions.showLightbox"
			data-wp-style--right="state.thisImage.buttonRight"
			data-wp-style--top="state.thisImage.buttonTop"
		>
			<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="none" viewBox="0 0 12 12">
				<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" />
			</svg>
		</button><figcaption class="wp-element-caption">The Flatpak version of Spotify doesn&#8217;t show the blue frame. The GTK-style window decoration is rendered correctly, and after installation the window looks normal and error-free.</figcaption></figure>



<p class="wp-block-paragraph">If you installed Spotify via the <a href="https://github.com/kpcyrd/spotify-launcher">Spotify Launcher</a> (the <em>spotify-launcher</em> package from Arch&#8217;s extra repository) or directly from the <a href="https://aur.archlinux.org/packages/spotify">AUR</a> (the <em>spotify</em> entry), you need to set the launch flag <code>--ozone-platform=x11</code> instead. That makes the GTK decoration show up correctly. Depending on how you installed it, add the flag like this:</p>



<p class="wp-block-paragraph"><strong>For AUR Spotify</strong> in the file <code>~/.config/spotify-flags.conf</code>:</p>



<pre class="wp-block-code"><code>--ozone-platform=x11</code></pre>



<p class="wp-block-paragraph"><strong>For Spotify Launcher</strong> in <code>~/.config/spotify-launcher.conf</code>:</p>



<pre class="wp-block-code"><code>&amp;#91;spotify]
extra_arguments = &amp;#91;&quot;--ozone-platform=x11&quot;]</code></pre>



<p class="wp-block-paragraph">You may have to create these files first. After restarting Spotify, the blue frame should be gone and everything should look normal again.</p>



<figure data-wp-context="{&quot;imageId&quot;:&quot;6ae05893cca4e&quot;}" data-wp-interactive="core/image" data-wp-key="6ae05893cca4e" class="wp-block-image wp-lightbox-container"><img loading="lazy" decoding="async" height="853" sizes="auto, (max-width: 781px) 100vw, 680px" srcset="https://linuxundich.de/wp-content/uploads/2025/11/spotify-ozone-platform-640x473.webp 640w, https://linuxundich.de/wp-content/uploads/2025/11/spotify-ozone-platform-768x568.webp 768w, https://linuxundich.de/wp-content/uploads/2025/11/spotify-ozone-platform.webp 1153w" width="1153" 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/2025/11/spotify-ozone-platform.webp" alt="The configuration files under ~/.config. You may have to create them first. You only need the file that matches your installation method, not both at the same time." style="width:100%"/><button
			class="lightbox-trigger"
			type="button"
			aria-haspopup="dialog"
			data-wp-bind--aria-label="state.thisImage.triggerButtonAriaLabel"
			data-wp-init="callbacks.initTriggerButton"
			data-wp-on--click="actions.showLightbox"
			data-wp-style--right="state.thisImage.buttonRight"
			data-wp-style--top="state.thisImage.buttonTop"
		>
			<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="none" viewBox="0 0 12 12">
				<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" />
			</svg>
		</button><figcaption class="wp-element-caption">The configuration files under ~/.config. You may have to create them first. You only need the file that matches your installation method, not both at the same time.</figcaption></figure>



<figure data-wp-context="{&quot;imageId&quot;:&quot;6ae05893ccf9e&quot;}" data-wp-interactive="core/image" data-wp-key="6ae05893ccf9e" class="wp-block-image wp-lightbox-container"><img loading="lazy" decoding="async" height="780" sizes="auto, (max-width: 781px) 100vw, 680px" srcset="https://linuxundich.de/wp-content/uploads/2025/11/spotify-flatpak-flags-640x390.webp 640w, https://linuxundich.de/wp-content/uploads/2025/11/spotify-flatpak-flags-768x468.webp 768w, https://linuxundich.de/wp-content/uploads/2025/11/spotify-flatpak-flags-1280x780.webp 1280w, https://linuxundich.de/wp-content/uploads/2025/11/spotify-flatpak-flags.webp 1491w" width="1280" 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/2025/11/spotify-flatpak-flags-1280x780.webp" alt="Alternatively, you can set the flag --ozone-platform=x11 if you installed Spotify from the AUR. The window frame is then displayed correctly and normally again." style="width:100%"/><button
			class="lightbox-trigger"
			type="button"
			aria-haspopup="dialog"
			data-wp-bind--aria-label="state.thisImage.triggerButtonAriaLabel"
			data-wp-init="callbacks.initTriggerButton"
			data-wp-on--click="actions.showLightbox"
			data-wp-style--right="state.thisImage.buttonRight"
			data-wp-style--top="state.thisImage.buttonTop"
		>
			<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="none" viewBox="0 0 12 12">
				<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" />
			</svg>
		</button><figcaption class="wp-element-caption">Alternatively, you can set the flag &#8211;ozone-platform=x11 if you installed Spotify from the AUR. The window frame is then displayed correctly and normally again.</figcaption></figure>



<p class="has-pale-cyan-blue-background-color has-background wp-block-paragraph"><strong>Correction from <a href="https://social.anoxinon.de/@fabiscafe@mstdn.social/115627842495268735">Fabian on Mastodon</a>:</strong> That&#8217;s not quite right. This is solely down to Spotify running natively on Wayland, where under GNOME it needs a client-side decoration (CSD), which it provides through that blue one. Forcing it back to X11 might cause real problems, like blurry fonts, bad (or no) scaling and so on. Also, Spotify isn&#8217;t Electron, it&#8217;s the Chromium Embedded Framework (CEF).</p>



<p class="wp-block-paragraph">Sure, it&#8217;s a crutch, but one that helps right now. And you can undo the change quickly, too. The other options would be to run GNOME under X11 or to make friends with the blue frames. To me, neither is exactly ideal. So for now this is a workaround, and of course you shouldn&#8217;t forget about it in case Spotify starts acting up again at some point.</p>
<hr><p>☕ <strong>Support Linux und Ich</strong><br>Thanks for reading <a href="https://linuxundich.de/en/">Linux und Ich</a>. If you enjoy the blog and would like to support my work, you will find more information on the <a href="https://linuxundich.de/en/support/">donation page</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://linuxundich.de/en/spotify-on-gnome-how-to-fix-the-blue-window-border/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Creating a Magnifier Effect for Screenshots with GIMP</title>
		<link>https://linuxundich.de/en/creating-a-magnifier-effect-for-screenshots-with-gimp/</link>
					<comments>https://linuxundich.de/en/creating-a-magnifier-effect-for-screenshots-with-gimp/#respond</comments>
		
		<dc:creator><![CDATA[Christoph Langner]]></dc:creator>
		<pubDate>Mon, 28 Apr 2025 07:17:12 +0000</pubDate>
				<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[GIMP]]></category>
		<category><![CDATA[Image Editing]]></category>
		<category><![CDATA[Screenshots]]></category>
		<category><![CDATA[Tips]]></category>
		<guid isPermaLink="false">https://linuxundich.de/en/?p=70</guid>

					<description><![CDATA[With GIMP, you can apply a magnifier effect to screenshots to highlight important details. This guide shows step by step how to create the effect quickly and easily.]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">When I write articles regularly or share content on platforms, taking screenshots is an essential part of my work. Desktop environments like KDE and GNOME already ship with good screenshot tools. KDE has the very solid <em>Spectacle</em>, for example, and GNOME offers a basic solution with its screenshot tool. Still, I often miss features for editing a shot afterward. Especially when I want to add notes, arrows or highlights, I can&#8217;t avoid reaching for additional tools or an image editor like <a href="https://linuxundich.de/tag/gimp/" data-type="post_tag" data-id="181">GIMP</a>.</p>



<p class="wp-block-paragraph">I used to use <a href="https://linuxundich.de/tag/shutter/" data-type="post_tag" data-id="599">Shutter</a> for this. Unfortunately, it has since lost its Wayland support and hasn&#8217;t seen any development for quite some time. As my current alternative, I use <a href="https://github.com/ksnip/ksnip">KSnip</a> to add notes and markings, even if that means pulling a pile of Qt libraries onto my system. What I&#8217;m still missing, though, is a magnifier effect that lets me enlarge small details in my screenshots and call them out.</p>



<figure data-wp-context="{&quot;imageId&quot;:&quot;6ae05893d4723&quot;}" data-wp-interactive="core/image" data-wp-key="6ae05893d4723" class="wp-block-image wp-lightbox-container"><img loading="lazy" decoding="async" height="894" sizes="auto, (max-width: 781px) 100vw, 680px" srcset="https://linuxundich.de/wp-content/uploads/2025/04/ksnip-screenhots-640x456.webp 640w, https://linuxundich.de/wp-content/uploads/2025/04/ksnip-screenhots-768x547.webp 768w, https://linuxundich.de/wp-content/uploads/2025/04/ksnip-screenhots.webp 1255w" width="1255" 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/2025/04/ksnip-screenhots.webp" alt="KSnip makes it quick to add notes and markings to screenshots. A magnifier effect to highlight details, however, is not available." style="width:100%"/><button
			class="lightbox-trigger"
			type="button"
			aria-haspopup="dialog"
			data-wp-bind--aria-label="state.thisImage.triggerButtonAriaLabel"
			data-wp-init="callbacks.initTriggerButton"
			data-wp-on--click="actions.showLightbox"
			data-wp-style--right="state.thisImage.buttonRight"
			data-wp-style--top="state.thisImage.buttonTop"
		>
			<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="none" viewBox="0 0 12 12">
				<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" />
			</svg>
		</button><figcaption class="wp-element-caption">KSnip makes it quick to add notes and markings to screenshots. A magnifier effect to highlight details, however, is not available.</figcaption></figure>



<p class="wp-block-paragraph">You can do this effect quickly and easily in GIMP, though, even if there is no dedicated filter for it. In this guide, I&#8217;ll show you how to create a magnifier effect on your screenshots in just a few minutes.</p>



<h3 class="wp-block-heading" id="schritt-fur-schritt-anleitung-fur-den-lupeneffekt-in-gimp">Step-by-step guide to the magnifier effect in GIMP</h3>



<h4 class="wp-block-heading" id="screenshot-offnen">Open the screenshot</h4>



<p class="wp-block-paragraph">First, open your screenshot in GIMP. If you haven&#8217;t taken a screenshot yet, you can do that right in GIMP: in the menu, choose <em>File</em> » <em>Create</em> » <em>Screenshot</em>. There you can either capture the screenshot directly in the program or import an earlier one.</p>



<h4 class="wp-block-heading" id="bereich-auswahlen">Select the area</h4>



<p class="wp-block-paragraph">Now pick the <em>Rectangle Select</em> tool or the <em>Ellipse Select</em> tool from the toolbox on the left. Drag the selection around the area you want to enlarge, that is, the area you later want to highlight with the magnifier effect. To create a circular selection with the ellipse tool, hold down the Shift key while dragging with the mouse.</p>



<p class="wp-block-paragraph">Once the selection is made, press <kbd>Ctrl</kbd>+<kbd>C</kbd> on the keyboard to copy the area. Then press <kbd>Ctrl</kbd>+<kbd>V</kbd> to paste it as a new floating selection. This new selection shows up in the upper right area of GIMP as <em>Floating Selection</em>. Right-click it and choose <em>To New Layer</em> to turn the floating selection into a regular layer named <em>Transformation</em>.</p>



<figure data-wp-context="{&quot;imageId&quot;:&quot;6ae05893d51ad&quot;}" data-wp-interactive="core/image" data-wp-key="6ae05893d51ad" class="wp-block-image wp-lightbox-container"><img loading="lazy" decoding="async" height="830" sizes="auto, (max-width: 781px) 100vw, 680px" srcset="https://linuxundich.de/wp-content/uploads/2025/04/gimp-lupen-effekt_02-640x415.webp 640w, https://linuxundich.de/wp-content/uploads/2025/04/gimp-lupen-effekt_02-768x498.webp 768w, https://linuxundich.de/wp-content/uploads/2025/04/gimp-lupen-effekt_02-1280x830.webp 1280w, https://linuxundich.de/wp-content/uploads/2025/04/gimp-lupen-effekt_02-1536x996.webp 1536w, https://linuxundich.de/wp-content/uploads/2025/04/gimp-lupen-effekt_02.webp 1854w" width="1280" 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/2025/04/gimp-lupen-effekt_02-1280x830.webp" alt="Select the area for the magnifier effect and copy it to a new layer. This is the basis for the enlargement effect later on." style="width:100%"/><button
			class="lightbox-trigger"
			type="button"
			aria-haspopup="dialog"
			data-wp-bind--aria-label="state.thisImage.triggerButtonAriaLabel"
			data-wp-init="callbacks.initTriggerButton"
			data-wp-on--click="actions.showLightbox"
			data-wp-style--right="state.thisImage.buttonRight"
			data-wp-style--top="state.thisImage.buttonTop"
		>
			<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="none" viewBox="0 0 12 12">
				<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" />
			</svg>
		</button><figcaption class="wp-element-caption">Select the area for the magnifier effect and copy it to a new layer. This is the basis for the enlargement effect later on.</figcaption></figure>



<h4 class="wp-block-heading" id="vergrossern-der-auswahl">Enlarge the selection</h4>



<p class="wp-block-paragraph">Now comes the actual magnifier effect: choose the <em>Scale</em> tool from the toolbox on the left and click the new layer you just created. Enlarge it until it gives you the “magnifying glass” look you want. Make sure to lock the aspect ratio so the proportions of the selection stay intact.</p>



<figure data-wp-context="{&quot;imageId&quot;:&quot;6ae05893d575f&quot;}" data-wp-interactive="core/image" data-wp-key="6ae05893d575f" class="wp-block-image wp-lightbox-container"><img loading="lazy" decoding="async" height="830" sizes="auto, (max-width: 781px) 100vw, 680px" srcset="https://linuxundich.de/wp-content/uploads/2025/04/gimp-lupen-effekt_03-640x415.webp 640w, https://linuxundich.de/wp-content/uploads/2025/04/gimp-lupen-effekt_03-768x498.webp 768w, https://linuxundich.de/wp-content/uploads/2025/04/gimp-lupen-effekt_03-1280x830.webp 1280w, https://linuxundich.de/wp-content/uploads/2025/04/gimp-lupen-effekt_03-1536x996.webp 1536w, https://linuxundich.de/wp-content/uploads/2025/04/gimp-lupen-effekt_03.webp 1854w" width="1280" 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/2025/04/gimp-lupen-effekt_03-1280x830.webp" alt="Enlarge the selected area to get the magnifier effect you want. Make sure to keep the aspect ratio of the selection." style="width:100%"/><button
			class="lightbox-trigger"
			type="button"
			aria-haspopup="dialog"
			data-wp-bind--aria-label="state.thisImage.triggerButtonAriaLabel"
			data-wp-init="callbacks.initTriggerButton"
			data-wp-on--click="actions.showLightbox"
			data-wp-style--right="state.thisImage.buttonRight"
			data-wp-style--top="state.thisImage.buttonTop"
		>
			<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="none" viewBox="0 0 12 12">
				<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" />
			</svg>
		</button><figcaption class="wp-element-caption">Enlarge the selected area to get the magnifier effect you want. Make sure to keep the aspect ratio of the selection.</figcaption></figure>



<h4 class="wp-block-heading" id="ebene-an-bildgrosse-anpassen">Fit the layer to the image size</h4>



<p class="wp-block-paragraph">Right-click the new layer in the right panel and choose <em>Layer to Image Size</em>. This fits the layer to the overall image size without changing any of the other elements in the screenshot.</p>



<h4 class="wp-block-heading" id="auswahl-um-den-effekt-hinzufugen">Add a selection around the effect</h4>



<p class="wp-block-paragraph">Right-click the layer in the right panel again, and this time choose <em>Alpha to Selection</em>. This makes the non-transparent area of the layer selectable.</p>



<h4 class="wp-block-heading" id="kontur-hinzufugen">Add an outline</h4>



<p class="wp-block-paragraph">Now go to <em>Edit</em> » <em>Stroke Selection …</em> and adjust the properties of the outline. Here you can pick the color and the thickness of the line. The default color is taken from GIMP&#8217;s foreground color. Unfortunately, there is no preview for this function. Click <em>OK</em> to apply the outline.</p>



<figure data-wp-context="{&quot;imageId&quot;:&quot;6ae05893d6003&quot;}" data-wp-interactive="core/image" data-wp-key="6ae05893d6003" class="wp-block-image wp-lightbox-container"><img loading="lazy" decoding="async" height="830" sizes="auto, (max-width: 781px) 100vw, 680px" srcset="https://linuxundich.de/wp-content/uploads/2025/04/gimp-lupen-effekt_05-640x415.webp 640w, https://linuxundich.de/wp-content/uploads/2025/04/gimp-lupen-effekt_05-768x498.webp 768w, https://linuxundich.de/wp-content/uploads/2025/04/gimp-lupen-effekt_05-1280x830.webp 1280w, https://linuxundich.de/wp-content/uploads/2025/04/gimp-lupen-effekt_05-1536x996.webp 1536w, https://linuxundich.de/wp-content/uploads/2025/04/gimp-lupen-effekt_05.webp 1854w" width="1280" 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/2025/04/gimp-lupen-effekt_05-1280x830.webp" alt="Add an outline around the enlarged area to make it stand out better. This gives you a clear separation from the background." style="width:100%"/><button
			class="lightbox-trigger"
			type="button"
			aria-haspopup="dialog"
			data-wp-bind--aria-label="state.thisImage.triggerButtonAriaLabel"
			data-wp-init="callbacks.initTriggerButton"
			data-wp-on--click="actions.showLightbox"
			data-wp-style--right="state.thisImage.buttonRight"
			data-wp-style--top="state.thisImage.buttonTop"
		>
			<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="none" viewBox="0 0 12 12">
				<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" />
			</svg>
		</button><figcaption class="wp-element-caption">Add an outline around the enlarged area to make it stand out better. This gives you a clear separation from the background.</figcaption></figure>



<h4 class="wp-block-heading" id="hintergrund-anpassen">Adjust the background</h4>



<p class="wp-block-paragraph">Last but not least, you can apply a filter to the background to strengthen the effect further. A blur or a shadow on the new layer helps the magnifier effect come into its own. To do that, pick <em>Filters</em> and try out different options, such as <em>Blur</em> or <em>Drop Shadow</em>.</p>



<figure data-wp-context="{&quot;imageId&quot;:&quot;6ae05893d65f1&quot;}" data-wp-interactive="core/image" data-wp-key="6ae05893d65f1" class="wp-block-image wp-lightbox-container"><img loading="lazy" decoding="async" height="830" sizes="auto, (max-width: 781px) 100vw, 680px" srcset="https://linuxundich.de/wp-content/uploads/2025/04/gimp-lupen-effekt_06-640x415.webp 640w, https://linuxundich.de/wp-content/uploads/2025/04/gimp-lupen-effekt_06-768x498.webp 768w, https://linuxundich.de/wp-content/uploads/2025/04/gimp-lupen-effekt_06-1280x830.webp 1280w, https://linuxundich.de/wp-content/uploads/2025/04/gimp-lupen-effekt_06-1536x996.webp 1536w, https://linuxundich.de/wp-content/uploads/2025/04/gimp-lupen-effekt_06.webp 1854w" width="1280" 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/2025/04/gimp-lupen-effekt_06-1280x830.webp" alt="Strengthen the magnifier effect with blur or a drop shadow. These effects help the focused area stand out more." style="width:100%"/><button
			class="lightbox-trigger"
			type="button"
			aria-haspopup="dialog"
			data-wp-bind--aria-label="state.thisImage.triggerButtonAriaLabel"
			data-wp-init="callbacks.initTriggerButton"
			data-wp-on--click="actions.showLightbox"
			data-wp-style--right="state.thisImage.buttonRight"
			data-wp-style--top="state.thisImage.buttonTop"
		>
			<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="none" viewBox="0 0 12 12">
				<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" />
			</svg>
		</button><figcaption class="wp-element-caption">Strengthen the magnifier effect with blur or a drop shadow. These effects help the focused area stand out more.</figcaption></figure>



<p class="wp-block-paragraph">With these simple steps, you&#8217;ve created an effective magnifier effect in GIMP. It takes a bit of practice and fine-tuning, but after a few tries you&#8217;ll get a good feel for the tools and can work them efficiently into your screenshot editing. Especially handy: you can use the method on any part of an image, to highlight not just text but any other detail in your screenshots.</p>



<figure data-wp-context="{&quot;imageId&quot;:&quot;6ae05893d6aef&quot;}" data-wp-interactive="core/image" data-wp-key="6ae05893d6aef" class="wp-block-image wp-lightbox-container"><img loading="lazy" decoding="async" height="828" sizes="auto, (max-width: 781px) 100vw, 680px" srcset="https://linuxundich.de/wp-content/uploads/2025/04/screenshot-ohne-lupe-640x414.webp 640w, https://linuxundich.de/wp-content/uploads/2025/04/screenshot-ohne-lupe-768x497.webp 768w, https://linuxundich.de/wp-content/uploads/2025/04/screenshot-ohne-lupe-1280x828.webp 1280w, https://linuxundich.de/wp-content/uploads/2025/04/screenshot-ohne-lupe.webp 1469w" width="1280" 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/2025/04/screenshot-ohne-lupe-1280x828.webp" alt="Before: screenshot without the magnifier effect. Details and smaller areas are harder to make out without it." style="width:100%"/><button
			class="lightbox-trigger"
			type="button"
			aria-haspopup="dialog"
			data-wp-bind--aria-label="state.thisImage.triggerButtonAriaLabel"
			data-wp-init="callbacks.initTriggerButton"
			data-wp-on--click="actions.showLightbox"
			data-wp-style--right="state.thisImage.buttonRight"
			data-wp-style--top="state.thisImage.buttonTop"
		>
			<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="none" viewBox="0 0 12 12">
				<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" />
			</svg>
		</button><figcaption class="wp-element-caption">Before: screenshot without the magnifier effect. Details and smaller areas are harder to make out without it.</figcaption></figure>



<figure data-wp-context="{&quot;imageId&quot;:&quot;6ae05893d6f0a&quot;}" data-wp-interactive="core/image" data-wp-key="6ae05893d6f0a" class="wp-block-image wp-lightbox-container"><img loading="lazy" decoding="async" height="828" sizes="auto, (max-width: 781px) 100vw, 680px" srcset="https://linuxundich.de/wp-content/uploads/2025/04/screenshot-mit-lupe-640x414.webp 640w, https://linuxundich.de/wp-content/uploads/2025/04/screenshot-mit-lupe-768x497.webp 768w, https://linuxundich.de/wp-content/uploads/2025/04/screenshot-mit-lupe-1280x828.webp 1280w, https://linuxundich.de/wp-content/uploads/2025/04/screenshot-mit-lupe.webp 1469w" width="1280" 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/2025/04/screenshot-mit-lupe-1280x828.webp" alt="After: details and smaller areas are now clearly highlighted, which makes them easier to see." style="width:100%"/><button
			class="lightbox-trigger"
			type="button"
			aria-haspopup="dialog"
			data-wp-bind--aria-label="state.thisImage.triggerButtonAriaLabel"
			data-wp-init="callbacks.initTriggerButton"
			data-wp-on--click="actions.showLightbox"
			data-wp-style--right="state.thisImage.buttonRight"
			data-wp-style--top="state.thisImage.buttonTop"
		>
			<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="none" viewBox="0 0 12 12">
				<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" />
			</svg>
		</button><figcaption class="wp-element-caption">After: details and smaller areas are now clearly highlighted, which makes them easier to see.</figcaption></figure>
<hr><p>☕ <strong>Support Linux und Ich</strong><br>Thanks for reading <a href="https://linuxundich.de/en/">Linux und Ich</a>. If you enjoy the blog and would like to support my work, you will find more information on the <a href="https://linuxundich.de/en/support/">donation page</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://linuxundich.de/en/creating-a-magnifier-effect-for-screenshots-with-gimp/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>GDM login screen showing up on the wrong monitor?</title>
		<link>https://linuxundich.de/en/gdm-login-screen-showing-up-on-the-wrong-monitor/</link>
					<comments>https://linuxundich.de/en/gdm-login-screen-showing-up-on-the-wrong-monitor/#respond</comments>
		
		<dc:creator><![CDATA[Christoph Langner]]></dc:creator>
		<pubDate>Thu, 17 Apr 2025 13:49:42 +0000</pubDate>
				<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[GDM]]></category>
		<category><![CDATA[GNOME]]></category>
		<category><![CDATA[Multi-Monitor]]></category>
		<category><![CDATA[Tips]]></category>
		<guid isPermaLink="false">https://linuxundich.de/en/?p=67</guid>

					<description><![CDATA[If the GDM login screen shows up on the wrong monitor, copying the display settings from your GNOME session usually fixes it. You can do that by hand, automatically with systemd, or conveniently via GUI.]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">When I connect my laptop to an external monitor and set it as the primary display, this usually works without a hitch under GNOME. The desktop remembers the monitor selection, and the next time I boot, everything is set up the way I want it. What has bugged me for a long time, though: the login screen regularly shows up on the wrong monitor, so not where I would expect it. Even when I have defined the external screen as the main display in the display settings, GDM completely ignores that.</p>



<div><figure data-wp-context='{"imageId":"6ae058940df49"}' data-wp-interactive="core/image" data-wp-key="6ae058940df49" class="wp-block-image size-large wp-lightbox-container"><img loading="lazy" decoding="async" height="790" sizes="auto, (max-width: 781px) 100vw, 680px" srcset="https://linuxundich.de/wp-content/uploads/2025/04/gdm-beispiel-640x395.webp 640w, https://linuxundich.de/wp-content/uploads/2025/04/gdm-beispiel-768x474.webp 768w, https://linuxundich.de/wp-content/uploads/2025/04/gdm-beispiel-1280x790.webp 1280w, https://linuxundich.de/wp-content/uploads/2025/04/gdm-beispiel.webp 1368w" width="1280" 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/2025/04/gdm-beispiel-1280x790.webp" alt="GDM is functional but plain, and unfortunately not very flexible. Without configuration, the login screen likes to show up on the wrong monitor." class="wp-image-44372" style="width:100%"><button class="lightbox-trigger" type="button" aria-haspopup="dialog" data-wp-bind--aria-label="state.thisImage.triggerButtonAriaLabel" data-wp-init="callbacks.initTriggerButton" data-wp-on--click="actions.showLightbox" data-wp-style--right="state.thisImage.buttonRight" data-wp-style--top="state.thisImage.buttonTop">
			<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="none" viewbox="0 0 12 12">
				<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"></path>
			</svg>
		</button><figcaption class="wp-element-caption">GDM is functional but plain, and unfortunately not very flexible. Without configuration, the login screen likes to show up on the wrong monitor.</figcaption></figure></div>



<p class="wp-block-paragraph">It gets especially annoying when the monitor GDM uses for the login isn’t even turned on. Then the screen stays black and I’m fumbling around in the dark until I open the laptop lid or figure out which monitor is the right one. Apparently GDM uses its own configuration, which has nothing to do with the display settings of the GNOME session. In the <a href="https://wiki.archlinux.org/title/GDM#Setup_default_monitor_settings">Arch Linux wiki</a> I came across a solution that fixes this behavior reliably, and it works on other distributions as well.</p>



<h3 class="wp-block-heading">Why GDM uses the wrong monitor</h3>



<p class="wp-block-paragraph">The problem typically shows up on systems with multiple screens, especially when proprietary graphics drivers such as Nvidia’s are in use. GNOME stores the screen layout per user in a file called <code>monitors.xml</code> in the directory <code>~/.config</code>. GDM, on the other hand, uses its own configuration in the context of the <code>gdm</code> user. Since this file is not automatically synced with the one of your main user when the system is set up, the login screen can end up on the wrong screen, and stay there.</p>



<div><figure data-wp-context='{"imageId":"6ae05894105a5"}' data-wp-interactive="core/image" data-wp-key="6ae05894105a5" class="wp-block-image size-full wp-lightbox-container"><img loading="lazy" decoding="async" height="786" sizes="auto, (max-width: 781px) 100vw, 680px" srcset="https://linuxundich.de/wp-content/uploads/2025/04/meld-monitors-640x421.webp 640w, https://linuxundich.de/wp-content/uploads/2025/04/meld-monitors-768x505.webp 768w, https://linuxundich.de/wp-content/uploads/2025/04/meld-monitors.webp 1195w" width="1195" 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/2025/04/meld-monitors.webp" alt="GNOME and GDM manage the screen configuration separately. GDM uses its own monitors.xml and completely ignores user settings." class="wp-image-44375" style="width:100%"><button class="lightbox-trigger" type="button" aria-haspopup="dialog" data-wp-bind--aria-label="state.thisImage.triggerButtonAriaLabel" data-wp-init="callbacks.initTriggerButton" data-wp-on--click="actions.showLightbox" data-wp-style--right="state.thisImage.buttonRight" data-wp-style--top="state.thisImage.buttonTop">
			<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="none" viewbox="0 0 12 12">
				<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"></path>
			</svg>
		</button><figcaption class="wp-element-caption">GNOME and GDM manage the screen configuration separately. GDM uses its own monitors.xml and completely ignores user settings.</figcaption></figure></div>



<h3 class="wp-block-heading">Manual solution: copy your display settings</h3>



<p class="wp-block-paragraph">The easiest way to teach GDM the right monitor configuration is to copy the <code>monitors.xml</code> file from your home directory to the GDM configuration directory.</p>



<ol class="wp-block-list">

<li><strong>First, set up the screen configuration you want in GNOME.</strong> Open the display settings via:</li>

</ol>



<pre class="wp-block-code"><code>$ &lt;strong&gt;gnome-control-center display&lt;/strong&gt;</code></pre>



<p class="wp-block-paragraph">Pick your preferred main screen and arrange the monitors as you like. The changes are saved automatically in your home directory under <code>~/.config/monitors.xml</code>.</p>



<ol class="wp-block-list" start="2">

<li><strong>Copy the file to the GDM home directory:</strong></li>

</ol>



<pre class="wp-block-code"><code>$ &lt;strong&gt;sudo install -o root -m 644 ~/.config/monitors.xml ~gdm/.config/&lt;/strong&gt;</code></pre>



<p class="wp-block-paragraph">The system correctly interprets the home directory of the GDM user <code>~gdm</code> here.</p>



<ol class="wp-block-list" start="3">

<li><strong>Restart GDM</strong> so the new configuration is picked up. Careful: this ends your current GNOME session without warning:</li>

</ol>



<pre class="wp-block-code"><code>$ &lt;strong&gt;sudo systemctl restart gdm&lt;/strong&gt;</code></pre>



<p class="wp-block-paragraph">After the restart, the login screen should show up on the monitor you want.</p>



<h3 class="wp-block-heading">Automated solution: with a systemd service</h3>



<p class="wp-block-paragraph">If you often work with different monitor setups or simply prefer a permanent solution, you can automate copying the file at boot.</p>



<ol class="wp-block-list">

<li><strong>Create the directory for the systemd override:</strong></li>

</ol>



<pre class="wp-block-code"><code>$ &lt;strong&gt;sudo mkdir -p /etc/systemd/system/gdm.service.d&lt;/strong&gt;</code></pre>



<ol class="wp-block-list" start="2">

<li><strong>Create a new configuration file <code>override.conf</code> with the following content:</strong></li>

</ol>



<pre class="wp-block-code"><code>&amp;#91;Service]
ExecStartPre=/bin/sh -c 'install -o root -m 644 /home/EUER_NUTZER/.config/monitors.xml ~gdm/.config/monitors.xml || true'</code></pre>



<p class="wp-block-paragraph">Replace <code>EUER_NUTZER</code> with your actual user name.</p>



<ol class="wp-block-list" start="3">

<li><strong>Reload the systemd configuration:</strong></li>

</ol>



<pre class="wp-block-code"><code>$ &lt;strong&gt;sudo systemctl daemon-reexec&lt;/strong&gt;</code></pre>



<p class="wp-block-paragraph">The next time GDM starts, the file is picked up automatically.</p>



<h3 class="wp-block-heading">Even easier: with the graphical GDM Settings</h3>



<p class="wp-block-paragraph">Last but not least, there is a graphical alternative. With the app <a href="https://gdm-settings.github.io">GDM Settings</a> you can configure many details of the login manager, including applying your display settings. Simply with a mouse click and without the command line.</p>



<p class="wp-block-paragraph">The app is not an official GNOME tool and usually isn’t in the repositories either. You can install it without trouble via <a href="https://flathub.org/apps/io.github.realmazharhussain.GdmSettings">Flathub</a>, though. Pay attention to the warning on first launch: use at your own risk. Many options change system files, which can cause problems in individual cases, but as a rule everything works as intended.</p>



<p class="wp-block-paragraph">To apply the screen configuration of the currently logged-in user, open Display in the sidebar and click Apply Current Display Settings [CHECK: exact English label]. There is no automatic transfer for changing setups here, though. If you use your laptop regularly between the office and a home office, each with a different monitor configuration, the systemd variant described above is possibly the better choice.</p>



<div><figure data-wp-context='{"imageId":"6ae058941d57a"}' data-wp-interactive="core/image" data-wp-key="6ae058941d57a" class="wp-block-image size-full wp-lightbox-container"><img loading="lazy" decoding="async" height="789" sizes="auto, (max-width: 781px) 100vw, 680px" srcset="https://linuxundich.de/wp-content/uploads/2025/04/gdm-settings-erscheinungsbild-640x425.webp 640w, https://linuxundich.de/wp-content/uploads/2025/04/gdm-settings-erscheinungsbild-768x510.webp 768w, https://linuxundich.de/wp-content/uploads/2025/04/gdm-settings-erscheinungsbild.webp 1188w" width="1188" 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/2025/04/gdm-settings-erscheinungsbild.webp" alt="With GDM Settings you can configure many details, for example theme, wallpaper, or automatic login." class="wp-image-44374" style="width:100%"><button class="lightbox-trigger" type="button" aria-haspopup="dialog" data-wp-bind--aria-label="state.thisImage.triggerButtonAriaLabel" data-wp-init="callbacks.initTriggerButton" data-wp-on--click="actions.showLightbox" data-wp-style--right="state.thisImage.buttonRight" data-wp-style--top="state.thisImage.buttonTop">
			<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="none" viewbox="0 0 12 12">
				<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"></path>
			</svg>
		</button><figcaption class="wp-element-caption">With GDM Settings you can configure many details, for example theme, wallpaper, or automatic login.</figcaption></figure></div>



<div><figure data-wp-context='{"imageId":"6ae0589420710"}' data-wp-interactive="core/image" data-wp-key="6ae0589420710" class="wp-block-image size-full wp-lightbox-container"><img loading="lazy" decoding="async" height="789" sizes="auto, (max-width: 781px) 100vw, 680px" srcset="https://linuxundich.de/wp-content/uploads/2025/04/gdm-settings-anzeige-640x425.webp 640w, https://linuxundich.de/wp-content/uploads/2025/04/gdm-settings-anzeige-768x510.webp 768w, https://linuxundich.de/wp-content/uploads/2025/04/gdm-settings-anzeige.webp 1188w" width="1188" 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/2025/04/gdm-settings-anzeige.webp" alt="In the Display section, one click transfers your user's current screen configuration to GDM." class="wp-image-44373" style="width:100%"><button class="lightbox-trigger" type="button" aria-haspopup="dialog" data-wp-bind--aria-label="state.thisImage.triggerButtonAriaLabel" data-wp-init="callbacks.initTriggerButton" data-wp-on--click="actions.showLightbox" data-wp-style--right="state.thisImage.buttonRight" data-wp-style--top="state.thisImage.buttonTop">
			<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="none" viewbox="0 0 12 12">
				<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"></path>
			</svg>
		</button><figcaption class="wp-element-caption">
In the Display section, one click transfers your user’s current screen configuration to GDM.</figcaption></figure></div>
<hr><p>☕ <strong>Support Linux und Ich</strong><br>Thanks for reading <a href="https://linuxundich.de/en/">Linux und Ich</a>. If you enjoy the blog and would like to support my work, you will find more information on the <a href="https://linuxundich.de/en/support/">donation page</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://linuxundich.de/en/gdm-login-screen-showing-up-on-the-wrong-monitor/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to turn off the “Select Audio Device” prompt in GNOME</title>
		<link>https://linuxundich.de/en/how-to-turn-off-the-select-audio-device-prompt-in-gnome/</link>
					<comments>https://linuxundich.de/en/how-to-turn-off-the-select-audio-device-prompt-in-gnome/#respond</comments>
		
		<dc:creator><![CDATA[Christoph Langner]]></dc:creator>
		<pubDate>Sun, 13 Apr 2025 16:18:43 +0000</pubDate>
				<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[Audio]]></category>
		<category><![CDATA[GNOME]]></category>
		<category><![CDATA[GNOME extension]]></category>
		<category><![CDATA[Headphones]]></category>
		<category><![CDATA[Tips]]></category>
		<guid isPermaLink="false">https://linuxundich.de/en/?p=63</guid>

					<description><![CDATA[When you plug in a headset, GNOME first asks which audio device you just connected. A small extension turns this dialog off for good.]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Many users know the problem: you plug in a pair of headphones, and instead of the sound you expect, the &#8220;Select Audio Device&#8221; dialog pops up first. This happens regularly on machines with a combined audio jack for headphones and microphone.</p>



<figure data-wp-context="{&quot;imageId&quot;:&quot;6ae0589426802&quot;}" data-wp-interactive="core/image" data-wp-key="6ae0589426802" class="wp-block-image wp-lightbox-container"><img loading="lazy" decoding="async" height="921" sizes="auto, (max-width: 781px) 100vw, 680px" srcset="https://linuxundich.de/wp-content/uploads/2025/04/audio-settings-640x480.webp 640w, https://linuxundich.de/wp-content/uploads/2025/04/audio-settings-768x576.webp 768w, https://linuxundich.de/wp-content/uploads/2025/04/audio-settings.webp 1228w" width="1228" 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/2025/04/audio-settings.webp" alt="The Select Audio Device dialog offers three icons to choose from: headphones, headset, and microphone." style="width:100%"/><button
			class="lightbox-trigger"
			type="button"
			aria-haspopup="dialog"
			data-wp-bind--aria-label="state.thisImage.triggerButtonAriaLabel"
			data-wp-init="callbacks.initTriggerButton"
			data-wp-on--click="actions.showLightbox"
			data-wp-style--right="state.thisImage.buttonRight"
			data-wp-style--top="state.thisImage.buttonTop"
		>
			<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="none" viewBox="0 0 12 12">
				<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" />
			</svg>
		</button><figcaption class="wp-element-caption">If GNOME doesn&#8217;t automatically detect the connected headphones, this dialog appears every time you plug them in.</figcaption></figure>



<p class="wp-block-paragraph">The cause is the audio detection of the GNOME Settings Daemon, which in some cases can&#8217;t automatically tell a headset from simple headphones. So far, there is no built-in option to turn the dialog off for good. An extension fixes that.</p>



<h3 class="wp-block-heading">A simple fix: Auto Select Headset</h3>



<p class="wp-block-paragraph">The GNOME Shell extension <em><a href="https://extensions.gnome.org/extension/3928/auto-select-headset/">Auto Select Headset</a></em> suppresses the &#8220;Select Audio Device&#8221; dialog on systems without automatic jack detection. Instead, it tells the system right away that a headset has been plugged in. The extension is for anyone who prefers the audio device to be picked automatically and doesn&#8217;t want to be asked every time. The source code is available on <a href="https://github.com/josephlbarnett/autoselectheadset-gnome-shell-extension?tab=readme-ov-file">GitHub</a>.</p>
<hr><p>☕ <strong>Support Linux und Ich</strong><br>Thanks for reading <a href="https://linuxundich.de/en/">Linux und Ich</a>. If you enjoy the blog and would like to support my work, you will find more information on the <a href="https://linuxundich.de/en/support/">donation page</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://linuxundich.de/en/how-to-turn-off-the-select-audio-device-prompt-in-gnome/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Checking USB Sticks and SD Cards for Errors</title>
		<link>https://linuxundich.de/en/checking-usb-sticks-and-sd-cards-for-errors/</link>
					<comments>https://linuxundich.de/en/checking-usb-sticks-and-sd-cards-for-errors/#respond</comments>
		
		<dc:creator><![CDATA[Christoph Langner]]></dc:creator>
		<pubDate>Wed, 08 Dec 2021 17:10:11 +0000</pubDate>
				<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[System Administration]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[USB]]></category>
		<guid isPermaLink="false">https://linuxundich.de/en/checking-usb-sticks-and-sd-cards-for-errors/</guid>

					<description><![CDATA[Unlike hard disks, USB sticks and SD memory cards have no mechanical parts that wear out. Even so, modern flash memory breaks too. With Badblocks and F3, you can check flash memory for errors and expose fakes.]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Lately I&#8217;ve often had the problem that the lousy sticks kept piling up at the top of the heap, so they were always the first ones in my hand when I reached into the junk box. At the latest when writing larger amounts of data, such as the ISO image of a Linux distribution or a Raspberry Pi OS image for a Raspberry Pi, problems appear. The read/write rate collapses, or more telling I/O errors show up right away. To rule this out, I want to check all my USB sticks and SD memory cards for errors once and sort out defective media for good. On Linux, you can do that with built-in tools.</p>



<h2 class="wp-block-heading">Checking USB sticks for errors</h2>



<p class="wp-block-paragraph">First, you need to find out the device ID of the USB stick or memory card. So plug the device into your computer or insert the SD card into the card reader and type <code>lsblk</code> in the terminal. The command lists all storage devices connected to the computer. As a rule, you can identify the device ID by the size of the device. In my example, the system attaches my 8 GB USB stick as <code>sdc</code> (that is, <code>/dev/sdc</code> in full). If you&#8217;re unsure, unplug the device you want to check and run <code>lsblk</code> again. If <code>sdc</code> is missing from the list, you have the right ID. Alternatively, graphical tools such as GNOME Disks also show the ID.</p>



<pre class="wp-block-preformatted">$ <strong>lsblk</strong>
[...]
sdc           8:32   1   7.5G  0 disk
├─sdc1        8:33   1   2.9G  0 part /run/media/toff/Ubuntu 21.10 amd64
├─sdc2        8:34   1   4.1M  0 part
└─sdc3        8:35   1   300K  0 part
[...]</pre>



<figure data-wp-context="{&quot;imageId&quot;:&quot;6ae058942813a&quot;}" data-wp-interactive="core/image" data-wp-key="6ae058942813a" class="wp-block-image size-full wp-lightbox-container"><img loading="lazy" decoding="async" height="667" sizes="auto, (max-width: 781px) 100vw, 680px" srcset="https://linuxundich.de/wp-content/uploads/2021/12/gnome-laufwerksverwaltung-640x443.png 640w, https://linuxundich.de/wp-content/uploads/2021/12/gnome-laufwerksverwaltung-768x532.png 768w, https://linuxundich.de/wp-content/uploads/2021/12/gnome-laufwerksverwaltung.png 963w" width="963" 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/2021/12/gnome-laufwerksverwaltung.png" alt="GNOME Disks shows the 8 GB USB stick with its device ID /dev/sdc." style="width:100%"/><button
			class="lightbox-trigger"
			type="button"
			aria-haspopup="dialog"
			data-wp-bind--aria-label="state.thisImage.triggerButtonAriaLabel"
			data-wp-init="callbacks.initTriggerButton"
			data-wp-on--click="actions.showLightbox"
			data-wp-style--right="state.thisImage.buttonRight"
			data-wp-style--top="state.thisImage.buttonTop"
		>
			<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="none" viewBox="0 0 12 12">
				<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" />
			</svg>
		</button><figcaption class="wp-element-caption">GNOME&#8217;s built-in Disks utility also shows the device IDs of hard disks, SSDs, USB sticks and other storage devices attached to the system.</figcaption></figure>



<p class="wp-block-paragraph">For the actual error check, the <code>badblocks</code> command from the <em>e2fsprogs</em> package comes into play, which is part of the standard installation of the usual distributions. Badblocks may refuse to start the check at first because the drive is supposedly in use by the system. This usually happens because the operating system mounts the device automatically as soon as you plug in the USB stick. On my system, clicking the eject icon in the file manager isn&#8217;t enough; I have to unmount the device ID of the drive and its partitions explicitly with <code>umount</code>.</p>



<p class="has-luminous-vivid-orange-background-color has-background wp-block-paragraph"><strong>Caution:</strong> I have to issue a warning at this point: when checking for errors, Badblocks overwrites all data and partitions on the specified device. So make absolutely sure you pass the right device ID to the command, and back up important data from the USB stick or SD memory card beforehand. If the worst happens, you won&#8217;t be able to recover the data after the check.</p>



<pre class="wp-block-preformatted">$ <strong>sudo badblocks -wsv /dev/sdc</strong>
/dev/sdc is apparently in use by the system; it's not safe to run badblocks!
$ <strong>sudo umount /dev/sdc*</strong>
umount: /dev/sdc: not mounted.
umount: /dev/sdc2: not mounted.
umount: /dev/sdc3: not mounted.</pre>



<p class="wp-block-paragraph">When calling Badblocks, you pass the parameters <code>-wsv</code> and the device ID. The parameters tell the program to run a destructive write test (<code>-w</code>), show the progress (<code>-s</code>) and output more information in general (<code>-v</code>). The thorough test writes every block of the device four times in a row with different patterns (0xaa, 0x55, 0xff and 0x00). Depending on speed and capacity, you need to allow quite some time for this. Checking the USB 2.0 stick with 8 GB of capacity from my example took more than an hour.</p>



<pre class="wp-block-preformatted">$ <strong>sudo badblocks -wsv /dev/sdc</strong>
Testing with pattern 0xaa:   0.00% done, 0:00 elapsed. (0/0/0 errors) done
Reading and comparing: done
Testing with pattern 0x55:   0.00% done, 23:47 elapsed. (0/0/0 errors) done
Reading and comparing: done
Testing with pattern 0xff:   0.00% done, 47:33 elapsed. (0/0/0 errors) done
Reading and comparing: done
Testing with pattern 0x00:   0.00% done, 1:11:26 elapsed. (0/0/0 errors) done
Reading and comparing: done</pre>



<p class="wp-block-paragraph">Besides the destructive method, Badblocks supports a non-destructive read-write mode. You enable it with the <code>-n</code> parameter instead of <code>-w</code>. In this variant, Badblocks first backs up the data of the block being checked to RAM, then overwrites the block with random data and checks whether the data was written correctly. Finally, Badblocks writes the backup back to the device. At first glance, this routine seems faster because there is only one pass, but in practice backing up and restoring the existing data takes considerably more time. In my example, it took more than 2.5 hours instead of just over one hour.</p>



<pre class="wp-block-preformatted">$ <strong>sudo badblocks -nsv /dev/sdc</strong>
Checking for bad blocks in non-destructive read-write mode
From block 0 to 7812607
Checking for bad blocks (non-destructive read-write test)
Testing with random pattern:  94.36% done, 2:35:18 elapsed. (0/0/0 errors)</pre>



<h2 class="wp-block-heading">Detecting fake USB sticks</h2>



<p class="wp-block-paragraph">The tool <a href="https://github.com/AltraMayor/f3">F3</a>, short for Fight Flash Fraud, goes one step further. The open-source program thoroughly checks whether a storage device really has the capacity it claims to have. Unfortunately, this is still a relevant topic, especially if you buy super cheap deals online. To expose fake USB sticks or SD memory cards, install the program from your distribution&#8217;s repositories. Debian, Ubuntu, Fedora and others carry the command-line tool in their official repositories; the package is usually called <em>f3</em>. Arch Linux only has the program in the AUR, so you need an AUR helper to install it.</p>



<pre class="wp-block-preformatted">### Installation on Arch Linux or Manjaro:
$ <strong>yay -S f3</strong>
### Installation on Debian, Ubuntu or Raspberry Pi OS:
$ <strong>sudo apt install f3</strong></pre>



<p class="wp-block-paragraph">The commands for checking USB storage are <code>f3write</code>, <code>f3read</code> and <code>f3probe</code>. You have to use the first two in combination, passing each the mount point of the device as an option. <code>f3write</code> keeps writing one-gigabyte files to the mounted device until it runs out of space. Then you use <code>f3read</code> to check whether the written data can really be read back. If the device is a fake USB stick or a manipulated SD memory card, <code>f3read</code> would report corrupted sectors. This check leaves all data on the device intact; you just have to delete the h2w files at the end, otherwise there&#8217;s no space left on the stick.</p>



<pre class="wp-block-preformatted">$ <strong>f3write /run/media/toff/291E-6F9C</strong>
[...]
Free space: 3.72 GB
Creating file 1.h2w ... OK!
Creating file 2.h2w ... OK!
Creating file 3.h2w ... OK!
Creating file 4.h2w ... OK!
Free space: 0.00 Byte
Average writing speed: 3.91 MB/s
$ <strong>f3read /run/media/toff/291E-6F9C</strong>
[...]
                  SECTORS      ok/corrupted/changed/overwritten
Validating file 1.h2w ... 2097152/        0/      0/      0
Validating file 2.h2w ... 2097152/        0/      0/      0
Validating file 3.h2w ... 2097152/        0/      0/      0
Validating file 4.h2w ... 1518736/        0/      0/      0

  Data OK: 3.72 GB (7810192 sectors)
Data LOST: 0.00 Byte (0 sectors)
	       Corrupted: 0.00 Byte (0 sectors)
	Slightly changed: 0.00 Byte (0 sectors)
	     Overwritten: 0.00 Byte (0 sectors)
Average reading speed: 14.73 MB/s
$ <strong>ls -al /run/media/toff/291E-6F9C</strong>
total 3907596
drwxr-xr-x  3 toff toff       4096 Jan  1  1970 .
drwxr-x---+ 4 root root         80 Dec  7 16:27 ..
-rw-r--r--  1 toff toff 1073741824 Dec  7 18:35 1.h2w
-rw-r--r--  1 toff toff 1073741824 Dec  7 18:40 2.h2w
-rw-r--r--  1 toff toff 1073741824 Dec  7 18:44 3.h2w
-rw-r--r--  1 toff toff  777592832 Dec  7 18:47 4.h2w
[...]</pre>



<p class="wp-block-paragraph"><code>f3probe --destructive</code> works a little faster. The <code>--destructive</code> option is optional, but it speeds things up considerably. In this test, F3 only writes the sectors it absolutely needs and doesn&#8217;t bother with backing up data. Since the probe accesses the hardware directly, you pass the device ID (here <code>/dev/sdg</code>) instead of the mount point. This way, the test with my 4 GB USB 2.0 stick takes only a little more than seven minutes. Keep in mind again, though, that this routine overwrites all data blocks on the device.</p>



<pre class="wp-block-preformatted">$ <strong>f3probe --destructive --time-ops /dev/sdg</strong>
[...]
Good news: The device `/dev/sdg' is the real thing

Device geometry:
	         *Usable* size: 3.73 GB (7831552 blocks)
	        Announced size: 3.73 GB (7831552 blocks)
	                Module: 4.00 GB (2^32 Bytes)
	Approximate cache size: 0.00 Byte (0 blocks), need-reset=no
	   Physical block size: 512.00 Byte (2^9 Bytes)

Probe time: 7'17"
 Operation: total time / count = avg time
      Read: 2.73s / 4812 = 568us
     Write: 7'13" / 3637313 = 119us
     Reset: 1us / 1 = 1us</pre>



<p class="wp-block-paragraph">Both Badblocks and F3 help you analyze errors on storage devices. You always need to bring a bit of time for the check, though. A thorough analysis of an 8 GB USB stick can easily take two hours, especially if the data is to be preserved during the check and the stick only supports the slow USB 2.0 protocol. Afterward, however, you can assume that the USB stick or SD memory card really works and has the capacity printed on the label.</p>

<hr><p>☕ <strong>Support Linux und Ich</strong><br>Thanks for reading <a href="https://linuxundich.de/en/">Linux und Ich</a>. If you enjoy the blog and would like to support my work, you will find more information on the <a href="https://linuxundich.de/en/support/">donation page</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://linuxundich.de/en/checking-usb-sticks-and-sd-cards-for-errors/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>SSH Tips: Changed Host Keys, Killing and Parking Connections</title>
		<link>https://linuxundich.de/en/ssh-tips-changed-host-keys-killing-and-parking-connections/</link>
					<comments>https://linuxundich.de/en/ssh-tips-changed-host-keys-killing-and-parking-connections/#respond</comments>
		
		<dc:creator><![CDATA[Christoph Langner]]></dc:creator>
		<pubDate>Sat, 07 May 2016 06:32:42 +0000</pubDate>
				<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[How-to]]></category>
		<category><![CDATA[Raspberry Pi]]></category>
		<category><![CDATA[SSH]]></category>
		<category><![CDATA[Tips]]></category>
		<guid isPermaLink="false">https://linuxundich.de/en/ssh-tips-changed-host-keys-killing-and-parking-connections/</guid>

					<description><![CDATA[SSH tips: remove changed host keys with ssh-keygen -R, kill hung connections and park sessions.]]></description>
										<content:encoded><![CDATA[
<p class="dropcapp wp-block-paragraph">If you like tinkering with the Raspberry Pi or other single-board computers such as the Banana Pi, Odroid and the like, you keep running into SSH. The images made for these mini computers are usually based on Linux and therefore mostly come with SSH access built in. In everyday tinkering, however, you set these machines up from scratch again and again, or you quickly pull the power plug to &#8220;just&#8221; restart the device. That throws SSH off balance: after installing a new system, the stored SSH key no longer matches, or the SSH client hangs when you suddenly pull the plug. You can solve these problems the quick and dirty way, but there is always a clean way, too.</p>

<span id="more-153"></span>

<p class="wp-block-paragraph">When establishing a connection via SSH, the SSH client usually stores the public SSH key of the remote system together with its hostname and IP address in the file <code>~/.ssh/known_hosts</code> in the current user&#8217;s home directory on the client machine. Among other things, this is done to prevent <a href="https://en.wikipedia.org/wiki/Man-in-the-middle_attack">man-in-the-middle attacks</a>, in which an attacker pretends to be the target machine in order to phish your login credentials. However, this security measure also kicks in when there is no threat at all: for example, when you set up a Pi from scratch and try to log in via SSH again. In such a case, SSH reports <code>WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED</code> in big letters.</p>

<h2 class="wp-block-heading">SSH after reinstalling the system</h2>

<pre class="wp-block-preformatted">$ <strong>grep 192.168.111.100 ~/.ssh/known_hosts</strong>
raspberrypi,192.168.111.100 ecdsa-sha2-nistp256 AAAAE2...ABBBBqf</pre>

<pre class="wp-block-preformatted">$ <strong>ssh pi@192.168.111.100</strong>
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the ECDSA key sent by the remote host is
SHA256:6rR+0/i3KnPLds3EuGkfWiudIgu8VMpe1xq+X3I3yNM.
Please contact your system administrator.
Add correct host key in /home/toff/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /home/toff/.ssh/known_hosts:10
ECDSA host key for 192.168.111.100 has changed and you have requested strict checking.
Host key verification failed.</pre>

<p class="wp-block-paragraph">You could now open the file <code>~/.ssh/known_hosts</code> in a text editor and delete the offending line 10 from the list by hand, but there is a better way: with <code>ssh-keygen -R IP-address</code>, you remove the key from the file with a single command, so the next time you connect, you start from scratch – and have to confirm the key just like the very first time you connected to this machine. This also works if you use the hostname instead of the IP address to connect. To be on the safe side, the command copies the old state to <code>~/.ssh/known_hosts.old</code> in the same directory.</p>

<pre class="wp-block-preformatted">$ <strong>ssh-keygen -R 192.168.111.100</strong>
# Host 192.168.111.100 found: line 10
/home/toff/.ssh/known_hosts updated.
Original contents retained as /home/toff/.ssh/known_hosts.old</pre>

<pre class="wp-block-preformatted">$ <strong>ssh pi@192.168.111.100</strong>
The authenticity of host 'raspberrypi (192.168.111.100)' can't be established.
ECDSA key fingerprint is SHA256:6rR+0/i3KnPLds3EuGkfWiudIgu8VMpe1xq+X3I3yNM.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.111.100' (ECDSA) to the list of known hosts.
pi@192.168.111.100's password:

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Fri Apr 22 08:40:10 2016 from 192.168.178.57</pre>

<h2 class="wp-block-heading">Forcibly terminating an SSH connection</h2>

<p class="dropcapp wp-block-paragraph">If you are logged in to a remote machine via SSH and shut it down with <code>shutdown</code>, <code>halt</code> or <code>reboot</code>, the system doesn&#8217;t kill the SSH connection abruptly. It stops the SSH server cleanly during shutdown, so you end up back in the terminal of the client machine and can keep working in the same terminal window. Now, I – and surely other Pi tinkerers too – like to unplug the Raspberry Pi and plug it back in to restart it quickly and painlessly. This is certainly not ideal for the integrity of the data on the memory card, but if I&#8217;m going to set up the system on it from scratch anyway, I don&#8217;t much care.</p>

<figure data-wp-context="{&quot;imageId&quot;:&quot;6ae058942f35e&quot;}" data-wp-interactive="core/image" data-wp-key="6ae058942f35e" class="wp-block-image wp-lightbox-container"><img loading="lazy" decoding="async" height="577" sizes="auto, (max-width: 781px) 100vw, 680px" srcset="https://linuxundich.de/wp-content/uploads/2016/05/raspberry-pi-ssh-steuercodes-640x475.png 640w, https://linuxundich.de/wp-content/uploads/2016/05/raspberry-pi-ssh-steuercodes-768x570.png 768w, https://linuxundich.de/wp-content/uploads/2016/05/raspberry-pi-ssh-steuercodes.png 777w" width="777" 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/2016/05/raspberry-pi-ssh-steuercodes.png" alt="SSH connections can be managed with a set of escape sequences." style="width:100%"/><button
			class="lightbox-trigger"
			type="button"
			aria-haspopup="dialog"
			data-wp-bind--aria-label="state.thisImage.triggerButtonAriaLabel"
			data-wp-init="callbacks.initTriggerButton"
			data-wp-on--click="actions.showLightbox"
			data-wp-style--right="state.thisImage.buttonRight"
			data-wp-style--top="state.thisImage.buttonTop"
		>
			<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="none" viewBox="0 0 12 12">
				<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" />
			</svg>
		</button><figcaption class="wp-element-caption">SSH connections can be managed with a set of escape sequences.</figcaption></figure>

<p class="wp-block-paragraph">The downside is that SSH usually hangs in the terminal when you do this – after all, you just pulled the chair out from under it. You could now kill the SSH process or close the terminal window and open it again, but there is a clean solution for this situation, too: SSH knows a number of escape sequences that let you manage the current SSH session. You get an overview of the available commands if you type <code>~?</code> on a new line in the terminal. To be on the safe side, simply press Enter once beforehand.</p>

<pre class="wp-block-preformatted">pi@raspberrypi:~ # <strong>~?</strong>
Supported escape sequences:
 ~.   - terminate connection (and any multiplexed sessions)
 ~B   - send a BREAK to the remote system
 ~C   - open a command line
 ~R   - request rekey
 ~V/v - decrease/increase verbosity (LogLevel)
 ~^Z  - suspend ssh
 ~#   - list forwarded connections
 ~&amp;   - background ssh (when waiting for connections to terminate)
 ~?   - this message
 ~~   - send the escape character by typing it twice
(Note that escapes are only recognized immediately after newline.)</pre>

<p class="wp-block-paragraph">The first sequence shown in the help is exactly the function we&#8217;re looking for: if you type <code>~.</code> as text during an SSH session, you terminate the current SSH connection, no matter what. This doesn&#8217;t only work with a session that is still active and working (which you could close with <code>exit</code> at any time anyway), but also when, for example, you cut the power to the Pi and nothing happens in the terminal anymore. Here, too, it can help to press Enter once more before the actual command. Otherwise the escape sequence may come to nothing.</p>

<h2 class="wp-block-heading">Pausing and resuming an SSH connection</h2>

<p class="dropcapp wp-block-paragraph">The escape sequences can do other handy things, too. For example, you can suspend an SSH connection and resume it later without having to use a terminal multiplexer such as <code>screen</code> or <code>tmux</code>. If a process takes longer than expected, you can park the connection this way while the process on the remote machine keeps running. Unlike with the two terminal multiplexers mentioned, you don&#8217;t have to think ahead that the task might take longer and start them as a precaution. The corresponding sequence is the somewhat cryptic <code>~^Z</code>, where the caret doesn&#8217;t stand for a character but for the Ctrl key. So you type <kbd>~</kbd> and then press <kbd>Ctrl</kbd>+<kbd>Z</kbd>. You then land back in the terminal of the machine on which you originally ran <code>ssh</code>. From there, you can pick up the connection again by typing <code>fg</code> and pressing Enter.</p>

<figure data-wp-context="{&quot;imageId&quot;:&quot;6ae058942f9c1&quot;}" data-wp-interactive="core/image" data-wp-key="6ae058942f9c1" class="wp-block-image wp-lightbox-container"><img loading="lazy" decoding="async" height="664" sizes="auto, (max-width: 781px) 100vw, 680px" srcset="https://linuxundich.de/wp-content/uploads/2016/05/ssh-raspberry-pi-suspend-640x550.png 640w, https://linuxundich.de/wp-content/uploads/2016/05/ssh-raspberry-pi-suspend-768x661.png 768w, https://linuxundich.de/wp-content/uploads/2016/05/ssh-raspberry-pi-suspend.png 772w" width="772" 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/2016/05/ssh-raspberry-pi-suspend.png" alt="Pausing and resuming an SSH connection." style="width:100%"/><button
			class="lightbox-trigger"
			type="button"
			aria-haspopup="dialog"
			data-wp-bind--aria-label="state.thisImage.triggerButtonAriaLabel"
			data-wp-init="callbacks.initTriggerButton"
			data-wp-on--click="actions.showLightbox"
			data-wp-style--right="state.thisImage.buttonRight"
			data-wp-style--top="state.thisImage.buttonTop"
		>
			<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="none" viewBox="0 0 12 12">
				<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" />
			</svg>
		</button><figcaption class="wp-element-caption">Pausing and resuming an SSH connection.</figcaption></figure>

<p class="wp-block-paragraph">If you work on a &#8220;truly&#8221; remote system over the internet, the connection may well drop. On the one hand, this is because the server terminates the connection after a period of inactivity; on the other hand, your own network infrastructure (read: the router) may interfere. However, you can prevent the timeout with a keep-alive function. Depending on the situation, you can either configure the SSH server accordingly (which of course requires root privileges) or call SSH with the appropriate parameters right away. In that case, you don&#8217;t need any special privileges on either system.</p>

<h3 class="wp-block-heading">Keep-alive on the server side</h3>

<pre class="wp-block-preformatted">### Default keep-alive settings:
$ <strong>grep Alive /etc/ssh/sshd_config</strong>
#TCPKeepAlive yes
#ClientAliveInterval 0
#ClientAliveCountMax 3
### Edit the SSH server configuration:
$ <strong>sudo nano /etc/ssh/sshd_config</strong>

### In the end, the relevant lines should look like this:
$ <strong>grep Alive /etc/ssh/sshd_config</strong>
TCPKeepAlive yes
ClientAliveInterval 60
ClientAliveCountMax 3

### Restart the SSH server once:
$ <strong>sudo systemctl restart sshd</strong></pre>

<h3 class="wp-block-heading">Keep-alive on the client side</h3>

<pre class="wp-block-preformatted">### Keep the SSH connection alive from the client side
$ <strong>ssh -o ServerAliveInterval=60 -o ServerAliveCountMax=1 pi@raspberrypi</strong></pre>

<p class="wp-block-paragraph">In the first case, the setting applies to all users who want to log in to the system via SSH. As a rule, you should therefore only make this change if all users actually need it. Most of the time, though, you only need keep-alive in exceptional cases, so it makes sense to set the option only when needed when calling <code>ssh</code>. For me, this is the case with a web service I can log in to via SSH, for example. If I start long-running backups there, my router terminates the connection before the backup process can report success. With the keep-alive settings mentioned above, however, that&#8217;s no longer a problem.</p>

<hr><p>☕ <strong>Support Linux und Ich</strong><br>Thanks for reading <a href="https://linuxundich.de/en/">Linux und Ich</a>. If you enjoy the blog and would like to support my work, you will find more information on the <a href="https://linuxundich.de/en/support/">donation page</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://linuxundich.de/en/ssh-tips-changed-host-keys-killing-and-parking-connections/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
