.
This commit is contained in:
parent
6623ee03f6
commit
44c8324063
120 changed files with 22842 additions and 4673 deletions
|
|
@ -1,40 +1,47 @@
|
|||
<!doctype html>
|
||||
<html lang="en"><head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<link rel="shortcut icon" href="https://nonsense.dymc.win/favicon.ico">
|
||||
<link id="stylesheet" rel="stylesheet" href="/css/light.css">
|
||||
<html lang="en"><head><script src="/livereload.js?mindelay=10&v=2&port=1313&path=livereload" data-no-instant defer></script>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<link rel="canonical" href="http://localhost:1313/multi-user-qtile-fiddling/" />
|
||||
<title>Multi user qtile fiddling - James' Blog</title>
|
||||
|
||||
<link rel="canonical" href="https://nonsense.dymc.win/multi-user-qtile-fiddling/" />
|
||||
<title>Multi user qtile fiddling</title>
|
||||
<link rel="stylesheet" href="/css/style.css">
|
||||
|
||||
<script>
|
||||
document.documentElement.setAttribute('data-theme', 'dark');
|
||||
</script>
|
||||
</head>
|
||||
<body><header id="banner">
|
||||
<nav class="navbar">
|
||||
<body><header class="site-header">
|
||||
<nav>
|
||||
<a href="http://localhost:1313/" class="home">~</a>
|
||||
<div class="nav-links">
|
||||
|
||||
<a href="https://nonsense.dymc.win/" class="home">🏠</a>
|
||||
|
||||
<a
|
||||
href="/info/"
|
||||
title="👋"
|
||||
>👋</a
|
||||
><a
|
||||
href="/search/"
|
||||
title="🔎"
|
||||
>🔎</a
|
||||
>
|
||||
|
||||
<button id="toggle-button" class="toggle-button" onclick="toggleTheme()">🌚</button>
|
||||
<a href="/search">/</a>
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
<main id="content">
|
||||
<article>
|
||||
<header id="post-header">
|
||||
<h2>Multi user qtile fiddling</h2>
|
||||
<div>
|
||||
<p>December 20, 2022</p>
|
||||
<article class="post">
|
||||
<header>
|
||||
<h1>Multi user qtile fiddling</h1>
|
||||
<time>Dec 20, 2022</time>
|
||||
|
||||
<div class="tags">
|
||||
|
||||
<a href="/tags/qtile">qtile</a>
|
||||
|
||||
<a href="/tags/python">python</a>
|
||||
|
||||
<a href="/tags/nixos">nixos</a>
|
||||
|
||||
<a href="/tags/home-manager">home-manager</a>
|
||||
|
||||
</div>
|
||||
</header><p>This post is going to detail how I solved a very particular problem I had created for myself. First, a quick description of the problem. I use home-manager on nixos to declaratively configure what happens on my computer. In the cases where home-manager does not expose sufficient configuration options for my liking (qtile for example), I instead link a configuration file from my nixos config to where it belongs in my home using <code>xdg.configFile</code>. This is what I do with my qtile <code>config.py</code>. I use qtile on my desktop and laptop but I dont want an identical setup on the two machines. I have jumped through many different slightly silly hoops in my nixos config sort of solving this problem until the other day it occured to me this could all be achieved with my python in my qtile config.</p>
|
||||
|
||||
</header>
|
||||
<div class="content">
|
||||
<p>This post is going to detail how I solved a very particular problem I had created for myself. First, a quick description of the problem. I use home-manager on nixos to declaratively configure what happens on my computer. In the cases where home-manager does not expose sufficient configuration options for my liking (qtile for example), I instead link a configuration file from my nixos config to where it belongs in my home using <code>xdg.configFile</code>. This is what I do with my qtile <code>config.py</code>. I use qtile on my desktop and laptop but I dont want an identical setup on the two machines. I have jumped through many different slightly silly hoops in my nixos config sort of solving this problem until the other day it occured to me this could all be achieved with my python in my qtile config.</p>
|
||||
<h3 id="the-nub-of-the-problem">THE NUB OF THE PROBLEM</h3>
|
||||
<p>I basically just want the config to work out which computer it’’s on and then change some things accordingly. This can be achieved by getting the hostname with the socket module:</p>
|
||||
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="k">if</span> <span class="n">socket</span><span class="o">.</span><span class="n">gethostname</span><span class="p">()</span> <span class="o">==</span> <span class="s1">'baron'</span><span class="p">:</span>
|
||||
|
|
@ -103,16 +110,16 @@
|
|||
</span></span><span class="line"><span class="cl"> <span class="k">for</span> <span class="n">p</span> <span class="ow">in</span> <span class="n">processes</span><span class="p">:</span>
|
||||
</span></span><span class="line"><span class="cl"> <span class="n">subprocess</span><span class="o">.</span><span class="n">Popen</span><span class="p">(</span><span class="n">p</span><span class="p">)</span>
|
||||
</span></span></code></pre></div><p>Of course, there are many ways that this could all be achievd but I think it’s quite neat having it all in my one qtile config. That’s about it for today. lots of love x</p>
|
||||
</article>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<small>
|
||||
made with <a href="https://gohugo.io">hugo</a>
|
||||
</small>
|
||||
|
||||
<script src="/js/search.js"></script>
|
||||
<script src="/js/toggle.js"></script>
|
||||
</footer>
|
||||
|
||||
</body>
|
||||
</div>
|
||||
</article>
|
||||
</main><footer class="site-footer">
|
||||
<small>
|
||||
<a href="/index.xml">RSS</a>
|
||||
·
|
||||
<a href="https://gohugo.io">Hugo</a>
|
||||
</small>
|
||||
<script src="/js/script.js"></script>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue