This is the multi-page printable view of this section.
Click here to print.
Return to the regular view of this page.
Source code
Links
Licence
AGPLv3, see LICENSE
Contents
Contents
Line count
Language |
files |
blank |
comment |
code |
JSON |
966 |
2 |
0 |
25853 |
Python |
581 |
2340 |
1222 |
9588 |
TOML |
8 |
391 |
8 |
7259 |
Go |
231 |
718 |
617 |
6539 |
Starlark |
118 |
543 |
699 |
3903 |
C++ |
87 |
138 |
199 |
2219 |
Text |
7 |
128 |
0 |
1788 |
Lua |
8 |
60 |
90 |
987 |
Markdown |
94 |
214 |
6 |
862 |
YAML |
5 |
80 |
2 |
606 |
Bourne Shell |
19 |
85 |
103 |
518 |
C |
7 |
52 |
91 |
407 |
diff |
4 |
7 |
51 |
319 |
Java |
11 |
37 |
15 |
250 |
C/C++ Header |
7 |
14 |
9 |
111 |
JavaScript |
1 |
7 |
10 |
78 |
Protocol Buffers |
2 |
21 |
64 |
74 |
SVG |
3 |
3 |
4 |
55 |
XML (Qt/GTK) |
1 |
0 |
0 |
31 |
ProGuard |
1 |
9 |
8 |
25 |
INI |
1 |
2 |
0 |
9 |
HCL |
1 |
1 |
5 |
8 |
Snakemake |
1 |
2 |
6 |
4 |
HTML |
2 |
0 |
0 |
3 |
Rust |
1 |
0 |
0 |
3 |
——– |
——– |
——– |
——– |
——– |
SUM: |
2167 |
4854 |
3209 |
61499 |
Setup
Development
- Build
compile_commands.json
: bazel run :refresh_compile_commands
- Run builds:
bazel build //...
- Run tests:
bazel test //...
1 - Bazel projects
1.1 - Bazel aspects
1.1.1 - al_print_deps
al_print_deps
load("@com-alwaldend-git-src//bzl/aspects:al_print_deps.bzl", "al_print_deps")
al_print_deps()
ASPECT ATTRIBUTES
ATTRIBUTES
1.1.2 - al_toml_validate
al_toml_validate
load("@com-alwaldend-git-src//bzl/aspects:al_toml_validate.bzl", "al_toml_validate")
al_toml_validate()
Aspect adding linters for toml files
ASPECT ATTRIBUTES
ATTRIBUTES
1.2 - Bazel configs
1.3 - Bazel macros
1.3.1 - al_alias_map
al_alias_map
load("@com-alwaldend-git-src//bzl/macros:al_alias_map.bzl", "al_alias_map")
al_alias_map(aliases, visibility)
Generate aliases from an alias map
PARAMETERS
Name |
Description |
Default Value |
aliases |
alias map, keys are names, values are alias arguments |
none |
visibility |
default visibility |
["//visibility:public"] |
1.3.2 - al_apply_patches
al_apply_patches
load("@com-alwaldend-git-src//bzl/macros:al_apply_patches.bzl", "al_apply_patches")
al_apply_patches(name, src, patches, visibility, **kwargs)
Create a genrule applying patches
PARAMETERS
Name |
Description |
Default Value |
name |
genrule name |
none |
src |
source archive label |
none |
patches |
patches label |
none |
visibility |
visibility |
["//visibility:public"] |
kwargs |
other genrule kwargs |
none |
1.3.3 - al_bzl_library_map
al_bzl_library_map
load("@com-alwaldend-git-src//bzl/macros:al_bzl_library_map.bzl", "al_bzl_library_map")
al_bzl_library_map(name, visibility, libs, deps, **kwargs)
Create bzl_library targets from a map
PARAMETERS
Name |
Description |
Default Value |
name |
combined bzl_library target name |
none |
visibility |
- |
none |
libs |
bzl_library names |
{} |
deps |
other al_bzl_library_map targets |
[] |
kwargs |
bzl_library kwargs |
none |
1.3.4 - al_combine_files
al_combine_files
load("@com-alwaldend-git-src//bzl/macros:al_combine_files.bzl", "al_combine_files")
al_combine_files(name, srcs, **kwargs)
Create a genrule combining several files into one
PARAMETERS
Name |
Description |
Default Value |
name |
genrule target |
none |
srcs |
list of labels to combine |
none |
kwargs |
other genrule kwargs |
none |
1.3.5 - al_compile_pip_requirements_combined
al_compile_pip_requirements_combined
load("@com-alwaldend-git-src//bzl/macros:al_compile_pip_requirements_combined.bzl", "al_compile_pip_requirements_combined")
al_compile_pip_requirements_combined(name, srcs, **kwargs)
Create compile_pip_requirements target for several requirement files
PARAMETERS
Name |
Description |
Default Value |
name |
compile_pip_requirements name |
none |
srcs |
list of labels of requirement files to combine |
none |
kwargs |
kwargs for compile_pip_requirements |
none |
1.3.6 - al_drawio_run_binary
al_drawio_run_binary
load("@com-alwaldend-git-src//bzl/macros:al_drawio_run_binary.bzl", "al_drawio_run_binary")
al_drawio_run_binary(**kwargs)
Wrapper around al_drawio_run_binary rule
PARAMETERS
Name |
Description |
Default Value |
kwargs |
kwargs for al_drawio_run_binary |
none |
1.3.7 - al_genquery_write_to_source_file
al_genquery_write_to_source_file
load("@com-alwaldend-git-src//bzl/macros:al_genquery_write_to_source_file.bzl", "al_genquery_write_to_source_file")
al_genquery_write_to_source_file(name, expression, scope, var_name, out_file)
Write genquery result to a bzl file
Example:
al_genquery_write_to_source_file(
name = "al_bzl_libs",
expression = """
filter(
"^//",
attr(
"srcs",
".{3,}",
kind(
"bzl_library",
deps("//bzl")
)
)
)
""",
out_file = "al_bzl_libs.bzl",
scope = ["//bzl"],
var_name = "AL_BZL_LIBS",
)
PARAMETERS
Name |
Description |
Default Value |
name |
name prefix |
none |
expression |
genquery expression |
none |
scope |
genquery scope |
none |
var_name |
variable name in the generated .bzl file |
none |
out_file |
output bzl file |
none |
1.3.8 - al_genrule
al_genrule
load("@com-alwaldend-git-src//bzl/macros:al_genrule.bzl", "al_genrule")
al_genrule(test, executable, **kwargs)
Generate al_genrule target
PARAMETERS
Name |
Description |
Default Value |
test |
If set, use al_genrule_test |
False |
executable |
if set, use al_genrule_executable |
False |
kwargs |
kwargs for the rule |
none |
1.3.9 - al_genrule_src
al_genrule_src
load("@com-alwaldend-git-src//bzl/macros:al_genrule_src.bzl", "al_genrule_src")
al_genrule_src(name, srcs, visibility)
Create a filegroup and a genrule generating a tar archive
PARAMETERS
Name |
Description |
Default Value |
name |
genrule name |
none |
srcs |
source labels |
[] |
visibility |
- |
["//visibility:public"] |
1.3.10 - al_genrule_with_wheels
al_genrule_with_wheels
load("@com-alwaldend-git-src//bzl/macros:al_genrule_with_wheels.bzl", "al_genrule_with_wheels")
al_genrule_with_wheels(name, wheels, srcs, cmd, **kwargs)
Regular genrule with wheels added to ${PYTHONPATH}
PARAMETERS
Name |
Description |
Default Value |
name |
genrule name |
none |
wheels |
list of wheel labels |
none |
srcs |
srcs for the genrule |
[] |
cmd |
genrule cmd |
[] |
kwargs |
other genrule kwargs |
none |
1.3.11 - al_go_checkers
1.3.12 - al_install_file
al_install_file
load("@com-alwaldend-git-src//bzl/macros:al_install_file.bzl", "al_install_file")
al_install_file(name, args, install_file_label, visibility, **py_binary_kwargs)
Create py_binary target to install file
PARAMETERS
Name |
Description |
Default Value |
name |
target name |
none |
args |
install-file args |
[] |
install_file_label |
- |
"//py/install-file:lib" |
visibility |
- |
["//visibility:public"] |
py_binary_kwargs |
- |
none |
1.3.13 - al_lua_library
al_lua_library
load("@com-alwaldend-git-src//bzl/macros:al_lua_library.bzl", "al_lua_library")
al_lua_library(name, srcs, check, stylua_config_label, stylua_label, pkg_tar_kwargs, visibility)
Generate targets for a lua library
Targets:
- ${name}: pkg_tar
- ${name}-stylua-fix: al_run_tool executable
- ${name}-stylua-test: al_run_tool test
PARAMETERS
Name |
Description |
Default Value |
name |
library name |
none |
srcs |
library sources |
none |
check |
if set, only these files will be checked |
[] |
stylua_config_label |
- |
"//lua:stylua-config" |
stylua_label |
- |
"@com-alwaldend-src-cargo//:stylua__stylua" |
pkg_tar_kwargs |
kwargs for pkg_tar |
{} |
visibility |
visibility |
["//visibility:public"] |
1.3.14 - al_md_data
al_md_data
load("@com-alwaldend-git-src//bzl/macros:al_md_data.bzl", "al_md_data")
al_md_data(name, srcs, deps, **kwargs)
Markdown data backed by a filegroup
Targets:
PARAMETERS
Name |
Description |
Default Value |
name |
filegroup name |
none |
srcs |
markdown files |
none |
deps |
deps |
[] |
kwargs |
filegroup kwargs |
none |
1.3.15 - al_pkg_tar_combined
al_pkg_tar_combined
load("@com-alwaldend-git-src//bzl/macros:al_pkg_tar_combined.bzl", "al_pkg_tar_combined")
al_pkg_tar_combined(name, srcs, strip_components, **kwargs)
Create a genrule combining several tars into one
PARAMETERS
Name |
Description |
Default Value |
name |
genrule name |
none |
srcs |
dicts tar archives ({“label”: “tar label”, “dir”: “target dir”}) |
[] |
strip_components |
value of –stip-components |
2 |
kwargs |
other genrule kwargs |
none |
1.3.16 - al_py_binary_shell
al_py_binary_shell
load("@com-alwaldend-git-src//bzl/macros:al_py_binary_shell.bzl", "al_py_binary_shell")
al_py_binary_shell(name, deps, srcs, shell_type, shell_label, **kwargs)
Create a py_binary target that allows you to run commands in proper python environment
PARAMETERS
Name |
Description |
Default Value |
name |
target name |
none |
deps |
py_binary deps |
[] |
srcs |
py_binary srcs |
[] |
shell_type |
${BAZEL_PYTHON_SHELL_TYPE} |
"python" |
shell_label |
- |
"//py/bazel-python-shell:library" |
kwargs |
other py_binary kwargs |
none |
1.3.17 - al_py_checker
al_py_checker
load("@com-alwaldend-git-src//bzl/macros:al_py_checker.bzl", "al_py_checker")
al_py_checker(name, tool, args_bin, args_test, test_size, disable_fix, **kwargs)
Create -fix and -test targets for a python checker
PARAMETERS
Name |
Description |
Default Value |
name |
Name prefix |
None |
tool |
Tool label |
None |
args_bin |
Args for the binary target |
None |
args_test |
Args for the test |
None |
test_size |
- |
"small" |
disable_fix |
If set, do not create fix target |
False |
kwargs |
Kwargs for both targets |
none |
1.3.18 - al_py_checkers
al_py_checkers
load("@com-alwaldend-git-src//bzl/macros:al_py_checkers.bzl", "al_py_checkers")
al_py_checkers(srcs, isort_label, black_label, mypy_label, flake8_label, pyproject_label)
Generate -fix and -test targets for python checkers
PARAMETERS
Name |
Description |
Default Value |
srcs |
list of source file labels |
none |
isort_label |
- |
"//py:isort" |
black_label |
- |
"//py:black" |
mypy_label |
- |
"//py:mypy" |
flake8_label |
- |
"//py:flake8" |
pyproject_label |
- |
"//:pyproject" |
1.3.19 - al_readme
al_readme
load("@com-alwaldend-git-src//bzl/macros:al_readme.bzl", "al_readme")
al_readme(name, srcs, subpackages, **kwargs)
Create readme targets
Targets:
- ${name}: al_md_data target
- ${name}-children: pkg_tar containing ${name}-children from subpackages
PARAMETERS
Name |
Description |
Default Value |
name |
target name |
none |
srcs |
- |
[":README.md"] |
subpackages |
override list of subpackages |
[] |
kwargs |
al_md_data kwargs |
none |
1.3.20 - al_run_tool
load("@com-alwaldend-git-src//bzl/macros:al_run_tool.bzl", "al_run_tool")
al_run_tool(name, tool, executable, test, **kwargs)
Generate either native_test, native_binary, or run_binary target
PARAMETERS
Name |
Description |
Default Value |
name |
Target name (required) |
none |
tool |
Tool label to run (required) |
none |
executable |
If True, generate native_binary |
False |
test |
If True, generate native_test |
False |
kwargs |
kwargs for rules |
none |
1.3.21 - al_sh_library
al_sh_library
load("@com-alwaldend-git-src//bzl/macros:al_sh_library.bzl", "al_sh_library")
al_sh_library(name, shfmt_src, editorconfig_src, shellcheck_src, run_args_src, visibility,
**common_kwargs)
Create targets for a shell library
Targets:
- ${name}-shfmt-fix: executable to run shfmt
- ${name}-shfmt-test: test whether the script is formatted
- ${name}-shellcheck-test: shellcheck test
PARAMETERS
Name |
Description |
Default Value |
name |
target name |
none |
shfmt_src |
- |
"@cc_mvdan_sh_v3//cmd/shfmt:shfmt" |
editorconfig_src |
- |
"//:editorconfig" |
shellcheck_src |
- |
"@com-github-koalaman-shellcheck-linux-x86_64//:bin" |
run_args_src |
- |
"//sh/scripts:run-args-lib" |
visibility |
- |
["//visibility:public"] |
common_kwargs |
kwargs for both targets |
none |
1.3.22 - al_template_files
al_template_files
load("@com-alwaldend-git-src//bzl/macros:al_template_files.bzl", "al_template_files")
al_template_files(**kwargs)
Macros around al_template_files rule
PARAMETERS
Name |
Description |
Default Value |
kwargs |
kwargs for al_template_files |
none |
1.3.23 - al_txt_data
al_txt_data
load("@com-alwaldend-git-src//bzl/macros:al_txt_data.bzl", "al_txt_data")
al_txt_data(name, srcs, **kwargs)
Text data
PARAMETERS
Name |
Description |
Default Value |
name |
target name |
none |
srcs |
sources |
none |
kwargs |
filegroup kwargs |
none |
1.4 - Bazel providers
1.4.1 - al_hugo_site_info
AlHugoSiteInfo
load("@com-alwaldend-git-src//bzl/providers:al_hugo_site_info.bzl", "AlHugoSiteInfo")
AlHugoSiteInfo(content, data, themes, layouts, config, env, env_script)
Information about a hugo site
FIELDS
Name |
Description |
content |
Content dir |
data |
Data dir |
themes |
Themes dir |
layouts |
Layouts dir |
config |
Config file |
env |
Environment variables |
env_script |
Shell script to export env variables |
1.4.2 - al_toml_info
AlTomlInfo
load("@com-alwaldend-git-src//bzl/providers:al_toml_info.bzl", "AlTomlInfo")
AlTomlInfo(srcs, deps)
Provide toml data info
FIELDS
Name |
Description |
srcs |
Toml files |
deps |
Toml data targets |
1.4.3 - al_transitive_sources
AlTransitiveSources
load("@com-alwaldend-git-src//bzl/providers:al_transitive_sources.bzl", "AlTransitiveSources")
AlTransitiveSources(transitive_sources)
Provide transitive sources
FIELDS
Name |
Description |
transitive_sources |
- |
al_transitive_sources
load("@com-alwaldend-git-src//bzl/providers:al_transitive_sources.bzl", "al_transitive_sources")
al_transitive_sources(srcs, deps)
Obtain the source files for a target and its transitive dependencies.
PARAMETERS
Name |
Description |
Default Value |
srcs |
a list of source files |
none |
deps |
a list of targets that are direct dependencies |
none |
RETURNS
a collection of the transitive sources
1.6 - Bazel rules
1.6.1 - al_drawio_run_binary
al_drawio_run_binary
load("@com-alwaldend-git-src//bzl/rules:al_drawio_run_binary.bzl", "al_drawio_run_binary")
al_drawio_run_binary(name, srcs, out, arguments, cmd_timeout)
Run drawio a a build action
ATTRIBUTES
Name |
Description |
Type |
Mandatory |
Default |
name |
A unique name for this target. |
Name |
required |
|
srcs |
Sources |
List of labels |
optional |
[] |
out |
Output |
Label; nonconfigurable |
required |
|
arguments |
Arguments, location statements are expanded |
List of strings |
required |
|
cmd_timeout |
Drawio command timeout |
String |
optional |
"1m" |
1.6.2 - al_genrule
al_genrule_executable
load("@com-alwaldend-git-src//bzl/rules:al_genrule.bzl", "al_genrule_executable")
al_genrule_executable(name, srcs, data, outs, cmd, set_flags, shell, tools, worker)
Build executable using shell worker
ATTRIBUTES
Name |
Description |
Type |
Mandatory |
Default |
name |
A unique name for this target. |
Name |
required |
|
srcs |
Sources, will not be added to runfiles |
List of labels |
optional |
[] |
data |
Data, will be added to runfiles |
List of labels |
optional |
[] |
outs |
Outputs |
List of labels; nonconfigurable |
required |
|
cmd |
Script to execute |
String |
required |
|
set_flags |
set flags |
List of strings |
optional |
["-eux"] |
shell |
shell to use |
String |
optional |
"/bin/sh" |
tools |
Tools, will be added to runfiles |
List of labels |
optional |
[] |
worker |
Worker binary |
Label |
optional |
"@com-alwaldend-git-src//go/bazel-shell-worker" |
al_genrule_regular
load("@com-alwaldend-git-src//bzl/rules:al_genrule.bzl", "al_genrule_regular")
al_genrule_regular(name, srcs, data, outs, cmd, set_flags, shell, tools, worker)
Build shell worker rule
ATTRIBUTES
Name |
Description |
Type |
Mandatory |
Default |
name |
A unique name for this target. |
Name |
required |
|
srcs |
Sources, will not be added to runfiles |
List of labels |
optional |
[] |
data |
Data, will be added to runfiles |
List of labels |
optional |
[] |
outs |
Outputs |
List of labels; nonconfigurable |
required |
|
cmd |
Script to execute |
String |
required |
|
set_flags |
set flags |
List of strings |
optional |
["-eux"] |
shell |
shell to use |
String |
optional |
"/bin/sh" |
tools |
Tools, will be added to runfiles |
List of labels |
optional |
[] |
worker |
Worker binary |
Label |
optional |
"@com-alwaldend-git-src//go/bazel-shell-worker" |
al_genrule_test
load("@com-alwaldend-git-src//bzl/rules:al_genrule.bzl", "al_genrule_test")
al_genrule_test(name, srcs, data, outs, cmd, set_flags, shell, tools, worker)
Test using shell worker
ATTRIBUTES
Name |
Description |
Type |
Mandatory |
Default |
name |
A unique name for this target. |
Name |
required |
|
srcs |
Sources, will not be added to runfiles |
List of labels |
optional |
[] |
data |
Data, will be added to runfiles |
List of labels |
optional |
[] |
outs |
Outputs |
List of labels; nonconfigurable |
required |
|
cmd |
Script to execute |
String |
required |
|
set_flags |
set flags |
List of strings |
optional |
["-eux"] |
shell |
shell to use |
String |
optional |
"/bin/sh" |
tools |
Tools, will be added to runfiles |
List of labels |
optional |
[] |
worker |
Worker binary |
Label |
optional |
"@com-alwaldend-git-src//go/bazel-shell-worker" |
1.6.3 - al_hugo_binary
al_hugo_binary
load("@com-alwaldend-git-src//bzl/rules:al_hugo_binary.bzl", "al_hugo_binary")
al_hugo_binary(name, arguments, site)
Run a hugo command
ATTRIBUTES
Name |
Description |
Type |
Mandatory |
Default |
name |
A unique name for this target. |
Name |
required |
|
arguments |
Hugo arguments |
List of strings |
required |
|
site |
Hugo site |
Label |
required |
|
1.6.4 - al_hugo_run_binary
al_hugo_run_binary
load("@com-alwaldend-git-src//bzl/rules:al_hugo_run_binary.bzl", "al_hugo_run_binary")
al_hugo_run_binary(name, arguments, site)
Run hugo binary as a build action
ATTRIBUTES
Name |
Description |
Type |
Mandatory |
Default |
name |
A unique name for this target. |
Name |
required |
|
arguments |
Hugo arguments |
List of strings |
required |
|
site |
Hugo site |
Label |
required |
|
1.6.5 - al_hugo_site
al_hugo_site
load("@com-alwaldend-git-src//bzl/rules:al_hugo_site.bzl", "al_hugo_site")
al_hugo_site(name, configs, content, env, hugo_data, hugo_layouts, postcss, themes, tools)
Define a hugo site
ATTRIBUTES
Name |
Description |
Type |
Mandatory |
Default |
name |
A unique name for this target. |
Name |
required |
|
configs |
Hugo configs |
List of labels |
required |
|
content |
Hugo content |
Label |
required |
|
env |
Hugo environment variables (support location statements, support make variables, support shell commands) |
Dictionary: String -> String |
optional |
{} |
hugo_data |
Hugo data |
Label |
required |
|
hugo_layouts |
Hugo layouts |
Label |
required |
|
postcss |
Postcss target |
Label |
required |
|
themes |
Hugo themes |
Label |
required |
|
tools |
Tools that should be available for the build |
List of labels |
optional |
[] |
1.6.6 - al_remove_directories
al_remove_directories
load("@com-alwaldend-git-src//bzl/rules:al_remove_directories.bzl", "al_remove_directories")
al_remove_directories(name, srcs)
Remove directory files from DefaultInfo
ATTRIBUTES
Name |
Description |
Type |
Mandatory |
Default |
name |
A unique name for this target. |
Name |
required |
|
srcs |
Sources to remove directories from |
List of labels |
optional |
[] |
1.6.7 - al_template_files
al_template_files
load("@com-alwaldend-git-src//bzl/rules:al_template_files.bzl", "al_template_files")
al_template_files(name, srcs, data, outs, templater)
Load data files, then template the template and write the output
ATTRIBUTES
Name |
Description |
Type |
Mandatory |
Default |
name |
A unique name for this target. |
Name |
required |
|
srcs |
Template files |
List of labels |
required |
|
data |
Data files |
List of labels |
required |
|
outs |
Output files |
List of labels; nonconfigurable |
required |
|
templater |
Templater to use |
Label |
optional |
"@com-alwaldend-git-src//go/template-files" |
1.6.8 - al_toml_data
al_toml_data
load("@com-alwaldend-git-src//bzl/rules:al_toml_data.bzl", "al_toml_data")
al_toml_data(name, deps, srcs, tomlv)
ATTRIBUTES
Name |
Description |
Type |
Mandatory |
Default |
name |
A unique name for this target. |
Name |
required |
|
deps |
Toml data targets |
List of labels |
optional |
[] |
srcs |
Toml files |
List of labels |
optional |
[] |
tomlv |
Tomlv target to use for validation |
Label |
optional |
"@com-alwaldend-git-src//tools:tomlv" |
1.6.9 - al_unpack_archives
al_unpack_archives
load("@com-alwaldend-git-src//bzl/rules:al_unpack_archives.bzl", "al_unpack_archives")
al_unpack_archives(name, srcs, out)
Unpack several archives using tar into a directory
ATTRIBUTES
Name |
Description |
Type |
Mandatory |
Default |
name |
A unique name for this target. |
Name |
required |
|
srcs |
- |
List of labels |
required |
|
out |
- |
String |
optional |
"" |
1.6.10 - al_write_script
al_write_script
load("@com-alwaldend-git-src//bzl/rules:al_write_script.bzl", "al_write_script")
al_write_script(name, out, content, make_vars, set_flags, shebang)
Write a script and make it executable
ATTRIBUTES
Name |
Description |
Type |
Mandatory |
Default |
name |
A unique name for this target. |
Name |
required |
|
out |
Output file |
Label; nonconfigurable |
required |
|
content |
Script content |
String |
required |
|
make_vars |
Additional make vars |
Dictionary: String -> String |
optional |
{} |
set_flags |
Flags to pass to set |
List of strings |
optional |
["-eu"] |
shebang |
Sheband to use |
String |
optional |
"#!/usr/bin/env sh" |
1.7 - Bazel rules
Qt setup
- Install qt:
aqt install-qt -O /opt/qt linux desktop 6.9.0
- Register toolchain:
register_toolchains("//bazel/qt:preinstalled-qt-toolchain")
1.7.1 - al_drawio_toolchain
load("@com-alwaldend-git-src//bzl/toolchains:al_drawio_toolchain.bzl", "al_drawio_toolchain")
al_drawio_toolchain(name, drawio)
Drawio toolchain
ATTRIBUTES
Name |
Description |
Type |
Mandatory |
Default |
name |
A unique name for this target. |
Name |
required |
|
drawio |
Drawio binary |
Label |
required |
|
1.7.2 - al_hugo_toolchain
load("@com-alwaldend-git-src//bzl/toolchains:al_hugo_toolchain.bzl", "al_hugo_toolchain")
al_hugo_toolchain(name, hugo)
Hugo toolchain
ATTRIBUTES
Name |
Description |
Type |
Mandatory |
Default |
name |
A unique name for this target. |
Name |
required |
|
hugo |
Hugo binary |
Label |
required |
|
1.7.3 - al_qt_local_toolchain
load("@com-alwaldend-git-src//bzl/toolchains:al_qt_local_toolchain.bzl", "al_qt_local_toolchain")
al_qt_local_toolchain(name, dir, platform, version)
Local qt toolchain
ATTRIBUTES
Name |
Description |
Type |
Mandatory |
Default |
name |
A unique name for this target. |
Name |
required |
|
dir |
Root qt directory |
String |
required |
|
platform |
Qt platform |
String |
required |
|
version |
Qt version |
String |
required |
|
1.7.4 - al_qt_resolved_toolchain
load("@com-alwaldend-git-src//bzl/toolchains:al_qt_resolved_toolchain.bzl", "al_qt_resolved_toolchain")
al_qt_resolved_toolchain(name)
Resolved qt toolchain
ATTRIBUTES
Name |
Description |
Type |
Mandatory |
Default |
name |
A unique name for this target. |
Name |
required |
|
1.7.5 - al_shellcheck_toolchain
load("@com-alwaldend-git-src//bzl/toolchains:al_shellcheck_toolchain.bzl", "al_shellcheck_toolchain")
al_shellcheck_toolchain(name, shellcheck)
Shellcheck toolchain
ATTRIBUTES
Name |
Description |
Type |
Mandatory |
Default |
name |
A unique name for this target. |
Name |
required |
|
shellcheck |
Shellcheck binary |
Label |
required |
|
1.8 - BUILD.bazel files
1.9 - Module extensions
1.9.1 - al_repo_map
al_repo_map
al_repo_map = use_extension("@com-alwaldend-git-src//bzl/extensions:al_repo_map.bzl", "al_repo_map")
al_repo_map.download(name, build_file_content, download_type, executable, repos, strip_prefix)
Extension to create several repos from a map
TAG CLASSES
download
Attributes
Name |
Description |
Type |
Mandatory |
Default |
name |
Name |
Name |
required |
|
build_file_content |
Build file content |
String |
optional |
"" |
download_type |
Download type |
String |
required |
|
executable |
Field executable for http_file |
Boolean |
optional |
False |
repos |
Map of repos |
Dictionary: String -> List of strings |
required |
|
strip_prefix |
Strip prefix |
String |
optional |
"" |
1.10 - Static bazel variables
1.11 - Toolchain types
2 - C projects
2.2 - Openssl build
2.3 - SRI calculator
Cli app to calculate subresource integrity
Links
Help
Usage: sri [OPTION...]
Generate sri of a file
Example:
bazel run //c/sri:bin -- --digest sha256 --file ${PWD}/README.md
-d, --digest=String Digest type (sha256, for example)
-f, --file=Path Path to the file to parse
-?, --help Give this help list
--usage Give a short usage message
3 - C++ projects
3.1 - Fork of InfiniTimeOrg/InfiniTime
3.2 - Leetcode submissions (cpp)
3.3 - Useless qt GUI
Desktop GUI written with C++, it doesn’t do anything
4 - Configs
4.1 - Dotfile configs
5 - Data
5.1 - Miscellaneous data
6 - Drawio diagrams
6.1 - Drawio diagrams
6.1.1 - arch-idea-anki-chinese-flashcards-enricher
6.1.2 - arch-idea-twitch-auto-clipper
6.1.3 - arch-interview-yandex-sre
7 - Golang projects
7.1 - Bazel worker that runs shell commands
7.2 - CLI app to download leetcode submissions
Download doesn’t work anymore because of Cloudflare
7.2.1 - Models for leetcode-downloader
7.3 - Cli tool to template files
7.4 - Leetcode submissions (go)
7.5 - Random golang tools
7.6 - Tool to install files
7.6.1 - Cmd code for file-installer
7.7 - Tool to parse README.md files
Example
bazel run golang/readme-tree -- parse -g -C "${PWD}" .
8 - Hugo projects
8.1 - Hugo sites
8.1.1 - Miscellaneous knowledge
8.1.1.1 - Hugo site content
8.1.1.2 - Hugo site layouts
8.2 - Hugo themes
9 - Images
9.1 - Assets for useless-qt-gui
10 - Java projects
10.1 - Leetcode submissions (java)
11 - Javascript projects
11.1 - Leetcode downloader
Tampermonkey script to download leetcode submissions
12 - Kotlin projects
13 - Lua projects
13.1 - Lua library for neovim
13.2 - Neovim config
14 - Miscellaneous pages
14.1 - Bazel
Advantages
- Hermetic builds
- Dependency graph
- Local build and test cache
- Remote cache
- Remote execution
- Unified API for builds, tasks, and tests
Disadvantages
- Additional layer of abstraction and complexity
- Weird edge cases and occasional bugs
- Lack of support, documentation, and information on the internet
- The majority of advantages are irrelevant for the majority of codebases
.bazelrc has variables
%workspace%
: Workspace directory
https://bazel.build/run/bazelrc
Local registry module is cached
If you changed a local registry module, but bazel still uses the old version,
restart bazel: bazel shutdown
https://github.com/bazelbuild/bazel/issues/20477#issuecomment-1851057077
Output root ownership
Bazel checks ownership of the output root at startup, so it will fail with
mkdir('/path/to/dir'): (error: 13): Permission denied
if the current user does
not own the directory.
Example:
$ bazel --client_debug
...
[FATAL 15:19:33.457 src/main/cpp/blaze_util_posix.cc:499] mkdir('/path/to/dir'): (error: 13): Permission denied
Traceback:
js_binary does not work for some reason
One of possible errors:
FATAL: aspect_rules_js[js_binary]: RUNFILES environment variable is not set
Solutions
Run the binary (that fixes it for some reason)
bazel run //tools:postcss
Run pnpm install
(sometimes node_modules directory is not up-to-date)
bazel run -- tools:pnpm --dir "${PWD}" install
14.2 - Books
Books
Thumbnail |
Info |
|
Title |
Reverend Insanity |
ALternative titles |
|
Authors |
|
Completion status |
Not finished, banned by CCP |
Reading status |
Finished available chapters, 2334 Chapters |
Quality |
Peak |
Links |
|
|
|
Title |
Virtuous Sons |
Authors |
|
Completion status |
Not finished |
Reading status |
Reading, chapter 2.14 |
Quality |
Peak |
Links |
|
|
|
Title |
My Longevity Simulation |
Authors |
|
Completion status |
Translation is not finished |
Reading status |
Reading, chapter 724 |
Quality |
Good |
Links |
|
|
|
Title |
Unintended Immortality |
ALternative titles |
-
The Unintentional Path to Immortality
-
我本无意成仙
|
Authors |
|
Completion status |
Not finished |
Reading status |
Reading, chapter 447 |
Quality |
Good |
Links |
|
|
|
Title |
Lord of the Mysteries |
Authors |
- Cuttlefish That Loves Diving (爱潜水的乌贼)
|
Completion status |
Finished |
Reading status |
Finished volume 2 |
Quality |
Good |
Links |
|
|
|
Title |
Ze Tian Ji |
ALternative titles |
|
Authors |
|
Completion status |
Finished |
Reading status |
Finished |
Quality |
Good |
Links |
|
|
|
Title |
The Path Toward Heaven |
ALternative titles |
|
Authors |
|
Completion status |
Finished, translation is not finished |
Reading status |
Finished available chapters |
Quality |
Good |
Links |
|
|
|
Title |
Nightfall |
ALternative titles |
|
Authors |
|
Completion status |
Finished |
Reading status |
Finished |
Quality |
Good |
Links |
|
|
|
Title |
The Experimental Log of the Crazy Lich |
ALternative titles |
|
Authors |
|
Completion status |
Finished volume 2 |
Reading status |
Finished volume 1 |
Quality |
Good |
Links |
|
|
|
Title |
The Sage Who Transcended Samsara |
ALternative titles |
|
Authors |
- Cuttlefish That Loves Diving (爱潜水的乌贼)
|
Completion status |
Finished |
Reading status |
Finished |
Quality |
Good, dropped at the end |
Links |
|
|
|
Title |
Beyond the Timescape |
ALternative titles |
|
Authors |
|
Completion status |
Not finished |
Reading status |
Dropped, chapter 65 |
Quality |
Ok |
Summary |
Shallow and edgy |
Links |
|
|
|
Title |
Archfiend |
ALternative titles |
|
Authors |
- Nocturnal Stranger (厄夜怪客)
|
Completion status |
Finished, not translated fully |
Reading status |
Finished translated chapters, chapter 528 |
Quality |
Decent |
Links |
|
|
|
Title |
Godclads |
Authors |
|
Completion status |
Not finished |
Reading status |
Reading, chapter 35-15, book 7 |
Quality |
Good, a bit too dramatic |
Links |
|
|
|
Title |
Defiance of the Fall |
Authors |
|
Completion status |
Not finished |
Reading status |
Reading, chapter 1333 |
Quality |
Good |
Links |
|
|
|
Title |
Matabar |
Authors |
|
Completion status |
Not finished |
Reading status |
Reading, chapter 91 |
Quality |
Good |
Links |
|
|
|
Title |
Renegade Immortal |
Authors |
|
Completion status |
Finished |
Reading status |
Finished |
Quality |
Good |
Links |
|
|
|
Title |
Shadow Slave |
Authors |
|
Completion status |
Not finished |
Reading status |
Reading, chapter 2388 |
Quality |
Good |
Links |
|
|
|
Title |
The Years of Apocalypse |
Authors |
|
Completion status |
Not finished |
Reading status |
Reading, chapter 199 |
Quality |
Good |
Links |
|
|
|
Title |
Book Of The Dead |
Authors |
|
Completion status |
Not finished |
Reading status |
Reading, book 5 chapter 25 |
Quality |
Good |
Links |
|
|
|
Title |
Downtown Druid |
Authors |
|
Completion status |
Not finished |
Reading status |
Finished volume 1 |
Quality |
Decent |
Links |
|
|
|
Title |
A Practical Guide to Sorcery |
Authors |
|
Completion status |
Not finished |
Reading status |
Reading, chapter 254 |
Quality |
Decent |
Links |
|
|
|
Title |
Dungeon Crawler Carl |
Authors |
|
Completion status |
Not completed |
Reading status |
Finished volume 7 |
Quality |
Good |
Links |
|
|
|
Title |
Beware Of Chicken |
Authors |
|
Completion status |
Not finished |
Reading status |
Dropped at some point |
Quality |
Good |
Links |
|
|
|
Title |
I Shall Seal the Heavens |
Authors |
|
Completion status |
Finished |
Reading status |
Finished |
Quality |
Good |
Links |
|
|
|
Title |
World of Cultivation |
ALternative titles |
|
Authors |
|
Completion status |
Finished |
Reading status |
Finished |
Quality |
Good |
Summary |
9/10. Great book. It's not the best in anything but every part of it is at least decent |
Links |
|
|
|
Title |
Hell Difficulty Tutorial |
Authors |
|
Completion status |
Not finished |
Reading status |
Reading, chapter 589 |
Quality |
Decent |
Links |
|
|
|
Title |
Return of the Runebound Professor |
Authors |
|
Completion status |
Not finished |
Reading status |
Dropped, chapter 722 (book 7) |
Quality |
Ok |
Links |
|
|
|
Title |
I Am Become Death |
Authors |
- J.M. Clarke (U Juggernaut)
|
Completion status |
Not finished |
Reading status |
Dropped, chapter 55 |
Quality |
Decent |
Summary |
Nothing exceptional |
Links |
|
|
|
Title |
Are You Even Human |
Authors |
|
Completion status |
Not finished |
Reading status |
Reading, chapter 47 |
Quality |
Decent |
Links |
|
|
|
Title |
Ghost of the Truthseeker |
Authors |
|
Completion status |
Not finished |
Reading status |
Dropped, chapter 220 |
Quality |
Ok |
Summary |
Feels generic |
Links |
|
|
|
Title |
Changeling |
Authors |
|
Completion status |
Not finished |
Reading status |
Reading, chapter 78 |
Quality |
Decent |
Links |
|
|
|
Title |
The Beginning After the End |
Authors |
|
Completion status |
Finished |
Reading status |
Dropped, volume 1, chapter 13 |
Quality |
Bad, isekai slop |
Links |
|
|
|
Title |
Rise of the Living Forge |
Authors |
|
Completion status |
Not finished |
Reading status |
Dropped, volume 1, chapter 66 |
Quality |
Ok, isekai slop |
Links |
|
|
|
Title |
Vigor Mortis |
Authors |
|
Completion status |
Completed |
Reading status |
Dropped, volume 4, chapter 27 |
Quality |
Ok |
Links |
|
|
|
Title |
Ultimate Level 1 |
Authors |
|
Completion status |
Not completed |
Reading status |
Dropped, volume 1, chapter 17 |
Quality |
Bad, litrpg slop |
Links |
|
|
|
Title |
If It’s for My Daughter, I’d Even Defeat a Demon Lord |
Authors |
|
Completion status |
Completed |
Reading status |
Dropped, volume 4, chapter 2 |
Quality |
Bad, Japanese slice-of-life litrpg fantasy slop |
Links |
|
|
|
Title |
Mark of the Fool |
Authors |
- J.M. Clarke (U Juggernaut)
|
Completion status |
Finished |
Reading status |
Finished |
Quality |
Decent, not enough progression |
Links |
|
|
|
Title |
DIE. RESPAWN. REPEAT. |
Authors |
|
Completion status |
Not finished |
Reading status |
Dropped, volume 4, chapter 8 (chapter 222) |
Quality |
Decent, a bit bland |
Links |
|
|
|
Title |
System Breaker |
Authors |
|
Completion status |
Not completed |
Reading status |
Dropped, volume 2, chapter 55 |
Quality |
Decent, MC is a bit immature |
Links |
|
|
|
Title |
Reborn as a Demonic Tree |
Authors |
|
Completion status |
Not completed |
Reading status |
Dropped, volume 8, chapter 421 |
Quality |
Ok, mediocre |
Links |
|
|
|
Title |
Accel World |
Authors |
|
Completion status |
Finished |
Reading status |
Dropped at some point |
Quality |
Bad, japanese slop |
Links |
|
|
|
Title |
The Jester of Apocalypse |
Authors |
|
Completion status |
Not finished, hiatus |
Reading status |
Finished available chapters |
Quality |
Ok, basic and a bit edgy |
Links |
|
|
|
Title |
Throne of Magical Arcana |
Authors |
- Cuttlefish That Loves Diving (爱潜水的乌贼)
|
Completion status |
Finished |
Reading status |
Dropped near the end when the main plot ended |
Quality |
Decent, a bit mediocre |
Links |
|
|
|
Title |
The Charm of Soul Pets |
Authors |
|
Completion status |
Finished |
Reading status |
Dropped, chapter 42 |
Quality |
Don't remember |
Links |
|
|
|
Title |
12 Miles Below |
Authors |
|
Completion status |
Not finished |
Reading status |
Dropped at some point |
Quality |
Decent |
Links |
|
|
|
Title |
Worm |
Authors |
|
Completion status |
Finished |
Reading status |
Finished |
Quality |
Decent |
Links |
|
|
|
Title |
Full Murderhobo |
Authors |
|
Completion status |
Not finished |
Reading status |
Finished, volume 3 |
Quality |
Ok, a bit basic |
Links |
|
|
|
Title |
The Divine Dungeon |
Authors |
|
Completion status |
Finished |
Reading status |
Finished |
Quality |
Ok, a bit basic |
Links |
|
|
|
Title |
SSS-Class Suicide Hunter |
Authors |
|
Completion status |
Not finished |
Reading status |
Dropped at some point |
Quality |
Ok, too much emotional bullshit |
Links |
|
|
|
Title |
Corpo Age |
Authors |
|
Completion status |
Not finished |
Reading status |
Dropped, volume 1, chapter 2 |
Quality |
Ok, feels basic |
Links |
|
|
|
Title |
Shen Yin Wang Zuo |
ALternative titles |
-
Sealed Divine Throne
-
神印王座
|
Authors |
|
Completion status |
Finished |
Reading status |
Dropped, chapter 101 |
Quality |
Bad, too bland |
Links |
|
|
|
Title |
Warlock of the Magus World |
Authors |
|
Completion status |
Finished |
Reading status |
Dropped, chapter 58 |
Quality |
Bad, edgy slop, too much 'AI chip, do the thing' |
Links |
|
|
|
Title |
Perfect World |
Authors |
|
Completion status |
Completed |
Reading status |
Dropped, chapter 75 |
Quality |
Don't remember, children are boring |
Links |
|
|
|
Title |
Trash of the Count’s Family |
Authors |
|
Completion status |
Not finished |
Reading status |
Dropped, chapter 215 |
Quality |
Bad |
Summary |
Korean slop, the same stuff happens over and over again, endless saving of useless garbage, humble bragging |
Links |
|
|
|
Title |
Forty Millenniums of Cultivation |
ALternative titles |
-
Forty Thousand Years Of Cultivation
-
修真四万年
|
Authors |
- The Enlightened Master Crouching Cow (卧牛真人)
|
Completion status |
Finished |
Reading status |
Dropped, chapter 2935 |
Quality |
0.8 |
Summary |
Good worldbuilding, but too many empty exclamations and not enough substance |
Links |
|
|
|
Title |
The Empty Box and Zeroth Maria |
ALternative titles |
-
Utsuro no Hako to Zero no Maria
-
空ろの箱と零のマリア
|
Authors |
|
Completion status |
Finished |
Reading status |
Finished |
Quality |
Decent? |
Summary |
Don't remember |
Links |
|
|
|
Title |
Rune Seeker |
Authors |
- J.M. Clarke (U Juggernaut)
|
Completion status |
Not finished |
Reading status |
Dropped, volume 2, chapter 12 |
Quality |
Ok |
Summary |
Shallow |
Links |
|
|
|
Title |
Chrysalis |
Authors |
|
Completion status |
Not finished |
Reading status |
Reading, chapter 1596 |
Quality |
Ok |
Summary |
Shallow |
Links |
|
|
|
Title |
My House of Horrors |
ALternative titles |
|
Authors |
- Can Fix Air-Conditioners (我会修空调)
|
Completion status |
Finished |
Reading status |
Dropped at some point |
Quality |
Ok |
Summary |
Repetetive |
Links |
|
|
|
Title |
The Spiritual Attainment of Minghe |
ALternative titles |
|
Authors |
- God Loves The World (神仙爱凡尘)
|
Completion status |
Finished |
Reading status |
Dropped, chapter 8 |
Quality |
Ok |
Summary |
Shallow, bad translation |
Links |
|
|
|
Title |
Unbound |
Authors |
|
Completion status |
Not finished |
Reading status |
Dropped, finisehd volume 3 |
Quality |
Ok |
Summary |
Shallow |
Links |
|
|
|
Title |
The Stubborn Skill-Grinder In A Time Loop |
Authors |
|
Completion status |
Not finished |
Reading status |
Dropped, chapter 44 |
Quality |
Ok |
Summary |
Shallow litrpg slop |
Links |
|
|
|
Title |
I Shall Be Everlasting In the World of Immortals |
ALternative titles |
|
Authors |
- Fast Food Restaurant (快餐店)
|
Completion status |
Not finished |
Reading status |
Dropped, chapter 241 |
Quality |
Ok |
Summary |
Shallow |
Links |
|
|
|
Title |
Solo Leveling |
ALternative titles |
|
Authors |
|
Completion status |
Finished |
Reading status |
Dropped, chapter 52 |
Quality |
Ok |
Summary |
Shallow litrpg slop |
Links |
|
|
|
Title |
The Strongest System |
ALternative titles |
|
Authors |
|
Completion status |
Finished |
Reading status |
Dropped, chapter 113 |
Quality |
Ok |
Summary |
Shallow |
Links |
|
|
|
Title |
Cultivation Chat Group |
ALternative titles |
|
Authors |
- Legend of the Paladin (圣骑士的传说)
|
Completion status |
Finished |
Reading status |
Finished |
Quality |
Decent |
Links |
|
|
|
Title |
Dao of the Bizarre Immortal |
ALternative titles |
|
Authors |
|
Completion status |
Finished |
Reading status |
Finished |
Quality |
Decent |
Links |
|
|
|
Title |
Blood & Fur |
Authors |
|
Completion status |
Not finished |
Reading status |
Reading, finished volume 1 |
Quality |
Good |
Links |
|
|
|
Title |
The Perfect Run |
Authors |
|
Completion status |
Finished |
Reading status |
Finished |
Quality |
Decent |
Links |
|
|
|
Title |
Diary of a Dead Wizard |
ALternative titles |
|
Authors |
|
Completion status |
Finished |
Reading status |
Reading, chapter 377 |
Quality |
Good |
Links |
|
|
14.3 - Glossary
Subresource Integrity
Subresource Integrity (SRI) is a security feature that enables browsers to
verify that resources they fetch (for example, from a CDN) are delivered without
unexpected manipulation. It works by allowing you to provide a cryptographic
hash that a fetched resource must match.
https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity
14.4 - Gnome boxes
Gnome boxes is a hypervisor.
Cpu
The default cpu doesn’t have a lot of capabilities, so you might need to patch
the config:
<!-- https://www.qemu.org/docs/master/system/i386/cpu.html -->
<cpu mode="host-model" />
Network
Default libvirt network interferes with gnome-boxes, you might need to disable it:
sudo systemctl disable --now libvirtd
Disk size
Just increasing the disk size is not enough, you need to increase the logical volume
size:
sudo lvextend -l +100%FREE /dev/fedora/root
sudo xfs_growfs /dev/fedora/root
Source: https://www.redhat.com/en/blog/resize-lvm-simple
14.5 - Hugo
Hugo is a static site builder
Environment variables
Hugo has an allowlist of environment variables, and js_binary
rules
do not work because they need a BAZEL_BINDIR
variable
Fix:
[security.exec]
osEnv = [
'(?i)^((HTTPS?|NO)_PROXY|PATH(EXT)?|APPDATA|TE?MP|TERM|GO\w+|(XDG_CONFIG_)?HOME|USERPROFILE|SSH_AUTH_SOCK|DISPLAY|LANG|SYSTEMDRIVE|BAZEL.+)$',
]
Configuration reference: https://gohugo.io/configuration/security/
14.6 - Ping
sendmsg: operation not permitted
This problem can be caused by vpns with “kill-switch” enabled, so you might need to disable them.
Disable Mullvad VPN:
sudo systemctl disable --now mullvad-daemon
14.7 - Shell
Deactivate venv in subshell
A subshell doesn’t have the deactivate
function, so you have to use a
workaround:
. .venv/bin/activate
(
echo "subshell, still in venv: $(which python)" && \
. "$(dirname "$(which python)")/activate" && \
deactivate && \
echo "subshell, out of venv: $(which python)"
)
A subshell ()
is different from a subprocess
https://unix.stackexchange.com/a/138498
A subshell starts out as an almost identical copy of the original shell process.
Under the hood, the shell calls the fork system call1, which creates a new
process whose code and memory are copies2. When the subshell is created, there
are very few differences between it and its parent. In particular, they have the
same variables. Even the $$ special variable keeps the same value in subshells:
it’s the original shell’s process ID. Similarly $PPID is the PID of the parent
of the original shell.
A few shells change a few variables in the subshell. Bash ≥4.0 sets BASHPID to
the PID of the shell process, which changes in subshells. Bash, zsh and mksh
arrange for $RANDOM to yield different values in the parent and in the subshell.
But apart from built-in special cases like these, all variables have the same
value in the subshell as in the original shell, the same export status, the same
read-only status, etc. All function definitions, alias definitions, shell
options and other settings are inherited as well.
A subshell created by (…) has the same file descriptors as its creator. Some
other means of creating subshells modify some file descriptors before executing
user code; for example, the left-hand side of a pipe runs in a subshell3 with
standard output connected to the pipe. The subshell also starts out with the
same current directory, the same signal mask, etc. One of the few exceptions is
that subshells do not inherit custom traps: ignored signals (trap ’’ SIGNAL)
remain ignored in the subshell, but other traps (trap CODE SIGNAL) are reset to
the default action4.
A subshell is thus different from executing a script. A script is a separate
program. This separate program might coincidentally be also a script which is
executed by the same interpreter as the parent, but this coincidence doesn’t
give the separate program any special visibility on internal data of the parent.
Non-exported variables are internal data, so when the interpreter for the child
shell script is executed, it doesn’t see these variables. Exported variables,
i.e. environment variables, are transmitted to executed programs.
15 - Patches
15.1 - Fixes for rules-haskell
15.2 - Git patches for InfiniTimeOrg/InfiniTime
16 - Perl projects
17 - Protobuf projects
17.2 - Models for leetcode-downloader
18 - Python projects
18.1 - Autoscroll
CLI app for autoscroll
About The Project
This package implements autoscroll, so you can autoscroll without depending on OS or mouse drivers
Features
- Pretty useless
- Has a config file with hot-reload
- Python3, PyQt6
- Some argparse tinkering
Usage
By default, the icon is disabled, to enable it pass --icon-enable
You can pass file contents as command line arguments using @path/to/the/file
syntax.
Arguments in that case can be placed wherever - on one line, on several lines
If you want to dynamically pass runtime arguments (without restarting the process), you can use --config
options for it
Once you press --buttons-start
, you can scroll vertically or horizontally just by moving your mouse untill you press --buttons-end
If --buttons-hold
is set, the srolling ends once you release --buttons-start
Once --buttons-start
is pressed, the scroll thread starts looping
Every loop consists of sleeping for an interval, then scrolling for either 0, 1, or -1 pixels on both axis towards the starting point
Starting point is the point where --buttons-start
was pressed
Sleep interval is recalculated on every mouse move as such:
100 / (--scrolling-acceleration * max(distance) + --scrolling-speed)
If --scrolling-acceleration
is not 0, the speed of scrolling will be faster
the farther away you are from the starting point
If --scrolling-acceleration
is 0, the speed of scrolling will be constant
Examples
Use the package
python3 -m venv venv
. venv/bin/activate
pip install autoscroll pyside6
autoscroll
Command line options
autoscroll --buttons-start 1 --debug-click --icon-disable
Pass a configuration file once
autoscroll --icon-enable @config.txt
If config.txt
is defined like this, its contents will be used as command line arguments - they will be loaded only once
Arguments can be placed wherever - on one line, on several lines
For example,
--buttons-start 1
--buttons-hold --debug-click
Listen for changes in the configuration file
autoscroll --config-enable --config-path config.txt
If config.txt is defined like this, the process will listen for changes in that
file and update itself
Arguments can be placed wherever - on one line, on several lines
The file is checked for changess every --config-interval
For example:
--buttons-start 1 --buttons-hold
--debug_click
--help
output
usage: autoscroll [-h] [-ss SCROLLING_SPEED] [-sd SCROLLING_DEAD_AREA]
[-sa SCROLLING_ACCELERATION] [-bh] [-bs BUTTONS_START] [-be BUTTONS_END]
[-ce] [-cp CONFIG_PATH] [-ci CONFIG_INTERVAL] [-ie] [-ip ICON_PATH]
[-is ICON_SIZE] [-df] [-dc] [-ds] [-di]
...
options:
-h, --help show this help message and exit
scrolling:
-ss, --scrolling-speed int
constant part of the scrolling speed
[default: 300]
-sd, --scrolling-dead-area int
size of the square area aroung the starting point where scrolling will stop, in
pixels
[default: 50]
-sa, --scrolling-acceleration int
dynamic part of the scrolling speed, depends on the distance from the point
where the scrolling started, can be set to 0
[default: 10]
buttons:
-bh, --buttons-hold if set, the scrolling will end once you release --buttons-start
-bs, --buttons-start int
button that starts the scrolling
[default: 2]
-be, --buttons-end int
button that ends the scrolling
[default: --buttons-start]
config:
-ce, --config-enable if set, arguments from the configuration file on --config-path will be loaded
every --config-interval
-cp, --config-path str
path to the configuration file
[default: /home/kongrentian/.config/autoscroll/config.txt]
-ci, --config-interval int
how often the config file should be checked for changes, in seconds
[default: 5]
icon:
-ie, --icon-enable if set, the icon will be enabled
-ip, --icon-path str path to the icon
[default: resources/img/icon.svg]
-is, --icon-size int size of the icon, in pixels
[default: 30]
debug:
-df, --debug-file if set, every time the config file is parsed, information will be printed to
stdout
-dc, --debug-click if set, click info will be printed to stdout
-ds, --debug-scroll if set, scroll info will be printed to stdout
-di, --debug-initial if set, startup configuration will be printed to stdout
18.2 - Leetcode submissions (python)
18.3 - Python scripts
18.4 - Python shell allowing you to run shell commands in python environment
18.5 - Replace sections of files
19 - Rust projects
19.1 - Rust tools
20 - Shell projects
20.1 - Git hooks
20.2 - Shell scripts
21 - Tools
22 - Vial configs
22.1 - Keyboard configs