<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Artem K.</title>
    <description>The latest articles on DEV Community by Artem K. (@artemkx).</description>
    <link>https://dev.to/artemkx</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4175757%2F16fdba24-3fe3-4071-b545-19577c537c80.png</url>
      <title>DEV Community: Artem K.</title>
      <link>https://dev.to/artemkx</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/artemkx"/>
    <language>en</language>
    <item>
      <title>How I put a physics-simulated cloth rug on my Mac desktop</title>
      <dc:creator>Artem K.</dc:creator>
      <pubDate>Sat, 10 Oct 2026 18:00:01 +0000</pubDate>
      <link>https://dev.to/artemkx/how-i-put-a-physics-simulated-cloth-rug-on-my-mac-desktop-14mm</link>
      <guid>https://dev.to/artemkx/how-i-put-a-physics-simulated-cloth-rug-on-my-mac-desktop-14mm</guid>
      <description>&lt;p&gt;  &lt;iframe src="https://www.youtube.com/embed/b0jrya30yU0" width="710" height="399"&gt;
  &lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Before every screen share or video call, the first thing everyone sees is my desktop — and it's a mess. I wanted a way to just… cover it. Not hide icons in a dock autohide trick, but literally throw a rug over the clutter. So &lt;code&gt;Desk Rug&lt;/code&gt; is a small native macOS app that puts a live, physics-simulated cloth rug on your desktop. One hotkey sweeps the icons underneath it; another brings them back.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The honest part first&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I didn't build this from zero. Desk Rug grows out of the MIT-licensed &lt;a href="https://github.com/siliconbag/under-the-rug" rel="noopener noreferrer"&gt;under-the-rug&lt;/a&gt; by siliconbag — a wonderful idea that deserved more engineering. My work was taking it apart and rebuilding it where it hurt: solver stability, startup speed, CPU use, and breadth (more rugs, more floors, scheduling, per-Space profiles). Credit where it's due — none of this exists without the original.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How the cloth actually works&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The rug is a grid of vertices simulated with &lt;strong&gt;XPBD&lt;/strong&gt; (substepped, in the style of &lt;em&gt;Ten Minute Physics'&lt;/em&gt; cloth), not a pre-baked animation:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A cloth grid of 56 columns at ~19pt spacing — small enough that the piles of icons under the rug deform the fabric into visible bumps and fold ridges.&lt;/li&gt;
&lt;li&gt;The ground is a signed &lt;strong&gt;height field&lt;/strong&gt; with static + kinetic Coulomb friction, so the rug settles, stays put, and slides the way real fabric does.&lt;/li&gt;
&lt;li&gt;Icon piles add bumps to the height field — that's what makes the "hidden icons under the rug" read as a bulge.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Self-collisions&lt;/strong&gt; are resolved with a spatial hash, so folds don't clip through each other.&lt;/li&gt;
&lt;li&gt;Coordinates live in screen points — same units as the desktop, which makes dragging, grabbing and releasing predictable.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Rendering&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;All shaders are &lt;strong&gt;MSL compiled at runtime from a source string&lt;/strong&gt; — no Metal toolchain or precompiled bundle needed, which keeps the app a single thin binary. The rug gets a soft directional light, a 16-tap Poisson soft shadow, and the fleece look comes from a procedural fragment pass on top of the vertex grid.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What I changed vs. the base project&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Solver stability&lt;/strong&gt;: tighter substep budget, velocity caps and a &lt;code&gt;maxSpeed&lt;/code&gt; guard — no more jitter or "blizzard" wake-up when the rug sits at rest.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Startup &amp;amp; CPU&lt;/strong&gt;: leaner grid and rendering path; the rug idles nearly at 0% CPU.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Content&lt;/strong&gt;: 6 rugs and 6 floors, and you can feed your own images for both (they're treated as UV-mapped fabrics).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Scheduling&lt;/strong&gt;: a per-day schedule that sweeps icons under before meetings and restores them after.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Per-Space profiles&lt;/strong&gt;: rug, floor and size follow which Space you're on.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Automation&lt;/strong&gt;: icons are &lt;em&gt;really&lt;/em&gt; moved via Finder (nothing is deleted) and restored to their exact positions around the screen edge. Global hotkey (⌃⌥⌘R) via Carbon.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;12 rugs→&lt;/strong&gt; …and it ships in 13 interface languages.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The fun part of tuning was that cloth parameters are exposed through environment variables (&lt;code&gt;RUG_G&lt;/code&gt;, &lt;code&gt;RUG_BEND&lt;/code&gt;, &lt;code&gt;RUG_DAMP&lt;/code&gt;, &lt;code&gt;RUG_COLS&lt;/code&gt;, …) so the demo harness can sweep values without recompiling — very useful when you're chasing "does it settle without a blizzard".&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Privacy&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;No accounts, no analytics, no network calls, no screen-recording permission. The app moves files through Finder on your machine and never sends anything anywhere.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Try it&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Free, native Swift, macOS 14+, universal binary. Not notarized yet, so first Open is via &lt;em&gt;right-click → Open&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Download:&lt;/strong&gt; &lt;a href="https://artapps.dev/desk-rug-macos" rel="noopener noreferrer"&gt;https://artapps.dev/desk-rug-macos&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I'd love to know whether the rebuild lands — especially the feel of dragging the fabric at 60 fps. PRs and issues welcome, respectful on the base project's license.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>productivity</category>
      <category>showdev</category>
      <category>news</category>
    </item>
  </channel>
</rss>
