diff options
| author | Loek Le Blansch <loek@pipeframe.xyz> | 2026-07-03 18:37:53 +0200 |
|---|---|---|
| committer | Loek Le Blansch <loek@pipeframe.xyz> | 2026-07-03 18:37:53 +0200 |
| commit | 31b2d83b8703971452a5200abf02a1353bef2a81 (patch) | |
| tree | bec103a73d283eddd47824e9a3911ff4f2a05ee2 | |
| parent | 38a2ee83e398bfe63328b5ac38fca69f032cde0d (diff) | |
| -rw-r--r-- | .config/gdb/gdbinit | 3 | ||||
| -rw-r--r-- | .config/inputrc | 8 | ||||
| -rw-r--r-- | .config/mpd/mpd.conf##default | 3 | ||||
| -rw-r--r-- | .config/nvim/init.vim | 9 | ||||
| -rw-r--r-- | .config/picom.conf | 11 | ||||
| -rwxr-xr-x | .local/share/bin/dbg | 53 | ||||
| -rwxr-xr-x | .local/share/bin/latex-doc | 4 | ||||
| -rwxr-xr-x | .local/share/bin/mk | 20 | ||||
| -rwxr-xr-x | .local/share/bin/mktags | 61 | ||||
| -rwxr-xr-x | .local/share/bin/mozc-config-filter | 2 | ||||
| -rwxr-xr-x | .local/share/mode/switch.d/chromium | 8 | ||||
| -rw-r--r-- | .profile | 11 |
12 files changed, 143 insertions, 50 deletions
diff --git a/.config/gdb/gdbinit b/.config/gdb/gdbinit index 4c61733..ba777a8 100644 --- a/.config/gdb/gdbinit +++ b/.config/gdb/gdbinit @@ -14,9 +14,12 @@ set history save on set history size 10000000 set history remove-duplicates 100 set style emoji off +set pagination off # aliases alias reset = monitor reset +alias erase = monitor flash erase + alias -a -- v8m = arm-v8m alias -a -- v8m tz = arm-v8m trustzone alias -a -- jlink sv = jlink server diff --git a/.config/inputrc b/.config/inputrc new file mode 100644 index 0000000..aa55cba --- /dev/null +++ b/.config/inputrc @@ -0,0 +1,8 @@ +set show-all-if-ambiguous on +set completion-ignore-case on +set colored-completion-prefix on +set colored-stats on +set menu-complete-display-prefix on + +TAB: menu-complete +"\e[Z": menu-complete-backward diff --git a/.config/mpd/mpd.conf##default b/.config/mpd/mpd.conf##default index f6d91a8..a2d0355 100644 --- a/.config/mpd/mpd.conf##default +++ b/.config/mpd/mpd.conf##default @@ -21,3 +21,6 @@ audio_output { name "desktop output" } +input_cache { + size "512 MB" +} diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index fbd8fb5..6214f9e 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -75,7 +75,6 @@ Plug 'junegunn/goyo.vim' Plug 'psliwka/vim-smoothie' Plug 'airblade/vim-gitgutter' Plug 'wellle/targets.vim' -Plug 'rrethy/vim-hexokinase', { 'do': 'make hexokinase' } Plug 'dkarter/bullets.vim' Plug 'editorconfig/editorconfig-vim' Plug 'rickhowe/diffunitsyntax' @@ -250,19 +249,17 @@ let g:lightline = { \ [ 'mode', 'paste' ], \ [ 'readonly', 'filename', 'modified'], \ ], - \ 'right': [ - \ [ 'lineinfo' ], - \ ], + \ 'right': [ [ 'lineinfo' ] ], \ }, \ 'inactive': { \ 'left': [ \ [ 'readonly', 'filename', 'modified'], \ ], - \ 'right': [ ], + \ 'right': [ [ 'lineinfo' ] ], \ }, \ 'tabline': { \ 'left': [ [ 'tabs' ] ], - \ 'right': [ ], + \ 'right': [ ], \ }, \ 'subseparator': { \ 'left': '', diff --git a/.config/picom.conf b/.config/picom.conf index c1a8080..372806a 100644 --- a/.config/picom.conf +++ b/.config/picom.conf @@ -7,7 +7,7 @@ corner-radius = 10; shadow = true; shadow-radius = 48; -shadow-opacity = 0.4; +shadow-opacity = 0.2; shadow-offset-y = -36; shadow-offset-x = -48; @@ -82,9 +82,18 @@ rules = ( corner-radius = 10; }, { + match = "window_type *= 'popup'"; + shadow = true; + corner-radius = 10; + }, + { match = "class_i *= 'RAIL'"; corner-radius = 0; }, + { + match = "_NET_WM_STATE@[*] = '_NET_WM_STATE_FULLSCREEN'"; + shadow = false; + }, ) animations = ( diff --git a/.local/share/bin/dbg b/.local/share/bin/dbg index 424110b..d042ba5 100755 --- a/.local/share/bin/dbg +++ b/.local/share/bin/dbg @@ -1,40 +1,27 @@ #!/bin/sh -progname="$(basename "$(readlink -f "$0")")" -die() { - ec="$1" - shift - echo "$@" - exit "$ec" -} - GDB="arm-none-eabi-gdb" -[ $# -lt 1 ] && die 1 "usage: $progname DEVICE [gdb args...]" -DEVICE="$1" -shift +found_executable=false + +while ! $found_executable ; do + [ ! -e build/zephyr ] && break + [ ! -e build/zephyr/zephyr.elf ] && break + set -- --se="build/zephyr/zephyr.elf" "$@" + + [ -e build/tfm/bin/tfm_s.elf ] && set -- "$@" --eval-command="add-symbol-file build/tfm/bin/tfm_s.elf" -if [ $# -eq 0 ] ; then - # automatically add --se flag if executable can be found + found_executable=true +done + +while ! $found_executable ; do exec="$(find . -maxdepth 3 -name '*.elf' | head -n1)" - [ -n "$exec" ] && set -- --se="$exec" -fi - -[ -n "$(echo "$*" | grep -i zephyr)" ] && GDB="arm-zephyr-eabi-gdb" - -fork JLinkGDBServerCLExe \ - -device "$DEVICE" \ - -select USB \ - -endian little \ - -if SWD \ - -speed auto \ - -singlerun \ - -noir \ - -nologtofile \ - -silent - -# append startup attach command to args -set -- --eval-command="target extended-remote :2331" "$@" - -# launch gdb and forward any other args to it + [ -n "$exec" ] && set -- "$@" --se="$exec" + found_executable=true + break +done + +set -- "$@" --eval-command="set jlink autoconnect on" +set -- "$@" --eval-command="set jlink watchdog on" + exec "$GDB" "$@" diff --git a/.local/share/bin/latex-doc b/.local/share/bin/latex-doc new file mode 100755 index 0000000..6d785f1 --- /dev/null +++ b/.local/share/bin/latex-doc @@ -0,0 +1,4 @@ +#!/bin/sh +set -e +cd /usr/share/doc/texlive/latex +fork xdg-open "$(find . -name '*.pdf' | fzf)" diff --git a/.local/share/bin/mk b/.local/share/bin/mk index 9283753..051235a 100755 --- a/.local/share/bin/mk +++ b/.local/share/bin/mk @@ -9,13 +9,27 @@ showmode() { printf '\e[1A\e['$col'G\e[1;30m%s\e[0m\n' "$mode" } +make_tags() { + build_dir="${1-build}" + + if [ -e "$build_dir/domains.yaml" ] ; then + yaml2json "$build_dir/domains.yaml" | jq --raw-output '. as $r | $r.flash_order[] as $n | $r.domains[] | select(.name == $n) | .build_dir' | while IFS= read -r build_dir; do + echo "Processing: $build_dir" + done + fi + +} + mode_west() { showmode 'west' - [ -z "$*" ] && set -- build + if [ -z "$*" ] ; then + set -- build + [ -e sysbuild ] || [ -e sysbuild.conf ] && set -- "$@" --sysbuild + fi west "$@" ec=$? - ninja -C build -t deps | sed -n 's/^ \{4\}//p' | sort -u | ctags -L - -f build/tags 2>/dev/null & + mktags build & exit $ec } @@ -45,7 +59,7 @@ mode_cmake() { ec=$? # generate vim tags (continue after mk exits) - ninja -C "$builddir" -t deps | sed -n 's/^ \{4\}//p' | sort -u | ctags -L - -f "$builddir/tags" 2>/dev/null & + mktags "$builddir" & exit $ec } diff --git a/.local/share/bin/mktags b/.local/share/bin/mktags new file mode 100755 index 0000000..2daf25c --- /dev/null +++ b/.local/share/bin/mktags @@ -0,0 +1,61 @@ +#!/bin/python3 + +from subprocess import run, DEVNULL +from pathlib import Path +from dataclasses import dataclass +from argparse import ArgumentParser + +@dataclass +class Options: + build_dir: Path + +def parse_arguments() -> Options: + parser = ArgumentParser(prog="mktags", description="generate vim tags file from build directory") + parser.add_argument("build_dir", type=Path, help="build directory", nargs='?', default=Path("build")) + + options = parser.parse_args() + return Options(**vars(options)) + +def index_files(build_dir: Path) -> list[Path]: + lines = [line for line in run(("ninja", "-C", str(build_dir), "-t", "deps"), text=True, capture_output=True).stdout.splitlines()] + lines = [line.lstrip() for line in lines if line.startswith(" ")] + return [Path(line) for line in lines] + +def get_sysbuild_files(domains_yml: Path) -> list[Path]: + if not domains_yml.exists(): + return [] + + from yaml import safe_load + yaml = safe_load(domains_yml.read_text()) + + build_dirs = [next(Path(domain['build_dir']) for domain in yaml['domains'] if domain['name'] == domain_name) for domain_name in yaml['flash_order']] + + files: set[Path] = set() + for dir in build_dirs: + files.update(get_files(dir)) + + return list(files) + +def get_files(build_dir: Path) -> list[Path]: + files = [] + + files += get_sysbuild_files(build_dir.joinpath("domains.yaml")) + files += index_files(build_dir) + + return files + +def gen_tags(files: list[Path]) -> str: + filelist = "\n".join(str(file) for file in files) + return run(("ctags", "-L", "-", "-f", "-"), text=True, input=filelist, capture_output=True).stdout + +if __name__ == "__main__": + options = parse_arguments() + + files = get_files(options.build_dir) + + files = list(set(files)) + + tags = gen_tags(files) + + options.build_dir.joinpath("tags").write_text(tags) + diff --git a/.local/share/bin/mozc-config-filter b/.local/share/bin/mozc-config-filter index bc33c20..522275a 100755 --- a/.local/share/bin/mozc-config-filter +++ b/.local/share/bin/mozc-config-filter @@ -1,5 +1,5 @@ #!/bin/sh -yay_dir="$(jq --raw-output .buildDir "$XDG_CONFIG_HOME/yay/config.json")" +yay_dir="$(yay -Pg | jq --raw-output .buildDir)" config_proto="$(mktemp)" git --git-dir="$yay_dir/mozc-ut/mozc" show HEAD:src/protocol/config.proto > "$config_proto" protoc --proto_path /tmp --decode=mozc.config.Config "$config_proto" < "$1" diff --git a/.local/share/mode/switch.d/chromium b/.local/share/mode/switch.d/chromium index 5ed07fc..0ea2caa 100755 --- a/.local/share/mode/switch.d/chromium +++ b/.local/share/mode/switch.d/chromium @@ -8,10 +8,12 @@ rm -f 'Cached Theme.pak' magick -size 100x100 "xc:$bg" 'bg.png' bg_alt=$(mix_rgb $bg $color0 0.65) fg_alt=$(mix_rgb $fg $color15 0.35) + bg="$(hex_to_rgb_array "$bg")" fg="$(hex_to_rgb_array "$fg")" bg_alt="$(hex_to_rgb_array "$bg_alt")" fg_alt="$(hex_to_rgb_array "$fg_alt")" + cat << EOF > 'manifest.json' { "description": "colorscheme generated by mode", @@ -20,11 +22,11 @@ cat << EOF > 'manifest.json' "theme": { "images": { "theme_frame": "bg.png" }, "colors": { - "frame": $bg, + "frame": $bg_alt, "button_background": $fg, "ntp_background": $bg, - "ntp_text": $bg, - "toolbar": $bg_alt, + "ntp_text": $bg_alt, + "toolbar": $bg, "toolbar_button_icon": $fg, "tab_background_text": $fg_alt, "tab_background_text_inactive": $fg_alt, @@ -66,11 +66,9 @@ export GOPATH="$HOME/.local/go" export PASSWORD_STORE_ENABLE_EXTENSIONS=true export PASSWORD_STORE_EXTENSIONS_DIR="$XDG_DATA_HOME/pass-extensions" export MOZ_USE_XINPUT2=1 -export CMAKE_BUILD_TYPE=Debug -export CMAKE_EXPORT_COMPILE_COMMANDS=1 -export CMAKE_GENERATOR=Ninja export LIBVIRT_DEFAULT_URI='qemu:///system' export WINEDEBUG='fixme-all,err-all' +export INPUTRC="$XDG_CONFIG_HOME/inputrc" # LS_COLORS [ ! -e "$XDG_CACHE_HOME/dircolors" ] || [ "$XDG_CONFIG_HOME/dircolors" -nt "$XDG_CACHE_HOME/dircolors" ] && dircolors "$XDG_CONFIG_HOME/dircolors" > "$XDG_CACHE_HOME/dircolors" @@ -100,6 +98,13 @@ export TEXMFVAR="$XDG_CACHE_HOME/texlive/texmf-var" export TEXMFCONFIG="$XDG_CONFIG_HOME/texlive/texmf-config" alias poke="poke --quiet" +# CMake +export CMAKE_BUILD_TYPE=Debug +export CMAKE_EXPORT_COMPILE_COMMANDS=1 +export CMAKE_GENERATOR=Ninja +export CMAKE_C_COMPILER_LAUNCHER=ccache +export CMAKE_CXX_COMPILER_LAUNCHER=ccache + # colors alias diff='diff --color=auto' alias mk='FROM_PROMPT=y mk' |