Sekai 🌐 πŸ—Ί

Sekai is the kanji for δΈ–η•Œ, meaning “the world”. That’s a great word because of the scale it designates.

Customized Archetype for This Site

Background I prefer including the date into the Permalink of a post. Everytime I create a new post, I type hugo new post/$(date -I)-post-title.md to ensure that the date is correct. Problem The title field in the post’s front matter contained the date, which wasn’t something that I wanted because it’s already shown next to the icon. Observations Neither \d nor [\d] works for the PCRE character class \d. [Read More]
Hugo 

Icon in Hugo Navbar

Motivation The original navbar in words took up half of the horizontal spaces of the viewport. I couldn’t add new items like “Tags” to display the tag list. Work Thanks to the pre field in Hugo Menus, one can easily add the icon as an HTML element by some editing on the template file. {{ range .Site.Menus.main.ByWeight }} {{ if .HasChildren }} <li class="navlinks-container"> {{ if .Pre }} <a class="navlinks-parent" title="{{ . [Read More]
Hugo  icons  navbar 

Network Interface Name Detection in Conky

Once-off Conky config for network graphs

When one changes connection type (say, from ethernet to Wi-Fi), the interface name changes (e.g. eth0 β†’ wlan1). To avoid changing Conky config file all the time, here’s a little Lua function for finding the network interface name. function findInterface() local handle = io.popen('ip a | grep "state UP" | cut -d: -f2 | tr -d " "') local result = handle:read('*a'):gsub('\n$','') handle:close() return result end ip a gives everything about connection info. [Read More]
Conky  Lua 

Staticman Script in Pure JS

Staticman without jQuery

The official Staticman script sample depends on jQuery. I have been using jQuery in my Staticman script for nested comments for more than six months. Recently, in the new release of Hugo Swift Theme, in which I’m a collaborator, one has removed all jQuery methods at commit f137efa4. Here’s the structure of the script: auxiliary functions like elem, elems, pushClass, deleteClass, etc. A self-executing function comments() some necessary local variables handleForm() consisting merely of an event listener handling form submission. [Read More]

Staticman With Introduction Theme

Goal To port Huginn’s Staticman integration to Introduction. Difficulties I’ve used some class names from Minimal Mistakes since the modals in the original code clashes with Introduction’s mobile responsive card display for projects. If I had know the practice of prepending a CSS class to avoid overiding the CSS properties of other components of a web site, I wouldn’t have mixed this Jekyll theme with my template for nested comments. [Read More]

CPU Temperature Display in Conky

Background I’m using Conky for monitoring the system. After a system upgrade, the CPU temperatures were gone. Conky’s standard error showed the following. Conky: can't open '/sys/class/hwmon/hwmon0/temp3_input': No such file or directory please check your device or remove this var from Conky... Source of message: https://bbs.archlinux.org/viewtopic.php?id=82231 An easy fix would be to adjust the following lines in .conkyrc according to the number N in /sys/class/hwmon/hwmonN containing the file temp3_input. (You may adjust the number 3 according to the number of CPU of your device. [Read More]
Conky  CPU  Linux 

Animated GIF Screenshots on Ubuntu

Background I’ve to take screenshots to demonstrate Conky’s visual output. I’ve chosen Byzanz after reading this answer on Ask Ubuntu. Peek is more user-friendly, but I prefer CLI’s precision. That’s feasible thanks to a comment mentioning xwininfo. After typing xwininfo, click on the target window. Switching to adjacent workplace is possible. $ xwininfo xwininfo: Please select the window about which you would like information by clicking the mouse in that window. [Read More]

More Static Nested Comments

Background I’ve made nested comment support for Beautiful Hugo, which I’ve ported to other Hugo themes like Introduction, Hyde-hyde, etc. Problem I Some of those Hugo themes that I worked with did show the HTML form, but the CSS styles were gone on the GitLab Pages. Reason I This is due to the lack of resources/_gen/ in the indexed repo for themes making use of assets/. Solution I Check that you have the required prerequisites. [Read More]

Huginn Theme With Staticman

Goal To provide Staticman support to the Hugo theme Huginn. Motivation A Framagit user tried using the public GitLab instance but failed. Finally, he removed Staticman from his site and his Hugo theme. If I had been notified, I would have explained that that was due to the constraint of gitlabBaseUrl, which could only take one GitLab instance. In response to demand for Staticman from Framagit users, I set up another GitLab instance of Staticman API and forked some Hugo/Jekyll repo under the project page Staticman et GitLab Pages. [Read More]

Right PATH to Linux

Roles of various config files

Background Updated $\LaTeX$ version From this $\TeX$-SE question about tlmgr, we see some advantages of installing $\TeX$Live directly from the official site: avoid errors due to outdated version of $\TeX$Live supplied by the OS’s package manager easier to manage packages with tlmgr. enjoy the newer version of $\TeX$Live not yet available in your current GNU/Linux version. The installation took about 30 minutes and 5G in the disk. I’ve chosen a local installation as this didn’t require sudo privileges. [Read More]
Linux