deploy: f74ec777f2
|
|
@ -1,10 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en-us">
|
||||
<head>
|
||||
<title>https://sqrtminusone.xyz/configs/readme/</title>
|
||||
<link rel="canonical" href="https://sqrtminusone.xyz/configs/readme/">
|
||||
<meta name="robots" content="noindex">
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="refresh" content="0; url=https://sqrtminusone.xyz/configs/readme/">
|
||||
</head>
|
||||
</html>
|
||||
|
|
@ -63,6 +63,8 @@
|
|||
<h1>Configs</h1>
|
||||
<ul>
|
||||
|
||||
<li><a href="https://sqrtminusone.xyz/configs/readme/">0001-01-01 | </a></li>
|
||||
|
||||
<li><a href="https://sqrtminusone.xyz/configs/console/">0001-01-01 | Console</a></li>
|
||||
|
||||
<li><a href="https://sqrtminusone.xyz/configs/desktop/">0001-01-01 | Desktop</a></li>
|
||||
|
|
@ -73,8 +75,6 @@
|
|||
|
||||
<li><a href="https://sqrtminusone.xyz/configs/mail/">0001-01-01 | Mail</a></li>
|
||||
|
||||
<li><a href="https://sqrtminusone.xyz/configs/readme/">0001-01-01 | My dotfiles</a></li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,15 @@
|
|||
<description>Recent content in Configs on SqrtMinusOne</description>
|
||||
<generator>Hugo -- gohugo.io</generator>
|
||||
<language>en-us</language><atom:link href="https://sqrtminusone.xyz/configs/index.xml" rel="self" type="application/rss+xml" />
|
||||
<item>
|
||||
<title></title>
|
||||
<link>https://sqrtminusone.xyz/configs/readme/</link>
|
||||
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
|
||||
|
||||
<guid>https://sqrtminusone.xyz/configs/readme/</guid>
|
||||
<description></description>
|
||||
</item>
|
||||
|
||||
<item>
|
||||
<title>Console</title>
|
||||
<link>https://sqrtminusone.xyz/configs/console/</link>
|
||||
|
|
@ -67,17 +76,5 @@ My email configration. Currently I use lieer to fetch emails from Gmail, davmail
|
|||
My problem with any particular mail setup was that I use Gmail labels quite extensively, and handling these over IMAP is rather awkward. Notmuch seems to be the only software that provides the same first-class support for labels.</description>
|
||||
</item>
|
||||
|
||||
<item>
|
||||
<title>My dotfiles</title>
|
||||
<link>https://sqrtminusone.xyz/configs/readme/</link>
|
||||
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
|
||||
|
||||
<guid>https://sqrtminusone.xyz/configs/readme/</guid>
|
||||
<description>These are my GNU/Linux configuration files. View at GitHub.
|
||||
Most of the software is configured with literate configuration strategy via Emacs&rsquo; Org Mode. This way has its pros and cons, but overall it&rsquo;s pretty nice to keep the configs interweaved with comments in a handful of files.
|
||||
The files themselves are managed and deployed via yadm, but I use Org Mode for things like config templating.
|
||||
My current GNU/Linux distribution is GNU Guix.</description>
|
||||
</item>
|
||||
|
||||
</channel>
|
||||
</rss>
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
|
||||
<title>My dotfiles</title>
|
||||
<title></title>
|
||||
<meta name="description" content="Freedom is a state of mind">
|
||||
<meta name="author" content='SqrtMinusOne'>
|
||||
|
||||
|
|
@ -59,94 +59,8 @@
|
|||
<hr>
|
||||
<div id="content">
|
||||
<div class="container">
|
||||
<h1>My dotfiles</h1>
|
||||
<figure><img src="https://forthebadge.com/images/badges/works-on-my-machine.svg"/>
|
||||
</figure>
|
||||
|
||||
<p>These are my GNU/Linux configuration files. <a href="https://github.com/SqrtMinusOne/dotfiles">View at GitHub</a>.</p>
|
||||
<p>Most of the software is configured with <a href="https://leanpub.com/lit-config/read">literate configuration</a> strategy via Emacs’ <a href="https://orgmode.org/">Org Mode</a>. This way has its pros and cons, but overall it’s pretty nice to keep the configs interweaved with comments in a handful of files.</p>
|
||||
<p>The files themselves are managed and deployed via <a href="https://yadm.io/">yadm</a>, but I use Org Mode for things like config templating.</p>
|
||||
<p>My current GNU/Linux distribution is <a href="https://guix.gnu.org/">GNU Guix</a>. I like Guix because, among other things, it allows <a href="https://guix.gnu.org/cookbook/en/html_node/Advanced-package-management.html#Advanced-package-management">declaring the required software</a> in configuration files, so I can have the same set of programs across multiple machines (look for tables with “Guix dependency” in the header).</p>
|
||||
<p>The central program to all of that is, of course <a href="https://www.gnu.org/software/emacs/">GNU Emacs</a>. As of the moment of this writing, it takes ~50% of my screen time and has the largest share of configuration here.</p>
|
||||
<p>Table of contents and software:</p>
|
||||
<ul>
|
||||
<li><a href="/configs/emacs/">Emacs.org</a>
|
||||
<ul>
|
||||
<li><a href="/configs/emacs/">GNU Emacs</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="/configs/desktop/">Desktop.org</a>
|
||||
<ul>
|
||||
<li><em>Active</em>: <a href="/configs/desktop/#exwm">EXWM</a>, <a href="/configs/desktop/#polybar">Polybar</a>, <a href="/configs/desktop/#rofi">Rofi</a>, <a href="/configs/desktop/#flameshot">Flameshot</a>, <a href="/configs/desktop/#dunst">dunst</a>, <a href="/configs/desktop/#picom">Picom</a>, <a href="/configs/desktop/#zathura">Zathura</a></li>
|
||||
<li><em>In Limbo</em>: <a href="/configs/desktop/#i3wm">i3wm</a>, <a href="/configs/desktop/#keynav">keynav</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="/configs/console/">Console.org</a>
|
||||
<ul>
|
||||
<li><em>Active</em>: <a href="/configs/console/#dot-profile">.profile</a>, <a href="/configs/console/#bash">Bash</a>, <a href="/configs/console/#fish">Fish</a>, <a href="/configs/console/#starship-prompt">Starship</a>, <a href="/configs/console/#tmux">Tmux</a>, <a href="/configs/console/#alacritty">Alacritty</a></li>
|
||||
<li><em>In Limbo</em>: <a href="/configs/console/#nushell">Nushell</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="/configs/guix/">Guix.org</a></li>
|
||||
<li><a href="/configs/mail/">Mail.org</a>
|
||||
<ul>
|
||||
<li><em>Active</em>: <a href="/configs/mail/#lieer">Lieer</a>, <a href="/configs/mail/#davmail">DavMail</a>, <a href="/configs/mail/#offlineimap">OfflineIMAP</a>, <a href="/configs/mail/#notmuch">Notmuch</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<p>(<em>Apparently, links on the second level work only in Emacs 🙁</em>)</p>
|
||||
<p>A few other repositories I may consider a part of my config:</p>
|
||||
<ul>
|
||||
<li><a href="https://github.com/SqrtMinusOne/channel-q">channel-q</a> is my Guix channel</li>
|
||||
<li><a href="https://github.com/SqrtMinusOne/sqrt-data">sqrt-data</a> is a home for my statistics gathering effort</li>
|
||||
<li>Emacs packages that I wrote (some of them originated in my Emacs config):
|
||||
<ul>
|
||||
<li><a href="https://github.com/SqrtMinusOne/lyrics-fetcher.el">lyrics-fetcher.el</a></li>
|
||||
<li><a href="https://github.com/SqrtMinusOne/pomm.el">pomm.el</a></li>
|
||||
<li><a href="https://github.com/SqrtMinusOne/perspective-exwm.el">perspective-exwm.el</a></li>
|
||||
<li><a href="https://github.com/SqrtMinusOne/exwm-modeline">exwm-modeline.el</a></li>
|
||||
<li><a href="https://github.com/SqrtMinusOne/org-journal-tags">org-journal-tags</a></li>
|
||||
<li><a href="https://github.com/SqrtMinusOne/elfeed-summary">elfeed-summary</a></li>
|
||||
<li><a href="https://github.com/SqrtMinusOne/password-store-ivy">password-store-ivy</a></li>
|
||||
<li><a href="https://github.com/SqrtMinusOne/elfeed-sync">elfeed-sync</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<p>Posts about my configuration:</p>
|
||||
<ul>
|
||||
<li><a href="https://sqrtminusone.xyz/posts/2022-05-09-pdf/">Extending elfeed with PDF viewer and subtitles fetcher</a></li>
|
||||
<li><a href="https://sqrtminusone.xyz/posts/2022-02-12-literate/">A few cases of literate configuration</a></li>
|
||||
<li><a href="https://sqrtminusone.xyz/posts/2022-01-03-exwm/">Using EXWM and perspective.el on a multi-monitor setup</a></li>
|
||||
<li><a href="https://sqrtminusone.xyz/posts/2021-10-04-emacs-i3/">Getting a consistent set of keybindings between i3 and Emacs</a></li>
|
||||
<li><a href="https://sqrtminusone.xyz/posts/2021-09-07-emms/">My EMMS and elfeed setup</a></li>
|
||||
<li><a href="https://sqrtminusone.xyz/posts/2021-05-01-org-python/">Replacing Jupyter Notebook with Org Mode</a></li>
|
||||
<li><a href="https://sqrtminusone.xyz/posts/2021-02-27-gmail/">Multiple Gmail accounts & labels with Emacs</a></li>
|
||||
</ul>
|
||||
<h2 id="some-statistics">Some statistics</h2>
|
||||
<figure><img src="https://sqrtminusone.xyz/stats/all.png"/>
|
||||
</figure>
|
||||
|
||||
<figure><img src="https://sqrtminusone.xyz/stats/emacs-vim.png"/>
|
||||
</figure>
|
||||
|
||||
<figure><img src="https://sqrtminusone.xyz/stats/literate-config.png"/>
|
||||
</figure>
|
||||
|
||||
<h2 id="misc">Misc</h2>
|
||||
<h3 id="notes">Notes</h3>
|
||||
<ul>
|
||||
<li><code>M-u C-c C-v t</code> to tangle a particular block</li>
|
||||
<li><code>M-u M-u C-c C-v t</code> to tangle a particular file</li>
|
||||
<li><code>C-c C-v d</code> to demarcate a block</li>
|
||||
</ul>
|
||||
<p>Uses yadm’s <code>post_alt</code> hook to create symlinks</p>
|
||||
<h3 id="encrypted-files">Encrypted files</h3>
|
||||
<div class="highlight"><pre tabindex="0" style=";-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-text" data-lang="text"><span style="display:flex;"><span>Mail/thexcloud/.credentials.gmailieer.json
|
||||
</span></span><span style="display:flex;"><span>Mail/progin6304/.credentials.gmailieer.json
|
||||
</span></span><span style="display:flex;"><span>.emacs.d/private.org
|
||||
</span></span><span style="display:flex;"><span>.emacs.d/private.el
|
||||
</span></span><span style="display:flex;"><span>.emacs.d/.trello/sqrtminusone.el
|
||||
</span></span></code></pre></div>
|
||||
<h1></h1>
|
||||
|
||||
</div>
|
||||
|
||||
</div><div id="footer" class="mb-5">
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 928 KiB After Width: | Height: | Size: 928 KiB |
|
Before Width: | Height: | Size: 492 KiB After Width: | Height: | Size: 492 KiB |
|
Before Width: | Height: | Size: 522 KiB After Width: | Height: | Size: 522 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 44 KiB |
|
Before Width: | Height: | Size: 637 KiB After Width: | Height: | Size: 637 KiB |
|
Before Width: | Height: | Size: 344 KiB After Width: | Height: | Size: 344 KiB |
|
Before Width: | Height: | Size: 671 KiB After Width: | Height: | Size: 671 KiB |
|
Before Width: | Height: | Size: 724 KiB After Width: | Height: | Size: 724 KiB |
35
index.xml
|
|
@ -450,7 +450,7 @@
|
|||
</span></span><span style="display:flex;"><span> <span style="color:#008000">:overwrite</span> <span style="color:#19177c">current-prefix-arg</span>)))
|
||||
</span></span></code></pre></div><p>If the <code>my/elfeed-show-rdrview-html</code> variable is bound and true, then the content in this buffer was retrieved via <code>rdrview</code>, so we&rsquo;ll use that instead of the output of <code>elfeed-deref</code>.</p>
|
||||
<p>Now we can open elfeed entries in a PDF viewer, which I find much nicer to read. Given that RSS feeds generally ship with simpler HTML than the regular websites, results usually look awesome:</p>
|
||||
<figure><img src="https://sqrtminusone.xyz/ox-hugo/pdf-prot.png"/>
|
||||
<figure><img src="https://sqrtminusone.xyz/images/pdf-prot.png"/>
|
||||
</figure>
|
||||
|
||||
<h3 id="opening-arbitrary-sites">Opening arbitrary sites</h3>
|
||||
|
|
@ -489,7 +489,7 @@
|
|||
</span></span></code></pre></div><p>Unfortunately, this part doesn&rsquo;t work that well, so we can&rsquo;t just uninstall Firefox or Chromium and browse the web from a PDF viewer.</p>
|
||||
<p>The most common problem I&rsquo;ve encountered is incorrectly formed pictures, such as <code>.png</code> files without the boundary info. I&rsquo;m sure you&rsquo;ve also come across this if you ever tried to insert a lot of Internet pictures into a LaTeX document.</p>
|
||||
<p>However, sans the pictures issue, for certain sites like Wikipedia this is usable. For instance, here&rsquo;s how the Emacs page looks:
|
||||
<img src="https://sqrtminusone.xyz/ox-hugo/pdf-emacs.png" alt=""></p>
|
||||
<img src="https://sqrtminusone.xyz/images/pdf-emacs.png" alt=""></p>
|
||||
<h2 id="youtube-transcripts">YouTube transcripts</h2>
|
||||
<h3 id="getting-subtitles">Getting subtitles</h3>
|
||||
<p>Finally, let&rsquo;s get to transcripts.</p>
|
||||
|
|
@ -584,7 +584,7 @@
|
|||
</span></span><span style="display:flex;"><span> (<span style="color:#008000">setq-local</span> <span style="color:#19177c">subed-mpv-video-file</span> (<span style="color:#19177c">elfeed-entry-link</span> <span style="color:#19177c">entry</span>))
|
||||
</span></span><span style="display:flex;"><span> (<span style="color:#19177c">subed-mpv--play</span> <span style="color:#19177c">subed-mpv-video-file</span>))
|
||||
</span></span></code></pre></div><p>And here&rsquo;s how it looks when used (the video on the screenshot is <a href="https://www.youtube.com/watch?v=qjAIXCmhCQQ">this System Crafters&rsquo; stream</a>):
|
||||
<img src="https://sqrtminusone.xyz/ox-hugo/pdf-subed.png" alt=""></p>
|
||||
<img src="https://sqrtminusone.xyz/images/pdf-subed.png" alt=""></p>
|
||||
<p>Keep in mind that this function has to be launched inside the buffer opened by the <code>my/elfeed-youtube-subtitles</code> function.</p>
|
||||
|
||||
</content>
|
||||
|
|
@ -846,7 +846,7 @@
|
|||
<h2 id="polybar">Polybar</h2>
|
||||
<p>Now, the most <del>crazy</del> advanced case I&rsquo;ve come up with so far.</p>
|
||||
<p>Basically, here is how my <a href="https://github.com/polybar/polybar">polybar</a> currently looks:
|
||||
<img src="https://sqrtminusone.xyz/ox-hugo/literate--polybar.png" alt=""></p>
|
||||
<img src="https://sqrtminusone.xyz/images/literate--polybar.png" alt=""></p>
|
||||
<p>It has:</p>
|
||||
<ul>
|
||||
<li>colors from the general color theme;</li>
|
||||
|
|
@ -1204,8 +1204,8 @@
|
|||
</span></span></code></pre></div><p>workspaces 2 and 3 on the machine with hostname &ldquo;indigo&rdquo; will be displayed on the monitor <code>DVI-D-0</code>.</p>
|
||||
<p>However, some features, common in other tiling WMs, are missing in EXWM out of the box, namely:</p>
|
||||
<ul>
|
||||
<li>a command to <a href="https://i3wm.org/docs/userguide.html#%5Ffocusing%5Fmoving%5Fcontainers">switch to another monitor</a>;</li>
|
||||
<li>a command to <a href="https://i3wm.org/docs/userguide.html#move%5Fto%5Foutputs">move the current workspace to another monitor</a>;</li>
|
||||
<li>a command to <a href="https://i3wm.org/docs/userguide.html#_focusing_moving_containers">switch to another monitor</a>;</li>
|
||||
<li>a command to <a href="https://i3wm.org/docs/userguide.html#move_to_outputs">move the current workspace to another monitor</a>;</li>
|
||||
<li>using the same commands to switch between windows and monitors.</li>
|
||||
</ul>
|
||||
<p>Here&rsquo;s my take on implementing them.</p>
|
||||
|
|
@ -1264,7 +1264,7 @@
|
|||
</span></span></code></pre></div><h3 id="switch-to-another-monitor">Switch to another monitor</h3>
|
||||
<p>With the functions from the previous two sections, we can implement switching to another monitor by switching to the most recently used workspace on that monitor.</p>
|
||||
<video controls width="100%">
|
||||
<source src="https://sqrtminusone.xyz/ox-hugo/exwm-workspace-switch.mp4" type="video/mp4">
|
||||
<source src="https://sqrtminusone.xyz/videos/exwm-workspace-switch.mp4" type="video/mp4">
|
||||
</video>
|
||||
<p>One caveat here is that on the startup the <code>my/exwm-last-workspaces</code> variable won&rsquo;t have any values from other monitor(s), so this list is concatenated with the list of available workspace indices.</p>
|
||||
<div class="highlight"><pre tabindex="0" style=";-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-emacs-lisp" data-lang="emacs-lisp"><span style="display:flex;"><span>(<span style="color:#008000">defun</span> <span style="color:#19177c">my/exwm-switch-to-other-monitor</span> (<span style="color:#008000">&amp;optional</span> <span style="color:#19177c">dir</span>)
|
||||
|
|
@ -1286,7 +1286,7 @@
|
|||
<h3 id="move-the-workspace-to-another-monitor">Move the workspace to another monitor</h3>
|
||||
<p>Now, moving the workspace to another monitor.</p>
|
||||
<video controls width="100%">
|
||||
<source src="https://sqrtminusone.xyz/ox-hugo/exwm-workspace-move.mp4" type="video/mp4">
|
||||
<source src="https://sqrtminusone.xyz/videos/exwm-workspace-move.mp4" type="video/mp4">
|
||||
</video>
|
||||
<p>This is actually quite easy to pull off - one just has to update <code>exwm-randr-workspace-monitor-plist</code> accordingly and run <code>exwm-randr-refresh</code>. I just add another check there because I don&rsquo;t want some monitor to remain without workspaces at all.</p>
|
||||
<div class="highlight"><pre tabindex="0" style=";-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-emacs-lisp" data-lang="emacs-lisp"><span style="display:flex;"><span>(<span style="color:#008000">defun</span> <span style="color:#19177c">my/exwm-workspace-switch-monitor</span> ()
|
||||
|
|
@ -1389,7 +1389,7 @@
|
|||
</span></span></code></pre></div><h3 id="resizing-windows">Resizing windows</h3>
|
||||
<p>I find this odd that there are different commands to resize tiling and floating windows.</p>
|
||||
<video controls width="100%">
|
||||
<source src="https://sqrtminusone.xyz/ox-hugo/exwm-resize-hydra.mp4" type="video/mp4">
|
||||
<source src="https://sqrtminusone.xyz/videos/exwm-resize-hydra.mp4" type="video/mp4">
|
||||
</video>
|
||||
<p>So let&rsquo;s define one command to perform both resizes depending on the context:</p>
|
||||
<div class="highlight"><pre tabindex="0" style=";-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-emacs-lisp" data-lang="emacs-lisp"><span style="display:flex;"><span>(<span style="color:#008000">setq</span> <span style="color:#19177c">my/exwm-resize-value</span> <span style="color:#666">5</span>)
|
||||
|
|
@ -1501,7 +1501,7 @@
|
|||
<p>One common point of criticism of i3 is that it is not extensible enough, especially compared to WMs that are configured in an actual programing language, like the mentioned XMonad, <a href="http://www.qtile.org/">Qtile</a>, <a href="https://awesomewm.org/">Awesome</a>, etc. But I think i3&rsquo;s extensibility is underappreciated, although the contents of this article may lie closer to the limits of how far one can go there.</p>
|
||||
<p>Here is a small demo of how it currently works:</p>
|
||||
<video controls width="100%">
|
||||
<source src="https://sqrtminusone.xyz/ox-hugo/i3-emacs-demo.mp4" type="video/mp4">
|
||||
<source src="https://sqrtminusone.xyz/static/videos/i3-emacs-demo.mp4" type="video/mp4">
|
||||
</video>
|
||||
<h2 id="emacs-integration">Emacs integration</h2>
|
||||
<p>What I&rsquo;m trying to do is actually quite simple, so I&rsquo;m somewhat surprised I didn&rsquo;t find anything similar on the Internet. But I didn&rsquo;t look too hard.</p>
|
||||
|
|
@ -1697,7 +1697,7 @@
|
|||
<guid>https://sqrtminusone.xyz/posts/2021-09-07-emms/</guid>
|
||||
<content type="html">
|
||||
<h2 id="intro">Intro</h2>
|
||||
<figure><img src="https://sqrtminusone.xyz/ox-hugo/emms-screenshot.png"/>
|
||||
<figure><img src="https://sqrtminusone.xyz/images/emms/emms-screenshot.png"/>
|
||||
</figure>
|
||||
|
||||
<p>This is the current state of my quest to live in Emacs, at least in part of reading RSS and music.</p>
|
||||
|
|
@ -1936,7 +1936,7 @@
|
|||
|
||||
<guid>https://sqrtminusone.xyz/posts/2021-05-01-org-python/</guid>
|
||||
<content type="html">
|
||||
<figure><img src="https://sqrtminusone.xyz/ox-hugo/org-python-screenshot.png"/>
|
||||
<figure><img src="https://sqrtminusone.xyz/images/org-python/org-python-screenshot.png"/>
|
||||
</figure>
|
||||
|
||||
<h2 id="why">Why?</h2>
|
||||
|
|
@ -2275,7 +2275,7 @@
|
|||
<div class="highlight"><pre tabindex="0" style=";-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-text" data-lang="text"><span style="display:flex;"><span>#+LATEX_CLASS: org-plain-extarticle
|
||||
</span></span><span style="display:flex;"><span>#+LATEX_CLASS_OPTIONS: [a4paper, 14pt]
|
||||
</span></span></code></pre></div><p>14pt size is required by certain state standards of ours for some reason.</p>
|
||||
<p>After which you can put whatever you want in the preamble with <code>LATEX_HEADER</code>. My workflow with LaTeX is to write a bunch of <code>.sty</code> files beforehand and import the necessary ones in the preamble. <a href="https://github.com/SqrtMinusOne/LaTeX%5Ftemplates">Here</a> is the repo with these files, although quite predictably, it&rsquo;s a mess. At any rate, I have to write something like the following in the target Org file:</p>
|
||||
<p>After which you can put whatever you want in the preamble with <code>LATEX_HEADER</code>. My workflow with LaTeX is to write a bunch of <code>.sty</code> files beforehand and import the necessary ones in the preamble. <a href="https://github.com/SqrtMinusOne/LaTeX_templates">Here</a> is the repo with these files, although quite predictably, it&rsquo;s a mess. At any rate, I have to write something like the following in the target Org file:</p>
|
||||
<div class="highlight"><pre tabindex="0" style=";-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-text" data-lang="text"><span style="display:flex;"><span>#+LATEX_HEADER: \usepackage{styles/generalPreamble}
|
||||
</span></span><span style="display:flex;"><span>#+LATEX_HEADER: \usepackage{styles/reportFormat}
|
||||
</span></span><span style="display:flex;"><span>#+LATEX_HEADER: \usepackage{styles/mintedSourceCode}
|
||||
|
|
@ -2305,10 +2305,10 @@
|
|||
<p>Any classical IMAP/SMTP client is hard to use in my case, because a message with multiple labels is copied to IMAP folders for each of the label plus the inbox folder, and the copies look like different messages from the client-side. For example, a message can be read in one label and unread in another.</p>
|
||||
<p>For a few years, my solution was <a href="https://getmailspring.com/">Mailspring</a>, which provides first-class support for labels. However, it has a feature to deploy <a href="https://www.bbc.com/news/technology-56071437">spy pixels</a> on emails (and offers no protection from them, obviously), the client is Electron-based with a mouse-driven interface, and the sync engine was closed-source at the time.</p>
|
||||
<p>So, I found an alternative in Emacs+notmuch+lieer and ditched one more proprietary app (the last big one I can&rsquo;t let go of is DataGrip).</p>
|
||||
<figure><img src="https://sqrtminusone.xyz/ox-hugo/main.png"/>
|
||||
<figure><img src="https://sqrtminusone.xyz/images/gmail/main.png"/>
|
||||
</figure>
|
||||
|
||||
<figure><img src="https://sqrtminusone.xyz/ox-hugo/mail.png"/>
|
||||
<figure><img src="https://sqrtminusone.xyz/images/gmail/mail.png"/>
|
||||
</figure>
|
||||
|
||||
<p>Notmuch&rsquo;s tags are just as advanced as Gmail&rsquo;s labels, so I have basically the same mail structure accessible from Emacs, Gmail Android client and even the web UI when I don&rsquo;t have access to the first two.</p>
|
||||
|
|
@ -2334,6 +2334,7 @@
|
|||
</span></span><span style="display:flex;"><span>pip install .
|
||||
</span></span></code></pre></div><p>After which we may check if the <code>gmi</code> executable is available:</p>
|
||||
<div class="highlight"><pre tabindex="0" style=";-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>which gmi
|
||||
</span></span></code></pre></div><div class="highlight"><pre tabindex="0" style=";-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-text" data-lang="text"><span style="display:flex;"><span>/home/pavel/Programs/miniconda3/envs/mail/bin/gmi
|
||||
</span></span></code></pre></div><h3 id="notmuch">Notmuch</h3>
|
||||
<p><a href="https://notmuchmail.org/">Notmuch</a> is present in most of the package repositories, so you can install it with your package manager, which is <code>pacman</code> in my case.</p>
|
||||
<div class="highlight"><pre tabindex="0" style=";-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>sudo pacman -S notmuch
|
||||
|
|
@ -2426,7 +2427,7 @@
|
|||
<p>Authorization parameters will be saved to your <a href="https://www.emacswiki.org/emacs/GnusAuthinfo">authinfo</a> file. If you didn&rsquo;t have one, the plaintext <code>.authinfo</code> will be created, so it&rsquo;s reasonable to encrypt it:</p>
|
||||
<div class="highlight"><pre tabindex="0" style=";-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span><span style="color:#008000">cd</span> ~
|
||||
</span></span><span style="display:flex;"><span>gpg -o .authinfo.gpg -c --cipher-algo AES256 .authinfo
|
||||
</span></span></code></pre></div><p>However, if you plan to use multiple accounts with different SMTP servers, it makes more sense to use something like <a href="https://marlam.de/msmtp/msmtp.html">MSMTP</a> to manage multiple accounts. Here are a couple of examples (<a href="https://www.reddit.com/r/emacs/comments/9piml5/a%5Ffew%5Fquick%5Femacsnotmuch%5Fquestions/e83zcck?utm%5Fsource=share&amp;utm%5Fmedium=web2x&amp;context=3">1</a>, <a href="https://www.reddit.com/r/emacs/comments/9piml5/a%5Ffew%5Fquick%5Femacsnotmuch%5Fquestions/e84otah?utm%5Fsource=share&amp;utm%5Fmedium=web2x&amp;context=3">2</a>) how to do that.</p>
|
||||
</span></span></code></pre></div><p>However, if you plan to use multiple accounts with different SMTP servers, it makes more sense to use something like <a href="https://marlam.de/msmtp/msmtp.html">MSMTP</a> to manage multiple accounts. Here are a couple of examples (<a href="https://www.reddit.com/r/emacs/comments/9piml5/a_few_quick_emacsnotmuch_questions/e83zcck?utm_source=share&amp;utm_medium=web2x&amp;context=3">1</a>, <a href="https://www.reddit.com/r/emacs/comments/9piml5/a_few_quick_emacsnotmuch_questions/e84otah?utm_source=share&amp;utm_medium=web2x&amp;context=3">2</a>) how to do that.</p>
|
||||
<p>Another alternative for Gmail is to use <a href="https://github.com/gauteh/lieer/wiki/GNU-Emacs-and-Lieer">lieer as sendmail program</a>. That may make sense if you don&rsquo;t want to enable IMAP and SMTP on your account.</p>
|
||||
<p>There are also <a href="https://notmuchmail.org/emacstips/#index13h2">a bunch of ways</a> to set up address completion if the built-in completion based on notmuch database does not suffice.</p>
|
||||
<p>I also use <a href="https://github.com/mhayashi1120/Emacs-langtool">LanguageTool for Emacs</a> to do a spell checking of important emails (integrations like that really make Emacs shine). For some reason, developers don&rsquo;t give a link to download the server on the frontpage, so <a href="https://dev.languagetool.org/http-server">here it is</a>. And here is the relevant part of my Emacs config:</p>
|
||||
|
|
@ -2526,7 +2527,7 @@
|
|||
</span></span></code></pre></div><p>The script is launched with cron every 5 minutes:</p>
|
||||
<div class="highlight"><pre tabindex="0" style=";-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>*/5 * * * * bash /home/pavel/bin/scripts/check-email
|
||||
</span></span></code></pre></div><p>Here&rsquo;s how the notification looks like:
|
||||
<img src="https://sqrtminusone.xyz/ox-hugo/notification.png" alt=""></p>
|
||||
<img src="https://sqrtminusone.xyz/images/gmail/notification.png" alt=""></p>
|
||||
<h2 id="caveats">Caveats</h2>
|
||||
<ul>
|
||||
<li><a href="https://github.com/gauteh/lieer#caveats">lieer</a> has an extensive list of caveats concerning Gmail API</li>
|
||||
|
|
|
|||
BIN
ox-hugo/all.png
|
Before Width: | Height: | Size: 114 KiB |
|
Before Width: | Height: | Size: 53 KiB |
|
Before Width: | Height: | Size: 59 KiB |
|
Before Width: | Height: | Size: 928 KiB |
|
|
@ -66,10 +66,10 @@
|
|||
<p>Any classical IMAP/SMTP client is hard to use in my case, because a message with multiple labels is copied to IMAP folders for each of the label plus the inbox folder, and the copies look like different messages from the client-side. For example, a message can be read in one label and unread in another.</p>
|
||||
<p>For a few years, my solution was <a href="https://getmailspring.com/">Mailspring</a>, which provides first-class support for labels. However, it has a feature to deploy <a href="https://www.bbc.com/news/technology-56071437">spy pixels</a> on emails (and offers no protection from them, obviously), the client is Electron-based with a mouse-driven interface, and the sync engine was closed-source at the time.</p>
|
||||
<p>So, I found an alternative in Emacs+notmuch+lieer and ditched one more proprietary app (the last big one I can’t let go of is DataGrip).</p>
|
||||
<figure><img src="/ox-hugo/main.png"/>
|
||||
<figure><img src="/images/gmail/main.png"/>
|
||||
</figure>
|
||||
|
||||
<figure><img src="/ox-hugo/mail.png"/>
|
||||
<figure><img src="/images/gmail/mail.png"/>
|
||||
</figure>
|
||||
|
||||
<p>Notmuch’s tags are just as advanced as Gmail’s labels, so I have basically the same mail structure accessible from Emacs, Gmail Android client and even the web UI when I don’t have access to the first two.</p>
|
||||
|
|
@ -95,6 +95,7 @@
|
|||
</span></span><span style="display:flex;"><span>pip install .
|
||||
</span></span></code></pre></div><p>After which we may check if the <code>gmi</code> executable is available:</p>
|
||||
<div class="highlight"><pre tabindex="0" style=";-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>which gmi
|
||||
</span></span></code></pre></div><div class="highlight"><pre tabindex="0" style=";-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-text" data-lang="text"><span style="display:flex;"><span>/home/pavel/Programs/miniconda3/envs/mail/bin/gmi
|
||||
</span></span></code></pre></div><h3 id="notmuch">Notmuch</h3>
|
||||
<p><a href="https://notmuchmail.org/">Notmuch</a> is present in most of the package repositories, so you can install it with your package manager, which is <code>pacman</code> in my case.</p>
|
||||
<div class="highlight"><pre tabindex="0" style=";-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>sudo pacman -S notmuch
|
||||
|
|
@ -187,7 +188,7 @@
|
|||
<p>Authorization parameters will be saved to your <a href="https://www.emacswiki.org/emacs/GnusAuthinfo">authinfo</a> file. If you didn’t have one, the plaintext <code>.authinfo</code> will be created, so it’s reasonable to encrypt it:</p>
|
||||
<div class="highlight"><pre tabindex="0" style=";-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span><span style="color:#008000">cd</span> ~
|
||||
</span></span><span style="display:flex;"><span>gpg -o .authinfo.gpg -c --cipher-algo AES256 .authinfo
|
||||
</span></span></code></pre></div><p>However, if you plan to use multiple accounts with different SMTP servers, it makes more sense to use something like <a href="https://marlam.de/msmtp/msmtp.html">MSMTP</a> to manage multiple accounts. Here are a couple of examples (<a href="https://www.reddit.com/r/emacs/comments/9piml5/a%5Ffew%5Fquick%5Femacsnotmuch%5Fquestions/e83zcck?utm%5Fsource=share&utm%5Fmedium=web2x&context=3">1</a>, <a href="https://www.reddit.com/r/emacs/comments/9piml5/a%5Ffew%5Fquick%5Femacsnotmuch%5Fquestions/e84otah?utm%5Fsource=share&utm%5Fmedium=web2x&context=3">2</a>) how to do that.</p>
|
||||
</span></span></code></pre></div><p>However, if you plan to use multiple accounts with different SMTP servers, it makes more sense to use something like <a href="https://marlam.de/msmtp/msmtp.html">MSMTP</a> to manage multiple accounts. Here are a couple of examples (<a href="https://www.reddit.com/r/emacs/comments/9piml5/a_few_quick_emacsnotmuch_questions/e83zcck?utm_source=share&utm_medium=web2x&context=3">1</a>, <a href="https://www.reddit.com/r/emacs/comments/9piml5/a_few_quick_emacsnotmuch_questions/e84otah?utm_source=share&utm_medium=web2x&context=3">2</a>) how to do that.</p>
|
||||
<p>Another alternative for Gmail is to use <a href="https://github.com/gauteh/lieer/wiki/GNU-Emacs-and-Lieer">lieer as sendmail program</a>. That may make sense if you don’t want to enable IMAP and SMTP on your account.</p>
|
||||
<p>There are also <a href="https://notmuchmail.org/emacstips/#index13h2">a bunch of ways</a> to set up address completion if the built-in completion based on notmuch database does not suffice.</p>
|
||||
<p>I also use <a href="https://github.com/mhayashi1120/Emacs-langtool">LanguageTool for Emacs</a> to do a spell checking of important emails (integrations like that really make Emacs shine). For some reason, developers don’t give a link to download the server on the frontpage, so <a href="https://dev.languagetool.org/http-server">here it is</a>. And here is the relevant part of my Emacs config:</p>
|
||||
|
|
@ -287,7 +288,7 @@
|
|||
</span></span></code></pre></div><p>The script is launched with cron every 5 minutes:</p>
|
||||
<div class="highlight"><pre tabindex="0" style=";-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>*/5 * * * * bash /home/pavel/bin/scripts/check-email
|
||||
</span></span></code></pre></div><p>Here’s how the notification looks like:
|
||||
<img src="/ox-hugo/notification.png" alt=""></p>
|
||||
<img src="/images/gmail/notification.png" alt=""></p>
|
||||
<h2 id="caveats">Caveats</h2>
|
||||
<ul>
|
||||
<li><a href="https://github.com/gauteh/lieer#caveats">lieer</a> has an extensive list of caveats concerning Gmail API</li>
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@
|
|||
<div id="content">
|
||||
<div class="container">
|
||||
<h1>Replacing Jupyter Notebook with Org Mode</h1>
|
||||
<figure><img src="/ox-hugo/org-python-screenshot.png"/>
|
||||
<figure><img src="/images/org-python/org-python-screenshot.png"/>
|
||||
</figure>
|
||||
|
||||
<h2 id="why">Why?</h2>
|
||||
|
|
@ -399,7 +399,7 @@
|
|||
<div class="highlight"><pre tabindex="0" style=";-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-text" data-lang="text"><span style="display:flex;"><span>#+LATEX_CLASS: org-plain-extarticle
|
||||
</span></span><span style="display:flex;"><span>#+LATEX_CLASS_OPTIONS: [a4paper, 14pt]
|
||||
</span></span></code></pre></div><p>14pt size is required by certain state standards of ours for some reason.</p>
|
||||
<p>After which you can put whatever you want in the preamble with <code>LATEX_HEADER</code>. My workflow with LaTeX is to write a bunch of <code>.sty</code> files beforehand and import the necessary ones in the preamble. <a href="https://github.com/SqrtMinusOne/LaTeX%5Ftemplates">Here</a> is the repo with these files, although quite predictably, it’s a mess. At any rate, I have to write something like the following in the target Org file:</p>
|
||||
<p>After which you can put whatever you want in the preamble with <code>LATEX_HEADER</code>. My workflow with LaTeX is to write a bunch of <code>.sty</code> files beforehand and import the necessary ones in the preamble. <a href="https://github.com/SqrtMinusOne/LaTeX_templates">Here</a> is the repo with these files, although quite predictably, it’s a mess. At any rate, I have to write something like the following in the target Org file:</p>
|
||||
<div class="highlight"><pre tabindex="0" style=";-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-text" data-lang="text"><span style="display:flex;"><span>#+LATEX_HEADER: \usepackage{styles/generalPreamble}
|
||||
</span></span><span style="display:flex;"><span>#+LATEX_HEADER: \usepackage{styles/reportFormat}
|
||||
</span></span><span style="display:flex;"><span>#+LATEX_HEADER: \usepackage{styles/mintedSourceCode}
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@
|
|||
<div class="container">
|
||||
<h1>My EMMS and elfeed setup</h1>
|
||||
<h2 id="intro">Intro</h2>
|
||||
<figure><img src="/ox-hugo/emms-screenshot.png"/>
|
||||
<figure><img src="/images/emms/emms-screenshot.png"/>
|
||||
</figure>
|
||||
|
||||
<p>This is the current state of my quest to live in Emacs, at least in part of reading RSS and music.</p>
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@
|
|||
<p>One common point of criticism of i3 is that it is not extensible enough, especially compared to WMs that are configured in an actual programing language, like the mentioned XMonad, <a href="http://www.qtile.org/">Qtile</a>, <a href="https://awesomewm.org/">Awesome</a>, etc. But I think i3’s extensibility is underappreciated, although the contents of this article may lie closer to the limits of how far one can go there.</p>
|
||||
<p>Here is a small demo of how it currently works:</p>
|
||||
<video controls width="100%">
|
||||
<source src="/ox-hugo/i3-emacs-demo.mp4" type="video/mp4">
|
||||
<source src="/static/videos/i3-emacs-demo.mp4" type="video/mp4">
|
||||
</video>
|
||||
<h2 id="emacs-integration">Emacs integration</h2>
|
||||
<p>What I’m trying to do is actually quite simple, so I’m somewhat surprised I didn’t find anything similar on the Internet. But I didn’t look too hard.</p>
|
||||
|
|
|
|||
|
|
@ -156,8 +156,8 @@
|
|||
</span></span></code></pre></div><p>workspaces 2 and 3 on the machine with hostname “indigo” will be displayed on the monitor <code>DVI-D-0</code>.</p>
|
||||
<p>However, some features, common in other tiling WMs, are missing in EXWM out of the box, namely:</p>
|
||||
<ul>
|
||||
<li>a command to <a href="https://i3wm.org/docs/userguide.html#%5Ffocusing%5Fmoving%5Fcontainers">switch to another monitor</a>;</li>
|
||||
<li>a command to <a href="https://i3wm.org/docs/userguide.html#move%5Fto%5Foutputs">move the current workspace to another monitor</a>;</li>
|
||||
<li>a command to <a href="https://i3wm.org/docs/userguide.html#_focusing_moving_containers">switch to another monitor</a>;</li>
|
||||
<li>a command to <a href="https://i3wm.org/docs/userguide.html#move_to_outputs">move the current workspace to another monitor</a>;</li>
|
||||
<li>using the same commands to switch between windows and monitors.</li>
|
||||
</ul>
|
||||
<p>Here’s my take on implementing them.</p>
|
||||
|
|
@ -216,7 +216,7 @@
|
|||
</span></span></code></pre></div><h3 id="switch-to-another-monitor">Switch to another monitor</h3>
|
||||
<p>With the functions from the previous two sections, we can implement switching to another monitor by switching to the most recently used workspace on that monitor.</p>
|
||||
<video controls width="100%">
|
||||
<source src="/ox-hugo/exwm-workspace-switch.mp4" type="video/mp4">
|
||||
<source src="/videos/exwm-workspace-switch.mp4" type="video/mp4">
|
||||
</video>
|
||||
<p>One caveat here is that on the startup the <code>my/exwm-last-workspaces</code> variable won’t have any values from other monitor(s), so this list is concatenated with the list of available workspace indices.</p>
|
||||
<div class="highlight"><pre tabindex="0" style=";-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-emacs-lisp" data-lang="emacs-lisp"><span style="display:flex;"><span>(<span style="color:#008000">defun</span> <span style="color:#19177c">my/exwm-switch-to-other-monitor</span> (<span style="color:#008000">&optional</span> <span style="color:#19177c">dir</span>)
|
||||
|
|
@ -238,7 +238,7 @@
|
|||
<h3 id="move-the-workspace-to-another-monitor">Move the workspace to another monitor</h3>
|
||||
<p>Now, moving the workspace to another monitor.</p>
|
||||
<video controls width="100%">
|
||||
<source src="/ox-hugo/exwm-workspace-move.mp4" type="video/mp4">
|
||||
<source src="/videos/exwm-workspace-move.mp4" type="video/mp4">
|
||||
</video>
|
||||
<p>This is actually quite easy to pull off - one just has to update <code>exwm-randr-workspace-monitor-plist</code> accordingly and run <code>exwm-randr-refresh</code>. I just add another check there because I don’t want some monitor to remain without workspaces at all.</p>
|
||||
<div class="highlight"><pre tabindex="0" style=";-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-emacs-lisp" data-lang="emacs-lisp"><span style="display:flex;"><span>(<span style="color:#008000">defun</span> <span style="color:#19177c">my/exwm-workspace-switch-monitor</span> ()
|
||||
|
|
@ -341,7 +341,7 @@
|
|||
</span></span></code></pre></div><h3 id="resizing-windows">Resizing windows</h3>
|
||||
<p>I find this odd that there are different commands to resize tiling and floating windows.</p>
|
||||
<video controls width="100%">
|
||||
<source src="/ox-hugo/exwm-resize-hydra.mp4" type="video/mp4">
|
||||
<source src="/videos/exwm-resize-hydra.mp4" type="video/mp4">
|
||||
</video>
|
||||
<p>So let’s define one command to perform both resizes depending on the context:</p>
|
||||
<div class="highlight"><pre tabindex="0" style=";-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-emacs-lisp" data-lang="emacs-lisp"><span style="display:flex;"><span>(<span style="color:#008000">setq</span> <span style="color:#19177c">my/exwm-resize-value</span> <span style="color:#666">5</span>)
|
||||
|
|
|
|||
|
|
@ -309,7 +309,7 @@
|
|||
<h2 id="polybar">Polybar</h2>
|
||||
<p>Now, the most <del>crazy</del> advanced case I’ve come up with so far.</p>
|
||||
<p>Basically, here is how my <a href="https://github.com/polybar/polybar">polybar</a> currently looks:
|
||||
<img src="/ox-hugo/literate--polybar.png" alt=""></p>
|
||||
<img src="/images/literate--polybar.png" alt=""></p>
|
||||
<p>It has:</p>
|
||||
<ul>
|
||||
<li>colors from the general color theme;</li>
|
||||
|
|
|
|||
|
|
@ -496,7 +496,7 @@
|
|||
</span></span><span style="display:flex;"><span> <span style="color:#008000">:overwrite</span> <span style="color:#19177c">current-prefix-arg</span>)))
|
||||
</span></span></code></pre></div><p>If the <code>my/elfeed-show-rdrview-html</code> variable is bound and true, then the content in this buffer was retrieved via <code>rdrview</code>, so we’ll use that instead of the output of <code>elfeed-deref</code>.</p>
|
||||
<p>Now we can open elfeed entries in a PDF viewer, which I find much nicer to read. Given that RSS feeds generally ship with simpler HTML than the regular websites, results usually look awesome:</p>
|
||||
<figure><img src="/ox-hugo/pdf-prot.png"/>
|
||||
<figure><img src="/images/pdf-prot.png"/>
|
||||
</figure>
|
||||
|
||||
<h3 id="opening-arbitrary-sites">Opening arbitrary sites</h3>
|
||||
|
|
@ -535,7 +535,7 @@
|
|||
</span></span></code></pre></div><p>Unfortunately, this part doesn’t work that well, so we can’t just uninstall Firefox or Chromium and browse the web from a PDF viewer.</p>
|
||||
<p>The most common problem I’ve encountered is incorrectly formed pictures, such as <code>.png</code> files without the boundary info. I’m sure you’ve also come across this if you ever tried to insert a lot of Internet pictures into a LaTeX document.</p>
|
||||
<p>However, sans the pictures issue, for certain sites like Wikipedia this is usable. For instance, here’s how the Emacs page looks:
|
||||
<img src="/ox-hugo/pdf-emacs.png" alt=""></p>
|
||||
<img src="/images/pdf-emacs.png" alt=""></p>
|
||||
<h2 id="youtube-transcripts">YouTube transcripts</h2>
|
||||
<h3 id="getting-subtitles">Getting subtitles</h3>
|
||||
<p>Finally, let’s get to transcripts.</p>
|
||||
|
|
@ -630,7 +630,7 @@
|
|||
</span></span><span style="display:flex;"><span> (<span style="color:#008000">setq-local</span> <span style="color:#19177c">subed-mpv-video-file</span> (<span style="color:#19177c">elfeed-entry-link</span> <span style="color:#19177c">entry</span>))
|
||||
</span></span><span style="display:flex;"><span> (<span style="color:#19177c">subed-mpv--play</span> <span style="color:#19177c">subed-mpv-video-file</span>))
|
||||
</span></span></code></pre></div><p>And here’s how it looks when used (the video on the screenshot is <a href="https://www.youtube.com/watch?v=qjAIXCmhCQQ">this System Crafters’ stream</a>):
|
||||
<img src="/ox-hugo/pdf-subed.png" alt=""></p>
|
||||
<img src="/images/pdf-subed.png" alt=""></p>
|
||||
<p>Keep in mind that this function has to be launched inside the buffer opened by the <code>my/elfeed-youtube-subtitles</code> function.</p>
|
||||
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -450,7 +450,7 @@
|
|||
</span></span><span style="display:flex;"><span> <span style="color:#008000">:overwrite</span> <span style="color:#19177c">current-prefix-arg</span>)))
|
||||
</span></span></code></pre></div><p>If the <code>my/elfeed-show-rdrview-html</code> variable is bound and true, then the content in this buffer was retrieved via <code>rdrview</code>, so we&rsquo;ll use that instead of the output of <code>elfeed-deref</code>.</p>
|
||||
<p>Now we can open elfeed entries in a PDF viewer, which I find much nicer to read. Given that RSS feeds generally ship with simpler HTML than the regular websites, results usually look awesome:</p>
|
||||
<figure><img src="https://sqrtminusone.xyz/ox-hugo/pdf-prot.png"/>
|
||||
<figure><img src="https://sqrtminusone.xyz/images/pdf-prot.png"/>
|
||||
</figure>
|
||||
|
||||
<h3 id="opening-arbitrary-sites">Opening arbitrary sites</h3>
|
||||
|
|
@ -489,7 +489,7 @@
|
|||
</span></span></code></pre></div><p>Unfortunately, this part doesn&rsquo;t work that well, so we can&rsquo;t just uninstall Firefox or Chromium and browse the web from a PDF viewer.</p>
|
||||
<p>The most common problem I&rsquo;ve encountered is incorrectly formed pictures, such as <code>.png</code> files without the boundary info. I&rsquo;m sure you&rsquo;ve also come across this if you ever tried to insert a lot of Internet pictures into a LaTeX document.</p>
|
||||
<p>However, sans the pictures issue, for certain sites like Wikipedia this is usable. For instance, here&rsquo;s how the Emacs page looks:
|
||||
<img src="https://sqrtminusone.xyz/ox-hugo/pdf-emacs.png" alt=""></p>
|
||||
<img src="https://sqrtminusone.xyz/images/pdf-emacs.png" alt=""></p>
|
||||
<h2 id="youtube-transcripts">YouTube transcripts</h2>
|
||||
<h3 id="getting-subtitles">Getting subtitles</h3>
|
||||
<p>Finally, let&rsquo;s get to transcripts.</p>
|
||||
|
|
@ -584,7 +584,7 @@
|
|||
</span></span><span style="display:flex;"><span> (<span style="color:#008000">setq-local</span> <span style="color:#19177c">subed-mpv-video-file</span> (<span style="color:#19177c">elfeed-entry-link</span> <span style="color:#19177c">entry</span>))
|
||||
</span></span><span style="display:flex;"><span> (<span style="color:#19177c">subed-mpv--play</span> <span style="color:#19177c">subed-mpv-video-file</span>))
|
||||
</span></span></code></pre></div><p>And here&rsquo;s how it looks when used (the video on the screenshot is <a href="https://www.youtube.com/watch?v=qjAIXCmhCQQ">this System Crafters&rsquo; stream</a>):
|
||||
<img src="https://sqrtminusone.xyz/ox-hugo/pdf-subed.png" alt=""></p>
|
||||
<img src="https://sqrtminusone.xyz/images/pdf-subed.png" alt=""></p>
|
||||
<p>Keep in mind that this function has to be launched inside the buffer opened by the <code>my/elfeed-youtube-subtitles</code> function.</p>
|
||||
|
||||
</content>
|
||||
|
|
@ -846,7 +846,7 @@
|
|||
<h2 id="polybar">Polybar</h2>
|
||||
<p>Now, the most <del>crazy</del> advanced case I&rsquo;ve come up with so far.</p>
|
||||
<p>Basically, here is how my <a href="https://github.com/polybar/polybar">polybar</a> currently looks:
|
||||
<img src="https://sqrtminusone.xyz/ox-hugo/literate--polybar.png" alt=""></p>
|
||||
<img src="https://sqrtminusone.xyz/images/literate--polybar.png" alt=""></p>
|
||||
<p>It has:</p>
|
||||
<ul>
|
||||
<li>colors from the general color theme;</li>
|
||||
|
|
@ -1204,8 +1204,8 @@
|
|||
</span></span></code></pre></div><p>workspaces 2 and 3 on the machine with hostname &ldquo;indigo&rdquo; will be displayed on the monitor <code>DVI-D-0</code>.</p>
|
||||
<p>However, some features, common in other tiling WMs, are missing in EXWM out of the box, namely:</p>
|
||||
<ul>
|
||||
<li>a command to <a href="https://i3wm.org/docs/userguide.html#%5Ffocusing%5Fmoving%5Fcontainers">switch to another monitor</a>;</li>
|
||||
<li>a command to <a href="https://i3wm.org/docs/userguide.html#move%5Fto%5Foutputs">move the current workspace to another monitor</a>;</li>
|
||||
<li>a command to <a href="https://i3wm.org/docs/userguide.html#_focusing_moving_containers">switch to another monitor</a>;</li>
|
||||
<li>a command to <a href="https://i3wm.org/docs/userguide.html#move_to_outputs">move the current workspace to another monitor</a>;</li>
|
||||
<li>using the same commands to switch between windows and monitors.</li>
|
||||
</ul>
|
||||
<p>Here&rsquo;s my take on implementing them.</p>
|
||||
|
|
@ -1264,7 +1264,7 @@
|
|||
</span></span></code></pre></div><h3 id="switch-to-another-monitor">Switch to another monitor</h3>
|
||||
<p>With the functions from the previous two sections, we can implement switching to another monitor by switching to the most recently used workspace on that monitor.</p>
|
||||
<video controls width="100%">
|
||||
<source src="https://sqrtminusone.xyz/ox-hugo/exwm-workspace-switch.mp4" type="video/mp4">
|
||||
<source src="https://sqrtminusone.xyz/videos/exwm-workspace-switch.mp4" type="video/mp4">
|
||||
</video>
|
||||
<p>One caveat here is that on the startup the <code>my/exwm-last-workspaces</code> variable won&rsquo;t have any values from other monitor(s), so this list is concatenated with the list of available workspace indices.</p>
|
||||
<div class="highlight"><pre tabindex="0" style=";-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-emacs-lisp" data-lang="emacs-lisp"><span style="display:flex;"><span>(<span style="color:#008000">defun</span> <span style="color:#19177c">my/exwm-switch-to-other-monitor</span> (<span style="color:#008000">&amp;optional</span> <span style="color:#19177c">dir</span>)
|
||||
|
|
@ -1286,7 +1286,7 @@
|
|||
<h3 id="move-the-workspace-to-another-monitor">Move the workspace to another monitor</h3>
|
||||
<p>Now, moving the workspace to another monitor.</p>
|
||||
<video controls width="100%">
|
||||
<source src="https://sqrtminusone.xyz/ox-hugo/exwm-workspace-move.mp4" type="video/mp4">
|
||||
<source src="https://sqrtminusone.xyz/videos/exwm-workspace-move.mp4" type="video/mp4">
|
||||
</video>
|
||||
<p>This is actually quite easy to pull off - one just has to update <code>exwm-randr-workspace-monitor-plist</code> accordingly and run <code>exwm-randr-refresh</code>. I just add another check there because I don&rsquo;t want some monitor to remain without workspaces at all.</p>
|
||||
<div class="highlight"><pre tabindex="0" style=";-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-emacs-lisp" data-lang="emacs-lisp"><span style="display:flex;"><span>(<span style="color:#008000">defun</span> <span style="color:#19177c">my/exwm-workspace-switch-monitor</span> ()
|
||||
|
|
@ -1389,7 +1389,7 @@
|
|||
</span></span></code></pre></div><h3 id="resizing-windows">Resizing windows</h3>
|
||||
<p>I find this odd that there are different commands to resize tiling and floating windows.</p>
|
||||
<video controls width="100%">
|
||||
<source src="https://sqrtminusone.xyz/ox-hugo/exwm-resize-hydra.mp4" type="video/mp4">
|
||||
<source src="https://sqrtminusone.xyz/videos/exwm-resize-hydra.mp4" type="video/mp4">
|
||||
</video>
|
||||
<p>So let&rsquo;s define one command to perform both resizes depending on the context:</p>
|
||||
<div class="highlight"><pre tabindex="0" style=";-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-emacs-lisp" data-lang="emacs-lisp"><span style="display:flex;"><span>(<span style="color:#008000">setq</span> <span style="color:#19177c">my/exwm-resize-value</span> <span style="color:#666">5</span>)
|
||||
|
|
@ -1501,7 +1501,7 @@
|
|||
<p>One common point of criticism of i3 is that it is not extensible enough, especially compared to WMs that are configured in an actual programing language, like the mentioned XMonad, <a href="http://www.qtile.org/">Qtile</a>, <a href="https://awesomewm.org/">Awesome</a>, etc. But I think i3&rsquo;s extensibility is underappreciated, although the contents of this article may lie closer to the limits of how far one can go there.</p>
|
||||
<p>Here is a small demo of how it currently works:</p>
|
||||
<video controls width="100%">
|
||||
<source src="https://sqrtminusone.xyz/ox-hugo/i3-emacs-demo.mp4" type="video/mp4">
|
||||
<source src="https://sqrtminusone.xyz/static/videos/i3-emacs-demo.mp4" type="video/mp4">
|
||||
</video>
|
||||
<h2 id="emacs-integration">Emacs integration</h2>
|
||||
<p>What I&rsquo;m trying to do is actually quite simple, so I&rsquo;m somewhat surprised I didn&rsquo;t find anything similar on the Internet. But I didn&rsquo;t look too hard.</p>
|
||||
|
|
@ -1697,7 +1697,7 @@
|
|||
<guid>https://sqrtminusone.xyz/posts/2021-09-07-emms/</guid>
|
||||
<content type="html">
|
||||
<h2 id="intro">Intro</h2>
|
||||
<figure><img src="https://sqrtminusone.xyz/ox-hugo/emms-screenshot.png"/>
|
||||
<figure><img src="https://sqrtminusone.xyz/images/emms/emms-screenshot.png"/>
|
||||
</figure>
|
||||
|
||||
<p>This is the current state of my quest to live in Emacs, at least in part of reading RSS and music.</p>
|
||||
|
|
@ -1936,7 +1936,7 @@
|
|||
|
||||
<guid>https://sqrtminusone.xyz/posts/2021-05-01-org-python/</guid>
|
||||
<content type="html">
|
||||
<figure><img src="https://sqrtminusone.xyz/ox-hugo/org-python-screenshot.png"/>
|
||||
<figure><img src="https://sqrtminusone.xyz/images/org-python/org-python-screenshot.png"/>
|
||||
</figure>
|
||||
|
||||
<h2 id="why">Why?</h2>
|
||||
|
|
@ -2275,7 +2275,7 @@
|
|||
<div class="highlight"><pre tabindex="0" style=";-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-text" data-lang="text"><span style="display:flex;"><span>#+LATEX_CLASS: org-plain-extarticle
|
||||
</span></span><span style="display:flex;"><span>#+LATEX_CLASS_OPTIONS: [a4paper, 14pt]
|
||||
</span></span></code></pre></div><p>14pt size is required by certain state standards of ours for some reason.</p>
|
||||
<p>After which you can put whatever you want in the preamble with <code>LATEX_HEADER</code>. My workflow with LaTeX is to write a bunch of <code>.sty</code> files beforehand and import the necessary ones in the preamble. <a href="https://github.com/SqrtMinusOne/LaTeX%5Ftemplates">Here</a> is the repo with these files, although quite predictably, it&rsquo;s a mess. At any rate, I have to write something like the following in the target Org file:</p>
|
||||
<p>After which you can put whatever you want in the preamble with <code>LATEX_HEADER</code>. My workflow with LaTeX is to write a bunch of <code>.sty</code> files beforehand and import the necessary ones in the preamble. <a href="https://github.com/SqrtMinusOne/LaTeX_templates">Here</a> is the repo with these files, although quite predictably, it&rsquo;s a mess. At any rate, I have to write something like the following in the target Org file:</p>
|
||||
<div class="highlight"><pre tabindex="0" style=";-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-text" data-lang="text"><span style="display:flex;"><span>#+LATEX_HEADER: \usepackage{styles/generalPreamble}
|
||||
</span></span><span style="display:flex;"><span>#+LATEX_HEADER: \usepackage{styles/reportFormat}
|
||||
</span></span><span style="display:flex;"><span>#+LATEX_HEADER: \usepackage{styles/mintedSourceCode}
|
||||
|
|
@ -2305,10 +2305,10 @@
|
|||
<p>Any classical IMAP/SMTP client is hard to use in my case, because a message with multiple labels is copied to IMAP folders for each of the label plus the inbox folder, and the copies look like different messages from the client-side. For example, a message can be read in one label and unread in another.</p>
|
||||
<p>For a few years, my solution was <a href="https://getmailspring.com/">Mailspring</a>, which provides first-class support for labels. However, it has a feature to deploy <a href="https://www.bbc.com/news/technology-56071437">spy pixels</a> on emails (and offers no protection from them, obviously), the client is Electron-based with a mouse-driven interface, and the sync engine was closed-source at the time.</p>
|
||||
<p>So, I found an alternative in Emacs+notmuch+lieer and ditched one more proprietary app (the last big one I can&rsquo;t let go of is DataGrip).</p>
|
||||
<figure><img src="https://sqrtminusone.xyz/ox-hugo/main.png"/>
|
||||
<figure><img src="https://sqrtminusone.xyz/images/gmail/main.png"/>
|
||||
</figure>
|
||||
|
||||
<figure><img src="https://sqrtminusone.xyz/ox-hugo/mail.png"/>
|
||||
<figure><img src="https://sqrtminusone.xyz/images/gmail/mail.png"/>
|
||||
</figure>
|
||||
|
||||
<p>Notmuch&rsquo;s tags are just as advanced as Gmail&rsquo;s labels, so I have basically the same mail structure accessible from Emacs, Gmail Android client and even the web UI when I don&rsquo;t have access to the first two.</p>
|
||||
|
|
@ -2334,6 +2334,7 @@
|
|||
</span></span><span style="display:flex;"><span>pip install .
|
||||
</span></span></code></pre></div><p>After which we may check if the <code>gmi</code> executable is available:</p>
|
||||
<div class="highlight"><pre tabindex="0" style=";-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>which gmi
|
||||
</span></span></code></pre></div><div class="highlight"><pre tabindex="0" style=";-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-text" data-lang="text"><span style="display:flex;"><span>/home/pavel/Programs/miniconda3/envs/mail/bin/gmi
|
||||
</span></span></code></pre></div><h3 id="notmuch">Notmuch</h3>
|
||||
<p><a href="https://notmuchmail.org/">Notmuch</a> is present in most of the package repositories, so you can install it with your package manager, which is <code>pacman</code> in my case.</p>
|
||||
<div class="highlight"><pre tabindex="0" style=";-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>sudo pacman -S notmuch
|
||||
|
|
@ -2426,7 +2427,7 @@
|
|||
<p>Authorization parameters will be saved to your <a href="https://www.emacswiki.org/emacs/GnusAuthinfo">authinfo</a> file. If you didn&rsquo;t have one, the plaintext <code>.authinfo</code> will be created, so it&rsquo;s reasonable to encrypt it:</p>
|
||||
<div class="highlight"><pre tabindex="0" style=";-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span><span style="color:#008000">cd</span> ~
|
||||
</span></span><span style="display:flex;"><span>gpg -o .authinfo.gpg -c --cipher-algo AES256 .authinfo
|
||||
</span></span></code></pre></div><p>However, if you plan to use multiple accounts with different SMTP servers, it makes more sense to use something like <a href="https://marlam.de/msmtp/msmtp.html">MSMTP</a> to manage multiple accounts. Here are a couple of examples (<a href="https://www.reddit.com/r/emacs/comments/9piml5/a%5Ffew%5Fquick%5Femacsnotmuch%5Fquestions/e83zcck?utm%5Fsource=share&amp;utm%5Fmedium=web2x&amp;context=3">1</a>, <a href="https://www.reddit.com/r/emacs/comments/9piml5/a%5Ffew%5Fquick%5Femacsnotmuch%5Fquestions/e84otah?utm%5Fsource=share&amp;utm%5Fmedium=web2x&amp;context=3">2</a>) how to do that.</p>
|
||||
</span></span></code></pre></div><p>However, if you plan to use multiple accounts with different SMTP servers, it makes more sense to use something like <a href="https://marlam.de/msmtp/msmtp.html">MSMTP</a> to manage multiple accounts. Here are a couple of examples (<a href="https://www.reddit.com/r/emacs/comments/9piml5/a_few_quick_emacsnotmuch_questions/e83zcck?utm_source=share&amp;utm_medium=web2x&amp;context=3">1</a>, <a href="https://www.reddit.com/r/emacs/comments/9piml5/a_few_quick_emacsnotmuch_questions/e84otah?utm_source=share&amp;utm_medium=web2x&amp;context=3">2</a>) how to do that.</p>
|
||||
<p>Another alternative for Gmail is to use <a href="https://github.com/gauteh/lieer/wiki/GNU-Emacs-and-Lieer">lieer as sendmail program</a>. That may make sense if you don&rsquo;t want to enable IMAP and SMTP on your account.</p>
|
||||
<p>There are also <a href="https://notmuchmail.org/emacstips/#index13h2">a bunch of ways</a> to set up address completion if the built-in completion based on notmuch database does not suffice.</p>
|
||||
<p>I also use <a href="https://github.com/mhayashi1120/Emacs-langtool">LanguageTool for Emacs</a> to do a spell checking of important emails (integrations like that really make Emacs shine). For some reason, developers don&rsquo;t give a link to download the server on the frontpage, so <a href="https://dev.languagetool.org/http-server">here it is</a>. And here is the relevant part of my Emacs config:</p>
|
||||
|
|
@ -2526,7 +2527,7 @@
|
|||
</span></span></code></pre></div><p>The script is launched with cron every 5 minutes:</p>
|
||||
<div class="highlight"><pre tabindex="0" style=";-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>*/5 * * * * bash /home/pavel/bin/scripts/check-email
|
||||
</span></span></code></pre></div><p>Here&rsquo;s how the notification looks like:
|
||||
<img src="https://sqrtminusone.xyz/ox-hugo/notification.png" alt=""></p>
|
||||
<img src="https://sqrtminusone.xyz/images/gmail/notification.png" alt=""></p>
|
||||
<h2 id="caveats">Caveats</h2>
|
||||
<ul>
|
||||
<li><a href="https://github.com/gauteh/lieer#caveats">lieer</a> has an extensive list of caveats concerning Gmail API</li>
|
||||
|
|
|
|||
|
|
@ -58,6 +58,8 @@
|
|||
</url><url>
|
||||
<loc>https://sqrtminusone.xyz/posts/hello-world/</loc>
|
||||
<lastmod>2021-02-01T00:00:00+00:00</lastmod>
|
||||
</url><url>
|
||||
<loc>https://sqrtminusone.xyz/configs/readme/</loc>
|
||||
</url><url>
|
||||
<loc>https://sqrtminusone.xyz/categories/</loc>
|
||||
</url><url>
|
||||
|
|
@ -72,7 +74,5 @@
|
|||
<loc>https://sqrtminusone.xyz/configs/guix/</loc>
|
||||
</url><url>
|
||||
<loc>https://sqrtminusone.xyz/configs/mail/</loc>
|
||||
</url><url>
|
||||
<loc>https://sqrtminusone.xyz/configs/readme/</loc>
|
||||
</url>
|
||||
</urlset>
|
||||
|
|
|
|||
BIN
stats/all.png
|
Before Width: | Height: | Size: 121 KiB After Width: | Height: | Size: 121 KiB |
|
Before Width: | Height: | Size: 64 KiB After Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 67 KiB After Width: | Height: | Size: 68 KiB |