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 ↩︎
rjekker/i3-battery-popup is a script that does things (message, notification, sound etc.) when the battery gets low.
I installed wish
1, added i3-battery-popup -L 30
to startup.
Was this really that easy this whole time?..
(TIL - it’s a tk-based dialog thing). Gets used by the script if available. ↩︎
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
I want to create a qtile widget to show the currently running taskwarrior task in my statusbar.
task rc.verbose=nothing rc.color=off a
The report in ~/.taskrc
is:
# Currently active name
report.a.description='Currently active task'
report.a.columns=id,description,project
report.a.labels=ID,D,P
report.a.filter=+ACTIVE
Found out about taskw, looks really nice. First draft implementation:
from taskw import TaskWarrior
def pretty_task(act):
return f"{act['id']}/{act['description']}"
def get_task():
w = TaskWarrior()
tasks = w.load_tasks()['pending']
act = [t for t in tasks if "start" in t]
# act = [t for t in tasks]
return '_'.join([pretty_task(a) for a in act])
Returns:
19:04:27 ~/.config/qtile/cfgs/ 130
> python3 get_task.py
98/Add Taskwarrior to qtile statusbar through python binding
Couldn’t find a way to access taskwarrior’s “virtual tags” (+ACTIVE
…), so I used the fact that "start"
exists in the dictionary only if the task started.
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.