<?xml version="1.0" encoding="UTF-8"?>
<rss  xmlns:atom="http://www.w3.org/2005/Atom" 
      xmlns:media="http://search.yahoo.com/mrss/" 
      xmlns:content="http://purl.org/rss/1.0/modules/content/" 
      xmlns:dc="http://purl.org/dc/elements/1.1/" 
      version="2.0">
<channel>
<title>George Ramzi</title>
<link>https://ramzi.uk/blog.html</link>
<atom:link href="https://ramzi.uk/blog.xml" rel="self" type="application/rss+xml"/>
<description></description>
<generator>quarto-1.10.18</generator>
<lastBuildDate>Sun, 11 Oct 2026 00:00:00 GMT</lastBuildDate>
<item>
  <title>Blogging with Quarto</title>
  <dc:creator>George Ramzi</dc:creator>
  <link>https://ramzi.uk/posts/2026_10_11_quarto_blog.html</link>
  <description><![CDATA[ 





<p>As I mentioned previously, I use Quarto for my lectures. I have had a ton of fun this year experimenting with Quarto and Reveal.js as a lecturing paltform, and it has been an amazing and genuinely innovative platform to play with. I’ve experimented with higher quality animations, two-way interaction with my students being able to vote in polls and directly ask me questions during lectures, and custom visualisations for complex topics like Git, SQL queries, and Docker.</p>
<p>I have had an incredibly time experimenting with Quarto, and I’m keeping an eye on Quarto 2 development<sup>1</sup>.</p>
<p>I have also experimented with Quarto as a more general publishing platform. I have a private GitLab repository in my University GitLab where I push lecture slides and general course materials, where they are automatically built and deployed to a University website. This allows me to share and publish my slides or public documents<sup>2</sup> with anyone at the University freely, which I find really liberating for generally disemminating my work.</p>
<p>However there was a single hold out – Hugo!</p>
<p>My site has long ran Hugo. Hugo is great – It’s incredibly easy to setup and use, it’s great for getting a <em>simple</em> site running really trivially. The issue is, I don’t want a simple site anymore!</p>
<p>My work is now running on a more dynamic platform where I can build crazy things, and I want to be able to do that here too. If I’m making things in Quarto for my lectures… Why can’t I use Quarto here too?</p>
<section id="image-vs-container" class="level2 page-columns page-full">
<h2 class="anchored" data-anchor-id="image-vs-container">Image vs container</h2>
<p>As an example, I recently delivered a lecture on Docker, and this was a figure I used to demonstrate the difference between an <em>image</em> and a <em>container</em>.</p>
<div class="column-page">
<figure class="dg-card figure">
<div class="dg-stage">
<div class="dg" data-dwell="1200,2500,2500,5000" style="width:560px; height:500px">
  <div class="frame t-image" data-label="image · shop-api" style="left:130px; top:24px; width:300px; height:190px"></div>
  <div class="chips" style="left:340px; top:12px"><span class="chip t-image">read-only</span></div>
  <div class="node t-image" style="left:148px; top:48px; width:264px; height:42px">app.jar</div>
  <div class="node t-image" style="left:148px; top:98px; width:264px; height:42px">Maven dependencies</div>
  <div class="node t-image" style="left:148px; top:148px; width:264px; height:42px">eclipse-temurin:21-jdk</div>

  <div class="group fragment">
    <svg><path class="wire draw" pathlength="1" d="M280 214 V252 H138 V292"></path></svg>
    <div class="note mono" style="left:292px; top:222px">docker run</div>
    <div class="frame t-ctr pop" data-label="shop-1" style="left:10px; top:292px; width:170px; height:170px; --delay:.4s">
      <div class="node dashed t-ctr" style="left:12px; top:24px; width:144px; height:40px; font-size:15px">writable</div>
      <div class="node faint t-image" style="left:12px; top:72px; width:144px; height:14px"></div>
      <div class="node faint t-image" style="left:12px; top:90px; width:144px; height:14px"></div>
      <div class="node faint t-image" style="left:12px; top:108px; width:144px; height:14px"></div>
      <div class="note t-ok" style="left:14px; top:134px"><span class="dot live"></span>&nbsp; running</div>
    </div>
  </div>

  <div class="group fragment">
    <svg><path class="wire draw" pathlength="1" d="M280 252 H323 V292"></path></svg>
    <div class="frame t-ctr pop" data-label="shop-2" style="left:195px; top:292px; width:170px; height:170px; --delay:.3s">
      <div class="node dashed t-ctr" style="left:12px; top:24px; width:144px; height:40px; font-size:15px">writable</div>
      <div class="node faint t-image" style="left:12px; top:72px; width:144px; height:14px"></div>
      <div class="node faint t-image" style="left:12px; top:90px; width:144px; height:14px"></div>
      <div class="node faint t-image" style="left:12px; top:108px; width:144px; height:14px"></div>
      <div class="note t-ok" style="left:14px; top:134px"><span class="dot live"></span>&nbsp; running</div>
    </div>
  </div>

  <div class="group fragment">
    <svg><path class="wire draw" pathlength="1" d="M280 252 H508 V292"></path></svg>
    <div class="frame t-ctr pop" data-label="shop-3" style="left:380px; top:292px; width:170px; height:170px; --delay:.4s">
      <div class="node dashed t-ctr" style="left:12px; top:24px; width:144px; height:40px; font-size:15px">writable</div>
      <div class="node faint t-image" style="left:12px; top:72px; width:144px; height:14px"></div>
      <div class="node faint t-image" style="left:12px; top:90px; width:144px; height:14px"></div>
      <div class="node faint t-image" style="left:12px; top:108px; width:144px; height:14px"></div>
      <div class="note t-ok" style="left:14px; top:134px"><span class="dot live"></span>&nbsp; running</div>
    </div>
    <div class="note pop" style="left:10px; top:476px; --delay:.8s">Each container: its own writable layer on the <span style="color:#34d399">shared, read-only image</span></div>
  </div>
</div>
</div>
<figcaption><span><strong>Image vs container.</strong> One read-only image; each <code>docker run</code> drops a container off it with its own thin writable layer.</span><span class="dg-steps"></span></figcaption>
</figure>
</div>
<script src="docker-diagrams/diagrams.js"></script>


</section>


<div id="quarto-appendix" class="default"><section id="footnotes" class="footnotes footnotes-end-of-document"><h2 class="anchored quarto-appendix-heading">Footnotes</h2>

<ol>
<li id="fn1"><p><a href="https://github.com/quarto-dev/q2">Q2</a> is a Rust rewrite of Quarto, with enhancements like WASM based rendering and a <a href="https://github.com/quarto-dev/quarto-hub">collaborative editor experience</a> that I am closely monitoring for future use!↩︎</p></li>
<li id="fn2"><p>This site only contains documents I am happy to share with the world – There aren’t any exam questions or answer sheets for class works or assessments, they all live offline. I only host things I’m happy anyone having access to!↩︎</p></li>
</ol>
</section></div> ]]></description>
  <category>MacOS</category>
  <category>Quarto</category>
  <guid>https://ramzi.uk/posts/2026_10_11_quarto_blog.html</guid>
  <pubDate>Sun, 11 Oct 2026 00:00:00 GMT</pubDate>
</item>
<item>
  <title>Why I switched to Quarto for my Lecture Slides</title>
  <dc:creator>George Ramzi</dc:creator>
  <link>https://ramzi.uk/posts/20260601_why_quarto.html</link>
  <description><![CDATA[ 





<p>During my time as a lecturer, I have primarily been a <em>Keynote</em> user. Keynote is pretty nice, the built in visuals are tasteful, and for me I find the outline view an absolute joy to use, <em>especially</em> on iPad<sup>1</sup>.</p>
<p>However, something I have always found a tempting offer is <a href="https://revealjs.com">Reveal.js</a>. In terms of interactivity, Reveal is <em>unparalleled</em>. Your whole presentation being a website that you can customise with CSS and JS, use any libraries you want? As a piece of software, I have always found it <em>intriguing</em>.</p>
<p><strong>However</strong>, there have always been a number of pain points that put me off…</p>
<ol type="1">
<li>I don’t want to author in HTML. Reveal has Markdown support, but honestly it has always felt quite unnatural to me to use. I find myself making a single massive markdown cell, having to break it up arbitrarily to achieve a specific slide layout, or doing a markdown chunk per slide, or sacrificing customisation, and the whole experience feels pretty obtuse.</li>
<li>Whilst HTML might open up a lot of interactivity, I do <em>not</em> have a web background; I don’t particularly like HTML, I find CSS a pain, and JavaScript has long been my least favourite programming language<sup>2</sup>. Whilst JS might open the door to customisation, the learning curve for me in particular would be high.</li>
<li>One of the appeals to me of Reveal.js is being able to demonstrate Python code, something Jupyter allows you to achieve in its editor. However, it depends on having a backend running, which means you lose that interactivity when you publish the slides (Or have to maintain a Jupyter server for potentially hundreds of students to utilise simultaneously).</li>
<li>Frankly, by default, Reveal is pretty <em>ugly</em>. Sorry if you are reading this and you were involved in picking the defaults, but it’s just not my <em>style</em>. To me, Reveal needs a lot of polish to get to a point I’d be happy with.</li>
<li>Laying out slides is not convenient. Obviously something WYSIWYG like Powerpoint and Keynote means that being able to quickly reshape and redesign your slides layouts is incredibly convenient in a way Reveal does not match. Perhaps, again, if I were better with HTML I could alleviate this — But also, if I alleviate this issue with HTML, why am I using Markdown? I don’t want to have to drop to HTML over <em>any and every issue</em>.</li>
</ol>
<p>This is all to say, whilst I love the concept of Reveal, I find it too inconvenient to use <em>directly</em>.</p>
<p>However, I’m always on the lookout for a convenient option or alternative.</p>
<p>For me, as a lecturer, I see a few options:</p>
<ol type="1">
<li>Suck it up — Powerpoint and Keynote are alright.</li>
<li>Reveal.js through Juptyer — Accept that you cannot distribute live slides, but enjoy some very dynamic visualisations; However, also accept some limitations compared to plain Reveal.js</li>
<li>Look at upcoming frameworks like Marimo, which has a presentation framework (which I must experiment with…)</li>
<li>Roll something entirely custom (an experiment for another day…)</li>
<li>A billion different HTML presentation frameworks</li>
<li><em>Quarto</em>.</li>
</ol>
<p>All of these have their own merits. Marimo in particular is very young, and I feel like it’s a real up-and-comping option — Whilst it’s not quite where I’d want it to be to consider it, I am keeping a close eye<sup>3</sup>…</p>
<p>For me, however, when I discovered Quarto, I started to see something powerful enough, flexible enough, and complete enough, that perhaps it might finally be what I had been looking for.</p>
<section id="quarto" class="level1">
<h1>Quarto</h1>
<p>For those unfamiliar with Quarto, it’s worth briefly explaining it.</p>
<p>Quarto is, in essence, a publication framework. In many ways, it can be seen more as a competitor to LaTeX and Juptyer than to Powerpoint — Documents are written in Markdown, can be exported to many formats, allow for referencing, embedding either code or the output of that code (in some languages) directly into your documents, and much more.</p>
<p>Your documents are authored in QMD files — Markdown with a little extra syntax added on top to make documents authoring and typesetting a little nicer. For the most part, QMD is nice enough to interact with; I do find myself having to look up syntax and style classes more than I’d like.</p>
<p>Your Quarto-authored documents are then exported to whichever formats you like, using whatever templates you like with mostly sane defaults:</p>
<ul>
<li>HTML</li>
<li>PDF</li>
<li>Word</li>
<li>Reveal.js</li>
<li>Powerpoint</li>
<li>Beamer</li>
<li>Github Flavoured Markdown</li>
<li>Hugo</li>
<li>Some Wiki formats</li>
<li>Jupyter</li>
</ul>
<p>There a <a href="https://quarto.org/docs/reference/">bunch of formats available</a>, some of which I am barely aware of, some of which you might never need, but some of which make for very tempting offers. However, for me personally, there was only one interesting format — Reveal.js</p>
<p>My main complaint about Reveal.js — The feeling that I need to frequently drop out of Markdown and into HTML to format my slides — is mostly alleviated by Quarto and it’s few syntactic deviations from standard Markdown.</p>
<section id="syntax" class="level2">
<h2 class="anchored" data-anchor-id="syntax">Syntax</h2>
<p>For the most part, Quarto’s syntax is just <em>Markdown</em>.</p>
<p>In a few trivial ways, it differentiates.</p>
<p>For example, you can specify a <code>div</code> and assign any classes to it using:</p>
<pre><code>::: {.cssclass}
content
:::</code></pre>
<p>There’s a number of convenience classes added by default to allow you to layout your document or slides. For example:</p>
<pre><code>::::{.columns}

:::{.column width=45%}
left column’s content
:::

:::{.column width=65%}
right column’s content
:::

::::</code></pre>
<p>There’s also some simple classes such as:</p>
<pre><code>:::{.r-vstack}
First item

Second item
:::</code></pre>
<p>In this syntax, everything placed inside is stacked vertically. You can also use <code>.r-hstack</code> for a horizontal stack. Useful for positioning images.</p>
<p>You can also use <code>.r-stack</code>, where all items inside stack on top of each-other… Again, useful for specific cases in presentations.</p>
<p>Overall, you can achieve most things you would want. There are <em>definitely</em> limitations. If you’re used to a WYSIWYG presentation tool, you’re losing a great deal of positional flexibility — Quickly resizing text boxes, placing images wherever you want, etc.</p>
<p>Personally, I’m happy with the positional compromises — I don’t mind a more restrictive layout (versus a WYSIWYG editor) for an easier time composing my lectures (the same trade-off most academics make when they choose LaTeX).</p>
<p>The final critical piece of syntax is the <code>fragment</code>. In Reveal, a <code>fragment</code> is essentially an <em>animation step</em>. You’re saying “This thing should be added to the list of things to animate” — By default, this animation is just starting hidden and then appearing.</p>
<p>This allows you to do incremental animations, particularly useful for slowly revealing parts of the slide as you present.</p>
<pre><code>Here’s some sample text.

[This text starts hidden, then appears!]{.fragment}

:::{.fragment}
This line will appear…

and this line will also appear at the same time!

Reveal will treat this all as one big chunk, even though it occupies multiple lines!
:::

:::{.incremental}
- This will appear first
- Then when you progress the slide this will appear second
- And finally this will appear third when you progress the slide again!
:::</code></pre>
<p>The <code>fragment</code> system is the underpinning of most animations in Reveal.</p>
</section>
<section id="embedding-and-presenting-code" class="level2">
<h2 class="anchored" data-anchor-id="embedding-and-presenting-code">Embedding and Presenting Code</h2>
<p>A particular highlight for me with regard to Quarto is its ability to render, highlight, and demonstrate code blocks in a file.</p>
<p>Reveal is already excellent at rendering code blocks, but the syntax for doing this in Quarto feels very natural. For example, last term I demonstrated a lot of Java code, so I could just add a code block, specify it was Java, and get pretty clean syntax highlighting:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb5" style="background: #f1f3f5;"><pre class="sourceCode java code-with-copy"><code class="sourceCode java"><span id="cb5-1"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">public</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">static</span> Optional<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">Integer</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">parseAge</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">String</span> input<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span></span>
<span id="cb5-2">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>input <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">null</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> Optional<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">empty</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">();</span></span>
<span id="cb5-3">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">try</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span></span>
<span id="cb5-4">        <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">int</span> age <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">Integer</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">parseInt</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>input<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">);</span></span>
<span id="cb5-5">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>age <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">||</span> age <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">150</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> Optional<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">empty</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">();</span></span>
<span id="cb5-6">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> Optional<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">of</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>age<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">);</span></span>
<span id="cb5-7">    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">catch</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">NumberFormatException</span> e<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span></span>
<span id="cb5-8">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> Optional<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">empty</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">();</span></span>
<span id="cb5-9">    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span></span>
<span id="cb5-10"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span></span></code></pre></div></div>
<p>You are able to not just demonstrate code, but make Quarto highlight individual lines of the code cell as a <em>fragment</em>, so when demonstrating code you can step through at your own pace as you present.</p>
<p>However, this goes a beyond just <em>demonstrating</em> code. Quarto is also happy <em>executing code</em> in your document, and embedding the output <em>directly into your slide!</em>. As someone who has spent a lot of time teaching Machine Learning concepts, this really excites me! I could write some Python code to demonstrate convolution, have it output a <code>matplotlib</code> figure as a <code>.gif</code>, and have that embed directly into my slides! In previous years, to demonstrate convolution, I have written the code to perform convolution, manually screenshot the outputs, and added them to my Keynote slides. It’s now entirely possible I could build something fully integrated into my slide. Awesome!</p>
<p>There’s support for a number of languages: Python, R, Julia, and JS with Observable. Each has their own quirks, but overall you can achieve a <em>lot</em> of very cool things<sup>4</sup>.</p>
</section>
<section id="plugins" class="level2">
<h2 class="anchored" data-anchor-id="plugins">Plugins</h2>
<p>This is where Quarto with Reveal.js starts paying off — The plugin ecosystem.</p>
<p>By default, Reveal is a fairly simple presentation framework, but with Plugins it can be extended to do much more. For example, there are a number of built-in plugins, such as the RevealMarkdown plugin that provides the markdown experience I mentioned earlier, RevealHighlight which provides syntax highlighting for code blocks, and RevealMaths which provides LaTeX maths support.</p>
<p>There are loads of really cool plugins. The reality is, when your entire presentation is a website, you get access to all the power of Javascript and can do some crazy things.</p>
<p>For example, I have a custom Reveal.js plugin with some Quarto magic attached called DAGraph — A plugin for rendering any <em>directed acyclic graph</em>, along with highlighting and annotating the graph, in an entirely declarative manner; For me, this allows me to achieve something I’ve long attempted to emulate before with <em>painstaking manual animations in Keynote</em>, visualising a git graph alongside the relevant commands in a git lecture.</p>
<p>A personal favourite of mine for lectures is Reveal’s <a href="https://github.com/reveal/multiplex">multiplex plugin</a>, which means that anyone viewing your presentation has their copy of the slides synchronised with yours; Any students in the audience can have a copy of the slides open on their laptops, and see exactly what’s on the projector. Both very useful for seeing the content more clearly (especially in large lecture theatres), and a really cool <em>thing</em> to show off to students.</p>
<p>Quarto has another layer of plugins on-top of Reveal, allowing for simplified authoring. If a Reveal plugin depended on you writing raw HTML, you might instead have a Quarto plugin implement a script in Lua that converts a simplified syntax into Reveal’s expected syntax. Personally, I find this highly compelling — I really do not want to have to write raw HTML when I’m authoring a presentation.</p>
<p>Reveal plugins unlock a lot of power through Javascript and access to JS libraries, and Quarto’s filters make utilising these libraries far simpler. The combination is honestly shockingly compelling…</p>
</section>
<section id="theming" class="level2">
<h2 class="anchored" data-anchor-id="theming">Theming</h2>
<p>Personally a slight pain-point for me with Reveal.js, as mentioned earlier, is that at the end of the day you have to embrace some <em>web tech</em>. For me, this means accepting that I have to write <code>CSS</code>…</p>
<p>Reveal.js slides are web pages. Just like any web page, you can style it with CSS. If you’re familiar with CSS, this will feel extremely comfortable and familiar, and I’m sure you can achieve a lot of amazing things really easily.</p>
<p>I am not.</p>
<p>I hate CSS.</p>
<p>I have tried my best to make my slides look pretty, but I’m no CSS wizard. I’m sure the web-devs of the world can achieve some excellent things — for me, I’m just happy with my slides looking good enough.</p>
<p>I do occasionally use some simple CSS to achieve some nice designs — Decorating boxes, highlighting text, doing some interesting visuals. Perhaps I’ll demonstrate some fun things in another post.</p>
</section>
<section id="workflow" class="level2">
<h2 class="anchored" data-anchor-id="workflow">Workflow</h2>
<p>For me, one of the nicest parts of using Quarto is the simple fact that <em>everything is a plaintext</em>.</p>
<p>My slides exist in a git repo. When I’m happy with a slide, I push it to my remote. On the remote, my CI compiles all my slides, and if the compilation succeeds all the slides are <code>rsync</code>’d to my server. For convenience for me, I have it also populate a sitemap of sorts that lets me find all my presentations so I can share and upload links to the slides.</p>
<p>All of this is entirely automated. I also have a modestly customised Docker image with Quarto and some extra Python dependencies, meaning my CI can simply use this image and cutting my build time down to about 40 seconds. When I send a commit, it’s compiled and uploaded to my server in about 2 minutes total.</p>
<p>If I’ve already uploaded a URL to my slides, notice a minor change, and want to quickly fix it, I can simply edit, commit, and get on with my life.</p>
<p><strong>However</strong>, I will note that actually, I also upload a PDF of my slides for accessibility to our University’s Moodle, and this <em>does not automatically update</em>. So, for now, the workflow is not <em>fully</em> automated. Suggestions are welcome<sup>5</sup>.</p>
<p>I should also note that, personally, I have always valued the fact that in Keynote, if I wanted to sit on the sofa with my iPad, or take an iPad to a cafe and type up some thoughts, I could do that. I’ve always enjoyed the flexibility in being able to simply take an iPad and go somewhere comfortable and still feel highly productive.</p>
<p>For Quarto, whilst there are some janky workarounds, for the most part on an iPad you can write the raw QMD, but you cannot render the output and examine it. This means it’s perfectly capable when you’re simply typing up your content, but when you actually want to typeset and layout your slides, then you need a device capable of running the Quarto binary and Pandoc. I might investigate a janky workaround, or possibly even a <em>non-janky</em> workaround, but that’ll be a story for another time.</p>
</section>
<section id="thoughts" class="level2">
<h2 class="anchored" data-anchor-id="thoughts">Thoughts</h2>
<p>I won’t lie, a big part of why I’m even writing this article is that Quarto… kind of caught me off guard?</p>
<p>I had tried many tools, including an experiment with using Reveal.js directly, and nothing ever really <em>clicked</em> in the same way that Keynote does. A simple WYSIWYG editor will always have that advantage of just feeling more <em>clean</em> and <em>organic</em>. The workflow is clear.</p>
<p>Reveal.js simply doesn’t have that, and the effort of styling a slide makes the work of building a full slide deck just too tedious for me.</p>
<p>Quarto hit that really rare, spectacular <em><strong>sweet spot</strong></em> for me — writing feels incredibly natural, once you’re familiar laying out slides feels natural, and the nature of essentially plain-text slides makes authoring feel as natural as Keynote’s outline mode I covet so much; If anything, it’s superior because I can also layout my slides!</p>
<p>Quarto really walks that line for me where I can author slides in plain text like LaTeX, but get something far more interesting and dynamic out the other side. For me, that combination makes it extremely compelling.</p>
<p>Personally, now I have invested the time into Quarto and getting my publishing workflow into a place I’m happy with, I don’t see myself changing to anything else any time soon. I think Quarto has nailed exactly what I was looking for all along.</p>
<hr>
<p>One particular treat with Quarto and Reveal comes from it’s plain-text, web stack underpinnings — With the right knowledge, you can pretty much bend<sup>6</sup> Quarto and Reveal into anything you like. HTML, CSS, and Javascript — whatever you want, with enough time, you can shape and reshape your slides into pretty much anything you want.</p>
<p>In the post-AI world, this suddenly makes Quarto a fundamentally different offering; Now you have both a canvas to paint, and clay to reshape<sup>7</sup>.</p>
<p>In my next post, I’ll discuss some of the ways I’ve found of utilising Quarto with AI to make some much more compelling lecture materials, some of which were simply unachievable before.</p>


</section>
</section>


<div id="quarto-appendix" class="default"><section id="footnotes" class="footnotes footnotes-end-of-document"><h2 class="anchored quarto-appendix-heading">Footnotes</h2>

<ol>
<li id="fn1"><p>I wish the Mac version had the simplified, full-screen experience the iPad has. I honestly find the Mac version pretty finicky and rarely use it.↩︎</p></li>
<li id="fn2"><p>A tight competition with PHP.↩︎</p></li>
<li id="fn3"><p>I have a real love-hate relationship with Python, and the idea of authoring my full lecture slides deck in Marimo is tempting but held back by my issues with Python. It’d still likely need a backend to run on, unless there’s something clever that can be done with Python running under WASM. Hmmmm………↩︎</p></li>
<li id="fn4"><p>This opens you up to <em>literate programming</em>, which is really awesome! Perhaps not so useful for presentations, but excellent for writing research papers.↩︎</p></li>
<li id="fn5"><p>If your suggestion involved Moodle API access, it’s never gonna happen. Don’t ask.↩︎</p></li>
<li id="fn6"><p>However, bend it far enough and it can <em>break</em>…↩︎</p></li>
<li id="fn7"><p>All of these changes were achievable before AI, but the upfront cost was often too high to justify. AI lowers that cost significantly, if you’re open to exploration.↩︎</p></li>
</ol>
</section></div> ]]></description>
  <category>Teaching</category>
  <category>RevealJS</category>
  <category>Quarto</category>
  <guid>https://ramzi.uk/posts/20260601_why_quarto.html</guid>
  <pubDate>Mon, 01 Jun 2026 00:00:00 GMT</pubDate>
</item>
<item>
  <title>AI in Education - Quarto, Reveal, and interactive presentations</title>
  <dc:creator>George Ramzi</dc:creator>
  <link>https://ramzi.uk/posts/20260518_ai_revealjs.html</link>
  <description><![CDATA[ 





<p>During my time as a lecturer, I have primarily been a <em>Keynote</em> user. Keynote is pretty nice, the built in visuals are tasteful, and for me I find the outline view an absolute joy to use, <em>especially</em> on iPad<sup>1</sup></p>
<p>However, something I have always found a tempting offer is <a href="https://revealjs.com">Reveal.js</a>. In terms of interactivity, Reveal is <em>unparalleled</em>. As a piece of software, I have always found it <em>intriguing</em>.</p>
<p><strong>However</strong>, there have always been a number of pain points that put me off…</p>
<ol type="1">
<li>I don’t want to author in HTML. Reveal has Markdown support, but honestly it has always felt quite unnatural to me to use. I find myself making a single massive markdown cell, having to break it up arbitrarily to achieve a specific slide layout, or doing a markdown chunk per slide, or sacrificing customisation, and the whole experience feels pretty obtuse.</li>
<li>Whilst HTML might open up a lot of interactivity, I do <em>not</em> have a web background; I don’t particularly like HTML, I find CSS a pain, and JavaScript has long been my least favourite programming language<sup>2</sup>. Whilst JS might open the door to customisation, the learning curve for me in particular would be high.</li>
<li>One of the appeals to me of Reveal.js is being able to demonstrate Python code, something Jupyter allows you to achieve in its editor. However, it depends on having a backend running, which means you lose that interactivity when you publish the slides (Or have to maintain a Jupyter server for potentially hundreds of students to utilise simultaneously).</li>
<li>Frankly, by default, Reveal is pretty <em>ugly</em>. Sorry if you are reading this and you were involved in picking the defaults, but it’s just not my <em>style</em>. To me, Reveal needs a lot of polish to get to a point I’d be happy with.</li>
<li>Laying out slides is not convenient. Obviously something WYSIWYG like Powerpoint and Keynote means that being able to quickly reshape and redesign your slides layouts is incredibly convenient in a way Reveal does not match. Perhaps, again, if I were better with HTML I could alleviate this — But also, if I alleviate this issue with HTML, why am I using Markdown? I don’t want to have to drop to HTML over <em>any and every issue</em>.</li>
</ol>
<p>This is all to say, whilst I love the concept of Reveal, I find it too inconvenient to use <em>directly</em>.</p>
<p>However, I’m always on the lookout for a convenient option or alternative.</p>
<p>For me, as a lecturer, I see a few options:</p>
<ol type="1">
<li>Suck it up — Powerpoint and Keynote are alright.</li>
<li>Reveal.js through Juptyer — Accept that you cannot distribute live slides, but enjoy some very dynamic visualisations; However, also accept some limitations compared to plain Reveal.js</li>
<li>Look at upcoming frameworks like Marimo, which has a presentation framework (which I must experiment with…)</li>
<li>Roll something entirely custom (an experiment for another day…)</li>
<li>A billion different HTML presentation frameworks</li>
<li><em>Quarto</em>.</li>
</ol>
<p>All of these have their own merits. Marimo in particular is very young, and I feel like it’s a real up-and-comping option — Whilst it’s not quite where I’d want it to be to consider it, I am keeping a close eye…</p>
<p>For me, however, when I discovered Quarto, I started to see something powerful enough, flexible enough, and complete enough, that perhaps it might finally be what I had been looking for.</p>
<section id="quarto" class="level1">
<h1>Quarto</h1>
<p>For those unfamiliar with Quarto, it’s worth briefly explaining it.</p>
<p>Quarto is, in essence, a publication framework. In many ways, it can be seen more as a competitor to LaTeX and Juptyer than to Powerpoint — Documents are written in Markdown, can be exported to many formats, allow for referencing, embedding either code or the output of that code (in some languages) directly into your documents, and much more.</p>
<p>Your documents are authored in QMD files — Markdown with a little extra syntax added on top to make documents authoring and typesetting a little nicer. For the most part, QMD is nice enough to interact with; I do find myself having to look up syntax and style classes more than I’d like.</p>
<p>Your Quarto-authored documents are then exported to whichever formats you like, using whatever templates you like with mostly sane defaults:</p>
<ul>
<li>HTML</li>
<li>PDF</li>
<li>Word</li>
<li>Reveal.js</li>
<li>Powerpoint</li>
<li>Beamer</li>
<li>Github Flavoured Markdown</li>
<li>Hugo</li>
<li>Some Wiki formats</li>
<li>Jupyter</li>
</ul>
<p>There a <a href="https://quarto.org/docs/reference/">bunch of formats available</a>, some of which I am barely aware of, some of which you might never need, but some of which make for very tempting offers. However, for me personally, there was only one interesting format — Reveal.js</p>
<p>My main complaint about Reveal.js — The feeling that I need to frequently drop out of Markdown and into HTML to format my slides — is mostly alleviated by Quarto and it’s few syntactic deviations from standard Markdown.</p>
<section id="syntax" class="level2">
<h2 class="anchored" data-anchor-id="syntax">Syntax</h2>
<p>For the most part, Quarto’s syntax is just <em>Markdown</em>.</p>
<p>In a few trivial ways, it differentiates.</p>
<p>For example, you can specify a <code>div</code> and assign any classes to it using:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode markdown code-with-copy"><code class="sourceCode markdown"><span id="cb1-1">::: {.cssclass}</span>
<span id="cb1-2">content</span>
<span id="cb1-3">:::</span></code></pre></div></div>
<p>There’s a number of convenience classes added by default to allow you to layout your document or slides. For example:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb2" style="background: #f1f3f5;"><pre class="sourceCode markdown code-with-copy"><code class="sourceCode markdown"><span id="cb2-1">::::{.columns}</span>
<span id="cb2-2"></span>
<span id="cb2-3">:::{.column width=45%}</span>
<span id="cb2-4">left column’s content</span>
<span id="cb2-5">:::</span>
<span id="cb2-6"></span>
<span id="cb2-7">:::{.column width=65%}</span>
<span id="cb2-8">right column’s content</span>
<span id="cb2-9">:::</span>
<span id="cb2-10"></span>
<span id="cb2-11">::::</span></code></pre></div></div>
<p>There’s also some simple classes such as:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode markdown code-with-copy"><code class="sourceCode markdown"><span id="cb3-1">:::{.r-vstack}</span>
<span id="cb3-2">First item</span>
<span id="cb3-3"></span>
<span id="cb3-4">Second item</span>
<span id="cb3-5">:::</span></code></pre></div></div>
<p>In this syntax, everything placed inside is stacked vertically. You can also use <code>.r-hstack</code> for a horizontal stack. Useful for positioning images.</p>
<p>You can also use <code>.r-stack</code>, where all items inside stack on top of each-other… Again, useful for specific cases in presentations.</p>
<p>Overall, you can achieve most things you would want. There are <em>definitely</em> limitations. If you’re used to a WYSIWYG presentation tool, you’re loosing a great deal of positional flexibility — Quickly resizing text boxes, placing images wherever you want, etc.</p>
<p>Personally, I’m happy with the positional compromises — I don’t mind a more restrictive layout (versus a WYSIWYG editor) for an easier time composing my lectures (the same trade-off most academics make when they choose LaTeX).</p>
<p>The final critical piece of syntax is the <code>fragment</code>. In Reveal, a <code>fragment</code> is essentially an <em>animation step</em>. You’re saying “This thing should be added to the list of things to animate” — By default, this animation is just starting hidden and then appearing.</p>
<p>This allows you to do incremental animations, particularly useful for slowly revealing parts of the slide as you present.</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb4" style="background: #f1f3f5;"><pre class="sourceCode markdown code-with-copy"><code class="sourceCode markdown"><span id="cb4-1">Here’s some sample text.</span>
<span id="cb4-2"></span>
<span id="cb4-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">[</span><span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">This text starts hidden, then appears!</span><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">]</span>{.fragment}</span>
<span id="cb4-4"></span>
<span id="cb4-5">:::{.fragment}</span>
<span id="cb4-6">This line will appear…</span>
<span id="cb4-7"></span>
<span id="cb4-8">and this line will also appear at the same time!</span>
<span id="cb4-9"></span>
<span id="cb4-10">Reveal will treat this all as one big chunk, even though it occupies multiple lines!</span>
<span id="cb4-11">:::</span>
<span id="cb4-12"></span>
<span id="cb4-13">:::{.incremental}</span>
<span id="cb4-14"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">- </span>This will appear first</span>
<span id="cb4-15"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">- </span>Then when you progress the slide this will appear second</span>
<span id="cb4-16"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">- </span>And finally this will appear third when you progress the slide again!</span>
<span id="cb4-17">:::</span></code></pre></div></div>
<p>The <code>fragment</code> system is the underpinning of most animations in Reveal.</p>
</section>
<section id="embedding-and-presenting-code" class="level2">
<h2 class="anchored" data-anchor-id="embedding-and-presenting-code">Embedding and Presenting Code</h2>
<p>A particular highlight for me with regard to Quarto is its ability to render, highlight, and demonstrate code blocks in a file.</p>
<p>Reveal is already excellent at rendering code blocks, but the syntax for doing this in Quarto feels very natural.</p>
<p>++ TODO: Rewrite this code blocks</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb5" style="background: #f1f3f5;"><pre class="sourceCode numberSource python number-lines code-with-copy"><code class="sourceCode python"><span id="cb5-1"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> numpy <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> np</span>
<span id="cb5-2"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> matplotlib.pyplot <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> plt</span>
<span id="cb5-3"></span>
<span id="cb5-4">r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.arange(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01</span>)</span>
<span id="cb5-5">theta <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.pi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> r</span>
<span id="cb5-6">fig, ax <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> plt.subplots(subplot_kw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>{‘projection’: ‘polar’})</span>
<span id="cb5-7">ax.plot(theta, r)</span>
<span id="cb5-8">ax.set_rticks([<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>])</span>
<span id="cb5-9">ax.grid(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb5-10">plt.show()</span></code></pre></div></div>
<p>You are able to not just demonstrate code, but make Quarto highlight individual lines of the code cell as a <em>fragment</em>, so when demonstrating code you can step through at your own pace as you present.</p>
</section>
<section id="computation-and-literate-programming" class="level2">
<h2 class="anchored" data-anchor-id="computation-and-literate-programming">Computation and Literate Programming</h2>
<p>Another excellent feature of Quarto is its ability to execute inline code. This means that not only can you demonstrate code, you can</p>
<p>Talk about using Reveal.js with Quarto, creating plugins, specifically DAGraph.</p>


</section>
</section>


<div id="quarto-appendix" class="default"><section id="footnotes" class="footnotes footnotes-end-of-document"><h2 class="anchored quarto-appendix-heading">Footnotes</h2>

<ol>
<li id="fn1"><p>I wish the Mac version had the simplified, full-screen experience the iPad has.↩︎</p></li>
<li id="fn2"><p>A tight competition with PHP.↩︎</p></li>
</ol>
</section></div> ]]></description>
  <category>Teaching</category>
  <category>AI</category>
  <category>RevealJS</category>
  <category>Quarto</category>
  <guid>https://ramzi.uk/posts/20260518_ai_revealjs.html</guid>
  <pubDate>Mon, 18 May 2026 00:00:00 GMT</pubDate>
</item>
<item>
  <title>AI in Education - Lecturing</title>
  <dc:creator>George Ramzi</dc:creator>
  <link>https://ramzi.uk/posts/20260307_ai_lecturing.html</link>
  <description><![CDATA[ 





<p>Since ChatGPT’s launch in 2022, being an academic involved in marking has steadily become a more painful experience. It’s quite hard sometimes pouring your energy into a module, into an assessment, and into marking, only to stumble across another report that is from a student you’ve never seen and you may never see again, who’s written a report that seems clearly written by an AI with no real understanding of your content, but in a way which you cannot prove. Instead, without a smoking gun<sup>1</sup> you have to accept that the student has unprovably cheated and live with the fact they have probably got an unearned first.</p>
<p>And each time, a small part of me chips away.</p>
<p>As I teach a lot of Software Engineering modules, I try to keep up with the advances in AI; A sisyphean task I would not wish upon anyone. However, this results in me often tinkering around with the latest models, the latest tools, and the latest <em>gimmicks</em> in the domain. As a consequence, I find myself paying for a recurring <em>Claude</em> subscription – Both begrudgingly and also because… well, frankly, I get the appeal.</p>
<p>I find AI to be a double edged sword.</p>
<p>On one hand, I find the industry fairly despicable. OpenAI seemingly do not care how you use their model, so long as you keep using it. xAI and Grok, led by the <a href="https://www.theguardian.com/technology/2026/jan/30/elon-musk-epstein-files-island-visits">always awful</a> <a href="https://youtu.be/LpxT9TLGoLI?si=wG_2nq8WbK6o_fJU">Elon Musk</a>, treat AI as a tool for a <a href="https://www.theguardian.com/technology/2026/jan/10/elon-musk-uk-free-speech-x-ban-grok-ai">culture</a> <a href="https://www.bbc.co.uk/news/articles/ce3kqzepp5zo">war</a>, and will happily let you use their AI for pretty much <a href="https://www.nbcnews.com/tech/elon-musk/house-democrats-probe-elon-musk-grok-ai-undressing-x-rcna259589">anything despicable</a> <a href="https://www.bbc.com/news/articles/cgk2lzmm22eo">you can</a> <a href="https://www.theguardian.com/world/2026/jan/12/monday-briefing-how-elon-musks-grok-is-being-used-as-a-tool-for-digital-sexual-abuse">think</a> <a href="https://www.bbc.co.uk/news/articles/cwy875j28k0o">of</a>. I also find it quite unpleasant that these companies were quite happy raiding pretty much all of human art and literature to invent tools to sell the work they stole back to us.</p>
<p>On the other hand, there are a lot of cases where… unfortunately… <em>I do understand the appeal…</em> As a programming tool, they are utterly indispensable. Claude Code as a tool has massively increased the speed of my development process<sup>2</sup>. Being able to ask Claude to find a specific feature, or where a feature could be implemented, in a codebase is very powerful, especially when trying to patch issues in a codebase you’ve never interacted with.</p>
<p>On the secret third other hand, each of these also have their issues – The huge proliferation of these tools is leading to the Linux kernel mailing list becoming unmaintainable, Github crashes 4-40 times a day, and AI may be making us all stupider. This isn’t even discussing the impacts of AI generated imagery, music, and more, all of which have an enormous impact on the same creatives whose work they stole to begin with.</p>
<p>I am conflicted.</p>
<hr>
<p>After some discussions with my coworkers about the burnout from marking yet-another AI authored submission for an assignment, an idea occurred. This idea led to a lecture that, I’ll be honest, only left me more conflicted.</p>
<section id="the-conceit" class="level2">
<h2 class="anchored" data-anchor-id="the-conceit">The conceit</h2>
<p>How would students feel if, instead of submitting AI work to us, we submitted it back to them? If the roles were reversed, how would students feel if their lecturer generated AI work for them?</p>
<p>Instead of writing my final lecture for my module, what if I got AI to do the <em>entire thing?</em></p>
</section>
<section id="how" class="level2">
<h2 class="anchored" data-anchor-id="how">How?</h2>
<p>To make this experiment work, I needed to get Claude to fully generate a lecture that sounds and looks comfortably like <em>me</em>. However, for it to be a fair test, it also needed to be automatic – The more modifications I <em>manually</em> make, the more unfair and inaccurate the test becomes. I needed Claude to make me a fully convincing Powerpoint that looked like I had made it, without me doing almost anything.</p>
<p>I decided to do this on our <em>Computational Creativity</em> module, a module that now naturally has to touch AI a number of times. In this module, we discuss a number of creative processes, and how these have been or could be emulated by computers. For me personally, I wanted to talk both about AI, but also about <em>lecturing</em> and education.</p>
<p>To do this, I used Claude “Cowork”. I gave Cowork access to my folder of lectures for the module, I converted my lecture template from <em>Keynote</em> to <em>Powerpoint</em>, I told Cowork the topics I wanted covered, and I let it do the work.</p>
</section>
<section id="prompts" class="level2">
<h2 class="anchored" data-anchor-id="prompts">Prompts</h2>
<p>I wanted to make sure there was as little human-intervention as possible, so I tried to keep the number of prompts to a minimum. I won’t post all of them, but here is the first prompt I wrote.</p>
<blockquote class="blockquote">
<p>I want to create a new lecture - But I want you to create every single word of it. The point of the lecture is about the power of LLMs, and I want to end the lecture by demonstrating that the entire lecture was, in fact, written by you. HOWEVER, I want it to sound like I wrote it! We need to walk the line where you write it, but it sounds like I wrote it.</p>
<p>I want to discuss the use of LLMs in education - For example, how LLMs and AI in general could allow for customised education, courses targeted at specific people to get them from where they are to where they need to be, directed support helping people understand material when they struggle, and even the ability to create custom lectures for large-group learning. If you have any other idea of topics related to LLMs/AI in education, I’m all ears!</p>
<p>Perhaps the most logical first-step will be planning the sort of content we want to include, before you approach actually writing all the slides?</p>
</blockquote>
<p>There was a small amount of iterating, and some hiccups along the way – The first version proposed was ~40 slides, and each had a sentence; Not my style at all.</p>
</section>
<section id="modifications" class="level2">
<h2 class="anchored" data-anchor-id="modifications">Modifications</h2>
<p>In order to make it fair, I wanted to make as few modifications as possible. I made 2 modifications to the slides:</p>
<ol type="1">
<li>On the title slide, I added the name and module code for the module.</li>
<li>During the reveal slide that reveals the conceit of the lecture, I removed the company name. I didn’t like that Claude has written “Claude by Anthropic” as “its” name.</li>
</ol>
</section>
<section id="presenting" class="level2">
<h2 class="anchored" data-anchor-id="presenting">Presenting</h2>
<p>The final part of this ploy was presenting the slides. However, this is where the results start to become slightly <em>skewed by real life.</em></p>
<p>I studied the slides ahead of the lecture to make sure I felt comfortable with the content, and presented the slides to my cohort.</p>
<hr>
<p>The actual experience of presenting the slides was mostly <em>fine</em>, although presenting it felt like presenting a lecture I knew I was <em>unhappy with.</em> A lecture I know I would’ve liked more time to get right. Not awful, but… <em>fine.</em></p>
<p>The biggest issue was that even with my convincing, the slides were only 16 information-packed slides. Whilst this isn’t impossible to work with, I personally do not want slides so <em>dense</em>.</p>
<p>Each slide had 3-6 bullet points, each of which was a full sentence. Whilst they all covered an interesting topic, they covered the full topic <strong>in one go</strong>. This is ok, but there’s no natural <em>flow</em> to the information being delivered as a result.</p>
<p>The content the model wrote wasn’t bad at all – I can clearly see the potential for this to be transformed into a really solid lecture with some work – but as is, presenting it was an unusual experience.</p>
<p>For the most part, each slide was so dense I almost had to just spend each slide fully discussing a topic[^I note that, in some ways, this does make my experience delivering the content easier, as I don’t need to be particularly careful to setup the next topic – There isn’t a connection between them anyways.], going in-depth where possible.</p>
<p>There were some issues, but for most part, from a presentation aspect, I feel like I did a good presentation using these slides, even if they didn’t truly feel like <em>my voice</em>.</p>
<hr>
<p>At the end of the lecture, I presented a slide.</p>
<blockquote class="blockquote">
<p>Every word of this lecture was written by an LLM.</p>
<p>Specifically, by Claude. I gave it a brief. I reviewed the output.</p>
<p>But I didn’t write it.</p>
</blockquote>
<p>There were some laughs from the students as I revealed what I had done. One student laughed, got her phone out, and took a photo of the slide. For the most part, the immediate reaction of the student was exactly what I had hoped for – Amusement, intrigue, and a bit of interest.</p>
<p>However, I then asked the students how they felt about this?</p>
<p>Could they tell?</p>
<p>Did they feel cheated?</p>
<p>Did this devalue the lecture they had just watched?</p>
<p>Did they feel how we feel when we receive AI-generated submissions?</p>
<p>These were the questions that inspired the lecture, and yet… The results were not what I expected.</p>
<p>The students told me that they honestly did not feel cheated. The reality of lecturing means that, even if I did not write the slides, the last hour of me presenting were still my work, my words, my presentation style, my behaviour, all my quirks and my humour. Whilst some claimed they could tell something was <em>different</em> with the slides, they didn’t know it was AI generated, and the words from my mouth were still, in essence a creative act.</p>
</section>
<section id="reflection" class="level2">
<h2 class="anchored" data-anchor-id="reflection">Reflection</h2>
<p>I won’t lie, these reactions shook me a little bit. The results were not what I expected, and whilst I did assume there would be value from my side of this, I honestly thought students would be more upset by this.</p>
<p>This has changed my mind slightly.</p>
<hr>
<p>I have until now held a pretty <em>anti-AI</em> stance when it came to lecturing. Whilst I used AI for programming, and sometimes for workshopping ideas of planning outlines, for the most part I have maintained that every word in my slides should be mine.</p>
<p>I don’t see this changing. Whilst I feel less stringently about this than I did a week ago, I find the process of presenting words I did not write extremely painful.</p>
<p>I have in the past adapted a coworker’s slides to deliver a lecture. In the process of doing this, I have <em>always</em> typed their slides into my own words. This was partly so I would present work that <em>feels</em> like it belongs with the rest of my slides – But honestly, it was also about learning the material! The process of typing up the slides myself felt like an educational experience, it familiarised me with the content I was delivering, and I always felt more confident presenting slides when I had written the slide myself.</p>
<p>I find myself increasingly conflicted. Students found the lecture compelling, and did not feel robbed or cheated by my <em>active deception</em>.</p>
<p>At the same time, <em><strong>I feel like I have robbed them of my work, and robbed myself of my voice</strong></em>.</p>
<p>Claude did an adequate job of writing slides, which overall show potential to become a good lecture but need some work. I did no work writing slides, and presented content I did not write and I feel do not sound like <em>me</em>.</p>
<p>I feel like this has the scope for misuse – A person less engaged and less honest could generate slides, not fully understand them but parrot enough of the slides to feel informed, and move on with their life. I don’t feel comfortable doing that – I put effort into my work, and want to present something I feel confident about and proud of.</p>
<hr>
<p>In a strange way, I suppose we were all justified in our views.</p>
<p>Students did not feel cheated, as they see the value in the presentation itself. I feel I cheated, as I see the value in the <em>process</em><sup>3</sup>.</p>


</section>


<div id="quarto-appendix" class="default"><section id="footnotes" class="footnotes footnotes-end-of-document"><h2 class="anchored quarto-appendix-heading">Footnotes</h2>

<ol>
<li id="fn1"><p>The finding of which might be the best feeling in the world↩︎</p></li>
<li id="fn2"><p>And often usually increased technical debt substantially. Slight deal with the devil…↩︎</p></li>
<li id="fn3"><p>Just in case it needs saying, this post was entirely my own words. Other than the quote from the presentation Claude wrote, I authored this entire post.↩︎</p></li>
</ol>
</section></div> ]]></description>
  <category>Teaching</category>
  <category>AI</category>
  <category>Claude</category>
  <guid>https://ramzi.uk/posts/20260307_ai_lecturing.html</guid>
  <pubDate>Sat, 07 Mar 2026 00:00:00 GMT</pubDate>
</item>
<item>
  <title>Ridiculous Automation - iTerm2</title>
  <dc:creator>George Ramzi</dc:creator>
  <link>https://ramzi.uk/posts/20221217_iTerm2_automation.html</link>
  <description><![CDATA[ 





<p>I love automation. Why spend 20 seconds doing a task when I can spend half an hour automating it?</p>
<p>For my research, I depend on Jupyter. Specifically, I run a private Jupyter server on a server at the University. To access it, I need to forward a port from the remote server to my Mac, which is just a single command.</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb1-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ssh</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-NL</span> 8081:localhost:8081 username@server.com</span></code></pre></div></div>
<p>I also then “Bury” the session, which in iTerm2 simply hides the terminal completely. Buried sessions don’t appear in the dock, or in mission control.</p>
<p>For convenience, I have a snippet set up in iTerm which will input the forwarding command for me.</p>
<ul>
<li>So, I hit <code>⌘-Space</code>, type “iTerm”, hit enter.</li>
<li>Then, I press <code>⇧⌘/</code>, type “SSH”, hit enter.</li>
<li>Finally, I hit <code>⇧⌘/</code> again, type “bury”, and hit enter again.</li>
</ul>
<p>That is a total of 20 keypresses! Simply not good enough.</p>
<p>There must be a way I can make this happen more simply. Maybe Shortcuts? (Terrible name BTW) No, iTerm2 doesn’t support Shortcuts (which is a real shame!). Maybe AppleScript? Well, iTerm2 does have AppleScript support, but apparently <a href="https://iterm2.com/documentation-scripting.html">it’s deprecated</a>. However, that webpage mentions Python scripting? Wait, <em>Python?</em>.</p>
<section id="iterm2" class="level2">
<h2 class="anchored" data-anchor-id="iterm2">iTerm2</h2>
<p>iTerm2 has integrated <a href="https://iterm2.com/python-api/">Python scripting</a>! The amount of elements exposed seems quite impressive, although admittedly I’ve only examined a little slither of it so far! Here’s a list of the objects it exposes:</p>
<ul>
<li>Alert</li>
<li>App</li>
<li>Arrangement</li>
<li>Broadcast</li>
<li>Color</li>
<li>Color Presets</li>
<li>Custom Control Sequences</li>
<li>Connection</li>
<li>Focus</li>
<li>Keyboard</li>
<li>Life Cycle</li>
<li>Main Menu</li>
<li>Preferences</li>
<li>Profile</li>
<li>Prompt</li>
<li>Registration</li>
<li>Screen</li>
<li>Selection</li>
<li>Session</li>
<li>Status Bar</li>
<li>Tab</li>
<li>Tmux</li>
<li>Tool</li>
<li>Transaction</li>
<li>Utilities</li>
<li>Variables</li>
<li>Window</li>
</ul>
<p>Although, I think from my little experience, there’s actually even more objects available that are returned from some functions. Anyways, I had a very simple plan: I needed to create a window, run a command, then bury that window. Thankfully, there are some example scripts I could dissect.</p>
<p>When you first create a script, iTerm asks what kind of script you would like:</p>
<ul>
<li><p>Basic A script with no external dependencies, just iTerm2 and basic Python libraries</p></li>
<li><p>Full Environment A script with access to external Python libraries and dependencies.</p></li>
</ul>
<p>Here, I clearly needed a Basic script.</p>
<p>Next, you are asked how you would like your script to run:</p>
<ul>
<li><p>Simple A single, one shot script.</p></li>
<li><p>Long-Running Daemon A constantly running daemon script.</p></li>
</ul>
<p>So I chose one shot.</p>
<p>Below is the script I ended up with:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb2" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb2-1"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> iterm2</span>
<span id="cb2-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># This script was created with the "basic" environment which does not support adding dependencies</span></span>
<span id="cb2-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># with pip.</span></span>
<span id="cb2-4"></span>
<span id="cb2-5"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">async</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> main(connection):</span>
<span id="cb2-6">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Your code goes here. Here's a bit of example code that adds a tab to the current window:</span></span>
<span id="cb2-7">    app <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">await</span> iterm2.async_get_app(connection)</span>
<span id="cb2-8">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">await</span> iterm2.Window.async_create(connection, command<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ssh -NL 8081:localhost:8081 username@server.com"</span>)</span>
<span id="cb2-9">    window <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> app.current_terminal_window</span>
<span id="cb2-10"></span>
<span id="cb2-11">    sessions <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> window.current_tab.sessions</span>
<span id="cb2-12">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(sessions) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:</span>
<span id="cb2-13">        sess <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sessions[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb2-14">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">await</span> sess.async_set_name(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"SSH Forwarding"</span>)</span>
<span id="cb2-15">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">await</span> sess.async_set_buried(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb2-16"></span>
<span id="cb2-17">iterm2.run_until_complete(main)</span></code></pre></div></div>
<p>It’s fairly self explanatory (and perhaps not all good practice!).</p>
<p>First, I get access to the app. Next, I create a window with the port forwarding command as the login shell command. Then I get the current window (which should be the one I just created), then get a list of all the “sessions” in that window (which should only be one, as it’s just been made!). I rename the session and bury it, then finally I tell iTerm to run the function. Just like that, done!</p>
<p>All it took was a little bit of code, and the forwarding part is finished! Now I can open iTerm, go to the “Scripts” tab, and select the script.</p>
<p>But wait, that’s still quite a few commands. Lets look back at those commands from earlier</p>
<ul>
<li>Launch iTerm - <code>⌘-Space</code>, type “iTerm”, hit enter.</li>
<li><del>Use the SSH snippet - <code>⇧⌘/</code>, type “SSH”, hit enter.</del></li>
<li><del>Bury the terminal <code>⇧⌘/</code> again, type “bury”, and hit enter again.</del></li>
<li>Use the SSH script - <code>⇧⌘/</code>, type “SSH”, hit enter.</li>
</ul>
<p>Surely we can do better…</p>
</section>
<section id="raycast" class="level2">
<h2 class="anchored" data-anchor-id="raycast">Raycast</h2>
<p>Instead of Spotlight, I use a program called “Raycast”. Raycast is basically a more extensible spotlight with a number of great extensions included by default and a built in store to get new extensions.</p>
<p>As part of that extensibility, I can add scripts as commands to Raycast. And, thankfully, you can execute the iTerm2 scripts you write from the command line (although, you need to be sure to use the Python environment that iTerm created for you).</p>
<p>So, in Raycast I added a script that tells iTerm to execute my script. I then added a shortcut to make it easier to execute quickly, <code>ssh</code>. Now, if I open Raycast and type “ssh” the command appears, and when I hit enter it executes the command!</p>
<p>Now, lets look back at the commands again:</p>
<ul>
<li>Launch iTerm - <code>⌘-Space</code>, type <del>“iTerm”</del> “ssh”, hit enter.</li>
<li><del>Use the SSH script - <code>⇧⌘/</code>, type “SSH”, hit enter.</del></li>
</ul>
</section>
<section id="conclusion" class="level2">
<h2 class="anchored" data-anchor-id="conclusion">Conclusion</h2>
<p>This was alot of work for a very silly reward, but it’s very possible that these skills will be useful in the future for automating other things; although I don’t currently have any ideas of anything else I could automate. Well, at least nothing that could be solved exclusively via the terminal.</p>


</section>

 ]]></description>
  <category>MacOS</category>
  <category>Automation</category>
  <category>Jupyter</category>
  <guid>https://ramzi.uk/posts/20221217_iTerm2_automation.html</guid>
  <pubDate>Sat, 17 Dec 2022 00:00:00 GMT</pubDate>
</item>
<item>
  <title>MacOS from the perspective of a Linux user</title>
  <dc:creator>George Langroudi</dc:creator>
  <link>https://ramzi.uk/posts/20210716_macos_as_a_linux_user.html</link>
  <description><![CDATA[ 





<p>After my last blog post I made the brazen decision to buy a 13” Macbook Pro. This was in retrospect, an incredibly stupid decision; It’s a pretty large purchase in my book. I decided to write this post both to justify the decision to myself, but also to put to (metaphorical) paper my thoughts and the interesting things I noted after making the switch.</p>
<section id="the-interface" class="level2">
<h2 class="anchored" data-anchor-id="the-interface">The Interface</h2>
<p>It’s no suprise to anyone that MacOS is gorgeous. The closest Linux has is KDE, which nails the look but not the UX. MacOS has this nice middle ground between KDE and GNOME.</p>
<p>What I mean by this is that KDE is gorgeous, but building the interface is up to you. As a result of this, alot of things feel disconnected. KDE suffers this alot, where it has a million options and features but most don’t really feel as polished or consistent. GNOME on the other hand has much more consistency. When on Wayland you get gestures that all feel natural and the desktop has a sort of “flow” to it when you use it.</p>
<p>MacOS has the beauty of KDE and the consistency of GNOME, but it does each a little better. The gestures are incredibly natural and comprehensive, and most things work pretty perfectly.</p>
</section>
<section id="the-global-menu" class="level2">
<h2 class="anchored" data-anchor-id="the-global-menu">The Global Menu</h2>
<p>MacOS has a menu bar almost permanently at the top of your screen. This menu bar is, as far as I’m concerned, nearly perfect.</p>
<p>I hate menu bars Usually. badly, when I need something I have to scan through inconsistently labelled menus searching for the button that does the thing I need.</p>
<p>Ubuntu understood this in Unity and created the Ubuntu Dash and a global menu. Like MacOS, you had a menu bar that was always at the top of your screen that integrated with the top panel. In Unity, if you hit the left alt key a small text box would appear at the top of the screen just under the menu bar. This text box was essentially a filter for the contents of every section of the menu. Now, I didn’t need to remember every single menu’s contents, I could simply search it to instantly find what I wanted.</p>
<p>One of the first things I notice was that in MacOS the menu bar always has a “Help” option. Clicking this will usually show you specific help information about whatever app you are using, but there’s also a search box. It turns out that this search box works exactly like Ubuntu’s dash!</p>
<p>The dash was one of my favourite features of Unity and I miss it immensely. There was only one issue with the dash, which was that not every app functioned; Canonical put a great deal of effort into fixing this but it was never perfect, especially with third party apps.n It turns out, MacOS has had this feature for years! By pressing ⇧⌘/ this search bar just appears in basically every app (more on the 1 exception I’ve found later).</p>
<p>Now this is all absolutely wonderful, but Apple take it a couple of steps further. First, by selecting an item it highlights where in the menu you can find it, which is helpful to find it later if you need to (although I would just search for it every time). Also, because it highlights each item’s location in the menu, you get to see if a command has a shortcut key you can use in the future! I cannot properly explain how much I love this.</p>
<p>Some apps use the menu bar in really great ways. One of these apps is iTerm2, which includes your snippets and profiles! I can save whatever commands I want and really conveniently search for them instantly! As an example, I frequently use a command to forward a specific port from a server to my local computer while using Jupyter. I can simple press ⇧⌘/, type “forw” and the command “Snippets &gt; Port Forwarding” appears. I press enter and the command appears in my terminal. This helps alleviate the fact that, much like KDE, the densely filled menu bars are unwieldly and searching through them hard. It is helpful to be able to scan through them to get an idea of the features an app has, but some dense apps (like iTerm) overwhelm you with menu options and giant multi-layered preference windows. Regardless, being able to search helps me quickly find if a feature is there (so long as it is labelled correctly), or quickly use an action that I know exists but haven’t yet remembered the hotkey for.</p>
<p>But wait, that’s not all! As if they read my mind, you can NAVIGATE THE ENTIRE MENU BAR WITH EMACS KEYS! When I found this out it BLEW MY MIND! I STILL cannot believe it works! I can hit ⇧⌘/, type something, then press This, almost singlehandedly, makes me happy I made the switch; it truly changes how I interact with my computer. Speaking of which…</p>
</section>
<section id="keybindings" class="level2">
<h2 class="anchored" data-anchor-id="keybindings">Keybindings</h2>
<p>This one is a mixed bag for me. As a Linux user, I’ve basically used a Windows keyboard for my entire life. Switching to the Mac keyboard on it’s own is it’s own learning curve. Throw in the alien keybindings and I’ve now got 2 different things to get used to. This is something I’m sure will come more naturally with time, but it’s still going to be a task.</p>
<p>First things first, Super and Meta are swapped. This has been the single most annoying problem I’ve had in general usage. When using Emacs in particular all my muscle memory is a little wrong and I’m constantly making mistakes. However, it’s not juse Emacs; simple actions like copy and paste are different as they don’t use Control, they use Command. In fact, I’m still struggling to get used to the separation of Command and Control. I think I get the general idea with Command issuing commands and control usually being responsible for things like navigation, but it’s another thing to get used to.</p>
<p>As I mentioned earlier, there’s 1 huge feature for me which is that there’s loads of Emacs keybindings all over the OS.</p>
<ul>
<li>Control + A/E jumps to the start/end of the line/entry</li>
<li>Control + K deletes the rest of the line</li>
<li>Control + P/N moves up or down a line</li>
<li>Control + F/B moves the cursor forwards/backwardpps</li>
</ul>
<p>I still have a number of keybindings to learn, and some make more sense than others (screenshot is ⇧⌘3 or ⇧⌘4 for screenshot region???), but having Emacs keys does make this a little easier.</p>
</section>
<section id="emacs-on-macos-is-awkward" class="level2">
<h2 class="anchored" data-anchor-id="emacs-on-macos-is-awkward">Emacs on MacOS is awkward</h2>
<p>I know that one of the first thing any developer should do when setting up a Mac is to install <a href="https://brew.sh/">homebrew</a>. After installing homebrew I install the other critical application, Emacs!</p>
<p>First thing I noticed, the (let’s be honest, useless) toolbar integrates with the window controls like most other MacOS apps. Nice! Although I immediately disable this because tool-bar-mode is useless.</p>
<p>Unfortunately Emacs on MacOS isn’t simply install and run, a few things are broken. First, all the icons are janky. I found out that there’s a non-interactive function you can call with <code>M-: (all-the-icons-install-fonts)</code>. Thankfully, I remembered this function exists already so just checked it was installed and called it with <code>M-x</code> and my problems were solved.</p>
<p>Next, accessing your Document’s does not work. You can press ⌘O gives you a file dialog that does let you access your Documents folder, but <code>C-x C-f</code> does not show any files inside your Documents. It turns out, to fix this you need to give full file system access to both Emacs and /usr/bin/ruby? I don’t know why it works, but it does work.</p>
<p>Overall, the experience has had a couple of inconveniences, but after solving these problems it works pretty well. System keybindings do not work at all when viewing an Emacs window, so you cannot switch workspaces with the keyboard or use that lovely ⇧⌘/ keybinding I mentioned earlier. I haven’t set up mu4e, and probably will not; Mail is already pretty nice and enough for my meager mail needs, plus it syncs well enough across devices. Setting up LSP language servers was a little annoying, as just using <code>M-x lsp-install-servers</code> doesn’t seem to play nice. However, installing the LSP server manually through pip (for python-lsp-server[all]), activating that environment with conda, and selecting the server with <code>+lsp/switch-client</code> seems to work perfectly fine. Perhaps with some clever <code>.dir-locals.el</code> trickery I could automate this, but I’m not super confident using <code>.dir-locals.el</code> to do that sort of thing. I just have to set it up once per session. For now, it’s good enough.</p>
<p>There’s also Mitsuharu Emacs. This is a well updated fork of Emacs (at time of writing, 27.2) with a few extra MacOS tweaks to make everything feel a little nicer. However, even this fork is not without it’s problems. The biggest issue I have with it is that it overwrites the tab-bar keybindings to use MacOS native tabs. This should actually be a good thing! Native MacOS tabs are nice. They’re a little larger than tab-bar-mode’s tabs, but they allow you to separate tabs into their own windows and back again. However, this functionality does not seem to work for me. <code>C-&lt;tab&gt;</code> will show the tab-bar along with a plus button to create a new tab, but pressing this would simply create a new frame. I once managed some strange elisp incantation to make it work, but I only wrote down the command I thought fixed it which turns out was not enough.</p>
<p>After writing that sentence, I spent half an hour trying to figure out the issue. Turns out it’s <em>something</em> Doom Emacs does. After looking at what settings Doom changes relating to the window, I accidentally discovered that the issue was…… <code>menu-bar-mode</code>! Doom disables <code>menu-bar-mode</code>. <u>I</u> would too, I’m on MacOS. If <code>menu-bar-mode</code> is nil, you still have your menu bar in the… menu… bar… the global menu at the top of the screen. Well, turns out that setting it to <code>t</code>, even though it does nothing visually, magically makes tabs work. Incredibly annoying, bizarre, and stupid, but it’s resolved and I now have working native tabs.</p>
</section>
<section id="bluetooth-codecs-shouldn-t-be-this-annoying" class="level2">
<h2 class="anchored" data-anchor-id="bluetooth-codecs-shouldn-t-be-this-annoying">Bluetooth codecs shouldn’t be this annoying</h2>
<p>I use a pair of Sony WF-1000MX3 earphones. These have a pair of built in microphones that can be used when taking phone calls which is nice. However, for some reason when using the microphone the audio quality drops dramatically.</p>
<p>On Linux and GNOME I can use system settings to explicity tell my OS not to use these earphones as a microphone, and then I can tell it not to use the awful “headset” codec and use the high quality AAC codec instead. MacOS, no such luck. When using my earphones the second I activate the microphone (i.e.&nbsp;I accidentally select the dictation page in settings) suddenly my audio quality drops dramatically.</p>
<p>When I first connected my earphones, my sound quality was absolutely terrible until I rebooted. Before rebooting I tried to debug it as I thought it would be permanent. A number of guides out there suggest downloading the XCode developer tools (which is an incredibly stupid workaround) and using a bluetooth utility to fix this which I tried, but this utility doesn’t exist in new versions, and I don’t believe works with Arm Macs.</p>
<p>After a reboot it turns out that MacOS is normally pretty good at automatically switching those settings. If I accidentally view the dictation page and my audio quality drops, when I leave after a while the codec switches back and the sound quality returns.</p>
</section>
<section id="the-touchbar-isn-t-as-useless-as-i-first-thought" class="level2">
<h2 class="anchored" data-anchor-id="the-touchbar-isn-t-as-useless-as-i-first-thought">The touchbar isn’t as useless as I first thought</h2>
<p>I, like most people, thought that the touchbar was an awful idea. After using it for a little while, I’m happy to admit that I was wrong.</p>
<p>First things first, Apple made a great decision when they decided to bring back the physical escape key. I don’t really use the function keys (in Emacs I don’t have them bound to anything important) so I don’t miss them, but I do use the escape key frequently so I’m glad it’s back. Also, even though the function keys are gone most applications I’ve used replace them with something else that I do use instead.</p>
<p>In Apple’s applications the touchbar is particularly well implemented. Take Safari for example: In normal use, the touchbar shows you your open tabs; cool, but not ground breaking. Although, quick note here, you cannot select pinned tabs through this which is pretty disappointing. Then, you open a video. The touchbar shows you a scrobbling bar that you can drag around to search through your video alongside a button that pops out the video into picture-in-picture mode. This, in my opinion, is super useful. The scrobbling on its own is great, but the pop-out button is just super convenient so I don’t need to right click the volume button to do it (which, side note, not the most user friendly way). Finally, you start typing something in and the touchbar shows you predictive text options. This happens across most text entries, and I find it suprisingly useful (particularly with a few hard-to-remember spellings). All of this just the interactions with a single application!</p>
<p>I would note that sometimes the functions of the touchbar can feel a little… opaque? Sometimes an icon simply isn’t enough to convey what a button does, and in apps like this I either have to manually edit the touchbar (the editor shows you the labels associated with each button), trial and error each button, or simply ignore the button altogether.</p>
</section>
<section id="other-stuff" class="level2">
<h2 class="anchored" data-anchor-id="other-stuff">Other stuff</h2>
<p>Here’s a couple of little things I’ve noticed or thought about.</p>
<p>First, like in Linux, it’s incredibly easy to rebind the Caps Lock key to something useful; specifically, you can rebind it to Control, Option, or Command, all directly in the settings panel. No need to install some extra tweaks software or run a terminal command, it Just Works<sup>tm</sup>.</p>
<p>I mentioned iTerm2 earlier, and it really is an incredibly good terminal emulator. My favourite feature are so far are the way you can bury terminals. I mentioned the port forwarding earlier, and that’s my primary use case for it; I need this command running, but I don’t need to look at the terminal unless the pipe breaks so just hide it from me. Don’t put it in the dock or hide it on my last desktop, just run it in the background. I also love the automatic profile switching. I use the default profile most of the time, but when I run terminal Emacs to edit something the keybindings clash. A little inconvenient, but I simply set up a profile with minimal keybindings and have iTerm switch to that profile when I’m in Emacs. When I’m done it switches back to whatever it was in before.</p>
<p>But that’s not all; iTerm2 has one unbelievable feature: Unbeatable tmux integration. When I connect to a tmux session, I simply use <code>tmux -CC a</code>. Now, all tmux split and tabs become <em>native</em> iTerm tabs and splits! Obviously it’s not totally necessary, but it makes using tmux just that little bit easier. The shortcut to full screen a split frame doesn’t matter anymore, I can just use iTerm’s native frame maximising shortcut. Plus, as I mentioned earlier, I can just search the Menu Bar with ⌘⇧/ to find the shortcut. Absolute magic.</p>
<p>A long time ago I got a Logitech MX Master for a ridiculously good deal and I’ve been using it for ~4 years now. When you press your thumb down on Linux, however you move your mouse it is just ignored which is nice for adjusting your hand position. I never used it, but it was an alright feature. Well, it turns out on MacOS so long as you have the Logi Options app installed that this hidden thumb button is <strong>actually</strong> a gesture button! The gestures are basically the same as the 3 finger workspace gestures on the touchpad, you just hold the button and push the mouse:</p>
<ul>
<li>Up to go into the overview (or whatever the Mac term for it is)</li>
<li>Down to go see all other instances of your current app are running</li>
<li>Left and right to switch workspaces</li>
</ul>
<p>This is a much better use for this (previously seemingly useless) button, and it’s really intuitive when I’m at a desk with a mouse and keyboard. Now I just wish it had the ability to press ⌘ and Scroll wheel to quickly switch workspaces.</p>
<p>This is pretty trivial, but on my Linux laptop my “Downloads” folder is an absolute state. I download something, use it for whatever I’m doing at the time, then forget it ever existed. As a result, my downloads folder is hundreds of PDFs and binaries I use for work. Having a “Downloads” icon on my dash silently shaming me means I have a empty downloads folder permanently. The same goes for the bin, I’ll drag something from downloads to the bin and immediately empty the bin. Again, I know it’s trivial, but it’s a minor change that means my computer is just a little cleaner. I’ll either delete useless files, or sort them into the correct place to find them later rather than just running a file search on my entire <code>/home</code> folder whenever I need something.</p>
</section>
<section id="conclusion-authored-october-11th-2026" class="level1">
<h1>Conclusion (authored October 11th 2026)</h1>
<p>I’m revisiting my blog posts, and I reread this with a curious eye given I authored this in <em>2021</em>. The work I do and the way I use my computer are nothing like they were back then. I noticed that this post did not have a real conclusion, and I thought it’d be fun to finally conclude it.</p>
<p>A lot has changed in 5 years! I finished my PhD, I got a job as a Teaching Fellow at the University of Kent, then eventually as a Lecturer at the University of Kent. In between I’ve had an M1 Macbook Pro (mine), an M2 Macbook Air (from work), and M3 Pro Macbook Pro (also from work), and an M4 Pro Mac Mini (again mine). I switched to an iPhone, I bought an iPad. I use an Apple Watch. This is probably sounding a little cult like, and honestly I imagine myself as a Linux user would find current me insufferable…</p>
<p>But hear me out…</p>
<p>The number 1 thing I’ve realised in my transition from Linux to MacOS is how much the <em>way I use my computer has changed</em>. My laptop running Linux was fun, but it was a <em>hobby</em>. It was a <em>project.</em> It was very fun! But it was an incredibly <em>unproductive machine.</em></p>
<p>I will note that this is an unfair criticism of Linux – The real criticism is partly that Linux is so fun to dig into that I always wanted to! But some of the critique is also that <em>I often needed to tinker to just get on with my job</em>.</p>
<p>I must have spent so long tinkering with Geary to get my mail looking nice. I could have used Evolution, which worked really well with Exchange, but I didn’t want to because it was <em>dated.</em> There was often nice apps that had simply aged and not received the upkeep they needed, or new and novel apps that were so new they weren’t very full featured<sup>1</sup>.</p>
<p>Apple silicon chips are mind-bogglingly powerful. MacOS is a really well built OS<sup>2</sup>. Having access to a real Unix terminal, Unix tools, a good package manager, containers, a spectacular terminal emulator (still using iTerm2, but might some day try Ghostty!), <em>and</em> a wide selection of amazingly well built apps is a really incredible experience.</p>
<p>I haven’t gone back to Linux, and I think I should soon! I currently have my PhD laptop charging in my office, and perhaps it needs a new OS so I can see how much things have changed – I hope things have improved!</p>
<p>There are some things I miss from the Linux world. I’m a pretty heavy container user now, and I imagine if I were on Linux I would be very happily using something like Fedora Silverblue as my daily driver. I think my biggest want for MacOS is to have some equivalent, where I can create a reproducable system. I’d love something like Nix or Silverblue. I love XCode, but I’d love it more if I actually had the choice <em>not</em> to use it; Previews are a godsend during SwiftUI development, and I’d love to stay in Emacs but I need the previews!</p>
<p>The biggest difference from switching to MacOS has been that my computer now <em>feels</em> like a <u>work</u> machine, not a tinkering toy or hobby project. This is why I use an iPhone and an iPad – I had an Android phone and a Samsung tablet back in the day, and they always grated me in one way or another that stopped me just getting work done. I hated that I couldn’t view notes on PDFs I’d made on my phone or tablet on my laptop, <em>why</em> can I not do that<sup>3</sup>?!</p>
<p>I need my devices to help me get things done. If all I was doing was writing code, Linux would’ve comfortably and happily been that for me! However, the reality is I spend a lot of my time <em>not</em> writing code and instead writing lectures, worksheets, exam questions, and many, <em>many</em> emails.</p>
<p>For the last 5 years I have continued to use my Mac, and I am very happy with my decision<sup>4</sup>.</p>


</section>


<div id="quarto-appendix" class="default"><section id="footnotes" class="footnotes footnotes-end-of-document"><h2 class="anchored quarto-appendix-heading">Footnotes</h2>

<ol>
<li id="fn1"><p>I wonder if AI has had a big impact in the state of the Linux desktop?↩︎</p></li>
<li id="fn2"><p>I will say right now, MacOS has issues. However, I regularly have to use Windows, and it is miserable. I used GNOME, KDE, MATE, XFCE, i3, Sway, QTile, and more, and every single one of them was equally or more flawed than anything MacOS provides. I very happily use MacOS every day, and yeah some times it can be a little annoying, but for the most part it is spectacularly well built.↩︎</p></li>
<li id="fn3"><p>This was the case in 2020, please do not @ me if this is better now. I’m glad it is for the Samsung users of the world, but I’m not one of you anymore.↩︎</p></li>
<li id="fn4"><p>I haven’t even touched <em>the community</em>. I love the Apple developer community, and everyone seems so much more friendly. The Linux community can be really unpleasant, elitist, argumentative, and just <strong>rude</strong>. I don’t miss interactions in the GNOME Matrix server or IRC – Asking for help and being made to feel like an inconsiderate jerk for daring to disturb, treated like a moron for not understanding something immediately. The online commentary around Linux from within the community is horrific, and it’s another thing I simply do not miss.↩︎</p></li>
</ol>
</section></div> ]]></description>
  <category>MacOS</category>
  <guid>https://ramzi.uk/posts/20210716_macos_as_a_linux_user.html</guid>
  <pubDate>Fri, 16 Jul 2021 00:00:00 GMT</pubDate>
</item>
<item>
  <title>Flashcards: Take 3, part 3</title>
  <dc:creator>George Ramzi</dc:creator>
  <link>https://ramzi.uk/posts/flashcards/2020_12_23_flashcards_take_3_part_3.html</link>
  <description><![CDATA[ 





<section id="day-8" class="level1">
<h1>Day 8</h1>
<p>Continuing from the last post, Flashcards is now on GTK4!</p>
<p><a href="../../posts/flashcards/2020_10_11_flashcards_take_3.html">Part 1</a> <a href="../../posts/flashcards/2020_12_19_flashcards_take_3_part_2.html">Part 2</a></p>
<p>The good news is that there’s loads of exciting new toys to play with! I’m incredibly excited to play with the transformations, as I’ve always pictured the card’s having a reveal animation where the widget flips over like a card, and doing this in GTK3 would’ve been an incredible amount of work.</p>
<p>The bad news is, everything is broken!</p>
<p>The Deck list is the first priority; users need to be able to select the deck that they want to view. Once this is working, I need to fix the card list; however the fix should be very similar. The Deck list is also a very simple list; The actual widget for each list is exceedingly basic with just 2 labels and the data is already in a <code>GtkListStore</code>, and this simplicity should make it a somewhat easy starting point. Previously (and I believe documented in this blog) I had turned each row into it’s own composite widget with GObject Properties that functioned as a getter and a setter that would edit the widget. Now I need to generate these lists using GtkListItemFactories. In theory, this should alleviate the worry I had before that using composite widgets would make long lists laggy! So I guess this isn’t actually bad news? As I needed to replace these anyway.</p>
<p>I decided to re-read the <a href="https://blog.gtk.org/2020/09/05/a-primer-on-gtklistview/">GTK blog posts about the new list views</a>, and the first thing that stood out to me was the following quote:</p>
<blockquote class="blockquote">
<p>Some of the early adopters of GTK4 have pointed out that the new list widgets are not the easiest to learn. In particular, <code>GtkExpression</code> and <code>GtkBuilderListItemFactory</code> are hard to wrap your head around.</p>
</blockquote>
<p>The blog posts is very well written to help make this all make more sense, the only down side is that all the code snippets are in C, but oh well. It also appears you can do most of the heavy lifting for this in your .ui file? Which if so means even more heavy lifting in the app is being handled by GTK.</p>
</section>
<section id="day-9" class="level1">
<h1>Day 9</h1>
<p>Getting the list factory working has been interesting, but a headache. Better examples (especially Python) would be extremely helpful, but I do think I’m beginning to understand how it works. So in the blog linked in the previous post, there’s 2 examples given. The first example is using <code>Gtk.SignalListItemFactory</code>, where the factory emits signals that need a specifically crafter function for the “bind” and “setup” signals. The bind signal creates a widget that will be placed in the list, and the setup signal modifies that row with the data for your row.</p>
<p>The second example uses <code>Gtk.BuilderListItemFactory</code>, which does not emit either signal (or any for that matter), but instead uses a .ui file to specify the layout of the widgets in each row. Additionally, the UI file can contain some special tags (which as far as I know cannot be used in normal .ui files or wouldn’t serve a purpose) that allow you to define how data will be input into the row. For me this is much more in line with how I already manage Flashcards, so I want to use that!</p>
<p>So after experimenting with the builder way first, I discovered that it’s not the easiest thing in the world to debug. Most of the work is taken care of for you, but the result of that is that it is hidden away from you. I decided that the easier way to go would be to follow the blog’s walkthrough and set up using the signal factory. This way, whenever a signal is emitted we can see what object the factory is using and do whatever you want with those objects while debugging. Doing this, I managed to get a working trivial list factory! The deck list is now managed as a list of GObjects that I’ve created, and the values I want are stored as GObject properties.</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb1-1"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">class</span> DeckRow(GObject.GObject):</span>
<span id="cb1-2">    _deck_id    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb1-3">    _deck_name  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span></span>
<span id="cb1-4">    _card_count <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb1-5">    </span>
<span id="cb1-6">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">__init__</span>(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>, did, name, count, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kwargs):</span>
<span id="cb1-7">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">super</span>().<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">__init__</span>()</span>
<span id="cb1-8">        GObject.GObject.<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">__init__</span>(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>)</span>
<span id="cb1-9">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.deck_id <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> did</span>
<span id="cb1-10">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.deck_name <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> name</span>
<span id="cb1-11">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.card_count <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> count</span>
<span id="cb1-12">    </span>
<span id="cb1-13">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">@GObject.Property</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">type</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>, nick<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"deck-name"</span>, default<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>)</span>
<span id="cb1-14">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> deck_id(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>):</span>
<span id="cb1-15">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>._deck_id</span>
<span id="cb1-16">    </span>
<span id="cb1-17">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">@deck_id.setter</span></span>
<span id="cb1-18">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> deck_id(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>, did):</span>
<span id="cb1-19">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>._deck_id <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> did</span>
<span id="cb1-20">    </span>
<span id="cb1-21">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">@GObject.Property</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">type</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>, nick<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"deck-name"</span>, default<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>)</span>
<span id="cb1-22">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> deck_name(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>):</span>
<span id="cb1-23">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>._deck_name</span>
<span id="cb1-24">    </span>
<span id="cb1-25">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">@deck_name.setter</span></span>
<span id="cb1-26">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> deck_name(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>, dname):</span>
<span id="cb1-27">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>._deck_name <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> dname</span>
<span id="cb1-28">    </span>
<span id="cb1-29">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">@GObject.Property</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">type</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>, default<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb1-30">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> card_count(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>):</span>
<span id="cb1-31">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>._card_count</span>
<span id="cb1-32">    </span>
<span id="cb1-33">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">@card_count.setter</span></span>
<span id="cb1-34">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> card_count(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>, count):</span>
<span id="cb1-35">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>._card_count <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> count</span></code></pre></div></div>
<p>It’s an exceedingly simple object, but it is being used to generate an exceedingly simple list. This is very much in line with how I managed the list rows before, but now <code>GtkListItemFactory</code> is generaing this all for me so if the list ever gets large enough it shouldn’t slow the interface. Again, the odds of someone having so many decks that it slows the interface is low, but this was a good chance to learn GtkListItemFactory and it’s eccentricities in a simple environment.</p>
<p>However, while this works perfectly well, I would much prefer that this list be handled with <code>GtkBuilderListItemFactory</code> rather than <code>GtkSignalListItemFactory</code>; not only does this mean I can understand how both of them work, but also this list is so incredibly simple that I might as well port it.</p>
<p>After a quick discussion in the GTK matrix room (Thank you Company!) I was pointed out that the issue was a missing <code>__gtype_name__ = DeckRow</code>. With that and the correct typing in the XML file, everything works perfectly! In case anyone else has a similar issue, here’s the XML I used:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb2" style="background: #f1f3f5;"><pre class="sourceCode xml code-with-copy"><code class="sourceCode xml"><span id="cb2-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">&lt;?xml</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">version=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1.0"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">encoding=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"UTF-8"</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">?&gt;</span></span>
<span id="cb2-2">&lt;<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">interface</span>&gt;</span>
<span id="cb2-3">  &lt;<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">template</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">class=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"GtkListItem"</span>&gt;</span>
<span id="cb2-4">    &lt;<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">property</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">name=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"child"</span>&gt;</span>
<span id="cb2-5">      &lt;<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">object</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">class=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"GtkBox"</span>&gt;</span>
<span id="cb2-6">        &lt;<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">property</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">name=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"hexpand"</span>&gt;1&lt;/<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">property</span>&gt;</span>
<span id="cb2-7">        &lt;<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">property</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">name=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"height_request"</span>&gt;64&lt;/<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">property</span>&gt;</span>
<span id="cb2-8">        &lt;<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">child</span>&gt;</span>
<span id="cb2-9">          &lt;<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">object</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">class=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"GtkLabel"</span>&gt;</span>
<span id="cb2-10">            &lt;<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">binding</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">name=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"label"</span>&gt;</span>
<span id="cb2-11">              &lt;<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lookup</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">name=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"deck-name"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">type=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"DeckRow"</span>&gt;</span>
<span id="cb2-12">                &lt;<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lookup</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">name=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"item"</span>&gt;GtkListItem&lt;/<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lookup</span>&gt;</span>
<span id="cb2-13">              &lt;/<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lookup</span>&gt;</span>
<span id="cb2-14">            &lt;/<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">binding</span>&gt;</span>
<span id="cb2-15">            &lt;<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">property</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">name=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"can_focus"</span>&gt;0&lt;/<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">property</span>&gt;</span>
<span id="cb2-16">            &lt;<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">property</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">name=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"halign"</span>&gt;start&lt;/<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">property</span>&gt;</span>
<span id="cb2-17">            &lt;<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">property</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">name=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"margin_start"</span>&gt;12&lt;/<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">property</span>&gt;</span>
<span id="cb2-18">            &lt;<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">property</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">name=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"hexpand"</span>&gt;1&lt;/<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">property</span>&gt;</span>
<span id="cb2-19">            &lt;<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">property</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">name=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"xalign"</span>&gt;0&lt;/<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">property</span>&gt;</span>
<span id="cb2-20">          &lt;/<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">object</span>&gt;</span>
<span id="cb2-21">        &lt;/<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">child</span>&gt;</span>
<span id="cb2-22">        &lt;<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">child</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">type=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"end"</span>&gt;</span>
<span id="cb2-23">          &lt;<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">object</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">class=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"GtkLabel"</span>&gt;</span>
<span id="cb2-24">            &lt;<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">binding</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">name=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"label"</span>&gt;</span>
<span id="cb2-25">              &lt;<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lookup</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">name=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"card-count"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">type=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"DeckRow"</span>&gt;</span>
<span id="cb2-26">                &lt;<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lookup</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">name=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"item"</span>&gt;GtkListItem&lt;/<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lookup</span>&gt;</span>
<span id="cb2-27">              &lt;/<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lookup</span>&gt;</span>
<span id="cb2-28">            &lt;/<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">binding</span>&gt;</span>
<span id="cb2-29">            &lt;<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">property</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">name=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"margin_end"</span>&gt;12&lt;/<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">property</span>&gt;</span>
<span id="cb2-30">          &lt;/<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">object</span>&gt;</span>
<span id="cb2-31">        &lt;/<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">child</span>&gt;</span>
<span id="cb2-32">      &lt;/<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">object</span>&gt;</span>
<span id="cb2-33">    &lt;/<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">property</span>&gt;</span>
<span id="cb2-34">  &lt;/<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">template</span>&gt;</span>
<span id="cb2-35">&lt;/<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">interface</span>&gt;</span></code></pre></div></div>
<p>Note that this XML is minimal, but slightly more complex than the example given in the blog post linked previously as we are looking for 2 properties for 2 different labels.</p>
<p>Lastly, before I commit this updated version I’m going to simplify the object. Firstly I removed some unnecessary GTK objects (like a box that’s only child was another box) and some unnecessary code from when I was building the ListFactory.</p>
<p>Also, because of it’s currently glitchy state (again, this is expected! it’s a pre-release patch to a library) I’ve changed the default window size to a desktop app size rather than a mobile app size I used to testing the UI’s mobile friendly~ness.</p>
</section>
<section id="day-10" class="level1">
<h1>Day 10</h1>
<p>Today I wanto to get the CardList ported over to using <code>GtkSignalListItemFactory</code>. Why Signal instead of Builder? Because from my understanding of how both work that I gained from implementing DeckList as both, I think the flexibility to edit the rows in code should be more flexible. I’m going to scrap the current implementation and rewrite it from scratch, and as the objects are reused I should also be able to have the row widget simply contain the editor; I didn’t do this before because I was concerned with the performance, but with ListFactory recycling the objects the performance impact should be minimal.</p>


</section>

 ]]></description>
  <category>Linux</category>
  <category>Software Development</category>
  <guid>https://ramzi.uk/posts/flashcards/2020_12_23_flashcards_take_3_part_3.html</guid>
  <pubDate>Wed, 23 Dec 2020 00:00:00 GMT</pubDate>
</item>
<item>
  <title>Flashcards: Take 3, part 2</title>
  <dc:creator>George Ramzi</dc:creator>
  <link>https://ramzi.uk/posts/flashcards/2020_12_19_flashcards_take_3_part_2.html</link>
  <description><![CDATA[ 





<p>I’ve found myself really motivated to keep working on this, so I may as well keep documenting it in case anyone else cares.</p>
<p><a href="../../posts/flashcards/2020_10_11_flashcards_take_3.html">Part 1</a></p>
<section id="day-4" class="level1">
<h1>Day 4</h1>
<p>One of my concerns around the design of this application is it’s reliance on Gtk.ListBoxes. I use ListBoxes because they allow me to create each row as it’s own widget with it’s own variables and dynamic interactions, meaning each row can contain more widgets and moving parts if I wanted. However, I worry that having so many complex widgets being created and stored could be both memory intensive and slow down the interface. From what I’ve seen, GTK3 can handle quite a high number of widgets before it starts to slow down, but for future proofing’s sake I’ve avoided making the ListBoxRows /too/ complicated. If we lived in an perfect world where I never needed to worry about overhead, I’d love each Row to contain it’s own CardEditor. Instead of editing cards in it’s own interface, the user would press the + button and a new card would appear, with GtkEntrys instead of labels for the front, hint, and back.</p>
<p>Previously, editing cards was done through a popup window. This window contained the old card’s details, and 3 entries for the new details. I might see about replacing this with something more intuitive, as this wasn’t particularly user friendly. My intitial card adding interface was designed for speed: I wanted the user to be able to populate their Decks as fast as possible. While adding new cards was very fast and intuitive, editing cards wasn’t a particularly positive experience.</p>
</section>
<section id="day-5" class="level1">
<h1>Day 5</h1>
<p>I implimented what I was thinking about in Day 4 and I hated it!</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://ramzi.uk/posts/flashcards/images/flashcards_take3_part2_1.png" class="img-fluid figure-img"></p>
<figcaption>In this implimentation, each row has a revealer hiding some buttons. When that row is selected, it shows its revealer and all other revealers get hidden. The most obvious advantage to this is that the card manages itself: no needing to find the selected card and find its details to delete it; the row can simply delete itself from the database and destroy itself.</figcaption>
</figure>
</div>
<p>OK maybe hate is a little strong, but it definitely needs work. I’m not sure I prefer it to the old design. On one hand, it’s far more obvious what these actions relate to as the list box is single select so the card to be edited or deleted is bright blue. On the other hand, it’s a lot of space to show 2 buttons. Perhaps a android~esque sideways sliding revealer (think gmail when you slide an e-mail to delete it) with icons could work? but that would use alot of horizontal space on an app we’re trying to make work on small form factors and large.</p>
<p>I also discovered the “content” CSS class for GtkListBoxes. This style class gives ListBoxes and their rows some pretty formatting, rounded corners, and separators basically for free. I wish I had discovered this sooner, but unfortunately it’s just one of those useful CSS styles hidden in GTK. I only found it through GNOME Games, which uses it in it’s preferences window to show the different consoles it has available (well, really it uses them throughout the whole preferences window). It looks very pretty!</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://ramzi.uk/posts/flashcards/images/flashcards_take3_part2_2.png" class="img-fluid figure-img"></p>
<figcaption>The same screenshot as the previous image, now with the “content” styling.</figcaption>
</figure>
</div>
</section>
<section id="day-6" class="level1">
<h1>Day 6</h1>
<p>2 months have passed since I last dedicated time to Flashcards. Today (17th December 2020) GTK4 was officially released. I’ve also spotted that there is a WIP merge request for GTK4 support for libhandy, which when it works will mean I can safely port my application to GTK4!</p>
<p>I thought about giving this branch a try and porting the application to GTK4 with the current WIP implementation. However, porting to GTK4, even with an early stage app, is no small task. Immediately, I’ll need to convert all .UI files to GTK4 (which can be done with <code>gtk4-builder-tool --3to4</code>). Not only that, a quick look through the porting guide tells me I’ll need to replace all my <code>container.add()</code> calls. It was at this point I noticed an incredibly embarrassing mistake I’d made thus far - I haven’t put this into a git repository yet! This needs to be fixed immediately.</p>
<p>I had an empty git repository ready for this project, so I added all the project files into that repository so I could move onto porting to GTK4. I added a second Flatpak manifest that could build the necessary libraries for a GTK4 port, specifically a GTK4 version of libhandy (which is not yet merged) and a version of PyGObject with the correct overrides for using GTK4 with templates (also not yet merged, although <a href="https://gitlab.gnome.org/GNOME/pygobject/-/merge_requests/145">hopefully merged soon</a>). However, even with a up to date PyGObject, it seems that the Python defaults to the version shipped with the current flatpak SDK rather than the version I’ve compiled. Thankfully, someone commented on the Merge request and confirmed my suspicions, and we simply needed to add the location of our compiled PyGObject to the <code>PYTHONPATH</code> variable. Finally, the application launches! Well, not quite. Now I need to remove all the deprecated functions!</p>
<p>As Flashcards wasn’t the most complex app in it’s current state, getting it ported to GTK4 was… shockingly simple? My main window file creates most of the complex widgets and adds them, so I commented most of the widgets out and added them back one at a time; each time I’d add one I’d get more errors that needed to be resolved. Most of the issues were fairly common across UI files, simple stuff like <code>show_close_button</code> being changed to <code>show_title_buttons</code>, removing “packing”, removing any child properties, and other assorted changes. For the most part I just removed or commented out the lines that caused issues if I didn’t know how to immediately resolve them. A few changes to the code to remove missing functions, and the application launched!</p>
<p>Unsuprisingly given that I’m using a freshly released GTK4, an unfinished GTK4 branch of libhandy, and a prereleased PyGObject, and the fact I haven’t even started porting any of the broken functionality from the transition from GTK3 to GTK4, it’s a giant mess! Admittedly most of the glitchiness comes from the fact libhandy’s GTK4 branch just isn’t there yet. The initial state is a completely white quircle until you resize the window (an issue with <code>Hdy.Leaflet</code>), where it finally draws all the widgets. However, quite a few things are in the wrong place because their position was managed with child properties which are gone!</p>
<p>Coincidentally, close to the release of GTK4 there was some discussion around the use of the Glade GTK interface designer to build your application’s interface. The consensus seems to be that unless someone dedicates time to work on Glade, developers should simply maintain their UI files by manually writing and editing the XML files. From some discussions I’ve seen in Matrix/IRC, some core GNOME contributors say this is how they work, but I think this is an incredibly poor response. Asking application developers to simply maintain the XML files manually isn’t exactly developer friendly. In the past I only edited the XML files if I needed to make a small quick change. Glade is a pretty great program, and I used it frequently when prototyping the interface for Flashcards. I can maintain the XML files, and going forward it seems like I will not have any other choice, but I’m not happy about it at all. When I next need to add a widget, I’ll likely still use Glade, but convert the file and manually add any libhandy widgets.</p>
</section>
<section id="day-7" class="level1">
<h1>Day 7</h1>
<p>With the move to GTK4 somehow working, time to fix a bunch of the things that broke.</p>
<p>First, a every time I had a box and I used <code>GtkBox</code>’s child properties to specify that a child is at the end is now gone, but now it depends on the parent widget. For example, when using a <code>GtkHeaderbar</code>, you can specify that a child should appear at the end of the title by changing <code>&lt;child&gt;</code> to <code>&lt;child type="end"&gt;</code>.</p>
<p>When it comes to children of a box, usually it can simply be fixed by setting the correct children to have <code>hexpand=true</code>. Simple enough.</p>
<p>Another change that I didn’t remember reading about but I’m kind of happy about is replacing <code>GtkPopover</code> menus (which used to be created manually, with a <code>GtkPopover</code>, a bunch of <code>GtkModelButtons</code> and <code>GtkSeparators</code>) with a properly defined menu. Now you can define the menu as part of the .ui file in a format like:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode xml code-with-copy"><code class="sourceCode xml"><span id="cb1-1">&lt;<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">menu</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">id=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"deck_list_menu"</span>&gt;</span>
<span id="cb1-2">    &lt;<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">section</span>&gt;</span>
<span id="cb1-3">        &lt;<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">item</span>&gt;</span>
<span id="cb1-4">            &lt;<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">attribute</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">name=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"label"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">translatable=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"yes"</span>&gt;New Deck&lt;/<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">attribute</span>&gt;</span>
<span id="cb1-5">            &lt;<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">attribute</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">name=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"action"</span>&gt;win.create-deck&lt;/<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">attribute</span>&gt;</span>
<span id="cb1-6">        &lt;/<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">item</span>&gt;</span>
<span id="cb1-7">    &lt;/<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">section</span>&gt;</span>
<span id="cb1-8">    &lt;<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">section</span>&gt;</span>
<span id="cb1-9">        &lt;<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">item</span>&gt;</span>
<span id="cb1-10">            &lt;<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">attribute</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">name=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"label"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">translatable=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"yes"</span>&gt;About Flashcards&lt;/<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">attribute</span>&gt;</span>
<span id="cb1-11">            &lt;<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">attribute</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">name=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"action"</span>&gt;win.show-about&lt;/<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">attribute</span>&gt;</span>
<span id="cb1-12">        &lt;/<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">item</span>&gt;</span>
<span id="cb1-13">    &lt;/<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">section</span>&gt;</span>
<span id="cb1-14">&lt;/<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">menu</span>&gt;</span></code></pre></div></div>
<p>Then you can set a MenuButton to use that menu model, and GTK will create the popover and populate it for you! This is one of those things that took me a while to get working correctly, but now I understand it I think it’s absolutely brilliant. No longer do I need to mess around with creating the popover, adding the right padding to each edge to match the HIG, and assigning it to the MenuButton. I simply define the menu, and the Popover is created for me with the correct styling. This might sound daft, but this makes me really happy; this is way more intuitive.</p>
<p>I think I’ll end these few days here, but there’s one more thing I think it worth pointing out; Sometimes when I want to figure out how to implement something I’ll look at other apps to see how they do it. In the case of porting to GTK4, at the time of writing the only working GTK4 app I could find is <a href="https://gitlab.gnome.org/haecker-felix/souk">Souk</a>, a Flatpak app store written in Rust. Today I found out you cannot simply create or define <code>GtkModelButtons</code> anymore, so I went to find out how Souk implemented it’s menu. Using the inspector, I found out it DID use <code>GtkModelButtons</code>. Confused, I looked at it’s .ui files and realised that it didn’t define the buttons itself, and this was how I learned that you can define menus in this new way.</p>
<p>I knew GTK was heading towards a more Action oriented design, so I looked for blog posts and found this blog on blogs.gtk.org titled <a href="https://blog.gtk.org/2020/05/01/custom-widgets-in-gtk-4-actions/">Custom widgets in GTK 4 – Actions</a>, which basically explained <em>most</em> of what I just described. The critical thing it missed was that whilst you can define your menu in your .ui file, you can also define where it is used in your .ui file, and it is exceedingly simple.</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb2" style="background: #f1f3f5;"><pre class="sourceCode xml code-with-copy"><code class="sourceCode xml"><span id="cb2-1">&lt;<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">child</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">type=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"end"</span>&gt;</span>
<span id="cb2-2">    &lt;<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">object</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">class=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"GtkMenuButton"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">id=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"deck_menu"</span>&gt;</span>
<span id="cb2-3">        &lt;<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">property</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">name=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"menu_model"</span>&gt;deck_list_menu&lt;/<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">property</span>&gt;</span>
<span id="cb2-4">        &lt;<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">property</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">name=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"icon_name"</span>&gt;open-menu-symbolic&lt;/<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">property</span>&gt;</span>
<span id="cb2-5">    &lt;/<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">object</span>&gt;</span>
<span id="cb2-6">&lt;/<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">child</span>&gt;</span></code></pre></div></div>
<p>And with that, the menu is defined entirely in the .ui file, all I need to do is define the actions.</p>


</section>

 ]]></description>
  <category>Linux</category>
  <category>Software Development</category>
  <guid>https://ramzi.uk/posts/flashcards/2020_12_19_flashcards_take_3_part_2.html</guid>
  <pubDate>Sat, 19 Dec 2020 00:00:00 GMT</pubDate>
</item>
<item>
  <title>Flashcards: Take 3</title>
  <dc:creator>George Ramzi</dc:creator>
  <link>https://ramzi.uk/posts/flashcards/2020_10_11_flashcards_take_3.html</link>
  <description><![CDATA[ 





<p>Flashcards, my poor, sweet side project, has been mistreated for far too long. It’s time to rectify this crime.</p>
<p>This project has been ignored for close to a year while I worked on my PhD and some PhD related side projects. Whilst doing these side projects I’ve learnt alot more about GTK and GLib, and when I decided to return to Flashcards I realised… the code is not great. It’s definitely not in a position that I want to share it. I tried to modernise it, but there’s also been alot of huge changes in GTK+Python, and whilst trying to update the code I realised I was going to be fighting an impossible battle.</p>
<p>This can only mean one thing. I need to start from scratch, with my old code and interface designs as a guide, and make a modern and well designed app that I’m more happy sharing. Lets get started rewriting this mess from scratch…</p>
<section id="preface" class="level1">
<h1>Preface</h1>
<p>As I previously described in an old blog post, the design behind Flashcards is based around the concept of “Decks”. The user creates as many Decks as they like, and each Deck contains a set of cards. The previous implimentation required each card be a simple collection of strings: A “Front”, a “Back”, and an optional “hint”. The user then selects a Deck, can review or edit the cards in the Deck, or begin revising the cards in the Deck.</p>
<p>For the sake of this sprint/hackathon thing, I plan to stick to that but I want to make it a little more future proof. Specifically, in the future I will likely need to render each component of the card to a webkit widget to allow complex text rendering, like LaTeX snippets and furigana (which were all goals I wanted in the previous version).</p>
<p>The hurdle the last version reached was my desire to port to GTK4 being blocked by LibHandy. My goal was to use GTK4’s <a href="https://blog.gtk.org/2019/05/08/gtk-3-96-0/">transitions</a> or possibly <a href="https://blog.gtk.org/2020/09/30/gtk-3-99-2/">shaders</a> to have a sort of “card flip” animation to really drive home the metaphor, but I’ll need to look down the line (when <a href="https://gitlab.gnome.org/GNOME/libhandy/-/merge_requests/625">LibHandy has a port</a>) if this is practical, aesthetically pleasing, or even possible with webkit. For now, as I’m sticking to just rendering plain text a stack like was used previously will work for now, but this will need to be replaced. However, I will need to design and implement a more “advanced” card editor at some point, and edit the SQLite database to work with these more complex card types (i.e.&nbsp;an extra column to specify the card types: simple, LaTeX, furigana, code, etc).</p>
</section>
<section id="day-1" class="level1">
<h1>Day 1</h1>
<p>I’m going to continue to use Python for this project. Partly because it’s what I’m the most experienced in, mostly because it’ll let me do this rewrite fast. Python really does spoil you as a developer, because whenever I use a compiled language now waiting for the project to compile after every change feels like an eternity.</p>
<p>A large chunk of my time was dedicated to learning the new features of LibHandy and deciding if they were worth using. Initially I planned to avoid HdyHeaderBar as the benefit did not seem worth it for my project, but it seems that HdyWindow prefers to have HdyHeaderBar, so I’ll use it.</p>
<p>The absolute greatest change LibHandy gives (which I believe GTK will in the future also provide) is the fact that the HeaderBar is now part of the content. Now I no longer need to manage multiple separate widgets interacting with each-other just to have a dynamic HeaderBar interacting with the content. This genuinely is a godsend. This nearly halves the number of files and widgets my application needs and I’m really excited to use it. Now, the window just contains 1 stack and the widgets are added to the stack. It also means managing the HdyLeaflet, which previously was a headache to coordinate, should be significantly simpler as all parts of the leaflet can be part of 1 simple widget and 1 UI file. I’m also assuming that because the header is part of the content, it’ll also be much easier as you don’t need to add the header, content, and separator individually.</p>
<p>I started late, but admittedly I’m a little frustrated by LibHandy. So far all I’ve managed to get is a HdyApplicationWindow and a box, with a HdyHeaderBar, a GtkLabel, and poor clipping…</p>
<p>However, I refuse to give up. <a href="https://blogs.gnome.org/alexm/2020/04/12/on-windows-and-titlebars/">The case</a> for HdyWindow is just too damn appealing.</p>
</section>
<section id="day-2" class="level1">
<h1>Day 2</h1>
<p>Coffee in hand, time to make the HdyWindow work. Maybe.</p>
<p>One large coffee and some reading later, turns out LibHandy wants you to call Handy.init() somewhere in your application (I’m assuming before you initialise any templates), and suddenly all the rendering artefacts are done and you’re left with a lovely functioning window with no clipping issues and working titlebar dragging. Hooray.</p>
<p>Now that hurdle has been overcome, time to start porting sections of the code over. A major change in LibHandy that I have to work around is the removal of HdyDialog. I couldn’t find why it had been removed, but in all honesty Flashcards didn’t use any complex dialogs anyway, so I’ll simply stick to regular HdyWindows that are small enough to work on small form factors. Another thing I learnt to love since I last worked on Flashcards is Gio.Actions and ActionGroups, which are a much more intuitive way of managing interfaces and communication between widgets. Now, I can create an action for a specific widget, and invoke that action from anywhere in the application. I can also assign buttons to simple activate that action, rather than defining a function and callback for each button interaction.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://ramzi.uk/posts/flashcards/images/flashcards_take3_1.png" class="img-fluid figure-img"></p>
<figcaption>Left: How a HdyApplicationWindow appears before using Handy.init() and Right: How HdyApplicationWindow appears after Handy.init. Note the corner rounding working. Not pictured: The titlebar is now a working dragable area.</figcaption>
</figure>
</div>
<p>I re-implimented the new deck dialog as a HdyWindow, created an action group for it, and began creating actions for the simple functions of the window. The window now hides on its own when attempting to close it, and the cancel button simply clears the input box and hides the widget. The overall code is significantly cleaner, and I no longer need to have so many variables containing each widget I need to interact with. The new dialog only needs access to 1 template child, the entry.</p>
<p>By the end of day 2, I have ported the database managing functions (basically wholecloth), reimplimented the creation of new Decks, and reimplimented the deck list. I’ve also started reimplimenting the card list view, but there’s much more work to be done. I decided I wanted to continue using the HdyLeaflet for the Deck view and the Card view so they would be side-by-side on large screens, and stacking on small screens. As I mentioned a while back, now the content and the header are in 1 place this is much simpler.</p>
<p>I had a small issue with both children in the leaflet being the same width. This was because both had at least 1 widget that wanted to horizontally expand, do all hexpands needed to be removed from the deck list (which only needs to be small anyways as it is <em>just</em> a list). Properly using the Gtk.Box child properties (specifically, pack start and end) meant this was quickly fixed. I quickly added both headerbars to a Hdy.HeaderGroup, and now I have working card-Deck leaflet.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://ramzi.uk/posts/flashcards/images/flashcards_take3_2.png" class="img-fluid figure-img"></p>
<figcaption>I mean… it doesn’t do much yet, but at least it’s pretty!</figcaption>
</figure>
</div>
<p>Something I noticed during this exercise, not LibHandy 1 is released there’s much more up-to-date documentation. Using <a href="https://lazka.github.io/pgi-docs/">https://lazka.github.io/pgi-docs/</a> you can view Handy 1’s classes. Previously there was a sometimes out of date Handy 0.0 docs with some missing classes. Now there’s a (currently) pretty up-to-date place to view all the clases and functions. I really hope it stays this consistent.</p>
</section>
<section id="day-3" class="level1">
<h1>Day 3</h1>
<p>Since I last worked on Flashcards, I had a look through the source code for GNOME Music. One of the coolest things I learnt about from their code was the existence of the <span class="citation" data-cites="GObject.property">@GObject.property</span> decorator. Just like you’d use the <span class="citation" data-cites="property">@property</span> and <span class="citation" data-cites="x.setter">@x.setter</span> decorators to create getter/setters, GObject.property allows you to use these setters from inside GTK Inspector. With <em>very</em> minor changes, some variables in Flashcards can now be tinkered with in the inspector.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://ramzi.uk/posts/flashcards/images/flashcards_take3_3.png" class="img-fluid figure-img"></p>
<figcaption>In this example, “count” (referring to the number of cards in a deck) and “did” (the unique identifier number for this deck) are custom properties. Admittedly, being able to edit these isn’t very useful, but “did” is not a user facing variable so being able to check it is very handy! Plus, if a user edits these in the inspector it doesn’t permanently break anything, but it will stop the app working correctly until next restart. Acceptable given it’s only doable through dev tools used at your own risk.</figcaption>
</figure>
</div>
<p>Today, I replaced database.py with a new file creatively named database2.py. The interface is the same, but most of the functions are gone. I’ve reimported the necessary functions and written new, more sensible functions in the place of some old ones. The old file just had a daunting number of functions, most of which I can’t remember why they existed or were just… weird.</p>
<p>I’ve also continued actionifying all the things. One issue I have with using actions is that I often find myself wanting to activate an action freely, in code. For example, I might want some function to emit an action to update the list of decks. I’ve yet to find a proper solution, but in every case so far I’ve not needed to do it in code. Instead, the widget I’m trying to give an action to has implimented Gtk.Actionable. This means I simply assign the GtkActionable the action mane and I can edit the action-target (basically parameters) in code. An example is the DeckList. Each item in the deck list should emit a “select-deck” signal with the deckid as a parameter. I can assign the deckid target in the did setter, and I can easily assign the action name, and now it does exactly what I want with significantly cleaner code.</p>
<p>My goal today is to get the CardList working correctly, even if you can’t add complex cards.</p>
<p>The CardList has the potential to become a really monolithic file. I may try to break the card editor into it’s own widget. This will be expecially important when I later implement more card types, as having multiple card editor UIs AND the card list AND the card search AND all the stacks that manage showing/hiding the correct areas in 1 file could turn this 1 component into an absolutely gigantic file. The previous implementation with it’s extremely basic editor already reached 250+ lines. When I re-impliment the card editor, this will need to be corrected.</p>
<p>Whenever I venture into a new area, such as implementing a more complex card editor, trying to picture an intuitive design is easily the hardest part. I can implement it, but chosing what I’m implementing is the hardest. For example, should the editor change depending on the card type? Do I want to render the results as the user enters them? Can I do that? I’ve edited the design to include a combo box to allow the user to select the card type. The options available are simple, Furigana, and Latex. However, I think for the time being I will hide the combo box and just assume the card is “simple”. I can come back to the others later, but for the initial reimplementation, simple will do. However, I think the idea of live rendering the result could be fun! I’ll need to do more reading into converting LaTeX snippets and Furigana into an image or webpage down the line. I imagine I could create an image to render these, and use it both in the editor (as a preview) and in the revise view.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://ramzi.uk/posts/flashcards/images/flashcards_take3_4.png" class="img-fluid figure-img"></p>
<figcaption>The future? Maybe!</figcaption>
</figure>
</div>
<p>I end the day with a basic implementation of the editor. It can add cards, but the deck list doesn’t update and the card list doesn’t yet exist. The deck list update shouldn’t be hard, the simplest answer would just be to refresh the entire list; however this could lead to performance issues further down the line if someone had thousands of cards, as each refresh needs to count the cards in each deck. The card list shouldn’t be too hard to implement, but implementing it cleanly will be a new challenge.</p>
<p>This is the end of this mini sprint/weekend of free time lost. I hope this is in a state where the next time I come back it’s fairly obvious what was happening. There’s some hacky things involved atm that I’m not proud of and want corrected. For example, the database object still needs to be passed to all widgets that need it in their constructor. And setting the database ID is being done by just changing the object’s did variable in the CardView’s code. Bad bad bad. Future me better fix that.</p>


</section>

 ]]></description>
  <category>Linux</category>
  <category>Software Development</category>
  <guid>https://ramzi.uk/posts/flashcards/2020_10_11_flashcards_take_3.html</guid>
  <pubDate>Sun, 11 Oct 2020 00:00:00 GMT</pubDate>
</item>
<item>
  <title>LabStreamingLayer and Flatpak work surprisingly well together</title>
  <dc:creator>George Ramzi</dc:creator>
  <link>https://ramzi.uk/posts/20200813_lsl_flatpak.html</link>
  <description><![CDATA[ 





<p>For my research I use LabStreamingLayer (LSL) to manage my data collection. It’s easy of use and portability mean I can write my experiments or tools in whatever language I like.</p>
<p>The apps, while mostly basic, are reliable. I use the LabRecorder and Keyboard app constantly for my work. They’re small apps that serve a single purpose and both serve that purpose well. There’s only one drawback for me: Windows. The LSL team provide binaries for Windows that work well enough, but I use Linux for my work. For the start of my PhD I ran all my experiments on Windows and processed the Data on Linux.</p>
<p>I spend some of my free time developing Linux desktop apps (although sadly nothing public… yet). As I’m used to using the GNOME development tool-chain, I’ve used Flatpak alot in the past. I began to wonder if LSL would function well in a Flatpak container, so I wrote a simple program to see if LSL would work. This app would look for LSL outlet and let the user select one to visualise; It would then plot this graph into a GTK window using Matplotlib. I wrote it in Python as the liblsl-python package was available through pip and is natively cross platform (as it ships precompiled liblsl libraries). To my surprise, this worked flawlessly.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://ramzi.uk/posts/images/hugo/lsl-gtk1.gif" class="img-fluid figure-img"></p>
<figcaption>My demo program running on synthetic data generated by Openbci’s GUI application.</figcaption>
</figure>
</div>
<p>A few months passed and I was working on another python application that I wanted to use for experiments. However, this time I wanted to use my knowledge of GTK development and run the whole experiment using Linux. This meant I would need to get the LabRecorder working on Linux. No matter, it’s all open-source and uses Qt for the interface. However, my knowledge of compiling C/C++ programs is…. nearly non-existent; And the precompiled binaries of liblsl for Fedora (which were accepted in the repos in <a href="https://bugzilla.redhat.com/show_bug.cgi?id=liblsl">2016</a>) were abandoned and had to be <a href="https://bugzilla.redhat.com/show_bug.cgi?id=1736030">removed from the repo before Fedora 31</a>.</p>
<p>However, I decided to give compiling LabRecorder a go. It didn’t work. Lots of errors. No clue.</p>
<p>So I decided to try again but writing a Flatpak manifest instead. From my experience, flatpak-builder is pretty good at deciding how best to build a program so long as you tell it the correct build system. So, an hour of figuring out why Qt wouldn’t create a window and why the binary wasn’t appearing anywhere and voilà, I had a LabRecorder window running on Linux in a Flatpak!</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://ramzi.uk/posts/images/hugo/LabRecorder.png" class="img-fluid figure-img"></p>
<figcaption>LabRecorder running in a flatpak on Fedora 32.</figcaption>
</figure>
</div>
<p>Below is the flatpak manifest:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode javascript code-with-copy"><code class="sourceCode javascript"><span id="cb1-1">{</span>
<span id="cb1-2">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"app-id"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"org.lsl.labrecorder"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-3">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"runtime"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"org.kde.Platform"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-4">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"runtime-version"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"5.14"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-5">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sdk"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"org.kde.Sdk"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-6">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"command"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"LabRecorder"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-7">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"finish-args"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> [</span>
<span id="cb1-8">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"--share=network"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-9">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"--share=ipc"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-10">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"--socket=x11"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-11">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"--env=QT_QPA_PLATFORM=xcb"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-12">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"--env=DISPLAY=:0.0"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-13">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"--socket=pulseaudio"</span></span>
<span id="cb1-14">  ]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-15">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cleanup"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> [</span>
<span id="cb1-16">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"/include"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-17">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"/lib/pkgconfig"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-18">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"/man"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-19">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"/share/doc"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-20">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"/share/gtk-doc"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-21">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"/share/man"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-22">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"/share/pkgconfig"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-23">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"*.la"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-24">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"*.a"</span></span>
<span id="cb1-25">  ]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-26">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"modules"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> [</span>
<span id="cb1-27">    {</span>
<span id="cb1-28">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"name"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"LSL"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-29">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"buildsystem"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cmake-ninja"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-30">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sources"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> [</span>
<span id="cb1-31">        {</span>
<span id="cb1-32">          <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"type"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"git"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-33">          <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"url"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://github.com/sccn/liblsl.git"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-34">          <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tag"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"v1.14.0b3"</span></span>
<span id="cb1-35">        }</span>
<span id="cb1-36">      ]</span>
<span id="cb1-37">    }<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-38">    {</span>
<span id="cb1-39">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"name"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"LabRecorder"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-40">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"builddir"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">true</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-41">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"buildsystem"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cmake-ninja"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-42">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sources"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> [</span>
<span id="cb1-43">        {</span>
<span id="cb1-44">          <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"type"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"git"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-45">          <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"url"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://github.com/labstreaminglayer/App-LabRecorder.git"</span></span>
<span id="cb1-46">        }</span>
<span id="cb1-47">      ]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-48">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"post-install"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> [</span>
<span id="cb1-49">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ls"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-50">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mv LabRecorder /app/bin/LabRecorder"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-51">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mv LabRecorderCLI /app/bin/LabRecorderCLI"</span></span>
<span id="cb1-52">      ]</span>
<span id="cb1-53">    }</span>
<span id="cb1-54">  ]</span>
<span id="cb1-55">}</span></code></pre></div></div>
<p>The manifest pulls in and builds both liblsl and LabRecorder on the org.kde.Platform (for the Qt and C++ libraries).</p>
<p>Where to go now? I’ve considered putting in a pull request to have this added to Flathub, but there’s no icon or .desktop file (and it would be inappropriate for me to create one without permission). I could also submit a pull request to have this in the LabRecorder repository, although I’m not sure they’ll be too thrilled at having an extra file to maintain. Admittedly, it’s not a complex file with much that needs changing, but still. Either way, this manifest exists and works. It might need updating in the future as new versions of liblsl and LabRecorder are released, but most likely all that will need changing is the tag for liblsl as LabRecorder starts to require newer versions.</p>



 ]]></description>
  <category>Linux</category>
  <category>Flatpak</category>
  <guid>https://ramzi.uk/posts/20200813_lsl_flatpak.html</guid>
  <pubDate>Thu, 13 Aug 2020 00:00:00 GMT</pubDate>
</item>
</channel>
</rss>
