In the middle of the desert you can say anything you want
If I write multiple posts per day, their order within that day looks wrong. This is because in their frontmatter each has a date but no time.
date: 2022-02-09
This is done so on obyde’s side, not something I want to change.
Solution?
Use the Zettelkasten-filenames of the actual .md files.1 I wanted them like this for better ordering visually on my local filesystem, why not take advantage of this.
Solution by SO2:
{{ range sort site.RegularPages "File.Path" }}
{{ . }}
{{ end }}
I’m now writing inside 220209-2209 Hugo sorting posts by filename
↩︎
templates - How to order content by FilePath in Hugo? - Stack Overflow ↩︎
CommandSet
creates a small menu with buttons; a lot of things that previously were CLI aliases fit there much better:
lazy.run_extension(
CommandSet(
commands={
"single small": "autorandr single_small",
"single": "autorandr single",
"home": "autorandr home",
"R night": redshift_night,
"R reset": redshift_reset,
"T disable": touchpad_disable,
"T enable": touchpad_enable,
"Screenshots": open_screenshots,
},
)
),
“Open directory with screenshots” made everything freze, qtile couldn’t be restarted, the usual.
The command I used was
open_screenshots = f"bash -c 'xdg-open {dirs.SCREENSHOT_R}''"
On a hunch, added the &
to detach the process.
open_screenshots = f"bash -c 'xdg-open {dirs.SCREENSHOT_R} &'"
Works like magic, the window appears, everything else keeps working.
When adapting an example qtile config1 that used volume keys (XF86AudioRaiseVolume
etc.) discovered that I can lock the function keys by pressing <Fn-Esc>
. Then a LED turns on, and all the F-keys become function keys.
(Or the opposite, I guess, with default BIOS settings).
Wanted to show the currently active taskwarrior task (220209-1901 taskwarrior getting currently active task) in my statusbar.
Github had helpful discussion1 that led me to this qtile widget code:
widget.GenPollText(
update_interval=1,
func=lambda: subprocess.check_output("path/to/my/get_tasks.sh").decode( "utf-8").strip(),
),
that runs this shell script:
#!/bin/bash
task rc.verbose=nothing rc.color=off a || true
The || true
bit makes sure the return code is 0. Taskwarrior returns 1
if no tasks are shown, in this case - if no task is in progress.
j
Used for testing phone lines.
Sample:
List 1
The birch canoe slid on the smooth planks.
Glue the sheet to the dark blue background.
It's easy to tell the depth of a well.
These days a chicken leg is a rare dish.
Rice is often served in round bowls.
The juice of lemons makes fine punch.
The box was thrown beside the parked truck.
The hogs were fed chopped corn and garbage.
Four hours of steady work faced us.
Large size in stockings is hard to sell
Adding a semi-random number of X
after each character of a password is better than giving no output a la linux sudo
(bad UX) or writing a single *
(unsafe).
Not allowing pasting in the password prompt, then creating weird complex first-time passwords with O
s and 0
s is worse than both.
Pycharm was slow. Googled for stuff, removed extensions, gave it more memory etc.
Solution from Everything - JetBrains YouTrack:
rm .cache/JetBrains/PyCharmCE2021.3/icons-v3.db
Deleting icon cache made all menus etc. fast.
Fascinating.
FUNSD is a “dataset for Text Detection, Optical Character Recognition, Spatial Layout Analysis and Form Understanding” and contains annotated forms. Initially I saw it when looking at HF layout datasets1.
ralphbean/taskw: python taskwarrior api is a Python lib to talk to Taskwarrior, by default through the import/export functionality.
Looks really neat and is a better way to parse the tasks for my statusbar than my planned “read and parse the shell output of the cli command”
Create a new project, point it at the folder with the sources, and instead of trying to use an existing poetry environment, just create a new one. It will use the same virtualenv as usual when running poetry shell
inside that directory. Nice!1
The project uses ./src/package_name
layout (220105-1142 Order of directories inside a python project), which created issues in the editor (tests and files run fine though). Fixed by adding ./src
as Source Root, then it parses all imports as packgae name
Official Black instructions for Pycharm worked for me: Editor integration — Black 21.12b0 documentation
This was tricky! I found a really nice post2 that showed how to spawn vim from ideavim. I tried following its example but
nmap <leader>f :action Tool_External_Tools_black<CR>
didn’t work.
The post mentioned running :actionlist
inside the editor to get the list of all available actions (I used to rely on a github gist for that!). Well, would you believe, External Tools
has a space inside it.
So the correct line is:
nmap <leader>f :action Tool_External Tools_black<CR>
Wow. …Wow.
In any case works now!
Reddit suggested using poetry env info
, which gives info about the environment, and add that interpreter to pycharm directly ↩︎
Customising IdeaVim - Chathura Colombage; His example .ideavimrc from that post is really really interesting, TODO steal ideas! ↩︎