├── gd ├── .envrc ├── .gitignore ├── Makefile ├── Cargo.toml └── shell.nix ├── nvim └── init.vim ├── xmonad ├── build ├── restart.sh ├── .xsession ├── HLint.hs ├── xmonad-start.desktop ├── recompile.sh ├── mac-host-ubuntu-guest-setup.md ├── xmonad-linus.cabal └── shell.nix ├── emacs └── doom-cfg │ ├── snippets │ └── .gitkeep │ ├── init.el │ └── packages.el ├── qutebrowser └── blocked-hosts ├── script ├── doom ├── git │ ├── hooks │ │ ├── prepare-commit-msg │ │ ├── prepare-commit-msg.sh │ │ └── prepare_commit_msg.bb │ └── ref-to-org-link.sh ├── emacsclient.sh ├── susp.sh ├── terminal-themes │ ├── Theme │ ├── PaletteExtra │ ├── color-tests │ │ ├── rubycolor.rb │ │ └── 256colors2.pl │ ├── listColorsForShell.dhall │ ├── listColorsForEmacs.dhall │ ├── themes │ │ ├── RetroBlue.dhall │ │ ├── Dark.dhall │ │ ├── Blue.dhall │ │ ├── Light.dhall │ │ ├── Red.dhall │ │ ├── Vanilla.dhall │ │ └── PastelDark.dhall │ ├── install_alacritty_colors.sh │ ├── renderControlSequences.dhall │ ├── toColorMap.dhall │ └── renderAlacrittyColorYaml.dhall ├── kill-emacs ├── mac-setup.sh ├── decrypt.sh ├── Makefile ├── startup_hook.sh ├── bb.edn ├── yodel.sh ├── test-runner.clj ├── rm-raf-if-dng.sh ├── raw-to-jpg.sh ├── gtag.sh ├── nix-pull.sh ├── windows │ └── set-ssh-authorized-keys-acl.ps1 ├── sync-sd-card.sh ├── copy-clipboard.sh ├── keyboard-repeat-mac.sh ├── tmux_startup.sh ├── mail-sync.sh ├── jpg-dng-diff.sh ├── tmux_move_pane.sh ├── seepr ├── tmux │ └── get_window_format_test.clj ├── tmux_get_status.sh ├── find_long_lines_test.clj ├── find_long_lines.bb └── tmux_get_window_format.sh ├── .rgignore ├── git ├── sendemail-aliases ├── gitignore └── cfg.personal.conf ├── nix └── nix.conf ├── uim ├── customs │ ├── custom-notify.scm │ ├── custom-xim.scm │ ├── custom-xkb.scm │ ├── custom-http.scm │ ├── custom-tutcode-rule.scm │ ├── custom-m17nlib.scm │ ├── custom-other-ims.scm │ ├── custom-anthy-advanced.scm │ ├── custom-look.scm │ ├── custom-ajax-ime-advanced.scm │ ├── custom-skk-advanced.scm │ ├── custom-predict.scm │ ├── custom-skk-dict.scm │ ├── custom-baidu-olime-jp-advanced.scm │ ├── custom-toolbar.scm │ ├── custom-google-cgiapi-jp-advanced.scm │ ├── custom-yahoo-jp-advanced.scm │ ├── custom-anthy-utf8.scm │ ├── custom-byeoru-keys1.scm │ ├── custom-social-ime-advanced.scm │ ├── custom-skk.scm │ ├── custom-byeoru.scm │ ├── custom-annotation.scm │ ├── custom-anthy.scm │ ├── custom-ajax-ime.scm │ ├── custom-yahoo-jp.scm │ ├── custom-global.scm │ ├── custom-social-ime.scm │ ├── custom-baidu-olime-jp.scm │ ├── custom-google-cgiapi-jp.scm │ ├── custom-anthy-keys4.scm │ ├── custom-ajax-ime-keys4.scm │ ├── custom-yahoo-jp-keys4.scm │ ├── custom-anthy-keys3.scm │ ├── custom-social-ime-keys4.scm │ ├── custom-ajax-ime-keys2.scm │ ├── custom-anthy-keys2.scm │ ├── custom-skk-keys3.scm │ ├── custom-yahoo-jp-keys2.scm │ ├── custom-global-keys1.scm │ ├── custom-ajax-ime-keys3.scm │ ├── custom-yahoo-jp-keys3.scm │ ├── custom-social-ime-keys2.scm │ ├── custom-baidu-olime-jp-keys4.scm │ ├── custom-social-ime-keys3.scm │ ├── custom-look-keys.scm │ ├── custom-google-cgiapi-jp-keys4.scm │ ├── custom-tutcode-keys2.scm │ ├── custom-skk-keys1.scm │ ├── custom-baidu-olime-jp-keys2.scm │ ├── custom-baidu-olime-jp-keys3.scm │ ├── custom-global-keys2.scm │ ├── custom-google-cgiapi-jp-keys2.scm │ ├── custom-byeoru-keys2.scm │ ├── custom-google-cgiapi-jp-keys3.scm │ ├── custom-anthy-keys1.scm │ ├── custom-ajax-ime-keys1.scm │ ├── custom-yahoo-jp-keys1.scm │ ├── custom-elatin.scm │ ├── custom-social-ime-keys1.scm │ ├── custom-baidu-olime-jp-keys1.scm │ ├── custom-google-cgiapi-jp-keys1.scm │ ├── custom-skk-keys2.scm │ ├── custom-tutcode-keys1.scm │ └── custom-tutcode.scm └── .uim ├── mpv ├── mpv.osx.conf ├── mpv.linux.conf └── mpv.k0.conf ├── pulse ├── default.pa ├── daemon.conf.k0 └── default.pa.k0 ├── bash └── .bashrc ├── nixos ├── w0 │ ├── wsl.conf │ ├── resolv.conf │ ├── syschdemd.nix │ ├── hosts │ ├── syschdemd.sh │ └── configuration.nix ├── haskell │ └── auca.nix ├── m0 │ ├── configuration.nix │ └── hardware-configuration.nix ├── k0 │ ├── hardware-configuration.nix │ └── quadmon.conf ├── k1 │ ├── hardware-configuration.nix │ └── configuration.nix └── overlay.nix ├── zsh ├── zprofile-w0 ├── func │ ├── color_cycle │ ├── tmux_list_sessions │ ├── apt_cache_search │ ├── _emacs_kill_buffer │ ├── susp │ ├── git_contents │ ├── _s │ ├── git_copy_sha │ ├── dirs_navigate │ ├── jl │ ├── gst │ ├── s │ ├── f_procs │ ├── emacs_list_buffers │ ├── vertical_label │ ├── find_long_lines │ ├── emacs_kill_buffer │ ├── gflat │ ├── f_text │ ├── rand_open │ ├── f │ ├── dir_info │ ├── gd │ └── gsts ├── paths-priorities ├── path-aliases ├── zprofile-macp └── .zshenv ├── xorg ├── 10-keyboard.conf ├── 10-server-flags.conf ├── 50-mouse.conf ├── 20-intel-video-k2.conf ├── 20-intel-video.conf ├── 50-synaptics.conf ├── 10-hdtv.conf ├── 10-dual-monitor-hybrid-forest.conf ├── 10-dual-monitor-hybrid.conf └── 10-dual-monitor-portrait.conf ├── ssh └── config.home.conf ├── melby └── systemd │ └── env ├── .editorconfig ├── zathura └── zathurarc ├── terminfo └── xterm-24bit.terminfo ├── .gitmodules ├── README.md ├── openvpn ├── home.ovpn ├── crl.rsa.2048.pem └── ca.rsa.2048.crt ├── lesskey └── cfg ├── gpg └── gpg-agent.nixos.conf ├── vimpc └── .vimpcrc ├── .gitignore ├── jj └── config.toml ├── mpd └── mpd.conf ├── LICENSE ├── notmuch ├── tags └── notmuch-config └── tig └── .tigrc /gd/.envrc: -------------------------------------------------------------------------------- 1 | use nix 2 | -------------------------------------------------------------------------------- /nvim/init.vim: -------------------------------------------------------------------------------- 1 | ../vim/cfg -------------------------------------------------------------------------------- /gd/.gitignore: -------------------------------------------------------------------------------- 1 | target 2 | -------------------------------------------------------------------------------- /xmonad/build: -------------------------------------------------------------------------------- 1 | recompile.sh -------------------------------------------------------------------------------- /emacs/doom-cfg/snippets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /qutebrowser/blocked-hosts: -------------------------------------------------------------------------------- 1 | www.yahoo.com 2 | -------------------------------------------------------------------------------- /script/doom: -------------------------------------------------------------------------------- 1 | ../emacs/doom-upstream/bin/doom -------------------------------------------------------------------------------- /.rgignore: -------------------------------------------------------------------------------- 1 | emacs/doom-upstream 2 | zsh/zcomet-upstream 3 | -------------------------------------------------------------------------------- /git/sendemail-aliases: -------------------------------------------------------------------------------- 1 | alias git git@vger.kernel.org 2 | -------------------------------------------------------------------------------- /script/git/hooks/prepare-commit-msg: -------------------------------------------------------------------------------- 1 | prepare_commit_msg.bb -------------------------------------------------------------------------------- /nix/nix.conf: -------------------------------------------------------------------------------- 1 | experimental-features = nix-command flakes 2 | -------------------------------------------------------------------------------- /uim/customs/custom-notify.scm: -------------------------------------------------------------------------------- 1 | (define notify-agent 'stderr) 2 | -------------------------------------------------------------------------------- /mpv/mpv.osx.conf: -------------------------------------------------------------------------------- 1 | loop-playlist=inf 2 | audio-display=no 3 | slang=en,eng 4 | -------------------------------------------------------------------------------- /xmonad/restart.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -ex 4 | 5 | ./xmonad --restart 6 | -------------------------------------------------------------------------------- /pulse/default.pa: -------------------------------------------------------------------------------- 1 | # Load in distro defaults. 2 | .include /etc/pulse/default.pa 3 | -------------------------------------------------------------------------------- /pulse/daemon.conf.k0: -------------------------------------------------------------------------------- 1 | default-sample-format = s32le 2 | default-sample-rate = 192000 3 | -------------------------------------------------------------------------------- /xmonad/.xsession: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | export PATH=~/.xmonad:$PATH 4 | exec xmonad 5 | -------------------------------------------------------------------------------- /bash/.bashrc: -------------------------------------------------------------------------------- 1 | export HISTCONTROL=ignoreboth:erasedups 2 | set -o vi 3 | 4 | alias q='exit' 5 | -------------------------------------------------------------------------------- /nixos/w0/wsl.conf: -------------------------------------------------------------------------------- 1 | [network] 2 | generateHosts = false 3 | generateResolvConf = false 4 | hostname = w0 5 | -------------------------------------------------------------------------------- /uim/customs/custom-xim.scm: -------------------------------------------------------------------------------- 1 | (define uim-xim-use-xft-font? #f) 2 | (define uim-xim-xft-font-name "Sans") 3 | -------------------------------------------------------------------------------- /uim/customs/custom-xkb.scm: -------------------------------------------------------------------------------- 1 | (define xkb-save-map? #f) 2 | (define xkb-map-path "/home/l/.uim.d/xkb-map") 3 | -------------------------------------------------------------------------------- /mpv/mpv.linux.conf: -------------------------------------------------------------------------------- 1 | ao=pulse 2 | loop-file=inf 3 | loop-playlist=inf 4 | audio-display=no 5 | slang=en,eng 6 | -------------------------------------------------------------------------------- /pulse/default.pa.k0: -------------------------------------------------------------------------------- 1 | # Load in distro defaults. 2 | .include /etc/pulse/default.pa 3 | 4 | set-default-sink 0 5 | -------------------------------------------------------------------------------- /mpv/mpv.k0.conf: -------------------------------------------------------------------------------- 1 | ao=pulse 2 | loop-playlist=inf 3 | hwdec=auto 4 | vo=gpu 5 | audio-display=no 6 | slang=en,eng 7 | -------------------------------------------------------------------------------- /gd/Makefile: -------------------------------------------------------------------------------- 1 | all: 2 | cargo install --profile release --path . 3 | build: 4 | cargo build 5 | test: 6 | cargo test 7 | -------------------------------------------------------------------------------- /script/emacsclient.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -euo pipefail 4 | 5 | emacsclient --alternate-editor "" --create-frame "$@" 6 | -------------------------------------------------------------------------------- /zsh/zprofile-w0: -------------------------------------------------------------------------------- 1 | # In w0 (wsl -d NixOS) we start out at /mnt/c/Users/ingra so we have to move 2 | # back into our home folder. 3 | cd 4 | -------------------------------------------------------------------------------- /xmonad/HLint.hs: -------------------------------------------------------------------------------- 1 | import "hint" HLint.HLint 2 | 3 | ignore "Use camelCase" 4 | ignore "Use section" 5 | ignore "Use infix" 6 | ignore "Use unless" 7 | -------------------------------------------------------------------------------- /xorg/10-keyboard.conf: -------------------------------------------------------------------------------- 1 | Section "InputClass" 2 | Identifier "Keyboard Defaults" 3 | MatchIsKeyboard "yes" 4 | Option "XkbLayout" "us" 5 | EndSection 6 | -------------------------------------------------------------------------------- /uim/customs/custom-http.scm: -------------------------------------------------------------------------------- 1 | (define http-proxy-setting 'direct) 2 | (define http-proxy-hostname "localhost") 3 | (define http-proxy-port 8080) 4 | (define http-timeout 3000) 5 | -------------------------------------------------------------------------------- /xmonad/xmonad-start.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Name=XMonad-start 3 | Comment=Lightweight tiling window manager 4 | Exec=xmonad-start 5 | Icon=xmonad.png 6 | Type=XSession 7 | -------------------------------------------------------------------------------- /git/gitignore: -------------------------------------------------------------------------------- 1 | # Global gitignore. 2 | # 3 | # NOTE: This file is read by "fd", and is used to ignore results even for 4 | # *tracked* files in Git if they match any of these patterns. 5 | -------------------------------------------------------------------------------- /xorg/10-server-flags.conf: -------------------------------------------------------------------------------- 1 | Section "ServerFlags" 2 | Option "BlankTime" "50" 3 | Option "StandbyTime" "60" 4 | Option "SuspendTime" "70" 5 | Option "OffTime" "80" 6 | EndSection 7 | -------------------------------------------------------------------------------- /script/git/hooks/prepare-commit-msg.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | COMMIT_MSG_FILE=$1 3 | 4 | sed -i '0,/^diff/{s/^diff /#+begin_src diff\ndiff /}' "${COMMIT_MSG_FILE}" 5 | echo '#+end_src' >> "${COMMIT_MSG_FILE}" 6 | -------------------------------------------------------------------------------- /ssh/config.home.conf: -------------------------------------------------------------------------------- 1 | Host * 2 | ServerAliveInterval 15 3 | Host 10.0.* 4 | ForwardAgent yes 5 | Host github.com 6 | HostName github.com 7 | User git 8 | IdentityFile ~/.ssh/id_rsa_github 9 | -------------------------------------------------------------------------------- /script/susp.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -eu 4 | 5 | systemctl suspend 6 | # For whatever reason, we cannot restart the openvpn-home.service with sudo (it 7 | # dies immediately). 8 | # systemctl restart openvpn-home.service 9 | -------------------------------------------------------------------------------- /melby/systemd/env: -------------------------------------------------------------------------------- 1 | PATH=/home/l/.nix-profile/bin:/run/wrappers/bin:/etc/profiles/per-user/l/bin:/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin 2 | # Disable debug logs. To enable them, use MIX_ENV=dev. 3 | MIX_ENV=prod 4 | -------------------------------------------------------------------------------- /script/terminal-themes/Theme: -------------------------------------------------------------------------------- 1 | { name : Text 2 | , emacsTheme : Text 3 | , text : Text 4 | , cursor : Text 5 | , background : Text 6 | , foreground : Text 7 | , palette16 : List Text 8 | , paletteExtra : ./PaletteExtra 9 | } 10 | -------------------------------------------------------------------------------- /xorg/50-mouse.conf: -------------------------------------------------------------------------------- 1 | Section "InputClass" 2 | Identifier "My Mouse" 3 | MatchIsPointer "yes" 4 | # Disable all acceleration/deceleration 5 | Option "AccelerationProfile" "-1" 6 | Option "AccelerationScheme" "none" 7 | EndSection 8 | -------------------------------------------------------------------------------- /xorg/20-intel-video-k2.conf: -------------------------------------------------------------------------------- 1 | Section "Device" 2 | Identifier "Intel Graphics" 3 | Driver "intel" 4 | #Option "AccelMethod" "sna" 5 | Option "AccelMethod" "uxa" 6 | #Option "AccelMethod" "xaa" 7 | EndSection 8 | -------------------------------------------------------------------------------- /xorg/20-intel-video.conf: -------------------------------------------------------------------------------- 1 | Section "Device" 2 | Identifier "Intel Graphics" 3 | Driver "intel" 4 | Option "AccelMethod" "sna" 5 | #Option "AccelMethod" "uxa" 6 | #Option "AccelMethod" "xaa" 7 | EndSection 8 | -------------------------------------------------------------------------------- /uim/customs/custom-tutcode-rule.scm: -------------------------------------------------------------------------------- 1 | (define tutcode-rule-use-tutplus? #f) 2 | (define tutcode-rule-uppercase-as-opposite-kana? #f) 3 | (define tutcode-rule-exclude-uppercase-for-katakana? #f) 4 | (define tutcode-rule-exclude-uppercase-for-kigou-in-katakana? #f) 5 | -------------------------------------------------------------------------------- /script/kill-emacs: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -euo pipefail 4 | 5 | main() 6 | { 7 | local session_name 8 | 9 | session_name="${1:-default}" 10 | 11 | emacsclient --socket-name="${session_name}" --eval "(kill-emacs)" 12 | } 13 | 14 | main "$@" 15 | -------------------------------------------------------------------------------- /xmonad/recompile.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -ex 4 | 5 | xmonad_dir="${HOME}/syscfg/xmonad" 6 | cd "${xmonad_dir}" 7 | cabal install --installdir ${xmonad_dir} --overwrite-policy=always 8 | cp -f "${xmonad_dir}/xmonad" "${xmonad_dir}/xmonad-x86_64-linux" 9 | 10 | -------------------------------------------------------------------------------- /script/mac-setup.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -o errexit 4 | set -o nounset 5 | set -o pipefail 6 | set -o xtrace 7 | 8 | # Disable creation of .DS_Store files from Finder. 9 | defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool TRUE 10 | -------------------------------------------------------------------------------- /uim/customs/custom-m17nlib.scm: -------------------------------------------------------------------------------- 1 | (define m17nlib-widgets '(widget_m17nlib_input_mode)) 2 | (define default-widget_m17nlib_input_mode 'action_m17nlib_off) 3 | (define m17nlib-input-mode-actions '(action_m17nlib_off action_m17nlib_on)) 4 | (define m17nlib-use-candidate-window? #t) 5 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | end_of_line = lf 6 | insert_final_newline = true 7 | trim_trailing_whitespace = true 8 | 9 | [*.{sh},Makefile] 10 | indent_style = tab 11 | tab_width = 8 12 | 13 | [COMMIT_EDITMSG] 14 | max_line_length = 72 15 | -------------------------------------------------------------------------------- /zathura/zathurarc: -------------------------------------------------------------------------------- 1 | map [normal] = zoom in 2 | map [normal] + zoom default 3 | map [normal] r reload 4 | map [normal] R rotate 5 | map [normal] h navigate previous 6 | map [normal] l navigate next 7 | map [normal] scroll full-up 8 | 9 | set font "CommitMono 9" 10 | -------------------------------------------------------------------------------- /zsh/func/color_cycle: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | color_cycle() 4 | { 5 | local root_dir 6 | local direction 7 | local res 8 | 9 | root_dir="$HOME/syscfg/script/terminal-themes" 10 | direction=$1 11 | 12 | source <("${root_dir}/change_theme.sh" "${direction}") 13 | } 14 | -------------------------------------------------------------------------------- /script/terminal-themes/PaletteExtra: -------------------------------------------------------------------------------- 1 | { xBrightOrange : Text 2 | , xDarkGreen : Text 3 | , xAvocado : Text 4 | , xLime : Text 5 | , xMoss : Text 6 | , xUltraBrightMagenta : Text 7 | , xUltraBrightGreen : Text 8 | , xUltraBrightRed : Text 9 | , xGrey1 : Text 10 | , xGrey2 : Text 11 | } 12 | -------------------------------------------------------------------------------- /nixos/w0/resolv.conf: -------------------------------------------------------------------------------- 1 | # This file was automatically generated by WSL. To stop automatic generation of this file, add the following entry to /etc/wsl.conf: 2 | # [network] 3 | # generateResolvConf = false 4 | domain T-mobile.com 5 | nameserver 172.27.16.1 6 | nameserver 8.8.8.8 7 | nameserver 192.168.0.1 8 | -------------------------------------------------------------------------------- /terminfo/xterm-24bit.terminfo: -------------------------------------------------------------------------------- 1 | xterm-24bit|xterm with 24-bit direct color mode, 2 | use=xterm-256color, 3 | sitm=\E[3m, 4 | ritm=\E[23m, 5 | setb24=\E[48;2;%p1%{65536}%/%d;%p1%{256}%/%{255}%&%d;%p1%{255}%&%dm, 6 | setf24=\E[38;2;%p1%{65536}%/%d;%p1%{256}%/%{255}%&%d;%p1%{255}%&%dm, 7 | 8 | -------------------------------------------------------------------------------- /script/decrypt.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | # decrypt files painlessly 3 | 4 | if [[ $1 == "outfile" ]]; then 5 | gpg2 -o "$(basename "$2" ".gpg")" -d "$2" 6 | elif [[ $1 == "viewfile" ]]; then 7 | gpg2 -d "$2" | less 8 | else 9 | echo "error: ivalid mode \`$1'" 10 | fi 11 | 12 | # vim:syntax=zsh 13 | -------------------------------------------------------------------------------- /uim/customs/custom-other-ims.scm: -------------------------------------------------------------------------------- 1 | (define generic-use-candidate-window? #t) 2 | (define generic-candidate-op-count 1) 3 | (define generic-nr-candidate-max 10) 4 | (define generic-commit-candidate-by-numeral-key? #t) 5 | (define generic-show-candidate-implicitly? #t) 6 | (define generic-show-prediction-candidates? #t) 7 | -------------------------------------------------------------------------------- /zsh/func/tmux_list_sessions: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | tmux_list_sessions() 4 | { 5 | if (( $#@ != 2 )); then 6 | echo >&2 "Usage: $0 " 7 | return 1 8 | fi 9 | local user="${1}" 10 | local host="${2}" 11 | 12 | 2>/dev/null ssh "${user}@${host}" tmux list-sessions | cut -d: -f1 13 | } 14 | -------------------------------------------------------------------------------- /xorg/50-synaptics.conf: -------------------------------------------------------------------------------- 1 | Section "InputClass" 2 | Identifier "touchpad catchall" 3 | Driver "synaptics" 4 | MatchIsTouchpad "on" 5 | MatchDevicePath "/dev/input/event*" 6 | Option "TapButton1" "0" 7 | Option "TapButton2" "0" 8 | Option "TapButton3" "0" 9 | EndSection 10 | -------------------------------------------------------------------------------- /zsh/func/apt_cache_search: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # apt_cache_search() is a shorcut for "apt-cache search PATTERN | sort | less". 4 | 5 | apt_cache_search() 6 | { 7 | pattern=$1 8 | if [[ -z "$pattern" ]]; then 9 | echo "Need pattern argument" 10 | return 1 11 | fi 12 | apt-cache search $pattern | sort | less 13 | } 14 | -------------------------------------------------------------------------------- /zsh/paths-priorities: -------------------------------------------------------------------------------- 1 | # xmonad 2 | $HOME/.xmonad 3 | 4 | # Personal scripts 5 | $HOME/syscfg/script 6 | 7 | # Haskell (Nix) 8 | $HOME/.cabal/bin 9 | 10 | # Haskell (Stack) 11 | $HOME/.local/bin 12 | 13 | # Rust 14 | $HOME/.cargo/bin 15 | 16 | # Golang 17 | $HOME/go/bin 18 | 19 | # nix-env profile 20 | $HOME/.nix-profile/bin 21 | -------------------------------------------------------------------------------- /xmonad/mac-host-ubuntu-guest-setup.md: -------------------------------------------------------------------------------- 1 | - in Apple keyboard settings, under "Modifier Keys", make CapsLock do nothing. 2 | - install Seil 3 | - map CapsLock to right command (ubuntu vm will see this Super_R in `xev` program) 4 | - in Ubuntu, modify the `Exec` line in `/usr/share/xsessions/xmonad.desktop` from 5 | Exec=xmonad 6 | to 7 | Exec=~/.xinitrc 8 | -------------------------------------------------------------------------------- /uim/customs/custom-anthy-advanced.scm: -------------------------------------------------------------------------------- 1 | (define anthy-use-prediction? #f) 2 | (define anthy-select-prediction-by-numeral-key? #f) 3 | (define anthy-use-implicit-commit-prediction? #t) 4 | (define anthy-prediction-start-char-count 1) 5 | (define anthy-use-with-vi? #f) 6 | (define anthy-auto-start-henkan? #f) 7 | (define anthy-use-mode-transition-keys-in-off-mode? #f) 8 | -------------------------------------------------------------------------------- /script/terminal-themes/color-tests/rubycolor.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | [0, 1, 4, 5, 7].each do |attr| 4 | puts '----------------------------------------------------------------' 5 | puts "\\033[#{attr};Foreground;Background" 6 | 30.upto(37) do |fg| 7 | 40.upto(47) do |bg| 8 | print "\033[#{attr};#{fg};#{bg}m #{fg};#{bg} " 9 | end 10 | puts "\033[0m" 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /uim/customs/custom-look.scm: -------------------------------------------------------------------------------- 1 | (define look-dict "/usr/share/dict/words") 2 | (define look-personal-dict-filename "/home/l/.look-uim-dict") 3 | (define look-use-annotation? #f) 4 | (define look-annotation-show-lines 2) 5 | (define look-beginning-character-length 1) 6 | (define look-candidates-max 20) 7 | (define look-prepared-words 0) 8 | (define look-fence-left "{") 9 | (define look-fence-right "}") 10 | -------------------------------------------------------------------------------- /zsh/path-aliases: -------------------------------------------------------------------------------- 1 | # To sort on expanded paths, first separate the expanded paths into their own 2 | # column (as the 4th whitespace-delimited column of text), then sort with `C-u 4 3 | # M-x sort-fields'. 4 | 5 | hash -d l=${HOME}/lo 6 | hash -d s=${HOME}/syscfg 7 | hash -d g=${HOME}/prog/git 8 | hash -d m=${HOME}/prog/melby 9 | 10 | hash -d nixp=${HOME}/.nix-profile 11 | hash -d nix=/nix/var/nix 12 | -------------------------------------------------------------------------------- /zsh/func/_emacs_kill_buffer: -------------------------------------------------------------------------------- 1 | #compdef emacs_kill_buffer 2 | 3 | # Adapted from https://unix.stackexchange.com/questions/239528/dynamic-zsh-autocomplete-for-custom-commands. 4 | _emacs_kill_buffer() { 5 | local state 6 | 7 | _arguments '1: :->buffer' 8 | case $state in 9 | (buffer) _arguments '1:buffers:(${(f)"$(emacs_list_buffers)"})' ;; 10 | *) ;; 11 | esac 12 | } 13 | 14 | _emacs_kill_buffer "$@" 15 | -------------------------------------------------------------------------------- /zsh/func/susp: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # susp() optionally sleeps for the given time amount, then suspends the system 4 | # using systemctl. 5 | 6 | susp() 7 | { 8 | amt=$1 9 | date # display system time before going into suspend 10 | if [[ -n $amt ]]; then 11 | echo "Sleeping for $amt before suspending..." 12 | sleep $amt && sudo systemctl suspend 13 | else 14 | sudo systemctl suspend 15 | fi 16 | } 17 | -------------------------------------------------------------------------------- /nixos/w0/syschdemd.nix: -------------------------------------------------------------------------------- 1 | { lib, pkgs, config, defaultUser, ... }: 2 | 3 | pkgs.substituteAll { 4 | name = "syschdemd"; 5 | src = ./syschdemd.sh; 6 | dir = "bin"; 7 | isExecutable = true; 8 | 9 | buildInputs = with pkgs; [ daemonize ]; 10 | 11 | inherit (pkgs) daemonize; 12 | inherit defaultUser; 13 | inherit (config.security) wrapperDir; 14 | fsPackagesPath = lib.makeBinPath config.system.fsPackages; 15 | } 16 | -------------------------------------------------------------------------------- /zsh/func/git_contents: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | git_contents() 4 | { 5 | # git-status: Is this a git repo? 6 | # git-log: If so, does it actually have any commits? (I.e., it may be the case 7 | # that this is a fresh repo without any commits yet, but where there are 8 | # still staged files such that git-ls-files is non-empty. 9 | git status &> /dev/null && # (1) 10 | git log --max-count 1 &> /dev/null # (2) 11 | } 12 | -------------------------------------------------------------------------------- /script/Makefile: -------------------------------------------------------------------------------- 1 | FLAGS=-O2 -Wall -Werror 2 | poke: poke.hs 3 | ghc --make ${FLAGS} poke 4 | panxor: panxor.hs 5 | ghc --make ${FLAGS} panxor 6 | time: time.hs 7 | ghc --make ${FLAGS} time 8 | up: up.hs 9 | ghc --make -threaded ${FLAGS} up 10 | usbmnt: usbmnt.hs 11 | ghc --make ${FLAGS} usbmnt 12 | clean: 13 | $(RM) poke time up usbmnt 14 | find -type f -iregex ".+\.\(aux\|o\|hi\|hp\|mix\|ps\|tix\|html\)" -exec rm -v {} \; 15 | -------------------------------------------------------------------------------- /script/terminal-themes/listColorsForShell.dhall: -------------------------------------------------------------------------------- 1 | let Mapped = { mapKey : Text, mapValue : Text } 2 | 3 | in λ(theme : ./Theme) → 4 | List/fold 5 | Mapped 6 | (./toColorMap.dhall theme) 7 | Text 8 | ( λ(a : Mapped) → 9 | λ(b : Text) → 10 | b 11 | ++ '' 12 | ${a.mapKey}=${a.mapValue} 13 | '' 14 | ) 15 | "" 16 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "zsh/zcomet"] 2 | path = zsh/zcomet-upstream 3 | url = https://github.com/agkozak/zcomet 4 | [submodule "doom-upstream"] 5 | path = emacs/doom-upstream 6 | url = https://github.com/doomemacs/doomemacs 7 | [submodule "wezterm/upstream"] 8 | path = wezterm/upstream 9 | url = https://github.com/wez/wezterm 10 | [submodule "clojure"] 11 | path = clojure 12 | url = https://github.com/practicalli/clojure-cli-config 13 | -------------------------------------------------------------------------------- /zsh/func/_s: -------------------------------------------------------------------------------- 1 | #compdef s 2 | 3 | # Adapted from https://unix.stackexchange.com/questions/239528/dynamic-zsh-autocomplete-for-custom-commands. 4 | _s() { 5 | local state 6 | 7 | _arguments \ 8 | '1: :->host' 9 | 10 | local user 11 | case "${words[2]}" in 12 | w0) user="ingra" ;; 13 | *) user="l" ;; 14 | esac 15 | 16 | case $state in 17 | (host) _arguments '1:hosts:(k0 k1 m0 w0 macp)' ;; 18 | esac 19 | } 20 | 21 | _s "$@" 22 | -------------------------------------------------------------------------------- /zsh/func/git_copy_sha: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | git_copy_sha() 4 | { 5 | ! git_contents && return 6 | # Copy to both X primary buffer and clipboard. We copy the SHA without a 7 | # trailing newline, but display it to STDOUT with a newline in order to 8 | # avoid printing the "%" symbol at the end. 9 | git rev-parse HEAD \ 10 | | tr -d '\n' \ 11 | | tee >(xsel -ip) >(xsel -ib) \ 12 | && printf '\n' 13 | } 14 | -------------------------------------------------------------------------------- /zsh/func/dirs_navigate: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # Usage: `_l_dirs_navigate ' to go forward/backwards in directory 4 | # (PWD) history. Use 'dirs -v' to see the directory history stack. 5 | 6 | dirs_navigate() 7 | { 8 | local direction="${1}" 9 | if [[ "${direction}" == prev ]]; then 10 | dirs $(dirs -lp | awk 'NR==1{store=$0;next}1;END{print store}') && popd && dir_info brief 11 | else 12 | cd -0 && dir_info brief 13 | fi 14 | } 15 | -------------------------------------------------------------------------------- /script/terminal-themes/listColorsForEmacs.dhall: -------------------------------------------------------------------------------- 1 | let Mapped = { mapKey : Text, mapValue : Text } 2 | 3 | in λ(theme : ./Theme) → 4 | List/fold 5 | Mapped 6 | (List/reverse Mapped (./toColorMap.dhall theme)) 7 | Text 8 | ( λ(a : Mapped) → 9 | λ(b : Text) → 10 | b 11 | ++ '' 12 | (setq l/color-${a.mapKey} "${a.mapValue}") 13 | '' 14 | ) 15 | "" 16 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Linus Arver's Dotfiles 2 | 3 | Use at your own risk! 4 | 5 | Also, I will force-push to this repo (rather frequently). 6 | 7 | # Installation 8 | 9 | Each subdirectory is responsible for one component, and is also the name of a build rule in the `Makefile`. 10 | 11 | E.g., to set up Emacs and Vim configurations, do: 12 | 13 | ``` 14 | make emacs vim 15 | ``` 16 | 17 | # Known Issues 18 | 19 | - The default repository name, `syscfg`, is hardcoded in some places. 20 | -------------------------------------------------------------------------------- /script/startup_hook.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -o errexit 4 | set -o nounset 5 | set -o pipefail 6 | 7 | # Start up various background services. This script is expected to be called 8 | # from XMonad on startup. The advantage of using this script is that we don't 9 | # have to recompile XMonad every time we want to change something here (as this 10 | # script is just Bash, not Haskell). 11 | 12 | case $(hostname) in 13 | k0) 14 | # Start mpd. 15 | mpd & 16 | ;; 17 | esac 18 | -------------------------------------------------------------------------------- /nixos/haskell/auca.nix: -------------------------------------------------------------------------------- 1 | { mkDerivation, base, cmdargs, directory, hinotify, monads-tf 2 | , process, stdenv, lib, stm, time 3 | }: 4 | mkDerivation { 5 | pname = "auca"; 6 | version = "0.0.1.5"; 7 | src = /home/l/prog/auca; 8 | isLibrary = false; 9 | isExecutable = true; 10 | buildDepends = [ 11 | base cmdargs directory hinotify monads-tf process stm time 12 | ]; 13 | description = "Execute arbitrary command(s) based on file changes"; 14 | license = lib.licenses.bsd2; 15 | } 16 | -------------------------------------------------------------------------------- /gd/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "gd" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 | 8 | [dependencies] 9 | clap = { version = "3.1.0", features = ["cargo"]} 10 | colored = "2" 11 | 12 | [profile.release] 13 | # Strip all symbols. 14 | strip = true 15 | # Bring in other optimizations to reduce binary size. 16 | debug = false 17 | opt-level = 'z' 18 | codegen-units = 1 19 | lto = true 20 | panic = 'abort' 21 | -------------------------------------------------------------------------------- /uim/customs/custom-ajax-ime-advanced.scm: -------------------------------------------------------------------------------- 1 | (define ajax-ime-url 'ajax-ime) 2 | (define ajax-ime-warn-connection? #t) 3 | (define ajax-ime-use-with-vi? #f) 4 | (define ajax-ime-auto-start-henkan? #f) 5 | (define ajax-ime-use-mode-transition-keys-in-off-mode? #f) 6 | (define ajax-ime-use-prediction? #f) 7 | (define ajax-ime-select-prediction-by-numeral-key? #f) 8 | (define ajax-ime-use-implicit-commit-prediction? #t) 9 | (define ajax-ime-prediction-cache-words 256) 10 | (define ajax-ime-prediction-start-char-count 2) 11 | -------------------------------------------------------------------------------- /script/bb.edn: -------------------------------------------------------------------------------- 1 | {:deps { 2 | dev.weavejester/medley {:mvn/version "1.8.1"}} 3 | :paths [ 4 | "git/hooks"] 5 | :tasks { 6 | test {:extra-paths [".", "tmux"] 7 | :extra-deps {io.github.cognitect-labs/test-runner 8 | {:git/tag "v0.5.1" :git/sha "dfb30dd"}} 9 | :task (exec 'cognitect.test-runner.api/test) 10 | :exec-args {:dirs ["."]} 11 | :org.babashka/cli {:coerce {:nses [:symbol] 12 | :vars [:symbol]}}}}} 13 | -------------------------------------------------------------------------------- /script/yodel.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -o errexit 4 | set -o nounset 5 | set -o pipefail 6 | 7 | # Given a list of youtube links, download them all. 8 | 9 | for link in $(cat "$1"); do 10 | # If the link is just a plain video ID, construct the link. 11 | if [[ ! "${link}" =~ ^https://.* ]]; then 12 | link="https://www.youtube.com/watch?v=${link}" 13 | fi 14 | 15 | f="$(youtube-dl --get-filename -o '%(title)s-%(id)s' "$link")" 16 | youtube-dl --extract-audio "$link" 17 | r128gain "${f}"* 18 | done 19 | -------------------------------------------------------------------------------- /zsh/func/jl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # Determine how many $LINES there are available in the current terminal and use 4 | # that to commits. Use a buffer of 4 lines to account for showing the prompt, as 5 | # well as any messages we might get from jj. Divide by 2 because in jj, each 6 | # commit takes up 2 lines (one for the commit title and another for the commit 7 | # id).. 8 | jl() 9 | { 10 | local commits_to_show 11 | commits_to_show=$(((LINES - 4) / 2)) 12 | jj log --limit "${commits_to_show}" "${@}" 13 | } 14 | -------------------------------------------------------------------------------- /script/test-runner.clj: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bb 2 | (require '[clojure.test :refer [run-tests]] 3 | '[babashka.classpath :refer [add-classpath]]) 4 | 5 | (add-classpath ".") 6 | 7 | (def namespaces 8 | ["find-long-lines" 9 | "prepare-commit-msg"]) 10 | 11 | (doseq [namespace namespaces] 12 | (let [test-namespace (symbol (str namespace "-test")) 13 | _ (require test-namespace) 14 | {:keys [fail error]} (run-tests test-namespace)] 15 | (when (pos? (+ fail error)) 16 | (System/exit 1)))) 17 | -------------------------------------------------------------------------------- /uim/customs/custom-skk-advanced.scm: -------------------------------------------------------------------------------- 1 | (define skk-style 'skk-style-ddskk-like) 2 | (define skk-use-recursive-learning? #t) 3 | (define skk-use-numeric-conversion? #t) 4 | (define skk-auto-start-henkan? #t) 5 | (define skk-dcomp-activate? #f) 6 | (define skk-use-look? #f) 7 | (define skk-look-dict "/usr/share/dict/words") 8 | (define skk-show-annotation? #t) 9 | (define skk-show-annotation-in-preedit? #f) 10 | (define skk-use-with-vi? #f) 11 | (define skk-egg-like-newline? #f) 12 | (define skk-commit-newline-explicitly? #f) 13 | -------------------------------------------------------------------------------- /zsh/func/gst: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | gst() 4 | { 5 | ! git_contents && return 6 | 7 | local ce="\x1b[0m" 8 | 9 | git -c color.status=always status 10 | local gstash=$(git stash list) 11 | if [[ -n "$gstash" ]]; then 12 | printf "\n\x1b[1;38;5;196m-- STASH --${ce}\n$gstash\n" 13 | fi 14 | local groot=$(git rev-parse --show-toplevel) 15 | local gau=$(git -C "$groot" ls-files -v | grep "^[[:lower:]]") 16 | if [[ -n "$gau" ]]; then 17 | printf "\n\x1b[1;38;5;201m-- ASSUME UNCHANGED --${ce}\n$gau\n" 18 | fi 19 | } 20 | -------------------------------------------------------------------------------- /script/rm-raf-if-dng.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -o errexit 4 | set -o nounset 5 | set -o pipefail 6 | 7 | if (( $# != 1 )); then 8 | echo >&2 "usage: $0 " 9 | fi 10 | 11 | if [[ -z $1 ]]; then 12 | echo >&2 "usage: $0 " 13 | fi 14 | 15 | mapfile -t raws < <(find "$1" -type f -name '*.RAF' | sort) 16 | 17 | for raw in "${raws[@]}"; do 18 | # Delete *.RAF file if a corresponding *.dng file exists. 19 | if [[ -f "${raw/RAF/dng}" ]]; then 20 | rm -fv "${raw}" 21 | fi 22 | done 23 | 24 | echo DONE 25 | -------------------------------------------------------------------------------- /nixos/w0/hosts: -------------------------------------------------------------------------------- 1 | # This file was automatically generated by WSL. To stop automatic generation of this file, add the following entry to /etc/wsl.conf: 2 | # [network] 3 | # generateHosts = false 4 | 127.0.0.1 localhost 5 | 127.0.1.1 w0.localdomain w0 6 | 7 | # The following lines are desirable for IPv6 capable hosts 8 | ::1 ip6-localhost ip6-loopback 9 | fe00::0 ip6-localnet 10 | ff00::0 ip6-mcastprefix 11 | ff02::1 ip6-allnodes 12 | ff02::2 ip6-allrouters 13 | 14 | 10.0.0.3 m0 15 | 10.0.0.4 k0 16 | 10.0.0.5 k1 17 | 10.0.0.6 w0 18 | 10.0.0.7 macp 19 | -------------------------------------------------------------------------------- /uim/customs/custom-predict.scm: -------------------------------------------------------------------------------- 1 | (define predict-custom-enable? #f) 2 | (define predict-custom-methods '()) 3 | (define predict-custom-look-dict "/usr/share/dict/words") 4 | (define predict-custom-look-candidates-max 10) 5 | (define predict-custom-look-skk-jisyo "/usr/share/skk/SKK-JISYO.L") 6 | (define predict-custom-look-skk-candidates-max 10) 7 | (define predict-custom-sqlite3-candidates-max 5) 8 | (define predict-custom-google-suggest-candidates-max 5) 9 | (define predict-custom-google-suggest-language 'en) 10 | (define predict-custom-google-suggest-use-ssl #t) 11 | -------------------------------------------------------------------------------- /uim/customs/custom-skk-dict.scm: -------------------------------------------------------------------------------- 1 | (define skk-use-skkserv? #f) 2 | (define skk-skkserv-enable-completion? #f) 3 | (define skk-skkserv-completion-timeout 2000) 4 | (define skk-skkserv-use-env? #t) 5 | (define skk-skkserv-hostname "localhost") 6 | (define skk-skkserv-portnum 1178) 7 | (define skk-skkserv-address-family 'unspecified) 8 | (define skk-dic-file-name "/nix/store/hh2yvp4k0g1mxd77m0hqf2x20w1xxllw-uim-1.8.6/share/skk/SKK-JISYO.L") 9 | (define skk-personal-dic-filename "/home/l/.skk-jisyo") 10 | (define skk-uim-personal-dic-filename "/home/l/.skk-uim-jisyo") 11 | -------------------------------------------------------------------------------- /script/raw-to-jpg.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Convert to jpeg. 4 | 5 | # Output directory (remove any trailing slash). 6 | outdir=${1%%/} 7 | shift 8 | 9 | inputs=($@) 10 | for input in "${inputs[@]}"; do 11 | # Input file: isolate filename (strip leading directories). 12 | infile="${input##*/}" 13 | # Output file: rename to .jpg extension. 14 | outfile="${infile%.*}.jpg" 15 | 16 | output="${outdir}/${outfile}" 17 | if [[ -f "${output}" ]]; then 18 | continue 19 | fi 20 | sips -s format jpeg $input --out "${output}" 21 | done 22 | -------------------------------------------------------------------------------- /zsh/func/s: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # SSH to known machines. 4 | 5 | s() 6 | { 7 | if (( $#@ == 0 )); then 8 | echo >&2 "Usage: " 9 | return 1 10 | fi 11 | 12 | local user 13 | local host="${1}" 14 | 15 | case "${host}" in 16 | w0) user="ingra" ;; 17 | *) user="l" ;; 18 | esac 19 | 20 | tmux rename-window "ssh->${user}@${host}" 21 | 22 | case "${host}" in 23 | w0) 24 | ssh -t "${user}@${host}" \"wsl.exe -d NixOS\" 25 | ;; 26 | *) 27 | ssh -t "${user}@${host}" 28 | ;; 29 | esac 30 | 31 | tmux set -w automatic-rename on 32 | } 33 | -------------------------------------------------------------------------------- /script/gtag.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | # Git tagging script 3 | 4 | # Usage: gtag 5 | 6 | # Note: should only be the version number itself; this script 7 | # will add "v" as a prefix when tagging it with git. 8 | 9 | program_name=$1 10 | version_number=$2 11 | 12 | if [[ -z $program_name || -z $version_number ]]; then 13 | echo "usage: gtag.sh " 14 | exit 1 15 | fi 16 | 17 | git commit -am "$program_name $version_number" 18 | git tag -a "v$version_number" -m "$program_name $version_number" 19 | -------------------------------------------------------------------------------- /script/terminal-themes/themes/RetroBlue.dhall: -------------------------------------------------------------------------------- 1 | { name = "RetroBlue" 2 | , emacsTheme = "zenburn" 3 | , cursor = "#ffffff" 4 | , text = "#000000" 5 | , background = "#1111aa" 6 | , foreground = "#ffffff" 7 | , palette16 = 8 | [ "#1111aa" 9 | , "#ff6666" 10 | , "#00ff00" 11 | , "#ffff00" 12 | , "#ff88ff" 13 | , "#ff00ff" 14 | , "#00ffff" 15 | , "#ffffff" 16 | , "#3333ff" 17 | , "#ff6666" 18 | , "#00ff00" 19 | , "#ffff00" 20 | , "#ff88ff" 21 | , "#ff00ff" 22 | , "#00ffff" 23 | , "#ffffff" 24 | ] 25 | , paletteExtra = (./PastelDark.dhall).paletteExtra 26 | } 27 | -------------------------------------------------------------------------------- /uim/customs/custom-baidu-olime-jp-advanced.scm: -------------------------------------------------------------------------------- 1 | (define baidu-olime-jp-server "cloud.ime.baidu.jp") 2 | (define baidu-olime-jp-use-ssl? #f) 3 | (define baidu-olime-jp-use-with-vi? #f) 4 | (define baidu-olime-jp-auto-start-henkan? #f) 5 | (define baidu-olime-jp-use-mode-transition-keys-in-off-mode? #f) 6 | (define baidu-olime-jp-use-prediction? #f) 7 | (define baidu-olime-jp-select-prediction-by-numeral-key? #f) 8 | (define baidu-olime-jp-use-implicit-commit-prediction? #t) 9 | (define baidu-olime-jp-prediction-cache-words 256) 10 | (define baidu-olime-jp-prediction-start-char-count 2) 11 | -------------------------------------------------------------------------------- /uim/customs/custom-toolbar.scm: -------------------------------------------------------------------------------- 1 | (define toolbar-display-time 'never) 2 | (define toolbar-show-action-based-switcher-button? #t) 3 | (define imsw-coverage 'system-global) 4 | (define toolbar-show-switcher-button? #f) 5 | (define toolbar-show-pref-button? #t) 6 | (define toolbar-show-dict-button? #f) 7 | (define toolbar-show-input-pad-button? #f) 8 | (define toolbar-show-handwriting-input-pad-button? #f) 9 | (define toolbar-show-help-button? #f) 10 | (define toolbar-help-browser 'system) 11 | (define toolbar-help-browser-name "firefox") 12 | (define toolbar-icon-for-dark-background? #f) 13 | -------------------------------------------------------------------------------- /uim/customs/custom-google-cgiapi-jp-advanced.scm: -------------------------------------------------------------------------------- 1 | (define google-cgiapi-jp-server "www.google.com") 2 | (define google-cgiapi-jp-use-ssl? #f) 3 | (define google-cgiapi-jp-use-with-vi? #f) 4 | (define google-cgiapi-jp-auto-start-henkan? #f) 5 | (define google-cgiapi-jp-use-mode-transition-keys-in-off-mode? #f) 6 | (define google-cgiapi-jp-use-prediction? #f) 7 | (define google-cgiapi-jp-select-prediction-by-numeral-key? #f) 8 | (define google-cgiapi-jp-use-implicit-commit-prediction? #t) 9 | (define google-cgiapi-jp-prediction-cache-words 256) 10 | (define google-cgiapi-jp-prediction-start-char-count 2) 11 | -------------------------------------------------------------------------------- /zsh/func/f_procs: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # Search processes. 4 | f_procs() 5 | { 6 | local pattern="${1}" 7 | shift 8 | local args=("$@") 9 | # Print out the first line of ps output, because it gives us the column 10 | # headers. Otherwise, we get a bunch of results without any indication of 11 | # what each column actually means. 12 | ps aux | head -n1 13 | # The process substitution with the `=(...)' syntax prevents the `rg' 14 | # process itself from showing up in the results. 15 | rg --color always --smart-case --pcre2 -i --no-line-number \ 16 | ${args[@]} "${pattern}" =(ps aux) 17 | } 18 | -------------------------------------------------------------------------------- /openvpn/home.ovpn: -------------------------------------------------------------------------------- 1 | client 2 | dev tun 3 | proto udp 4 | remote us-seattle.privacy.network 1198 5 | resolv-retry infinite 6 | nobind 7 | persist-key 8 | persist-tun 9 | cipher aes-128-cbc 10 | auth sha1 11 | tls-client 12 | remote-cert-tls server 13 | # Read username/password from a file, so that we don't have to type it in over 14 | # and over. It's annoying that we leave it unencrypted like this, but whatever. 15 | auth-user-pass /home/l/secure/pia.txt 16 | compress 17 | verb 1 18 | reneg-sec 0 19 | crl-verify /home/l/syscfg/openvpn/crl.rsa.2048.pem 20 | ca /home/l/syscfg/openvpn/ca.rsa.2048.crt 21 | disable-occ 22 | -------------------------------------------------------------------------------- /lesskey/cfg: -------------------------------------------------------------------------------- 1 | #command 2 | 3 | # map backspace to back-screen 4 |  back-screen 5 | 6 | #line-edit 7 | \e[3~ delete 8 | 9 | #env 10 | 11 | # -F: exit less if everything can be displayed in one screen 12 | # 13 | # -i: make lower-case-only searches case insensitive (mixed-case searches are 14 | # automatically case-sensitive!) 15 | # 16 | # -M: verbose status bar to show location information 17 | # 18 | # -R: make 'git diff' more compliant with highly customized LESS_TERMCAP options 19 | # 20 | # -X: try not to clear the screen 21 | # 22 | # --tabs=4: set tab stop to 4 spaces (default 8) 23 | LESS = -FiMRX --tabs=4 24 | -------------------------------------------------------------------------------- /script/terminal-themes/themes/Dark.dhall: -------------------------------------------------------------------------------- 1 | -- Based on Visibone Alt. 2 from https://terminal.sexy 2 | { name = "Dark" 3 | , emacsTheme = "zenburn" 4 | , cursor = "#ffffff" 5 | , text = "#000000" 6 | , background = "#333333" 7 | , foreground = "#cccccc" 8 | , palette16 = 9 | [ "#222222" 10 | , "#cc6699" 11 | , "#99cc66" 12 | , "#cc9966" 13 | , "#6699cc" 14 | , "#9966cc" 15 | , "#66cc99" 16 | , "#cccccc" 17 | , "#333333" 18 | , "#ff99cc" 19 | , "#ccff99" 20 | , "#ffcc99" 21 | , "#99ccff" 22 | , "#cc99ff" 23 | , "#99ffcc" 24 | , "#ffffff" 25 | ] 26 | , paletteExtra = (./PastelDark.dhall).paletteExtra 27 | } 28 | -------------------------------------------------------------------------------- /uim/customs/custom-yahoo-jp-advanced.scm: -------------------------------------------------------------------------------- 1 | (define yahoo-jp-server "jlp.yahooapis.jp") 2 | (define yahoo-jp-path "/JIMService/V1/") 3 | (define yahoo-jp-appid "") 4 | (define yahoo-jp-use-ssl? #f) 5 | (define yahoo-jp-use-with-vi? #f) 6 | (define yahoo-jp-auto-start-henkan? #f) 7 | (define yahoo-jp-use-mode-transition-keys-in-off-mode? #f) 8 | (define yahoo-jp-use-prediction? #f) 9 | (define yahoo-jp-prediction-type 'www) 10 | (define yahoo-jp-select-prediction-by-numeral-key? #f) 11 | (define yahoo-jp-use-implicit-commit-prediction? #t) 12 | (define yahoo-jp-prediction-cache-words 256) 13 | (define yahoo-jp-prediction-start-char-count 2) 14 | -------------------------------------------------------------------------------- /script/nix-pull.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Usage: nix-pull.sh 4 | # 5 | # This clones all "nix-env" packages in the remote host into the current 6 | # system. 7 | 8 | set -o errexit 9 | set -o nounset 10 | set -o pipefail 11 | 12 | nix_pull() 13 | { 14 | local remote 15 | local closure 16 | remote="${1}" 17 | closure="${2}" 18 | nix-copy-closure --from "${remote}" "${closure}" 19 | nix-env --install "${closure}" 20 | } 21 | 22 | remote="${1}" 23 | shift 24 | 25 | for closure in $(ssh ${USER}@${remote} nix-env -q --out-path | awk '{print $2}'); do 26 | nix_pull "${remote}" "${closure}" 27 | done 28 | 29 | -------------------------------------------------------------------------------- /script/terminal-themes/themes/Blue.dhall: -------------------------------------------------------------------------------- 1 | -- Based on Codeschool light by Chris Kempson from https://terminal.sexy 2 | { name = "Blue" 3 | , emacsTheme = "doom-one-light" 4 | , cursor = "#2299dd" 5 | , text = "#ffffff" 6 | , background = "#b1eaff" 7 | , foreground = "#2a343a" 8 | , palette16 = 9 | [ "#84d5ff" 10 | , "#c43d16" 11 | , "#007836" 12 | , "#535000" 13 | , "#356ab7" 14 | , "#b02f50" 15 | , "#31a3a8" 16 | , "#2a343a" 17 | , "#b1eaff" 18 | , "#e45d36" 19 | , "#2b8c64" 20 | , "#636000" 21 | , "#558ad7" 22 | , "#d04f70" 23 | , "#39bdc4" 24 | , "#000000" 25 | ] 26 | , paletteExtra = (./Vanilla.dhall).paletteExtra 27 | } 28 | -------------------------------------------------------------------------------- /script/terminal-themes/themes/Light.dhall: -------------------------------------------------------------------------------- 1 | -- Based on Ivory Light by Baskerville from https://terminal.sexy 2 | { name = "Light" 3 | , emacsTheme = "doom-solarized-light" 4 | , cursor = "#999933" 5 | , text = "#ffffff" 6 | , background = "#fef9ec" 7 | , foreground = "#34363c" 8 | , palette16 = 9 | [ "#eee9dc" 10 | , "#cc514e" 11 | , "#00a250" 12 | , "#a08a00" 13 | , "#208ffb" 14 | , "#b453a9" 15 | , "#00a4c1" 16 | , "#34363c" 17 | , "#fef9ec" 18 | , "#b22b31" 19 | , "#007427" 20 | , "#715f00" 21 | , "#0065ca" 22 | , "#a03196" 23 | , "#007693" 24 | , "#000000" 25 | ] 26 | , paletteExtra = (./Vanilla.dhall).paletteExtra 27 | } 28 | -------------------------------------------------------------------------------- /uim/customs/custom-anthy-utf8.scm: -------------------------------------------------------------------------------- 1 | (define anthy-utf8-widgets '(widget_anthy_utf8_input_mode widget_anthy_utf8_kana_input_method)) 2 | (define default-widget_anthy_utf8_input_mode 'action_anthy_utf8_hiragana) 3 | (define anthy-utf8-input-mode-actions '(action_anthy_utf8_direct action_anthy_utf8_hiragana action_anthy_utf8_katakana action_anthy_utf8_halfkana action_anthy_utf8_halfwidth_alnum action_anthy_utf8_fullwidth_alnum)) 4 | (define default-widget_anthy_utf8_kana_input_method 'action_anthy_utf8_roma) 5 | (define anthy-utf8-kana-input-method-actions '(action_anthy_utf8_roma action_anthy_utf8_kana action_anthy_utf8_azik action_anthy_utf8_act action_anthy_utf8_kzik)) 6 | -------------------------------------------------------------------------------- /uim/customs/custom-byeoru-keys1.scm: -------------------------------------------------------------------------------- 1 | (define byeoru-on-key '("(")) 2 | (define byeoru-on-key? (make-key-predicate '("("))) 3 | (define byeoru-latin-key '("(")) 4 | (define byeoru-latin-key? (make-key-predicate '("("))) 5 | (define byeoru-conversion-key '("F9")) 6 | (define byeoru-conversion-key? (make-key-predicate '("F9"))) 7 | (define byeoru-commit-key '(generic-commit-key)) 8 | (define byeoru-commit-key? (make-key-predicate '(generic-commit-key?))) 9 | (define byeoru-cancel-key '(generic-cancel-key)) 10 | (define byeoru-cancel-key? (make-key-predicate '(generic-cancel-key?))) 11 | -------------------------------------------------------------------------------- /script/windows/set-ssh-authorized-keys-acl.ps1: -------------------------------------------------------------------------------- 1 | 2 | # Fix permissions for authorized_keys file. 3 | # https://www.concurrency.com/blog/may-2019/key-based-authentication-for-openssh-on-windows 4 | 5 | $acl = Get-Acl C:\ProgramData\ssh\administrators_authorized_keys 6 | $acl.SetAccessRuleProtection($true, $false) 7 | $administratorsRule = New-Object system.security.accesscontrol.filesystemaccessrule("Administrators","FullControl","Allow") 8 | $systemRule = New-Object system.security.accesscontrol.filesystemaccessrule("SYSTEM","FullControl","Allow") 9 | $acl.SetAccessRule($administratorsRule) 10 | $acl.SetAccessRule($systemRule) 11 | $acl | Set-Acl 12 | 13 | Write-Host "Done" 14 | -------------------------------------------------------------------------------- /script/terminal-themes/themes/Red.dhall: -------------------------------------------------------------------------------- 1 | -- Based on Aiseered.vim by Alexander Evstiougov from https://www.vim.org/scripts/script.php?script_id=750 2 | { name = "Red" 3 | , emacsTheme = "zenburn" 4 | , cursor = "#ffffff" 5 | , text = "#000000" 6 | , background = "#400000" 7 | , foreground = "#cfcfcf" 8 | , palette16 = 9 | [ "#400000" 10 | , "#dd8800" 11 | , "#66dd88" 12 | , "#ccdd77" 13 | , "#1188cc" 14 | , "#bb88aa" 15 | , "#66cccc" 16 | , "#cfcfcf" 17 | , "#600000" 18 | , "#ffaa00" 19 | , "#88ffaa" 20 | , "#eeff99" 21 | , "#33aaee" 22 | , "#ddaacc" 23 | , "#88eeee" 24 | , "#ffffff" 25 | ] 26 | , paletteExtra = (./PastelDark.dhall).paletteExtra 27 | } 28 | -------------------------------------------------------------------------------- /gd/shell.nix: -------------------------------------------------------------------------------- 1 | { profile ? "default" }: 2 | with import { overlays = [ (import ~/.nix-defexpr/channels/rust-overlay) ]; }; 3 | let 4 | platform-specific = if stdenv.hostPlatform.isDarwin then 5 | (with darwin.apple_sdk.frameworks; [ 6 | Security 7 | ]) else []; 8 | in mkShell { 9 | RUST_SRC_PATH = "${rust-bin.stable.latest.${profile}.override { 10 | extensions = [ "rust-src" ]; 11 | }}/lib/rustlib/src/rust/library"; 12 | nativeBuildInputs = 13 | [ rust-bin.stable.latest.${profile} pkg-config openssl ]; 14 | buildInputs = [ 15 | (rust-bin.stable.latest.${profile}.override { 16 | extensions = ["rust-src"]; 17 | }) 18 | ]; 19 | } 20 | -------------------------------------------------------------------------------- /xmonad/xmonad-linus.cabal: -------------------------------------------------------------------------------- 1 | name: xmonad-linus 2 | version: 0.0.0.0 3 | license: BSD2 4 | author: Linus Arver 5 | maintainer: linusarver@gmail.com 6 | category: Utility 7 | build-type: Simple 8 | cabal-version: >=1.10 9 | 10 | executable xmonad 11 | main-is: xmonad.hs 12 | default-language: Haskell2010 13 | ghc-options: -O2 -Wall -Werror -threaded -fno-warn-tabs 14 | default-extensions: 15 | DeriveDataTypeable 16 | , RecordWildCards 17 | build-depends: 18 | base >= 4.8 19 | , array >= 0.5.1.0 20 | , containers >= 0.5.6.2 21 | , unix >= 2.7.1.0 22 | , random >= 1.1 23 | , safe >= 0.3.15 24 | , X11 >= 1.8 25 | , xmonad >= 0.11.1 26 | , xmonad-contrib >= 0.11.4 27 | -------------------------------------------------------------------------------- /uim/customs/custom-social-ime-advanced.scm: -------------------------------------------------------------------------------- 1 | (define social-ime-server "www.social-ime.com") 2 | (define social-ime-path "/api/") 3 | (define social-ime-prediction-api-path "/api2/predict.php") 4 | (define social-ime-user "") 5 | (define social-ime-use-with-vi? #f) 6 | (define social-ime-auto-start-henkan? #f) 7 | (define social-ime-use-mode-transition-keys-in-off-mode? #f) 8 | (define social-ime-use-prediction? #f) 9 | (define social-ime-prediction-type 'www) 10 | (define social-ime-select-prediction-by-numeral-key? #f) 11 | (define social-ime-use-implicit-commit-prediction? #t) 12 | (define social-ime-prediction-cache-words 256) 13 | (define social-ime-prediction-start-char-count 2) 14 | (define social-ime-warn-connection? #t) 15 | -------------------------------------------------------------------------------- /script/sync-sd-card.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -o errexit 4 | set -o nounset 5 | set -o pipefail 6 | 7 | if (( $# != 1 )) || [[ -z $1 ]]; then 8 | echo >&2 "usage: $0 " 9 | fi 10 | 11 | if [[ -d /Volumes/sd128GB ]]; then 12 | rsync -ahP --no-whole-file --inplace \ 13 | --exclude='.*/' \ 14 | --exclude='*.DAT' \ 15 | /Volumes/{sd128GB,wd1TB} 16 | fi 17 | 18 | if [[ -d /Volumes/wd1TB ]]; then 19 | mapfile -t raws < <(find "/Volumes/wd1TB/sd128GB/DCIM/${1}_FUJI" -name '*.RAF' | sort) 20 | if ! (( ${#raws[@]} )); then 21 | echo >&2 "no *.RAF raws found in ${1}_FUJI" 22 | exit 23 | fi 24 | parallel -j "$(nproc --all)" -m raw-to-jpg.sh \ 25 | ~/converted \ 26 | ::: "${raws[@]}" 27 | fi 28 | -------------------------------------------------------------------------------- /uim/customs/custom-skk.scm: -------------------------------------------------------------------------------- 1 | (define skk-use-candidate-window? #t) 2 | (define skk-commit-candidate-by-label-key? #t) 3 | (define skk-candidate-selection-style 'ddskk-like) 4 | (define skk-use-manual-candwin-setting? #f) 5 | (define skk-candidate-op-count 5) 6 | (define skk-nr-candidate-max 7) 7 | (define skk-widgets '(widget_skk_input_mode widget_skk_kana_input_method)) 8 | (define default-widget_skk_input_mode 'action_skk_latin) 9 | (define skk-input-mode-actions '(action_skk_latin action_skk_hiragana action_skk_katakana action_skk_hankana action_skk_wide_latin)) 10 | (define default-widget_skk_kana_input_method 'action_skk_roma) 11 | (define skk-kana-input-method-actions '(action_skk_roma action_skk_azik action_skk_act action_skk_kzik)) 12 | -------------------------------------------------------------------------------- /script/copy-clipboard.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -euo pipefail 4 | 5 | copy_prefer_tmux() 6 | { 7 | # Prefer to copy into tmux if possible, because it can also (with the -w 8 | # flag) attempt to copy into the system clipboard. 9 | if [[ -n "${TMUX:-}" ]]; then 10 | tmux load-buffer -w - 11 | else 12 | copy_clipboard 13 | fi 14 | } 15 | 16 | copy_clipboard() 17 | { 18 | case "$(uname)" in 19 | Linux) xsel --clipboard ;; 20 | Darwin) pbcopy ;; 21 | esac 22 | } 23 | 24 | main() 25 | { 26 | local input 27 | input=$( 10j 6 | map 10k 7 | 8 | " Make tab navigation reasonable. Unfortunately cannot be bound as it 9 | " conflicts with . So we have to use the Alt key instead. 10 | map :tabprevious 11 | map :tabnext 12 | 13 | " Skip forward/backward 5 seconds. 14 | map h :seek- 5 15 | map l :seek+ 5 16 | 17 | " Change songs. 18 | map H :previous 19 | map L :next 20 | 21 | map p :pause 22 | 23 | " already exits vimpc. 24 | map :qa 25 | 26 | " Go to current song. 27 | map c f 28 | 29 | " Go to random song. 30 | map r % 31 | 32 | " Increase volume. 33 | map = + 34 | -------------------------------------------------------------------------------- /uim/customs/custom-annotation.scm: -------------------------------------------------------------------------------- 1 | (define skk-show-annotation? #t) 2 | (define skk-show-annotation-in-preedit? #f) 3 | (define enable-annotation? #t) 4 | (define annotation-agent 'eb) 5 | (define eb-enable-for-annotation? #f) 6 | (define annotation-eb-dic-path "/nix/store/hh2yvp4k0g1mxd77m0hqf2x20w1xxllw-uim-1.8.6/share/dict") 7 | (define annotation-dict-server "dict.org") 8 | (define annotation-dict-servname 2628) 9 | (define annotation-dict-database "web1913") 10 | (define annotation-dict-cache-words 256) 11 | (define annotation-filter-server-setting? 'pipe) 12 | (define annotation-filter-unix-domain-socket-path "/path/of/socket") 13 | (define annotation-filter-tcpserver-name "localhost") 14 | (define annotation-filter-tcpserver-port 6789) 15 | (define annotation-filter-command "/path/of/filter-program") 16 | -------------------------------------------------------------------------------- /uim/customs/custom-anthy.scm: -------------------------------------------------------------------------------- 1 | (define anthy-show-segment-separator? #f) 2 | (define anthy-segment-separator "|") 3 | (define anthy-use-candidate-window? #t) 4 | (define anthy-candidate-op-count 1) 5 | (define anthy-nr-candidate-max 10) 6 | (define anthy-select-candidate-by-numeral-key? #f) 7 | (define anthy-widgets '(widget_anthy_input_mode widget_anthy_kana_input_method)) 8 | (define default-widget_anthy_input_mode 'action_anthy_direct) 9 | (define anthy-input-mode-actions '(action_anthy_direct action_anthy_hiragana action_anthy_katakana action_anthy_halfkana action_anthy_halfwidth_alnum action_anthy_fullwidth_alnum)) 10 | (define default-widget_anthy_kana_input_method 'action_anthy_roma) 11 | (define anthy-kana-input-method-actions '(action_anthy_roma action_anthy_kana action_anthy_azik action_anthy_act action_anthy_kzik)) 12 | -------------------------------------------------------------------------------- /zsh/func/vertical_label: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | vertical_label() 4 | { 5 | c=$3 6 | ce="\x1b[0m" 7 | label=$2 8 | i=1 9 | # The `s/^/x/' marks each line's beginning with a non-whitespace character 10 | # `x' so that when we pipe it to the `read' zsh builtin, we read all leading 11 | # indentation as well (otherwise we lose it). The `s/\t/ /g' standardizes 12 | # all tab characters to four spaces; this is purely for visual aesthetics. 13 | eval $1 | sed 's/^/x/ ; s/\t/ /g ; s/%/%%%%/g' | while read -r line; do 14 | case $label[$i] in 15 | " ") printf " " ;; 16 | "-") printf " $c\u2503$ce" ;; 17 | *) printf " $c$label[$i]$ce" ;; 18 | esac 19 | line_without_x=$line[2,-1] 20 | printf " ${line_without_x//\\/\\\\\\\\}\n" 21 | ((i+=1)) 22 | if (( i > $#label )); then 23 | i=1 24 | fi 25 | done 26 | } 27 | -------------------------------------------------------------------------------- /script/terminal-themes/install_alacritty_colors.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # We only need to run this script when we add a new terminal color theme. 4 | 5 | set -euxo pipefail 6 | 7 | root_dir="${HOME}/syscfg/script/terminal-themes" 8 | 9 | # Convert dhall-ized color definitions into something Alacritty can understand. 10 | get_theme_alacritty() { 11 | local renderer_path 12 | local theme="${1:-}" 13 | 14 | renderer_path="${root_dir}/renderAlacrittyColorYaml.dhall" 15 | 16 | dhall text <<< "${renderer_path} ${theme}" 17 | } 18 | 19 | main() { 20 | for theme in "${root_dir}"/themes/*; do 21 | output_path="${root_dir}/../../alacritty/colors_$(basename "${theme}")" 22 | output_path="${output_path%.dhall}.yml" 23 | get_theme_alacritty "${theme}" > "${output_path}" 24 | done 25 | } 26 | 27 | main "$@" 28 | -------------------------------------------------------------------------------- /zsh/func/find_long_lines: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # Find files with lines that have 80+ columns. 4 | # Usage: find_long_lines TABWIDTH [DIRECTORY] [COLUMNS] 5 | 6 | find_long_lines() { 7 | # Search current directory by default. 8 | tabwidth="${1}" 9 | dir="${2:-.}" 10 | 11 | # Search lines longer than 80 columns by default. 12 | columns="${3:-80}" 13 | ((columns++)) 14 | 15 | if (( $# < 1 )) || (( $# > 3 )); then 16 | echo "usage: $0 TABWIDTH [DIRECTORY] [COLUMNS]" 17 | return 1 18 | fi 19 | 20 | if [[ ! -d "$dir" ]]; then 21 | echo "directory \`$dir' does not exist" 22 | return 1 23 | elif [[ -z $tabwidth ]]; then 24 | echo "second argument must contain a number" 25 | return 1 26 | fi 27 | 28 | find "$dir" -type f -not -path "$dir/.git"\ 29 | -exec sh -c "expand -t $tabwidth {} | grep -n \".\{${columns}\}\"" \; -print 30 | } 31 | -------------------------------------------------------------------------------- /script/mail-sync.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # Call lieer to sync notmuch database with Gmail. 4 | 5 | set -euo pipefail 6 | 7 | # Be explicit about which Notmuch configuration we're using. 8 | export NOTMUCH_CONFIG="${HOME}/.notmuch-config" 9 | 10 | # If we're running inside cron, we might not be aware of the usual paths used by 11 | # Nixpkgs. Enable them here. 12 | export PATH="${HOME}/.nix-profile/bin:/run/current-system/sw/bin:${PATH}" 13 | 14 | NOTMUCH_TAGS_FILE="${HOME}/syscfg/notmuch/tags" 15 | 16 | main() 17 | { 18 | cd ~/mail/linusarver@gmail.com 19 | 20 | # "gmi" is a script provided by the "lieer" package. It fetches mail from 21 | # Gmail to disk. 22 | gmi sync 23 | 24 | # Re-index new emails. 25 | notmuch new 26 | 27 | # Tag emails. 28 | notmuch tag --batch --input="${NOTMUCH_TAGS_FILE}" 29 | } 30 | 31 | main "$@" 32 | -------------------------------------------------------------------------------- /script/terminal-themes/themes/Vanilla.dhall: -------------------------------------------------------------------------------- 1 | { name = "Vanilla" 2 | , emacsTheme = "doom-one-light" 3 | , cursor = "#aaaaaa" 4 | , text = "#ffffff" 5 | , background = "#ffffff" 6 | , foreground = "#222222" 7 | , palette16 = 8 | [ "#cccccc" 9 | , "#ff0000" 10 | , "#007700" 11 | , "#999900" 12 | , "#0000ff" 13 | , "#cc00cc" 14 | , "#00aaaa" 15 | , "#222222" 16 | , "#ffffff" 17 | , "#ff6666" 18 | , "#33cc33" 19 | , "#aaaa66" 20 | , "#3333ff" 21 | , "#cc66cc" 22 | , "#33aaaa" 23 | , "#000000" 24 | ] 25 | , paletteExtra = 26 | { xBrightOrange = "#cc7700" 27 | , xDarkGreen = "#2e3330" 28 | , xAvocado = "#3f5f4f" 29 | , xLime = "#ccff94" 30 | , xMoss = "#86ab8e" 31 | , xUltraBrightMagenta = "#ff00ff" 32 | , xUltraBrightGreen = "#00ff00" 33 | , xUltraBrightRed = "#ff0000" 34 | , xGrey1 = "#1c1c1c" 35 | , xGrey2 = "#262626" 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /uim/customs/custom-ajax-ime.scm: -------------------------------------------------------------------------------- 1 | (define ajax-ime-show-segment-separator? #f) 2 | (define ajax-ime-segment-separator "|") 3 | (define ajax-ime-use-candidate-window? #t) 4 | (define ajax-ime-candidate-op-count 1) 5 | (define ajax-ime-nr-candidate-max 10) 6 | (define ajax-ime-select-candidate-by-numeral-key? #f) 7 | (define ajax-ime-widgets '(widget_ajax-ime_input_mode widget_ajax-ime_kana_input_method)) 8 | (define default-widget_ajax-ime_input_mode 'action_ajax-ime_direct) 9 | (define ajax-ime-input-mode-actions '(action_ajax-ime_direct action_ajax-ime_hiragana action_ajax-ime_katakana action_ajax-ime_halfkana action_ajax-ime_halfwidth_alnum action_ajax-ime_fullwidth_alnum)) 10 | (define default-widget_ajax-ime_kana_input_method 'action_ajax-ime_roma) 11 | (define ajax-ime-kana-input-method-actions '(action_ajax-ime_roma action_ajax-ime_kana action_ajax-ime_azik action_ajax-ime_act action_ajax-ime_kzik)) 12 | -------------------------------------------------------------------------------- /uim/customs/custom-yahoo-jp.scm: -------------------------------------------------------------------------------- 1 | (define yahoo-jp-show-segment-separator? #f) 2 | (define yahoo-jp-segment-separator "|") 3 | (define yahoo-jp-use-candidate-window? #t) 4 | (define yahoo-jp-candidate-op-count 1) 5 | (define yahoo-jp-nr-candidate-max 10) 6 | (define yahoo-jp-select-candidate-by-numeral-key? #f) 7 | (define yahoo-jp-widgets '(widget_yahoo-jp_input_mode widget_yahoo-jp_kana_input_method)) 8 | (define default-widget_yahoo-jp_input_mode 'action_yahoo-jp_direct) 9 | (define yahoo-jp-input-mode-actions '(action_yahoo-jp_direct action_yahoo-jp_hiragana action_yahoo-jp_katakana action_yahoo-jp_halfkana action_yahoo-jp_halfwidth_alnum action_yahoo-jp_fullwidth_alnum)) 10 | (define default-widget_yahoo-jp_kana_input_method 'action_yahoo-jp_roma) 11 | (define yahoo-jp-kana-input-method-actions '(action_yahoo-jp_roma action_yahoo-jp_kana action_yahoo-jp_azik action_yahoo-jp_act action_yahoo-jp_kzik)) 12 | -------------------------------------------------------------------------------- /zsh/zprofile-macp: -------------------------------------------------------------------------------- 1 | # Allow both chinese characters (in our prompt) and also the UTF-8 geometric 2 | # character set we use for displaying our git prompts. If we don't do this, 3 | # these characters don't get displayed correctly. 4 | export LANG=en_US.UTF-8 5 | 6 | # We need to do this because /etc/zprofile (read in just before this file) 7 | # changes the order of PATH directories, because it calls out to 8 | # /usr/libexec/path_helper, putting the ~/.nix-profile/bin folder _after_ the 9 | # other standard locations, which is NOT what we want. 10 | __l_prepend_path $HOME/.nix-profile/bin 11 | 12 | # Load Nix stuff. For some reason, we have to do this on macp after the Monterey 13 | # 12.5 update. Otherwise the "nix" command just doesn't get found. 14 | if [ -e '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh' ]; then 15 | . '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh' 16 | fi 17 | -------------------------------------------------------------------------------- /zsh/func/emacs_kill_buffer: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # Used to revive emacsclient whenever it starts hanging due to some buffer 4 | # waiting on input (which will never come, because it is hanging). 5 | emacs_kill_buffer() 6 | { 7 | if (( $# != 2 )); then 8 | >&2 echo "usage: $0 " 9 | return 1 10 | fi 11 | 12 | local socket="${1}" 13 | local buffer 14 | local elisp 15 | buffer="${2}" 16 | elisp=$(cat << EOF 17 | (let* 18 | ( 19 | (kill-me "${buffer}")) 20 | (switch-to-buffer kill-me) 21 | 22 | ; (with-editor-cancel) is dangerous because it also silently deletes the 23 | ; file on disk! Only invoke it if (kill-this-buffer) fails (typically 24 | ; due to the function having been made useless by magit's with-editor 25 | ; mode). 26 | (or (kill-this-buffer) (with-editor-cancel t)) 27 | ) 28 | EOF 29 | ) 30 | 31 | emacsclient --socket "${socket}" -e "${elisp}" 32 | } 33 | -------------------------------------------------------------------------------- /uim/customs/custom-global.scm: -------------------------------------------------------------------------------- 1 | (define custom-activate-default-im-name? #t) 2 | (define custom-preserved-default-im-name 'byeoru) 3 | (define default-im-name 'byeoru) 4 | (define enabled-im-list '(byeoru anthy-utf8)) 5 | (define enable-im-switch? #t) 6 | (define switch-im-key '(")")) 7 | (define switch-im-key? (make-key-predicate '(")"))) 8 | (define switch-im-skip-direct-im? #t) 9 | (define enable-im-toggle? #t) 10 | (define toggle-im-key '(",")) 11 | (define toggle-im-key? (make-key-predicate '(","))) 12 | (define toggle-im-alt-im 'byeoru) 13 | (define uim-color 'uim-color-uim) 14 | (define candidate-window-style 'vertical) 15 | (define candidate-window-position 'caret) 16 | (define enable-lazy-loading? #t) 17 | (define bridge-show-input-state? #t) 18 | (define bridge-show-with? 'mode) 19 | (define bridge-show-input-state-time-length 3) 20 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *# 2 | *.aes 3 | .clj-kondo 4 | .direnv 5 | *.elc 6 | *.log 7 | *.hi 8 | .lsp 9 | .nrepl-port 10 | *.o 11 | *.pyc 12 | *.swp 13 | *.DS_Store 14 | *~ 15 | *.zwc 16 | cache 17 | cmus/* 18 | emacs/doom-cfg/custom.el 19 | emacs/spell-fu/*.data 20 | emacs/spell-fu/*.txt 21 | gpg 22 | karabiner/assets 23 | karabiner/automatic_backups 24 | lh/target 25 | melby/* 26 | mpv/mpv.conf 27 | nvim/.netrwhist 28 | openvpn/*.ovpn 29 | qutebrowser/autoconfig.yml 30 | qutebrowser/bookmarks 31 | qutebrowser/quickmarks 32 | qutebrowser/qsettings 33 | ssh/* 34 | tmux/resurrect 35 | vim/.VimballRecord 36 | vim/.netrwhist 37 | vim/colors 38 | vim/sessions 39 | wezterm/upstream 40 | xmonad/.cabal-sandbox 41 | xmonad/cabal.sandbox.config 42 | xmonad/dist 43 | xmonad/dist-newstyle 44 | xmonad/.stack-work 45 | xmonad/xmonad 46 | xmonad/xmonad-x86_64-linux 47 | xmonad/xmonad.errors 48 | xmonad/xmonad.state 49 | xmonad/xmonad-session-rc 50 | zsh/zcomet 51 | -------------------------------------------------------------------------------- /openvpn/crl.rsa.2048.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN X509 CRL----- 2 | MIICWDCCAUAwDQYJKoZIhvcNAQENBQAwgegxCzAJBgNVBAYTAlVTMQswCQYDVQQI 3 | EwJDQTETMBEGA1UEBxMKTG9zQW5nZWxlczEgMB4GA1UEChMXUHJpdmF0ZSBJbnRl 4 | cm5ldCBBY2Nlc3MxIDAeBgNVBAsTF1ByaXZhdGUgSW50ZXJuZXQgQWNjZXNzMSAw 5 | HgYDVQQDExdQcml2YXRlIEludGVybmV0IEFjY2VzczEgMB4GA1UEKRMXUHJpdmF0 6 | ZSBJbnRlcm5ldCBBY2Nlc3MxLzAtBgkqhkiG9w0BCQEWIHNlY3VyZUBwcml2YXRl 7 | aW50ZXJuZXRhY2Nlc3MuY29tFw0xNjA3MDgxOTAwNDZaFw0zNjA3MDMxOTAwNDZa 8 | MCYwEQIBARcMMTYwNzA4MTkwMDQ2MBECAQYXDDE2MDcwODE5MDA0NjANBgkqhkiG 9 | 9w0BAQ0FAAOCAQEAQZo9X97ci8EcPYu/uK2HB152OZbeZCINmYyluLDOdcSvg6B5 10 | jI+ffKN3laDvczsG6CxmY3jNyc79XVpEYUnq4rT3FfveW1+Ralf+Vf38HdpwB8EW 11 | B4hZlQ205+21CALLvZvR8HcPxC9KEnev1mU46wkTiov0EKc+EdRxkj5yMgv0V2Re 12 | ze7AP+NQ9ykvDScH4eYCsmufNpIjBLhpLE2cuZZXBLcPhuRzVoU3l7A9lvzG9mjA 13 | 5YijHJGHNjlWFqyrn1CfYS6koa4TGEPngBoAziWRbDGdhEgJABHrpoaFYaL61zqy 14 | MR6jC0K2ps9qyZAN74LEBedEfK7tBOzWMwr58A== 15 | -----END X509 CRL----- 16 | -------------------------------------------------------------------------------- /uim/customs/custom-social-ime.scm: -------------------------------------------------------------------------------- 1 | (define social-ime-show-segment-separator? #f) 2 | (define social-ime-segment-separator "|") 3 | (define social-ime-use-candidate-window? #t) 4 | (define social-ime-candidate-op-count 1) 5 | (define social-ime-nr-candidate-max 10) 6 | (define social-ime-select-candidate-by-numeral-key? #f) 7 | (define social-ime-widgets '(widget_social-ime_input_mode widget_social-ime_kana_input_method)) 8 | (define default-widget_social-ime_input_mode 'action_social-ime_direct) 9 | (define social-ime-input-mode-actions '(action_social-ime_direct action_social-ime_hiragana action_social-ime_katakana action_social-ime_halfkana action_social-ime_halfwidth_alnum action_social-ime_fullwidth_alnum)) 10 | (define default-widget_social-ime_kana_input_method 'action_social-ime_roma) 11 | (define social-ime-kana-input-method-actions '(action_social-ime_roma action_social-ime_kana action_social-ime_azik action_social-ime_act action_social-ime_kzik)) 12 | -------------------------------------------------------------------------------- /script/jpg-dng-diff.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -o errexit 4 | set -o nounset 5 | set -o pipefail 6 | 7 | # Get *.jpg files in foo/, and list *.dng files in bar/. List all *.dng files 8 | # that are in bar (matching filename without the extension) that are not in 9 | # foo/. 10 | # 11 | # Usage: $0 | xargs rm 12 | 13 | if (( $# != 2 )) || [[ -z $1 ]] || [[ -z $2 ]]; then 14 | echo >&2 "usage: $0 " 15 | fi 16 | 17 | jpg_dir=$1 18 | dng_dir=$2 19 | 20 | mapfile -t dngs < <(find "${dng_dir}" -name '*.dng' | sort) 21 | 22 | for dng in "${dng_dir}"/*.dng; do 23 | photo="$(basename "${dng%.dng}")" 24 | hi_res="${dng}" 25 | lo_res="${jpg_dir}/${photo}.jpg" 26 | # If the hi-res photo does not have a lo-res counterpart, then it is a 27 | # candidate for deletion. The idea is that we would have gone through the 28 | # jpgs to delete those jpgs we were not interested in. 29 | if [[ ! -f "${lo_res}" ]]; then 30 | echo "${hi_res}" 31 | fi 32 | done 33 | -------------------------------------------------------------------------------- /zsh/func/gflat: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # Shortcut for "git rebase -i HEAD~" where is a positive integer, and 4 | # where "f" is used to flatten all commits up to the oldest (topmost in rebase 5 | # buffer) commit. 6 | gflat() 7 | { 8 | if (( $# != 1 )); then 9 | printf "gflat: Need exactly 1 argument.\n" 10 | return 1 11 | # The odd-looking "<->" pattern is a zsh-ism tht checks to see that the 12 | # string only has digits [1]. 13 | # [1]: https://www.zsh.org/mla/users/2007/msg00084.html 14 | elif [[ "$1" == <-> ]]; then 15 | # Strip any leading zeroes [1]. 16 | # [1]: https://groups.google.com/d/msg/comp.unix.shell/VI8nIp1plWc/WOhfzd16ug8J 17 | n="${1#${1%%[!0]*}}" 18 | 19 | if (( n < 2 )); then 20 | printf "gflat: Numerical argument must be at least 2.\n" 21 | return 1 22 | fi 23 | 24 | arg=HEAD~"${n}" 25 | # The argument may be a commit-ish. 26 | else 27 | arg="$1" 28 | fi 29 | 30 | GIT_SEQUENCE_EDITOR="sed -i -e '2,\$s/^pick/f/'" git rebase -i "${arg}" 31 | } 32 | -------------------------------------------------------------------------------- /uim/customs/custom-baidu-olime-jp.scm: -------------------------------------------------------------------------------- 1 | (define baidu-olime-jp-show-segment-separator? #f) 2 | (define baidu-olime-jp-segment-separator "|") 3 | (define baidu-olime-jp-use-candidate-window? #t) 4 | (define baidu-olime-jp-candidate-op-count 1) 5 | (define baidu-olime-jp-nr-candidate-max 10) 6 | (define baidu-olime-jp-select-candidate-by-numeral-key? #f) 7 | (define baidu-olime-jp-widgets '(widget_baidu-olime-jp_input_mode widget_baidu-olime-jp_kana_input_method)) 8 | (define default-widget_baidu-olime-jp_input_mode 'action_baidu-olime-jp_direct) 9 | (define baidu-olime-jp-input-mode-actions '(action_baidu-olime-jp_direct action_baidu-olime-jp_hiragana action_baidu-olime-jp_katakana action_baidu-olime-jp_halfkana action_baidu-olime-jp_halfwidth_alnum action_baidu-olime-jp_fullwidth_alnum)) 10 | (define default-widget_baidu-olime-jp_kana_input_method 'action_baidu-olime-jp_roma) 11 | (define baidu-olime-jp-kana-input-method-actions '(action_baidu-olime-jp_roma action_baidu-olime-jp_kana action_baidu-olime-jp_azik action_baidu-olime-jp_act action_baidu-olime-jp_kzik)) 12 | -------------------------------------------------------------------------------- /xmonad/shell.nix: -------------------------------------------------------------------------------- 1 | { nixpkgs ? import { }, compiler ? "ghc963" }: 2 | let 3 | inherit (nixpkgs) pkgs; 4 | ghc = pkgs.haskell.packages.${compiler}.ghcWithPackages (ps: 5 | with ps; 6 | [ 7 | # If you want to use cached Haskell packages (instead of making cabal 8 | # download them dynamically), you can list them here (e.g., "mtl"). But 9 | # this only works if the nixpkgs cache has them built; it may be that 10 | # nixpkgs does not have them yet (at least at the correct versions) which 11 | # would mean that we would have to download and build these packages 12 | # ourselves. 13 | 14 | xmonad 15 | xmonad-contrib 16 | ]); 17 | in pkgs.stdenv.mkDerivation { 18 | name = "my-haskell-env-0"; 19 | buildInputs = [ 20 | ghc 21 | pkgs.cabal-install 22 | pkgs.pkg-config 23 | pkgs.zlib 24 | 25 | pkgs.gmp 26 | pkgs.libffi 27 | pkgs.xorg.libXinerama 28 | pkgs.xorg.libXScrnSaver 29 | pkgs.xorg.libXrandr 30 | ]; 31 | shellHook = "eval $(egrep ^export ${ghc}/bin/ghc)"; 32 | } 33 | 34 | -------------------------------------------------------------------------------- /uim/customs/custom-google-cgiapi-jp.scm: -------------------------------------------------------------------------------- 1 | (define google-cgiapi-jp-show-segment-separator? #f) 2 | (define google-cgiapi-jp-segment-separator "|") 3 | (define google-cgiapi-jp-use-candidate-window? #t) 4 | (define google-cgiapi-jp-candidate-op-count 1) 5 | (define google-cgiapi-jp-nr-candidate-max 10) 6 | (define google-cgiapi-jp-select-candidate-by-numeral-key? #f) 7 | (define google-cgiapi-jp-widgets '(widget_google-cgiapi-jp_input_mode widget_google-cgiapi-jp_kana_input_method)) 8 | (define default-widget_google-cgiapi-jp_input_mode 'action_google-cgiapi-jp_direct) 9 | (define google-cgiapi-jp-input-mode-actions '(action_google-cgiapi-jp_direct action_google-cgiapi-jp_hiragana action_google-cgiapi-jp_katakana action_google-cgiapi-jp_halfkana action_google-cgiapi-jp_halfwidth_alnum action_google-cgiapi-jp_fullwidth_alnum)) 10 | (define default-widget_google-cgiapi-jp_kana_input_method 'action_google-cgiapi-jp_roma) 11 | (define google-cgiapi-jp-kana-input-method-actions '(action_google-cgiapi-jp_roma action_google-cgiapi-jp_kana action_google-cgiapi-jp_azik action_google-cgiapi-jp_act action_google-cgiapi-jp_kzik)) 12 | -------------------------------------------------------------------------------- /zsh/.zshenv: -------------------------------------------------------------------------------- 1 | # Default (personal) values. Use these as a baseline, and modify further in 2 | # ~/.zprofile depending on the machine as necessary. 3 | 4 | . $HOME/.zsh/lib.sh 5 | 6 | # Space-delimited list of directories to use for setting org-agenda-files. All 7 | # *.org files in these directories are included, recursively. 8 | export L_ORG_AGENDA_DIRS="$HOME/lo" 9 | # Space-delimited list of exclusion patterns to remove files from 10 | # org-agenda-files. 11 | export L_ORG_AGENDA_EXCLUDE_PATTERNS=" 12 | $HOME/lo/archived/ 13 | $HOME/lo/plan.org 14 | $HOME/lo/note.org 15 | $HOME/lo/note/chart.org 16 | $HOME/lo/note/snippets.org 17 | " 18 | 19 | __l_prepend_path ~/.nix-profile/bin 20 | 21 | case "$(hostname)" in 22 | w0) export TERM=xterm-24bit ;; 23 | *) export TERM=wezterm ;; 24 | esac 25 | 26 | # Let emacs and other applications know that our terminal supports 24-bit colors. 27 | export COLORTERM=truecolor 28 | 29 | # Tell clojure CLI to look into ~/.config/clojure to look for cross-project 30 | # configuration files. 31 | if [[ -z "${XDG_CONFIG_HOME:-}" ]]; then 32 | export XDG_CONFIG_HOME="$HOME/.config" 33 | fi 34 | -------------------------------------------------------------------------------- /zsh/func/f_text: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # Search plaintext. This is the typical use case for ripgrep and is pretty 4 | # straightforward. 5 | f_text() 6 | { 7 | local pattern="${1}" 8 | shift 9 | local args=() 10 | 11 | # Explicitly ignore the .git folder because rg by default ignores the paths 12 | # inside .gitignore files, but still searches inside the .git folder itself. 13 | local rg_args=(--glob '!.git') 14 | 15 | # Filter out arguments meant for f_text(), not rg. 16 | for arg in "${@}"; do 17 | case "${arg}" in 18 | SEARCH_ALL_FILES) 19 | # Providing 2 -u flags (--unrestricted) makes rg ignore 20 | # .gitignore files and also search hidden files and directories. 21 | rg_args=(-uu) 22 | ;; 23 | SEARCH_ALL_FILES_BINARY) 24 | # Providing three -u flags (--unrestricted) makes rg search even 25 | # binary files. 26 | rg_args=(-uuu) 27 | ;; 28 | # Save anything else we don't recognize (to pass along to rg). 29 | *) args+=("${arg}") ;; 30 | esac 31 | done 32 | 33 | rg --color always --smart-case --pcre2 --hidden \ 34 | ${rg_args[@]} ${args[@]} "${pattern}" 35 | } 36 | -------------------------------------------------------------------------------- /zsh/func/rand_open: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # rand_open() [recurse/norecurse] ['command string'] [extensions...] 4 | 5 | # Find all files matching the extension (recursively or not), and store the 6 | # filenames as a list in `/tmp/rand_open_files`. Then, use the given command 7 | # string to open this list of files. 8 | 9 | rand_open() 10 | { 11 | :>/tmp/rand_open_files 12 | recurse_flag=$1 13 | command=$2 14 | if [[ -n $3 ]]; then 15 | output_ext=".$3" 16 | else 17 | output_ext="" 18 | fi 19 | output_file=/tmp/rand_open_files${output_ext} 20 | regex_str=".*\\.\\(" 21 | find_recurse="" 22 | shift 3 23 | 24 | for ext in $*; do 25 | regex_str+="$ext\\|" 26 | done 27 | 28 | regex_str+="\\)$" 29 | 30 | if [[ $recurse_flag == "norecurse" ]]; then 31 | find_recurse="-maxdepth 1" 32 | fi 33 | 34 | find -L $PWD ${(z)find_recurse} -type f -iregex $regex_str \ 35 | | shuf --random-source /dev/urandom \ 36 | > $output_file 37 | 38 | if [[ $(wc -l $output_file | cut -d ' ' -f 1) -gt 0 ]]; then 39 | ${(z)command} $output_file 40 | echo "Chose file \`$chosen'" 41 | else 42 | echo "No files to choose." 43 | fi 44 | } 45 | -------------------------------------------------------------------------------- /nixos/m0/configuration.nix: -------------------------------------------------------------------------------- 1 | { config, pkgs, ... }: 2 | 3 | { 4 | imports = [ ../extra.nix ./hardware-configuration.nix ]; 5 | 6 | boot.loader.grub.enable = true; 7 | boot.loader.grub.device = 8 | "/dev/disk/by-id/ata-KINGSTON_SVP100S296G_X0NA40R9K0KK"; 9 | 10 | boot.initrd.luks.devices = { 11 | luksroot = { 12 | device = "/dev/disk/by-id/ata-KINGSTON_SVP100S296G_X0NA40R9K0KK-part2"; 13 | preLVM = true; 14 | }; 15 | }; 16 | 17 | # Mount our secondary luks (RAID1) device. Actual path is just 18 | # "/root/keyfile", but we are in "stage 1" where the root filesystem is 19 | # mounted at "/mnt-root", not "/". 20 | #boot.initrd.postMountCommands = 21 | # "cryptsetup luksOpen --key-file /mnt-root/root/keyfile /dev/md127 craid"; 22 | 23 | boot.kernel.sysctl = { 24 | # Make the kernel reluctant to use swap. 25 | "vm.swappiness" = 5; 26 | }; 27 | 28 | networking = { 29 | hostName = "m0"; 30 | 31 | # Static IP. 32 | interfaces.enp2s0.ipv4.addresses = [{ 33 | address = "10.0.0.3"; 34 | prefixLength = 24; 35 | }]; 36 | defaultGateway = "10.0.0.1"; 37 | nameservers = [ "8.8.8.8" ]; 38 | }; 39 | } 40 | -------------------------------------------------------------------------------- /nixos/m0/hardware-configuration.nix: -------------------------------------------------------------------------------- 1 | # Do not modify this file! It was generated by ‘nixos-generate-config’ 2 | # and may be overwritten by future invocations. Please make changes 3 | # to /etc/nixos/configuration.nix instead. 4 | { config, lib, pkgs, ... }: 5 | 6 | { 7 | imports = 8 | [ 9 | ]; 10 | 11 | boot.initrd.availableKernelModules = [ "ahci" "ohci_pci" "ehci_pci" "pata_atiixp" "usbhid" "sd_mod" ]; 12 | boot.kernelModules = [ "kvm-amd" ]; 13 | boot.extraModulePackages = [ ]; 14 | 15 | fileSystems."/" = 16 | { device = "/dev/disk/by-uuid/5f3b6d45-4fbc-41bf-b00b-3d7a570029bf"; 17 | fsType = "ext4"; 18 | }; 19 | 20 | fileSystems."/boot" = 21 | { device = "/dev/disk/by-uuid/c82e45c6-9289-4e0e-b8f1-84a8a4f0acb9"; 22 | fsType = "ext4"; 23 | }; 24 | 25 | #fileSystems."/mnt/a" = 26 | # { device = "/dev/disk/by-uuid/45a51c5e-ead8-4afb-be41-20f8564898bd"; 27 | # fsType = "ext4"; 28 | # }; 29 | 30 | swapDevices = 31 | [ { device = "/dev/disk/by-uuid/eca98203-0adf-4035-be48-ff7cd134d3bf"; } 32 | ]; 33 | 34 | nix.settings.max-jobs = lib.mkDefault 2; 35 | } 36 | -------------------------------------------------------------------------------- /script/git/hooks/prepare_commit_msg.bb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bb 2 | (ns prepare-commit-msg 3 | (:require [clojure.java.io :as io] 4 | [clojure.string :as str])) 5 | (def pats 6 | ["#\ndiff " 7 | "# Everything below it will be ignored.\ndiff "]) 8 | 9 | (defn- search-pat 10 | [s pat] 11 | [(str/index-of s pat) 12 | (str/index-of pat "diff")]) 13 | 14 | (defn wrap-diff 15 | [s] 16 | (if-let [[idx offset] (->> pats 17 | (map #(search-pat s %)) 18 | (some (fn [[idx _ :as tup]] 19 | (when (some? idx) tup))))] 20 | (let [before (subs s 0 (+ offset idx)) 21 | after (subs s (+ offset idx)) 22 | new-parts [before 23 | "#+begin_src diff\n" 24 | after 25 | "#+end_src\n"]] 26 | (str/join new-parts)) 27 | s)) 28 | (defn wrap-diff-portion 29 | [file] 30 | (->> (slurp file) 31 | wrap-diff 32 | (spit file))) 33 | (defn -main [& [file & rst]] 34 | (wrap-diff-portion file)) 35 | (when (= *file* (System/getProperty "babashka.file")) 36 | (apply -main *command-line-args*)) 37 | -------------------------------------------------------------------------------- /jj/config.toml: -------------------------------------------------------------------------------- 1 | [user] 2 | 3 | "name" = "Linus Arver" 4 | "email" = "linus@ucla.edu" 5 | 6 | [aliases] 7 | sync = ["rebase", "-b", 'all:trunk()..(visible_heads() ~ (immutable_heads() | remote_bookmarks()) | branches())', "-d", "main"] 8 | 9 | [lazyjj] 10 | layout = "vertical" 11 | 12 | [templates] 13 | draft_commit_description = ''' 14 | concat( 15 | coalesce(description, default_commit_description, "\n"), 16 | "\n\n", 17 | "JJ: --------------------------------------------------------------------\n", 18 | "JJ: ignore-rest\n", 19 | surround( 20 | "#+begin_src txt\n", "#+end_src\n", 21 | indent(" ", diff.stat(72)), 22 | ), 23 | "#+begin_src diff\n", 24 | diff.git(), 25 | "#+end_src\n", 26 | ) 27 | ''' 28 | 29 | [colors] 30 | 31 | # Diff chunks. 32 | "diff added token" = { fg = "#335533", bg = "#ccffcc", bold = true, underline = false } 33 | "diff removed token" = { fg = "#553333", bg = "#ffcccc", bold = true, underline = false } 34 | 35 | # There are for the line numbers in the left margin, next to the diff chunk lines. 36 | "diff added" = { fg = "#ccffcc", bold = true } 37 | "diff removed" = { fg = "#ffcccc", bold = true } 38 | 39 | [ui] 40 | merge-editor = "meld" 41 | -------------------------------------------------------------------------------- /nixos/k0/hardware-configuration.nix: -------------------------------------------------------------------------------- 1 | # Do not modify this file! It was generated by ‘nixos-generate-config’ 2 | # and may be overwritten by future invocations. Please make changes 3 | # to /etc/nixos/configuration.nix instead. 4 | { config, lib, pkgs, ... }: 5 | 6 | { 7 | imports = 8 | [ 9 | ]; 10 | 11 | boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "ehci_pci" "nvme" "usbhid" "usb_storage" "sd_mod" ]; 12 | boot.kernelModules = [ "kvm-intel" ]; 13 | boot.extraModulePackages = [ ]; 14 | 15 | fileSystems."/" = 16 | { device = "/dev/disk/by-id/dm-name-vg0-root"; 17 | fsType = "ext4"; 18 | }; 19 | 20 | fileSystems."/boot" = 21 | { device = "/dev/disk/by-id/nvme-SAMSUNG_MZVKW512HMJP-000H1_S34CNA0J100907-part1"; 22 | fsType = "vfat"; 23 | }; 24 | 25 | fileSystems."/home" = 26 | { device = "/dev/disk/by-id/dm-name-vg0-home"; 27 | fsType = "ext4"; 28 | }; 29 | 30 | swapDevices = 31 | [ { device = "/dev/disk/by-id/dm-name-vg0-swap"; } 32 | ]; 33 | 34 | nix.settings.max-jobs = lib.mkDefault 12; 35 | powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; 36 | } 37 | -------------------------------------------------------------------------------- /nixos/k1/hardware-configuration.nix: -------------------------------------------------------------------------------- 1 | # Do not modify this file! It was generated by ‘nixos-generate-config’ 2 | # and may be overwritten by future invocations. Please make changes 3 | # to /etc/nixos/configuration.nix instead. 4 | { config, lib, pkgs, ... }: 5 | 6 | { 7 | imports = 8 | [ 9 | ]; 10 | 11 | boot.initrd.availableKernelModules = [ "uhci_hcd" "ehci_pci" "ata_piix" "usb_storage" "ums_realtek" "sd_mod" "sr_mod" ]; 12 | boot.kernelModules = [ ]; 13 | boot.extraModulePackages = [ ]; 14 | 15 | fileSystems."/" = 16 | { device = "/dev/disk/by-uuid/3adb795c-f155-4a9b-a53c-609bbcd28238"; 17 | fsType = "ext4"; 18 | }; 19 | 20 | fileSystems."/boot" = 21 | { device = "/dev/disk/by-uuid/4d0d83c3-dcfb-4c06-95f9-3b29c755d3ef"; 22 | fsType = "ext4"; 23 | }; 24 | 25 | fileSystems."/home" = 26 | { device = "/dev/disk/by-uuid/8a51a7f0-124b-4ce7-b7d4-86a09602e64e"; 27 | fsType = "ext4"; 28 | }; 29 | 30 | swapDevices = 31 | [ { device = "/dev/disk/by-uuid/5d435cd0-059d-4c42-880a-2dca398cef2a"; } 32 | ]; 33 | 34 | nix.maxJobs = lib.mkDefault 2; 35 | powerManagement.cpuFreqGovernor = "ondemand"; 36 | } 37 | -------------------------------------------------------------------------------- /uim/customs/custom-anthy-keys4.scm: -------------------------------------------------------------------------------- 1 | (define anthy-hiragana-key '("F6")) 2 | (define anthy-hiragana-key? (make-key-predicate '("F6"))) 3 | (define anthy-katakana-key '("F7")) 4 | (define anthy-katakana-key? (make-key-predicate '("F7"))) 5 | (define anthy-halfkana-key '("F8")) 6 | (define anthy-halfkana-key? (make-key-predicate '("F8"))) 7 | (define anthy-halfwidth-alnum-key '("F10")) 8 | (define anthy-halfwidth-alnum-key? (make-key-predicate '("F10"))) 9 | (define anthy-fullwidth-alnum-key '("F9")) 10 | (define anthy-fullwidth-alnum-key? (make-key-predicate '("F9"))) 11 | (define anthy-kana-toggle-key '()) 12 | (define anthy-kana-toggle-key? (make-key-predicate '())) 13 | (define anthy-alkana-toggle-key '()) 14 | (define anthy-alkana-toggle-key? (make-key-predicate '())) 15 | (define anthy-next-prediction-key '("tab" "down" "n" "i")) 16 | (define anthy-next-prediction-key? (make-key-predicate '("tab" "down" "n" "i"))) 17 | (define anthy-prev-prediction-key '(generic-prev-candidate-key)) 18 | (define anthy-prev-prediction-key? (make-key-predicate '(generic-prev-candidate-key?))) 19 | -------------------------------------------------------------------------------- /uim/customs/custom-ajax-ime-keys4.scm: -------------------------------------------------------------------------------- 1 | (define ajax-ime-hiragana-key '("F6")) 2 | (define ajax-ime-hiragana-key? (make-key-predicate '("F6"))) 3 | (define ajax-ime-katakana-key '("F7")) 4 | (define ajax-ime-katakana-key? (make-key-predicate '("F7"))) 5 | (define ajax-ime-halfkana-key '("F8")) 6 | (define ajax-ime-halfkana-key? (make-key-predicate '("F8"))) 7 | (define ajax-ime-halfwidth-alnum-key '("F10")) 8 | (define ajax-ime-halfwidth-alnum-key? (make-key-predicate '("F10"))) 9 | (define ajax-ime-fullwidth-alnum-key '("F9")) 10 | (define ajax-ime-fullwidth-alnum-key? (make-key-predicate '("F9"))) 11 | (define ajax-ime-kana-toggle-key '()) 12 | (define ajax-ime-kana-toggle-key? (make-key-predicate '())) 13 | (define ajax-ime-alkana-toggle-key '()) 14 | (define ajax-ime-alkana-toggle-key? (make-key-predicate '())) 15 | (define ajax-ime-next-prediction-key '("tab" "down" "n" "i")) 16 | (define ajax-ime-next-prediction-key? (make-key-predicate '("tab" "down" "n" "i"))) 17 | (define ajax-ime-prev-prediction-key '(generic-prev-candidate-key)) 18 | (define ajax-ime-prev-prediction-key? (make-key-predicate '(generic-prev-candidate-key?))) 19 | -------------------------------------------------------------------------------- /uim/customs/custom-yahoo-jp-keys4.scm: -------------------------------------------------------------------------------- 1 | (define yahoo-jp-hiragana-key '("F6")) 2 | (define yahoo-jp-hiragana-key? (make-key-predicate '("F6"))) 3 | (define yahoo-jp-katakana-key '("F7")) 4 | (define yahoo-jp-katakana-key? (make-key-predicate '("F7"))) 5 | (define yahoo-jp-halfkana-key '("F8")) 6 | (define yahoo-jp-halfkana-key? (make-key-predicate '("F8"))) 7 | (define yahoo-jp-halfwidth-alnum-key '("F10")) 8 | (define yahoo-jp-halfwidth-alnum-key? (make-key-predicate '("F10"))) 9 | (define yahoo-jp-fullwidth-alnum-key '("F9")) 10 | (define yahoo-jp-fullwidth-alnum-key? (make-key-predicate '("F9"))) 11 | (define yahoo-jp-kana-toggle-key '()) 12 | (define yahoo-jp-kana-toggle-key? (make-key-predicate '())) 13 | (define yahoo-jp-alkana-toggle-key '()) 14 | (define yahoo-jp-alkana-toggle-key? (make-key-predicate '())) 15 | (define yahoo-jp-next-prediction-key '("tab" "down" "n" "i")) 16 | (define yahoo-jp-next-prediction-key? (make-key-predicate '("tab" "down" "n" "i"))) 17 | (define yahoo-jp-prev-prediction-key '(generic-prev-candidate-key)) 18 | (define yahoo-jp-prev-prediction-key? (make-key-predicate '(generic-prev-candidate-key?))) 19 | -------------------------------------------------------------------------------- /xorg/10-hdtv.conf: -------------------------------------------------------------------------------- 1 | # nvidia-settings: X configuration file generated by nvidia-settings 2 | # nvidia-settings: version 304.117 (buildmeister@swio-display-x86-rhel47-01) Tue Nov 26 22:29:30 PST 2013 3 | 4 | Section "ServerLayout" 5 | Identifier "Layout0" 6 | Screen 0 "Screen0" 0 0 7 | Option "Xinerama" "0" 8 | EndSection 9 | 10 | Section "Monitor" 11 | # HorizSync source: edid, VertRefresh source: edid 12 | Identifier "Monitor0" 13 | VendorName "Unknown" 14 | ModelName "SAMSUNG" 15 | HorizSync 30.0 - 70.0 16 | VertRefresh 59.0 - 71.0 17 | Option "DPMS" 18 | EndSection 19 | 20 | Section "Device" 21 | Identifier "Device0" 22 | Driver "nvidia" 23 | VendorName "NVIDIA Corporation" 24 | BoardName "GeForce 8600 GT" 25 | Option "NoLogo" "1" 26 | EndSection 27 | 28 | Section "Screen" 29 | Identifier "Screen0" 30 | Device "Device0" 31 | Monitor "Monitor0" 32 | DefaultDepth 24 33 | Option "Stereo" "0" 34 | Option "nvidiaXineramaInfoOrder" "DFP-1" 35 | Option "metamodes" "nvidia-auto-select +0+0" 36 | SubSection "Display" 37 | Depth 24 38 | EndSubSection 39 | EndSection 40 | 41 | -------------------------------------------------------------------------------- /uim/customs/custom-anthy-keys3.scm: -------------------------------------------------------------------------------- 1 | (define anthy-beginning-of-preedit-key '(generic-beginning-of-preedit-key)) 2 | (define anthy-beginning-of-preedit-key? (make-key-predicate '(generic-beginning-of-preedit-key?))) 3 | (define anthy-end-of-preedit-key '(generic-end-of-preedit-key)) 4 | (define anthy-end-of-preedit-key? (make-key-predicate '(generic-end-of-preedit-key?))) 5 | (define anthy-kill-key '(generic-kill-key)) 6 | (define anthy-kill-key? (make-key-predicate '(generic-kill-key?))) 7 | (define anthy-kill-backward-key '(generic-kill-backward-key)) 8 | (define anthy-kill-backward-key? (make-key-predicate '(generic-kill-backward-key?))) 9 | (define anthy-backspace-key '(generic-backspace-key)) 10 | (define anthy-backspace-key? (make-key-predicate '(generic-backspace-key?))) 11 | (define anthy-delete-key '(generic-delete-key)) 12 | (define anthy-delete-key? (make-key-predicate '(generic-delete-key?))) 13 | (define anthy-go-left-key '(generic-go-left-key)) 14 | (define anthy-go-left-key? (make-key-predicate '(generic-go-left-key?))) 15 | (define anthy-go-right-key '(generic-go-right-key)) 16 | (define anthy-go-right-key? (make-key-predicate '(generic-go-right-key?))) 17 | (define anthy-vi-escape-key '("escape" "[")) 18 | (define anthy-vi-escape-key? (make-key-predicate '("escape" "["))) 19 | -------------------------------------------------------------------------------- /git/cfg.personal.conf: -------------------------------------------------------------------------------- 1 | [user] 2 | name = Linus Arver 3 | email = linus@ucla.edu 4 | [clone] 5 | defaultRemoteName = u 6 | [color] 7 | branch = auto 8 | diff = auto 9 | status = auto 10 | [color "diff"] 11 | meta = yellow bold 12 | commit = blue bold reverse 13 | [color "status"] 14 | untracked = yellow bold 15 | [commit] 16 | cleanup = scissors 17 | [core] 18 | editor = ~/syscfg/script/emacsclient-tty.sh 19 | excludesFile = ~/.gitignore 20 | hooksPath = ~/syscfg/script/git/hooks 21 | [diff] 22 | algorithm = histogram 23 | colorMoved = default 24 | colorMovedWS = allow-indentation-change 25 | context = 5 26 | tool = difftastic 27 | [difftool] 28 | prompt = false 29 | [difftool "difftastic"] 30 | cmd = difft "$LOCAL" "$REMOTE" 31 | [gui] 32 | spellingdictionary = none 33 | [init] 34 | defaultBranch = main 35 | [merge] 36 | conflictStyle = zdiff3 37 | [pager] 38 | difftool = true 39 | [push] 40 | default = simple 41 | autoSetupRemote = true 42 | [rebase] 43 | updateRefs = true 44 | [rerere] 45 | enabled = true 46 | [sendemail] 47 | aliasesFile = ~/.git-sendemail-aliases 48 | aliasFileType = mailrc 49 | chainReplyTo = false 50 | sendmailCmd = "gmi send --quiet -t -C ~/mail/linusarver@gmail.com" 51 | suppressCc = self 52 | [tag] 53 | sort = taggerdate 54 | [tig] 55 | vertical-split = false 56 | -------------------------------------------------------------------------------- /uim/customs/custom-social-ime-keys4.scm: -------------------------------------------------------------------------------- 1 | (define social-ime-hiragana-key '("F6")) 2 | (define social-ime-hiragana-key? (make-key-predicate '("F6"))) 3 | (define social-ime-katakana-key '("F7")) 4 | (define social-ime-katakana-key? (make-key-predicate '("F7"))) 5 | (define social-ime-halfkana-key '("F8")) 6 | (define social-ime-halfkana-key? (make-key-predicate '("F8"))) 7 | (define social-ime-halfwidth-alnum-key '("F10")) 8 | (define social-ime-halfwidth-alnum-key? (make-key-predicate '("F10"))) 9 | (define social-ime-fullwidth-alnum-key '("F9")) 10 | (define social-ime-fullwidth-alnum-key? (make-key-predicate '("F9"))) 11 | (define social-ime-kana-toggle-key '()) 12 | (define social-ime-kana-toggle-key? (make-key-predicate '())) 13 | (define social-ime-alkana-toggle-key '()) 14 | (define social-ime-alkana-toggle-key? (make-key-predicate '())) 15 | (define social-ime-next-prediction-key '("tab" "down" "n" "i")) 16 | (define social-ime-next-prediction-key? (make-key-predicate '("tab" "down" "n" "i"))) 17 | (define social-ime-prev-prediction-key '(generic-prev-candidate-key)) 18 | (define social-ime-prev-prediction-key? (make-key-predicate '(generic-prev-candidate-key?))) 19 | -------------------------------------------------------------------------------- /uim/customs/custom-ajax-ime-keys2.scm: -------------------------------------------------------------------------------- 1 | (define ajax-ime-on-key '("\\" generic-on-key)) 2 | (define ajax-ime-on-key? (make-key-predicate '("\\" generic-on-key?))) 3 | (define ajax-ime-off-key '("\\" generic-off-key)) 4 | (define ajax-ime-off-key? (make-key-predicate '("\\" generic-off-key?))) 5 | (define ajax-ime-begin-conv-key '(generic-begin-conv-key)) 6 | (define ajax-ime-begin-conv-key? (make-key-predicate '(generic-begin-conv-key?))) 7 | (define ajax-ime-commit-key '(generic-commit-key)) 8 | (define ajax-ime-commit-key? (make-key-predicate '(generic-commit-key?))) 9 | (define ajax-ime-cancel-key '(generic-cancel-key)) 10 | (define ajax-ime-cancel-key? (make-key-predicate '(generic-cancel-key?))) 11 | (define ajax-ime-next-candidate-key '(generic-next-candidate-key)) 12 | (define ajax-ime-next-candidate-key? (make-key-predicate '(generic-next-candidate-key?))) 13 | (define ajax-ime-prev-candidate-key '(generic-prev-candidate-key)) 14 | (define ajax-ime-prev-candidate-key? (make-key-predicate '(generic-prev-candidate-key?))) 15 | (define ajax-ime-next-page-key '(generic-next-page-key)) 16 | (define ajax-ime-next-page-key? (make-key-predicate '(generic-next-page-key?))) 17 | (define ajax-ime-prev-page-key '(generic-prev-page-key)) 18 | (define ajax-ime-prev-page-key? (make-key-predicate '(generic-prev-page-key?))) 19 | -------------------------------------------------------------------------------- /uim/customs/custom-anthy-keys2.scm: -------------------------------------------------------------------------------- 1 | (define anthy-on-key '("zenkaku-hankaku" "(")) 2 | (define anthy-on-key? (make-key-predicate '("zenkaku-hankaku" "("))) 3 | (define anthy-off-key '("zenkaku-hankaku" "(")) 4 | (define anthy-off-key? (make-key-predicate '("zenkaku-hankaku" "("))) 5 | (define anthy-begin-conv-key '(generic-begin-conv-key)) 6 | (define anthy-begin-conv-key? (make-key-predicate '(generic-begin-conv-key?))) 7 | (define anthy-commit-key '(generic-commit-key)) 8 | (define anthy-commit-key? (make-key-predicate '(generic-commit-key?))) 9 | (define anthy-cancel-key '(generic-cancel-key)) 10 | (define anthy-cancel-key? (make-key-predicate '(generic-cancel-key?))) 11 | (define anthy-next-candidate-key '(generic-next-candidate-key)) 12 | (define anthy-next-candidate-key? (make-key-predicate '(generic-next-candidate-key?))) 13 | (define anthy-prev-candidate-key '(generic-prev-candidate-key)) 14 | (define anthy-prev-candidate-key? (make-key-predicate '(generic-prev-candidate-key?))) 15 | (define anthy-next-page-key '(generic-next-page-key)) 16 | (define anthy-next-page-key? (make-key-predicate '(generic-next-page-key?))) 17 | (define anthy-prev-page-key '(generic-prev-page-key)) 18 | (define anthy-prev-page-key? (make-key-predicate '(generic-prev-page-key?))) 19 | -------------------------------------------------------------------------------- /uim/customs/custom-skk-keys3.scm: -------------------------------------------------------------------------------- 1 | (define skk-begin-conv-with-completion-key '(" ")) 2 | (define skk-begin-conv-with-completion-key? (make-key-predicate '(" "))) 3 | (define skk-commit-with-conv-completion-key '("j")) 4 | (define skk-commit-with-conv-completion-key? (make-key-predicate '("j"))) 5 | (define skk-next-candidate-key '(generic-next-candidate-key)) 6 | (define skk-next-candidate-key? (make-key-predicate '(generic-next-candidate-key?))) 7 | (define skk-prev-candidate-key '("x" generic-prev-candidate-key)) 8 | (define skk-prev-candidate-key? (make-key-predicate '("x" generic-prev-candidate-key?))) 9 | (define skk-next-page-key '(generic-next-page-key)) 10 | (define skk-next-page-key? (make-key-predicate '(generic-next-page-key?))) 11 | (define skk-prev-page-key '(generic-prev-page-key)) 12 | (define skk-prev-page-key? (make-key-predicate '(generic-prev-page-key?))) 13 | (define skk-backspace-key '(generic-backspace-key)) 14 | (define skk-backspace-key? (make-key-predicate '(generic-backspace-key?))) 15 | (define skk-go-left-key '(generic-go-left-key)) 16 | (define skk-go-left-key? (make-key-predicate '(generic-go-left-key?))) 17 | (define skk-go-right-key '(generic-go-right-key)) 18 | (define skk-go-right-key? (make-key-predicate '(generic-go-right-key?))) 19 | -------------------------------------------------------------------------------- /uim/customs/custom-yahoo-jp-keys2.scm: -------------------------------------------------------------------------------- 1 | (define yahoo-jp-on-key '("\\" generic-on-key)) 2 | (define yahoo-jp-on-key? (make-key-predicate '("\\" generic-on-key?))) 3 | (define yahoo-jp-off-key '("\\" generic-off-key)) 4 | (define yahoo-jp-off-key? (make-key-predicate '("\\" generic-off-key?))) 5 | (define yahoo-jp-begin-conv-key '(generic-begin-conv-key)) 6 | (define yahoo-jp-begin-conv-key? (make-key-predicate '(generic-begin-conv-key?))) 7 | (define yahoo-jp-commit-key '(generic-commit-key)) 8 | (define yahoo-jp-commit-key? (make-key-predicate '(generic-commit-key?))) 9 | (define yahoo-jp-cancel-key '(generic-cancel-key)) 10 | (define yahoo-jp-cancel-key? (make-key-predicate '(generic-cancel-key?))) 11 | (define yahoo-jp-next-candidate-key '(generic-next-candidate-key)) 12 | (define yahoo-jp-next-candidate-key? (make-key-predicate '(generic-next-candidate-key?))) 13 | (define yahoo-jp-prev-candidate-key '(generic-prev-candidate-key)) 14 | (define yahoo-jp-prev-candidate-key? (make-key-predicate '(generic-prev-candidate-key?))) 15 | (define yahoo-jp-next-page-key '(generic-next-page-key)) 16 | (define yahoo-jp-next-page-key? (make-key-predicate '(generic-next-page-key?))) 17 | (define yahoo-jp-prev-page-key '(generic-prev-page-key)) 18 | (define yahoo-jp-prev-page-key? (make-key-predicate '(generic-prev-page-key?))) 19 | -------------------------------------------------------------------------------- /uim/customs/custom-global-keys1.scm: -------------------------------------------------------------------------------- 1 | (define generic-on-key '("zenkaku-hankaku" " ")) 2 | (define generic-on-key? (make-key-predicate '("zenkaku-hankaku" " "))) 3 | (define generic-off-key '("zenkaku-hankaku" " ")) 4 | (define generic-off-key? (make-key-predicate '("zenkaku-hankaku" " "))) 5 | (define generic-begin-conv-key '(" ")) 6 | (define generic-begin-conv-key? (make-key-predicate '(" "))) 7 | (define generic-commit-key '("j" generic-return-key)) 8 | (define generic-commit-key? (make-key-predicate '("j" generic-return-key?))) 9 | (define generic-cancel-key '("escape" "[" "g")) 10 | (define generic-cancel-key? (make-key-predicate '("escape" "[" "g"))) 11 | (define generic-next-candidate-key '(" " "down" "n")) 12 | (define generic-next-candidate-key? (make-key-predicate '(" " "down" "n"))) 13 | (define generic-prev-candidate-key '("up" "p")) 14 | (define generic-prev-candidate-key? (make-key-predicate '("up" "p"))) 15 | (define generic-next-page-key '("next")) 16 | (define generic-next-page-key? (make-key-predicate '("next"))) 17 | (define generic-prev-page-key '("prior")) 18 | (define generic-prev-page-key? (make-key-predicate '("prior"))) 19 | -------------------------------------------------------------------------------- /uim/customs/custom-ajax-ime-keys3.scm: -------------------------------------------------------------------------------- 1 | (define ajax-ime-beginning-of-preedit-key '(generic-beginning-of-preedit-key)) 2 | (define ajax-ime-beginning-of-preedit-key? (make-key-predicate '(generic-beginning-of-preedit-key?))) 3 | (define ajax-ime-end-of-preedit-key '(generic-end-of-preedit-key)) 4 | (define ajax-ime-end-of-preedit-key? (make-key-predicate '(generic-end-of-preedit-key?))) 5 | (define ajax-ime-kill-key '(generic-kill-key)) 6 | (define ajax-ime-kill-key? (make-key-predicate '(generic-kill-key?))) 7 | (define ajax-ime-kill-backward-key '(generic-kill-backward-key)) 8 | (define ajax-ime-kill-backward-key? (make-key-predicate '(generic-kill-backward-key?))) 9 | (define ajax-ime-backspace-key '(generic-backspace-key)) 10 | (define ajax-ime-backspace-key? (make-key-predicate '(generic-backspace-key?))) 11 | (define ajax-ime-delete-key '(generic-delete-key)) 12 | (define ajax-ime-delete-key? (make-key-predicate '(generic-delete-key?))) 13 | (define ajax-ime-go-left-key '(generic-go-left-key)) 14 | (define ajax-ime-go-left-key? (make-key-predicate '(generic-go-left-key?))) 15 | (define ajax-ime-go-right-key '(generic-go-right-key)) 16 | (define ajax-ime-go-right-key? (make-key-predicate '(generic-go-right-key?))) 17 | (define ajax-ime-vi-escape-key '("escape" "[")) 18 | (define ajax-ime-vi-escape-key? (make-key-predicate '("escape" "["))) 19 | -------------------------------------------------------------------------------- /uim/customs/custom-yahoo-jp-keys3.scm: -------------------------------------------------------------------------------- 1 | (define yahoo-jp-beginning-of-preedit-key '(generic-beginning-of-preedit-key)) 2 | (define yahoo-jp-beginning-of-preedit-key? (make-key-predicate '(generic-beginning-of-preedit-key?))) 3 | (define yahoo-jp-end-of-preedit-key '(generic-end-of-preedit-key)) 4 | (define yahoo-jp-end-of-preedit-key? (make-key-predicate '(generic-end-of-preedit-key?))) 5 | (define yahoo-jp-kill-key '(generic-kill-key)) 6 | (define yahoo-jp-kill-key? (make-key-predicate '(generic-kill-key?))) 7 | (define yahoo-jp-kill-backward-key '(generic-kill-backward-key)) 8 | (define yahoo-jp-kill-backward-key? (make-key-predicate '(generic-kill-backward-key?))) 9 | (define yahoo-jp-backspace-key '(generic-backspace-key)) 10 | (define yahoo-jp-backspace-key? (make-key-predicate '(generic-backspace-key?))) 11 | (define yahoo-jp-delete-key '(generic-delete-key)) 12 | (define yahoo-jp-delete-key? (make-key-predicate '(generic-delete-key?))) 13 | (define yahoo-jp-go-left-key '(generic-go-left-key)) 14 | (define yahoo-jp-go-left-key? (make-key-predicate '(generic-go-left-key?))) 15 | (define yahoo-jp-go-right-key '(generic-go-right-key)) 16 | (define yahoo-jp-go-right-key? (make-key-predicate '(generic-go-right-key?))) 17 | (define yahoo-jp-vi-escape-key '("escape" "[")) 18 | (define yahoo-jp-vi-escape-key? (make-key-predicate '("escape" "["))) 19 | -------------------------------------------------------------------------------- /script/tmux_move_pane.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Usage: $0 4 | # 5 | # Move the current tmux pane in the given session either left or right, across 6 | # windows --- cycling to the front or back as necessary. 7 | 8 | set -euo pipefail 9 | 10 | main() 11 | { 12 | local session_name 13 | local window_index 14 | local direction 15 | 16 | local target_window_index 17 | local window_index_last 18 | 19 | session_name="${1}" 20 | window_index="${2}" 21 | direction="${3}" 22 | 23 | # This only works because we turn on "renumber-windows" in tmux. 24 | window_index_last="$(tmux list-windows -F \#I | tail -n1)" 25 | 26 | if [[ "${direction}" == LEFT ]]; then 27 | # If we're already at the leftmost window, move the pane to the last 28 | # window. 29 | if (( "${window_index}" == 0 )); then 30 | target_window_index="${window_index_last}" 31 | else 32 | target_window_index="$((window_index - 1))" 33 | fi 34 | else 35 | # If we're at the rightmost window, then we have to move the pane to the 36 | # first window. 37 | if (( "${window_index}" == "${window_index_last}" )); then 38 | target_window_index="0" 39 | else 40 | target_window_index="$((window_index + 1))" 41 | fi 42 | fi 43 | 44 | tmux join-pane -t "${session_name}:${target_window_index}" 45 | tmux set key-table root 46 | } 47 | 48 | main "$@" 49 | -------------------------------------------------------------------------------- /uim/customs/custom-social-ime-keys2.scm: -------------------------------------------------------------------------------- 1 | (define social-ime-on-key '("\\" generic-on-key)) 2 | (define social-ime-on-key? (make-key-predicate '("\\" generic-on-key?))) 3 | (define social-ime-off-key '("\\" generic-off-key)) 4 | (define social-ime-off-key? (make-key-predicate '("\\" generic-off-key?))) 5 | (define social-ime-begin-conv-key '(generic-begin-conv-key)) 6 | (define social-ime-begin-conv-key? (make-key-predicate '(generic-begin-conv-key?))) 7 | (define social-ime-commit-key '(generic-commit-key)) 8 | (define social-ime-commit-key? (make-key-predicate '(generic-commit-key?))) 9 | (define social-ime-cancel-key '(generic-cancel-key)) 10 | (define social-ime-cancel-key? (make-key-predicate '(generic-cancel-key?))) 11 | (define social-ime-next-candidate-key '(generic-next-candidate-key)) 12 | (define social-ime-next-candidate-key? (make-key-predicate '(generic-next-candidate-key?))) 13 | (define social-ime-prev-candidate-key '(generic-prev-candidate-key)) 14 | (define social-ime-prev-candidate-key? (make-key-predicate '(generic-prev-candidate-key?))) 15 | (define social-ime-next-page-key '(generic-next-page-key)) 16 | (define social-ime-next-page-key? (make-key-predicate '(generic-next-page-key?))) 17 | (define social-ime-prev-page-key '(generic-prev-page-key)) 18 | (define social-ime-prev-page-key? (make-key-predicate '(generic-prev-page-key?))) 19 | -------------------------------------------------------------------------------- /script/terminal-themes/themes/PastelDark.dhall: -------------------------------------------------------------------------------- 1 | -- Color definition order for "palette16". 2 | -- 00 black 3 | -- 01 red 4 | -- 02 green 5 | -- 03 yellow 6 | -- 04 blue 7 | -- 05 magenta 8 | -- 06 cyan 9 | -- 07 white 10 | -- 08 *bright* black 11 | -- 09 *bright* red 12 | -- 10 *bright* green 13 | -- 11 *bright* yellow 14 | -- 12 *bright* blue 15 | -- 13 *bright* magenta 16 | -- 14 *bright* cyan 17 | -- 15 *bright* white 18 | -- 19 | -- The "text" field is only used by Alacritty to colorize the text (letter) of 20 | -- the current cursor position. 21 | { name = "PastelDark" 22 | , emacsTheme = "zenburn" 23 | , cursor = "#ffffff" 24 | , text = "#000000" 25 | , background = "#343c48" 26 | , foreground = "#e5e7ea" 27 | , palette16 = 28 | [ "#22222f" 29 | , "#e49f9f" 30 | , "#91e380" 31 | , "#eae47c" 32 | , "#7cacd3" 33 | , "#df9494" 34 | , "#8cdbd8" 35 | , "#e5e7ea" 36 | , "#343c48" 37 | , "#e5bfbf" 38 | , "#afe0a1" 39 | , "#f2fb9e" 40 | , "#95add1" 41 | , "#f2b0b0" 42 | , "#b4f0f0" 43 | , "#ffffff" 44 | ] 45 | , paletteExtra = 46 | { xBrightOrange = "#ffcfaf" 47 | , xDarkGreen = "#2e3330" 48 | , xAvocado = "#3f5f4f" 49 | , xLime = "#ccff94" 50 | , xMoss = "#86ab8e" 51 | , xUltraBrightMagenta = "#ff00ff" 52 | , xUltraBrightGreen = "#00ff00" 53 | , xUltraBrightRed = "#ff0000" 54 | , xGrey1 = "#1c1c1c" 55 | , xGrey2 = "#262626" 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /uim/customs/custom-baidu-olime-jp-keys4.scm: -------------------------------------------------------------------------------- 1 | (define baidu-olime-jp-hiragana-key '("F6")) 2 | (define baidu-olime-jp-hiragana-key? (make-key-predicate '("F6"))) 3 | (define baidu-olime-jp-katakana-key '("F7")) 4 | (define baidu-olime-jp-katakana-key? (make-key-predicate '("F7"))) 5 | (define baidu-olime-jp-halfkana-key '("F8")) 6 | (define baidu-olime-jp-halfkana-key? (make-key-predicate '("F8"))) 7 | (define baidu-olime-jp-halfwidth-alnum-key '("F10")) 8 | (define baidu-olime-jp-halfwidth-alnum-key? (make-key-predicate '("F10"))) 9 | (define baidu-olime-jp-fullwidth-alnum-key '("F9")) 10 | (define baidu-olime-jp-fullwidth-alnum-key? (make-key-predicate '("F9"))) 11 | (define baidu-olime-jp-kana-toggle-key '()) 12 | (define baidu-olime-jp-kana-toggle-key? (make-key-predicate '())) 13 | (define baidu-olime-jp-alkana-toggle-key '()) 14 | (define baidu-olime-jp-alkana-toggle-key? (make-key-predicate '())) 15 | (define baidu-olime-jp-next-prediction-key '("tab" "down" "n" "i")) 16 | (define baidu-olime-jp-next-prediction-key? (make-key-predicate '("tab" "down" "n" "i"))) 17 | (define baidu-olime-jp-prev-prediction-key '(generic-prev-candidate-key)) 18 | (define baidu-olime-jp-prev-prediction-key? (make-key-predicate '(generic-prev-candidate-key?))) 19 | -------------------------------------------------------------------------------- /uim/customs/custom-social-ime-keys3.scm: -------------------------------------------------------------------------------- 1 | (define social-ime-beginning-of-preedit-key '(generic-beginning-of-preedit-key)) 2 | (define social-ime-beginning-of-preedit-key? (make-key-predicate '(generic-beginning-of-preedit-key?))) 3 | (define social-ime-end-of-preedit-key '(generic-end-of-preedit-key)) 4 | (define social-ime-end-of-preedit-key? (make-key-predicate '(generic-end-of-preedit-key?))) 5 | (define social-ime-kill-key '(generic-kill-key)) 6 | (define social-ime-kill-key? (make-key-predicate '(generic-kill-key?))) 7 | (define social-ime-kill-backward-key '(generic-kill-backward-key)) 8 | (define social-ime-kill-backward-key? (make-key-predicate '(generic-kill-backward-key?))) 9 | (define social-ime-backspace-key '(generic-backspace-key)) 10 | (define social-ime-backspace-key? (make-key-predicate '(generic-backspace-key?))) 11 | (define social-ime-delete-key '(generic-delete-key)) 12 | (define social-ime-delete-key? (make-key-predicate '(generic-delete-key?))) 13 | (define social-ime-go-left-key '(generic-go-left-key)) 14 | (define social-ime-go-left-key? (make-key-predicate '(generic-go-left-key?))) 15 | (define social-ime-go-right-key '(generic-go-right-key)) 16 | (define social-ime-go-right-key? (make-key-predicate '(generic-go-right-key?))) 17 | (define social-ime-vi-escape-key '("escape" "[")) 18 | (define social-ime-vi-escape-key? (make-key-predicate '("escape" "["))) 19 | -------------------------------------------------------------------------------- /uim/customs/custom-look-keys.scm: -------------------------------------------------------------------------------- 1 | (define look-on-key '("zenkaku-hankaku" " ")) 2 | (define look-on-key? (make-key-predicate '("zenkaku-hankaku" " "))) 3 | (define look-off-key '("zenkaku-hankaku" " ")) 4 | (define look-off-key? (make-key-predicate '("zenkaku-hankaku" " "))) 5 | (define look-completion-key '("tab" generic-end-of-preedit-key)) 6 | (define look-completion-key? (make-key-predicate '("tab" generic-end-of-preedit-key?))) 7 | (define look-next-char-key '("right" "f")) 8 | (define look-next-char-key? (make-key-predicate '("right" "f"))) 9 | (define look-prev-char-key '(generic-backspace-key generic-go-left-key)) 10 | (define look-prev-char-key? (make-key-predicate '(generic-backspace-key? generic-go-left-key?))) 11 | (define look-next-candidate-key '("down" "n")) 12 | (define look-next-candidate-key? (make-key-predicate '("down" "n"))) 13 | (define look-prev-candidate-key '("up" "p")) 14 | (define look-prev-candidate-key? (make-key-predicate '("up" "p"))) 15 | (define look-save-dict-key '("s" "return")) 16 | (define look-save-dict-key? (make-key-predicate '("s" "return"))) 17 | (define look-load-dict-key '("l")) 18 | (define look-load-dict-key? (make-key-predicate '("l"))) 19 | -------------------------------------------------------------------------------- /uim/customs/custom-google-cgiapi-jp-keys4.scm: -------------------------------------------------------------------------------- 1 | (define google-cgiapi-jp-hiragana-key '("F6")) 2 | (define google-cgiapi-jp-hiragana-key? (make-key-predicate '("F6"))) 3 | (define google-cgiapi-jp-katakana-key '("F7")) 4 | (define google-cgiapi-jp-katakana-key? (make-key-predicate '("F7"))) 5 | (define google-cgiapi-jp-halfkana-key '("F8")) 6 | (define google-cgiapi-jp-halfkana-key? (make-key-predicate '("F8"))) 7 | (define google-cgiapi-jp-halfwidth-alnum-key '("F10")) 8 | (define google-cgiapi-jp-halfwidth-alnum-key? (make-key-predicate '("F10"))) 9 | (define google-cgiapi-jp-fullwidth-alnum-key '("F9")) 10 | (define google-cgiapi-jp-fullwidth-alnum-key? (make-key-predicate '("F9"))) 11 | (define google-cgiapi-jp-kana-toggle-key '()) 12 | (define google-cgiapi-jp-kana-toggle-key? (make-key-predicate '())) 13 | (define google-cgiapi-jp-alkana-toggle-key '()) 14 | (define google-cgiapi-jp-alkana-toggle-key? (make-key-predicate '())) 15 | (define google-cgiapi-jp-next-prediction-key '("tab" "down" "n" "i")) 16 | (define google-cgiapi-jp-next-prediction-key? (make-key-predicate '("tab" "down" "n" "i"))) 17 | (define google-cgiapi-jp-prev-prediction-key '(generic-prev-candidate-key)) 18 | (define google-cgiapi-jp-prev-prediction-key? (make-key-predicate '(generic-prev-candidate-key?))) 19 | -------------------------------------------------------------------------------- /zsh/func/f: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # Find all files and directories using rg.. Does not traverse git folders by 4 | # default, but this can be "overridden" by simply cd-ing into the .git folder 5 | # first. 6 | f() 7 | { 8 | if (( $# < 2 )); then 9 | echo >&2 "usage: $0 [OTHER_RIPGREP_ARGS..] " 10 | echo >&2 "args:" 11 | printf >&2 '%s\n' "$@" 12 | return 1 13 | fi 14 | 15 | local subcommand 16 | local pattern 17 | local args 18 | subcommand="${1}" 19 | shift 1 20 | 21 | # PATTERN is in the last element of "$@". Assign all other elements to 22 | # $args array. 23 | args=("$@") 24 | pattern=${args[-1]} 25 | unset 'args[-1]' 26 | 27 | # Imply '--' if the pattern starts with a dash. Otherwise the pattern 28 | # becomes a flag for rg. 29 | if [[ "${pattern}" =~ ^- ]]; then 30 | args+=(--) 31 | fi 32 | 33 | # Determine type of search. Search files and directories for 'f' and text 34 | # for 't'. 35 | case "${subcommand}" in 36 | files|procs|text) 37 | f_${subcommand} "${pattern}" "${args[@]}" 38 | ;; 39 | all_files) 40 | f_files "${pattern}" SEARCH_ALL_FILES "${args[@]}" 41 | ;; 42 | all_text) 43 | f_text "${pattern}" SEARCH_ALL_FILES "${args[@]}" 44 | ;; 45 | all_text_binary) 46 | f_text "${pattern}" SEARCH_ALL_FILES_BINARY "${args[@]}" 47 | ;; 48 | *) 49 | echo >&2 "$0: unknown search type \`${_type}'" 50 | return 1 51 | ;; 52 | esac 53 | } 54 | -------------------------------------------------------------------------------- /uim/customs/custom-tutcode-keys2.scm: -------------------------------------------------------------------------------- 1 | (define tutcode-next-page-key '(generic-next-page-key)) 2 | (define tutcode-next-page-key? (make-key-predicate '(generic-next-page-key?))) 3 | (define tutcode-prev-page-key '(generic-prev-page-key)) 4 | (define tutcode-prev-page-key? (make-key-predicate '(generic-prev-page-key?))) 5 | (define tutcode-backspace-key '(generic-backspace-key)) 6 | (define tutcode-backspace-key? (make-key-predicate '(generic-backspace-key?))) 7 | (define tutcode-return-key '(generic-return-key)) 8 | (define tutcode-return-key? (make-key-predicate '(generic-return-key?))) 9 | (define tutcode-vi-escape-key '("escape" "[")) 10 | (define tutcode-vi-escape-key? (make-key-predicate '("escape" "["))) 11 | (define tutcode-register-candidate-key '("|")) 12 | (define tutcode-register-candidate-key? (make-key-predicate '("|"))) 13 | (define tutcode-purge-candidate-key '("!")) 14 | (define tutcode-purge-candidate-key? (make-key-predicate '("!"))) 15 | (define tutcode-mazegaki-relimit-left-key '("<")) 16 | (define tutcode-mazegaki-relimit-left-key? (make-key-predicate '("<"))) 17 | (define tutcode-mazegaki-relimit-right-key '(">")) 18 | (define tutcode-mazegaki-relimit-right-key? (make-key-predicate '(">"))) 19 | (define tutcode-verbose-stroke-key '(" ")) 20 | (define tutcode-verbose-stroke-key? (make-key-predicate '(" "))) 21 | -------------------------------------------------------------------------------- /uim/customs/custom-skk-keys1.scm: -------------------------------------------------------------------------------- 1 | (define skk-on-key '("j" generic-on-key)) 2 | (define skk-on-key? (make-key-predicate '("j" generic-on-key?))) 3 | (define skk-latin-key '("l" generic-off-key)) 4 | (define skk-latin-key? (make-key-predicate '("l" generic-off-key?))) 5 | (define skk-wide-latin-key '("l")) 6 | (define skk-wide-latin-key? (make-key-predicate '("l"))) 7 | (define skk-kcode-input-key '("yen")) 8 | (define skk-kcode-input-key? (make-key-predicate '("yen"))) 9 | (define skk-kanji-mode-key '("q")) 10 | (define skk-kanji-mode-key? (make-key-predicate '("q"))) 11 | (define skk-hankaku-kana-key '("q")) 12 | (define skk-hankaku-kana-key? (make-key-predicate '("q"))) 13 | (define skk-kana-toggle-key '("q")) 14 | (define skk-kana-toggle-key? (make-key-predicate '("q"))) 15 | (define skk-begin-conv-key '(generic-begin-conv-key)) 16 | (define skk-begin-conv-key? (make-key-predicate '(generic-begin-conv-key?))) 17 | (define skk-commit-key '("j")) 18 | (define skk-commit-key? (make-key-predicate '("j"))) 19 | (define skk-cancel-key '(generic-cancel-key)) 20 | (define skk-cancel-key? (make-key-predicate '(generic-cancel-key?))) 21 | (define skk-sticky-key '()) 22 | (define skk-sticky-key? (make-key-predicate '())) 23 | -------------------------------------------------------------------------------- /uim/customs/custom-baidu-olime-jp-keys2.scm: -------------------------------------------------------------------------------- 1 | (define baidu-olime-jp-on-key '("\\" generic-on-key)) 2 | (define baidu-olime-jp-on-key? (make-key-predicate '("\\" generic-on-key?))) 3 | (define baidu-olime-jp-off-key '("\\" generic-off-key)) 4 | (define baidu-olime-jp-off-key? (make-key-predicate '("\\" generic-off-key?))) 5 | (define baidu-olime-jp-begin-conv-key '(generic-begin-conv-key)) 6 | (define baidu-olime-jp-begin-conv-key? (make-key-predicate '(generic-begin-conv-key?))) 7 | (define baidu-olime-jp-commit-key '(generic-commit-key)) 8 | (define baidu-olime-jp-commit-key? (make-key-predicate '(generic-commit-key?))) 9 | (define baidu-olime-jp-cancel-key '(generic-cancel-key)) 10 | (define baidu-olime-jp-cancel-key? (make-key-predicate '(generic-cancel-key?))) 11 | (define baidu-olime-jp-next-candidate-key '(generic-next-candidate-key)) 12 | (define baidu-olime-jp-next-candidate-key? (make-key-predicate '(generic-next-candidate-key?))) 13 | (define baidu-olime-jp-prev-candidate-key '(generic-prev-candidate-key)) 14 | (define baidu-olime-jp-prev-candidate-key? (make-key-predicate '(generic-prev-candidate-key?))) 15 | (define baidu-olime-jp-next-page-key '(generic-next-page-key)) 16 | (define baidu-olime-jp-next-page-key? (make-key-predicate '(generic-next-page-key?))) 17 | (define baidu-olime-jp-prev-page-key '(generic-prev-page-key)) 18 | (define baidu-olime-jp-prev-page-key? (make-key-predicate '(generic-prev-page-key?))) 19 | -------------------------------------------------------------------------------- /uim/customs/custom-baidu-olime-jp-keys3.scm: -------------------------------------------------------------------------------- 1 | (define baidu-olime-jp-beginning-of-preedit-key '(generic-beginning-of-preedit-key)) 2 | (define baidu-olime-jp-beginning-of-preedit-key? (make-key-predicate '(generic-beginning-of-preedit-key?))) 3 | (define baidu-olime-jp-end-of-preedit-key '(generic-end-of-preedit-key)) 4 | (define baidu-olime-jp-end-of-preedit-key? (make-key-predicate '(generic-end-of-preedit-key?))) 5 | (define baidu-olime-jp-kill-key '(generic-kill-key)) 6 | (define baidu-olime-jp-kill-key? (make-key-predicate '(generic-kill-key?))) 7 | (define baidu-olime-jp-kill-backward-key '(generic-kill-backward-key)) 8 | (define baidu-olime-jp-kill-backward-key? (make-key-predicate '(generic-kill-backward-key?))) 9 | (define baidu-olime-jp-backspace-key '(generic-backspace-key)) 10 | (define baidu-olime-jp-backspace-key? (make-key-predicate '(generic-backspace-key?))) 11 | (define baidu-olime-jp-delete-key '(generic-delete-key)) 12 | (define baidu-olime-jp-delete-key? (make-key-predicate '(generic-delete-key?))) 13 | (define baidu-olime-jp-go-left-key '(generic-go-left-key)) 14 | (define baidu-olime-jp-go-left-key? (make-key-predicate '(generic-go-left-key?))) 15 | (define baidu-olime-jp-go-right-key '(generic-go-right-key)) 16 | (define baidu-olime-jp-go-right-key? (make-key-predicate '(generic-go-right-key?))) 17 | (define baidu-olime-jp-vi-escape-key '("escape" "[")) 18 | (define baidu-olime-jp-vi-escape-key? (make-key-predicate '("escape" "["))) 19 | -------------------------------------------------------------------------------- /mpd/mpd.conf: -------------------------------------------------------------------------------- 1 | # Adapted from 2 | # https://raw.githubusercontent.com/MusicPlayerDaemon/MPD/master/doc/mpdconf.example. 3 | 4 | music_directory "~/Music" 5 | # Automatically prune new/deleted files in the music_directory. 6 | auto_update "yes" 7 | 8 | # Allow saving playlists from vimpc. 9 | playlist_directory "~/Music/playlists" 10 | 11 | # Local output. 12 | audio_output { 13 | type "pulse" 14 | name "pulseaudio-output" 15 | } 16 | 17 | # Streaming output. You have to first control MPD via an SSH session. If you 18 | # did a toplevel `bind_to_address` and `port` configuration, you could control 19 | # MPD playback (think of it as a remote control) via the IP and port. However 20 | # we already have SSH access to this machine so there is no point in 21 | # configuring that. As soon as the playback *begins*, the IP and port here 22 | # become active clients can then connect to it. 23 | # 24 | # So the process is: 25 | # (1) start MPD playback via SSH 26 | # (2) run `mpv http://10.0.0.4:8030` to start listening to it from the client 27 | # 28 | audio_output { 29 | type "httpd" 30 | name "http-output" 31 | encoder "opus" 32 | port "8030" 33 | bind_to_address "10.0.0.4" 34 | bitrate "96000" 35 | format "48000:16:2" 36 | always_on "yes" 37 | tags "yes" 38 | } 39 | 40 | # Enable replay gain. 41 | replaygain "track" 42 | -------------------------------------------------------------------------------- /uim/customs/custom-global-keys2.scm: -------------------------------------------------------------------------------- 1 | (define generic-beginning-of-preedit-key '("home" "a")) 2 | (define generic-beginning-of-preedit-key? (make-key-predicate '("home" "a"))) 3 | (define generic-end-of-preedit-key '("end" "e")) 4 | (define generic-end-of-preedit-key? (make-key-predicate '("end" "e"))) 5 | (define generic-kill-key '("k")) 6 | (define generic-kill-key? (make-key-predicate '("k"))) 7 | (define generic-kill-backward-key '("u")) 8 | (define generic-kill-backward-key? (make-key-predicate '("u"))) 9 | (define generic-backspace-key '("backspace" "h")) 10 | (define generic-backspace-key? (make-key-predicate '("backspace" "h"))) 11 | (define generic-delete-key '("delete" "d")) 12 | (define generic-delete-key? (make-key-predicate '("delete" "d"))) 13 | (define generic-go-left-key '("left" "b")) 14 | (define generic-go-left-key? (make-key-predicate '("left" "b"))) 15 | (define generic-go-right-key '("right" "f")) 16 | (define generic-go-right-key? (make-key-predicate '("right" "f"))) 17 | (define generic-return-key '("return" "m")) 18 | (define generic-return-key? (make-key-predicate '("return" "m"))) 19 | -------------------------------------------------------------------------------- /uim/customs/custom-google-cgiapi-jp-keys2.scm: -------------------------------------------------------------------------------- 1 | (define google-cgiapi-jp-on-key '("\\" generic-on-key)) 2 | (define google-cgiapi-jp-on-key? (make-key-predicate '("\\" generic-on-key?))) 3 | (define google-cgiapi-jp-off-key '("\\" generic-off-key)) 4 | (define google-cgiapi-jp-off-key? (make-key-predicate '("\\" generic-off-key?))) 5 | (define google-cgiapi-jp-begin-conv-key '(generic-begin-conv-key)) 6 | (define google-cgiapi-jp-begin-conv-key? (make-key-predicate '(generic-begin-conv-key?))) 7 | (define google-cgiapi-jp-commit-key '(generic-commit-key)) 8 | (define google-cgiapi-jp-commit-key? (make-key-predicate '(generic-commit-key?))) 9 | (define google-cgiapi-jp-cancel-key '(generic-cancel-key)) 10 | (define google-cgiapi-jp-cancel-key? (make-key-predicate '(generic-cancel-key?))) 11 | (define google-cgiapi-jp-next-candidate-key '(generic-next-candidate-key)) 12 | (define google-cgiapi-jp-next-candidate-key? (make-key-predicate '(generic-next-candidate-key?))) 13 | (define google-cgiapi-jp-prev-candidate-key '(generic-prev-candidate-key)) 14 | (define google-cgiapi-jp-prev-candidate-key? (make-key-predicate '(generic-prev-candidate-key?))) 15 | (define google-cgiapi-jp-next-page-key '(generic-next-page-key)) 16 | (define google-cgiapi-jp-next-page-key? (make-key-predicate '(generic-next-page-key?))) 17 | (define google-cgiapi-jp-prev-page-key '(generic-prev-page-key)) 18 | (define google-cgiapi-jp-prev-page-key? (make-key-predicate '(generic-prev-page-key?))) 19 | -------------------------------------------------------------------------------- /nixos/w0/syschdemd.sh: -------------------------------------------------------------------------------- 1 | #! @shell@ 2 | 3 | set -e 4 | 5 | sw="/nix/var/nix/profiles/system/sw/bin" 6 | systemPath=`${sw}/readlink -f /nix/var/nix/profiles/system` 7 | 8 | # Needs root to work 9 | if [[ $EUID -ne 0 ]]; then 10 | echo "[ERROR] Requires root! :( Make sure the WSL default user is set to root" 11 | exit 1 12 | fi 13 | 14 | if [ ! -e "/run/current-system" ]; then 15 | LANG="C.UTF-8" /nix/var/nix/profiles/system/activate 16 | fi 17 | 18 | if [ ! -e "/run/systemd.pid" ]; then 19 | PATH=/run/current-system/systemd/lib/systemd:@fsPackagesPath@ \ 20 | LOCALE_ARCHIVE=/run/current-system/sw/lib/locale/locale-archive \ 21 | @daemonize@/bin/daemonize /run/current-system/sw/bin/unshare -fp --mount-proc systemd 22 | /run/current-system/sw/bin/pgrep -xf systemd > /run/systemd.pid 23 | 24 | # Wait for systemd to start 25 | status=1 26 | while [[ $status -gt 0 ]]; do 27 | $sw/sleep 1 28 | status=0 29 | $sw/nsenter -t $(< /run/systemd.pid) -p -m -- \ 30 | $sw/systemctl is-system-running -q --wait 2>/dev/null \ 31 | || status=$? 32 | done 33 | fi 34 | 35 | userShell=$($sw/getent passwd @defaultUser@ | $sw/cut -d: -f7) 36 | if [[ $# -gt 0 ]]; then 37 | # wsl seems to prefix with "-c" 38 | shift 39 | cmd="$@" 40 | else 41 | cmd="$userShell" 42 | fi 43 | exec $sw/nsenter -t $(< /run/systemd.pid) -p -m -- $sw/machinectl -q --uid=@defaultUser@ shell .host /bin/sh -c "cd \"$PWD\"; exec $cmd" 44 | -------------------------------------------------------------------------------- /script/git/ref-to-org-link.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # Given a Git commit SHA from either the command line or STDIN, get a link to 4 | # the upstream web page for that commit. Currently only GitHub is supported. 5 | 6 | set -euo pipefail 7 | 8 | get_upstream_link() 9 | { 10 | local sha="${1:-}" 11 | local remote 12 | 13 | # A remote will typically look like "git@github.com:foo/bar.git". We 14 | # have to clean this up to look like 15 | # "https://github.com/foo/bar/commit/". 16 | remote="$(git rev-parse --abbrev-ref --symbolic-full-name "@{u}")" 17 | 18 | # Get rid of the "/master" if the remote is "origin/master", so we just 19 | # have "origin". 20 | remote="${remote%/*}" 21 | 22 | remote="$(git remote get-url "${remote}")" 23 | case "${remote}" in 24 | git@github.com*) 25 | if [[ "${remote}" =~ git@github.com: ]]; then 26 | remote="${remote#git@github.com:}" 27 | remote="${remote%.git}" 28 | remote="https://github.com/${remote}" 29 | fi 30 | ;; 31 | *) 32 | echo >&2 "non-github upstreams are not supported" 33 | return 1 34 | ;; 35 | esac 36 | 37 | echo "${remote}/commit/${sha}" 38 | } 39 | 40 | main() 41 | { 42 | local sha="${1:-}" 43 | if [[ -z "${sha}" ]]; then 44 | sha=$([")) 18 | (define google-cgiapi-jp-vi-escape-key? (make-key-predicate '("escape" "["))) 19 | -------------------------------------------------------------------------------- /uim/customs/custom-anthy-keys1.scm: -------------------------------------------------------------------------------- 1 | (define anthy-next-segment-key '(generic-go-right-key)) 2 | (define anthy-next-segment-key? (make-key-predicate '(generic-go-right-key?))) 3 | (define anthy-prev-segment-key '(generic-go-left-key)) 4 | (define anthy-prev-segment-key? (make-key-predicate '(generic-go-left-key?))) 5 | (define anthy-extend-segment-key '("o" "right")) 6 | (define anthy-extend-segment-key? (make-key-predicate '("o" "right"))) 7 | (define anthy-shrink-segment-key '("i" "left")) 8 | (define anthy-shrink-segment-key? (make-key-predicate '("i" "left"))) 9 | (define anthy-transpose-as-hiragana-key '("F6" "Muhenkan")) 10 | (define anthy-transpose-as-hiragana-key? (make-key-predicate '("F6" "Muhenkan"))) 11 | (define anthy-transpose-as-katakana-key '("F7" "Muhenkan")) 12 | (define anthy-transpose-as-katakana-key? (make-key-predicate '("F7" "Muhenkan"))) 13 | (define anthy-transpose-as-halfkana-key '("F8" "Muhenkan")) 14 | (define anthy-transpose-as-halfkana-key? (make-key-predicate '("F8" "Muhenkan"))) 15 | (define anthy-transpose-as-halfwidth-alnum-key '("F10")) 16 | (define anthy-transpose-as-halfwidth-alnum-key? (make-key-predicate '("F10"))) 17 | (define anthy-transpose-as-fullwidth-alnum-key '("F9")) 18 | (define anthy-transpose-as-fullwidth-alnum-key? (make-key-predicate '("F9"))) 19 | (define anthy-commit-as-opposite-kana-key '()) 20 | (define anthy-commit-as-opposite-kana-key? (make-key-predicate '())) 21 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright (c) 2021, Linus Arver 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | * Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | * Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | -------------------------------------------------------------------------------- /uim/customs/custom-ajax-ime-keys1.scm: -------------------------------------------------------------------------------- 1 | (define ajax-ime-next-segment-key '(generic-go-right-key)) 2 | (define ajax-ime-next-segment-key? (make-key-predicate '(generic-go-right-key?))) 3 | (define ajax-ime-prev-segment-key '(generic-go-left-key)) 4 | (define ajax-ime-prev-segment-key? (make-key-predicate '(generic-go-left-key?))) 5 | (define ajax-ime-extend-segment-key '("o" "right")) 6 | (define ajax-ime-extend-segment-key? (make-key-predicate '("o" "right"))) 7 | (define ajax-ime-shrink-segment-key '("i" "left")) 8 | (define ajax-ime-shrink-segment-key? (make-key-predicate '("i" "left"))) 9 | (define ajax-ime-transpose-as-hiragana-key '("F6" "Muhenkan")) 10 | (define ajax-ime-transpose-as-hiragana-key? (make-key-predicate '("F6" "Muhenkan"))) 11 | (define ajax-ime-transpose-as-katakana-key '("F7" "Muhenkan")) 12 | (define ajax-ime-transpose-as-katakana-key? (make-key-predicate '("F7" "Muhenkan"))) 13 | (define ajax-ime-transpose-as-halfkana-key '("F8" "Muhenkan")) 14 | (define ajax-ime-transpose-as-halfkana-key? (make-key-predicate '("F8" "Muhenkan"))) 15 | (define ajax-ime-transpose-as-halfwidth-alnum-key '("F10")) 16 | (define ajax-ime-transpose-as-halfwidth-alnum-key? (make-key-predicate '("F10"))) 17 | (define ajax-ime-transpose-as-fullwidth-alnum-key '("F9")) 18 | (define ajax-ime-transpose-as-fullwidth-alnum-key? (make-key-predicate '("F9"))) 19 | (define ajax-ime-commit-as-opposite-kana-key '("q")) 20 | (define ajax-ime-commit-as-opposite-kana-key? (make-key-predicate '("q"))) 21 | -------------------------------------------------------------------------------- /uim/customs/custom-yahoo-jp-keys1.scm: -------------------------------------------------------------------------------- 1 | (define yahoo-jp-next-segment-key '(generic-go-right-key)) 2 | (define yahoo-jp-next-segment-key? (make-key-predicate '(generic-go-right-key?))) 3 | (define yahoo-jp-prev-segment-key '(generic-go-left-key)) 4 | (define yahoo-jp-prev-segment-key? (make-key-predicate '(generic-go-left-key?))) 5 | (define yahoo-jp-extend-segment-key '("o" "right")) 6 | (define yahoo-jp-extend-segment-key? (make-key-predicate '("o" "right"))) 7 | (define yahoo-jp-shrink-segment-key '("i" "left")) 8 | (define yahoo-jp-shrink-segment-key? (make-key-predicate '("i" "left"))) 9 | (define yahoo-jp-transpose-as-hiragana-key '("F6" "Muhenkan")) 10 | (define yahoo-jp-transpose-as-hiragana-key? (make-key-predicate '("F6" "Muhenkan"))) 11 | (define yahoo-jp-transpose-as-katakana-key '("F7" "Muhenkan")) 12 | (define yahoo-jp-transpose-as-katakana-key? (make-key-predicate '("F7" "Muhenkan"))) 13 | (define yahoo-jp-transpose-as-halfkana-key '("F8" "Muhenkan")) 14 | (define yahoo-jp-transpose-as-halfkana-key? (make-key-predicate '("F8" "Muhenkan"))) 15 | (define yahoo-jp-transpose-as-halfwidth-alnum-key '("F10")) 16 | (define yahoo-jp-transpose-as-halfwidth-alnum-key? (make-key-predicate '("F10"))) 17 | (define yahoo-jp-transpose-as-fullwidth-alnum-key '("F9")) 18 | (define yahoo-jp-transpose-as-fullwidth-alnum-key? (make-key-predicate '("F9"))) 19 | (define yahoo-jp-commit-as-opposite-kana-key '("q")) 20 | (define yahoo-jp-commit-as-opposite-kana-key? (make-key-predicate '("q"))) 21 | -------------------------------------------------------------------------------- /uim/customs/custom-elatin.scm: -------------------------------------------------------------------------------- 1 | (define elatin-rules 'elatin-rules-latin-prefix) 2 | (define elatin-esc-turns-off? #f) 3 | (define elatin-nr-candidates-max 10) 4 | (define elatin-numeral-key-selects-candidate? #t) 5 | (define elatin-use-completion? #f) 6 | (define elatin-show-all-if-ambiguous? #f) 7 | (define elatin-on-key '("\\")) 8 | (define elatin-on-key? (make-key-predicate '("\\"))) 9 | (define elatin-off-key '("\\")) 10 | (define elatin-off-key? (make-key-predicate '("\\"))) 11 | (define elatin-backspace-key '(generic-backspace-key)) 12 | (define elatin-backspace-key? (make-key-predicate '(generic-backspace-key?))) 13 | (define elatin-commit-key '(generic-commit-key)) 14 | (define elatin-commit-key? (make-key-predicate '(generic-commit-key?))) 15 | (define elatin-cancel-key '(generic-cancel-key)) 16 | (define elatin-cancel-key? (make-key-predicate '(generic-cancel-key?))) 17 | (define elatin-next-candidate-key '("down" "n")) 18 | (define elatin-next-candidate-key? (make-key-predicate '("down" "n"))) 19 | (define elatin-prev-candidate-key '("up" "p")) 20 | (define elatin-prev-candidate-key? (make-key-predicate '("up" "p"))) 21 | (define elatin-next-page-key '(generic-next-page-key)) 22 | (define elatin-next-page-key? (make-key-predicate '(generic-next-page-key?))) 23 | (define elatin-prev-page-key '(generic-prev-page-key)) 24 | (define elatin-prev-page-key? (make-key-predicate '(generic-prev-page-key?))) 25 | (define elatin-completion-key '("tab")) 26 | (define elatin-completion-key? (make-key-predicate '("tab"))) 27 | -------------------------------------------------------------------------------- /uim/customs/custom-social-ime-keys1.scm: -------------------------------------------------------------------------------- 1 | (define social-ime-next-segment-key '(generic-go-right-key)) 2 | (define social-ime-next-segment-key? (make-key-predicate '(generic-go-right-key?))) 3 | (define social-ime-prev-segment-key '(generic-go-left-key)) 4 | (define social-ime-prev-segment-key? (make-key-predicate '(generic-go-left-key?))) 5 | (define social-ime-extend-segment-key '("o" "right")) 6 | (define social-ime-extend-segment-key? (make-key-predicate '("o" "right"))) 7 | (define social-ime-shrink-segment-key '("i" "left")) 8 | (define social-ime-shrink-segment-key? (make-key-predicate '("i" "left"))) 9 | (define social-ime-transpose-as-hiragana-key '("F6" "Muhenkan")) 10 | (define social-ime-transpose-as-hiragana-key? (make-key-predicate '("F6" "Muhenkan"))) 11 | (define social-ime-transpose-as-katakana-key '("F7" "Muhenkan")) 12 | (define social-ime-transpose-as-katakana-key? (make-key-predicate '("F7" "Muhenkan"))) 13 | (define social-ime-transpose-as-halfkana-key '("F8" "Muhenkan")) 14 | (define social-ime-transpose-as-halfkana-key? (make-key-predicate '("F8" "Muhenkan"))) 15 | (define social-ime-transpose-as-halfwidth-alnum-key '("F10")) 16 | (define social-ime-transpose-as-halfwidth-alnum-key? (make-key-predicate '("F10"))) 17 | (define social-ime-transpose-as-fullwidth-alnum-key '("F9")) 18 | (define social-ime-transpose-as-fullwidth-alnum-key? (make-key-predicate '("F9"))) 19 | (define social-ime-commit-as-opposite-kana-key '("q")) 20 | (define social-ime-commit-as-opposite-kana-key? (make-key-predicate '("q"))) 21 | -------------------------------------------------------------------------------- /nixos/w0/configuration.nix: -------------------------------------------------------------------------------- 1 | { lib, pkgs, config, modulesPath, ... }: 2 | 3 | with lib; 4 | let 5 | defaultUser = "l"; 6 | syschdemd = import ./syschdemd.nix { inherit lib pkgs config defaultUser; }; 7 | in { 8 | imports = [ "${modulesPath}/profiles/minimal.nix" ]; 9 | 10 | # WSL is closer to a container than anything else 11 | boot.isContainer = true; 12 | 13 | environment.systemPackages = with pkgs; [ zsh ]; 14 | 15 | environment.etc.hosts.enable = false; 16 | environment.etc."resolv.conf".enable = false; 17 | 18 | environment.etc."wsl.conf".source = ./wsl.conf; 19 | environment.etc."resolv.conf".source = ./resolv.conf; 20 | 21 | networking.hostName = "w0"; 22 | networking.dhcpcd.enable = false; 23 | 24 | users.users.${defaultUser} = { 25 | isNormalUser = true; 26 | extraGroups = [ "wheel" ]; 27 | shell = pkgs.zsh; 28 | }; 29 | 30 | users.users.root = { 31 | shell = "${syschdemd}/bin/syschdemd"; 32 | # Otherwise WSL fails to login as root with "initgroups failed 5" 33 | extraGroups = [ "root" ]; 34 | }; 35 | 36 | security.sudo.wheelNeedsPassword = false; 37 | 38 | # Disable systemd units that don't make sense on WSL 39 | systemd.services."serial-getty@ttyS0".enable = false; 40 | systemd.services."serial-getty@hvc0".enable = false; 41 | systemd.services."getty@tty1".enable = false; 42 | systemd.services."autovt@".enable = false; 43 | 44 | systemd.services.firewall.enable = false; 45 | systemd.services.systemd-resolved.enable = false; 46 | systemd.services.systemd-udevd.enable = false; 47 | 48 | # Don't allow emergency mode, because we don't have a console. 49 | systemd.enableEmergencyMode = false; 50 | } 51 | -------------------------------------------------------------------------------- /nixos/overlay.nix: -------------------------------------------------------------------------------- 1 | # See https://nixos.org/manual/nixpkgs/stable/#chap-overlays for an overview of overlays. 2 | 3 | self: super: 4 | 5 | { 6 | # Taken from 7 | # http://lists.science.uu.nl/pipermail/nix-dev/2015-January/015601.html. We 8 | # add in some custom Haskell packages. 9 | haskellPackages = super.haskellPackages.override { 10 | overrides = self: super: { 11 | # Local packages not found on Hackage, but which still exist on the 12 | # local machine. As long as they have a .cabal file, we can use 13 | # `cabal2nix` to generate a Nix expression to build them. 14 | # 15 | # To generate the local package's nix expression, simply invoke 16 | # 17 | # cabal2nix path/to/folder/containing/cabal/file > project-name.nix 18 | # 19 | # . E.g., like this: 20 | # 21 | # cabal2nix ~/prog/auca > auca.nix 22 | # 23 | # . The `~/prog/auca` folder contains the `auca.cabal` file, which 24 | # will be looked up automatically by cabal2nix. Then, it's simply a 25 | # matter of moving the generated file to a folder inside ~/.nixpkgs, 26 | # and calling that file with `callPackage`. 27 | # 28 | # As for the local package itself, you can do 29 | # 30 | # cabal2nix --shell path/to/folder > shell.nix 31 | # 32 | # to create a nix-shell environment. You can just do `nix-shell` after 33 | # that to get ghci. For cabal2nix to work properly, you need to have 34 | # the `cabal` binary available. To do this, you should have 35 | # `haskellPackages.cabal-install` installed either on your system, or 36 | # through nix-env. 37 | auca = self.callPackage ./haskell/auca.nix { }; 38 | }; 39 | }; 40 | } 41 | -------------------------------------------------------------------------------- /uim/customs/custom-baidu-olime-jp-keys1.scm: -------------------------------------------------------------------------------- 1 | (define baidu-olime-jp-next-segment-key '(generic-go-right-key)) 2 | (define baidu-olime-jp-next-segment-key? (make-key-predicate '(generic-go-right-key?))) 3 | (define baidu-olime-jp-prev-segment-key '(generic-go-left-key)) 4 | (define baidu-olime-jp-prev-segment-key? (make-key-predicate '(generic-go-left-key?))) 5 | (define baidu-olime-jp-extend-segment-key '("o" "right")) 6 | (define baidu-olime-jp-extend-segment-key? (make-key-predicate '("o" "right"))) 7 | (define baidu-olime-jp-shrink-segment-key '("i" "left")) 8 | (define baidu-olime-jp-shrink-segment-key? (make-key-predicate '("i" "left"))) 9 | (define baidu-olime-jp-transpose-as-hiragana-key '("F6" "Muhenkan")) 10 | (define baidu-olime-jp-transpose-as-hiragana-key? (make-key-predicate '("F6" "Muhenkan"))) 11 | (define baidu-olime-jp-transpose-as-katakana-key '("F7" "Muhenkan")) 12 | (define baidu-olime-jp-transpose-as-katakana-key? (make-key-predicate '("F7" "Muhenkan"))) 13 | (define baidu-olime-jp-transpose-as-halfkana-key '("F8" "Muhenkan")) 14 | (define baidu-olime-jp-transpose-as-halfkana-key? (make-key-predicate '("F8" "Muhenkan"))) 15 | (define baidu-olime-jp-transpose-as-halfwidth-alnum-key '("F10")) 16 | (define baidu-olime-jp-transpose-as-halfwidth-alnum-key? (make-key-predicate '("F10"))) 17 | (define baidu-olime-jp-transpose-as-fullwidth-alnum-key '("F9")) 18 | (define baidu-olime-jp-transpose-as-fullwidth-alnum-key? (make-key-predicate '("F9"))) 19 | (define baidu-olime-jp-commit-as-opposite-kana-key '("q")) 20 | (define baidu-olime-jp-commit-as-opposite-kana-key? (make-key-predicate '("q"))) 21 | -------------------------------------------------------------------------------- /emacs/doom-cfg/init.el: -------------------------------------------------------------------------------- 1 | ;;; init.el -*- lexical-binding: t; -*- 2 | 3 | (doom! :input 4 | 5 | :completion 6 | corfu 7 | vertico 8 | 9 | :ui 10 | deft 11 | doom 12 | hl-todo 13 | modeline 14 | workspaces 15 | 16 | :editor 17 | (evil +everywhere) 18 | file-templates 19 | fold 20 | (format +onsave) 21 | multiple-cursors 22 | parinfer 23 | rotate-text 24 | snippets 25 | word-wrap 26 | 27 | :emacs 28 | dired 29 | electric 30 | ibuffer 31 | undo 32 | vc 33 | 34 | :term 35 | 36 | :checkers 37 | syntax 38 | (spell +aspell +everywhere) 39 | 40 | :tools 41 | direnv 42 | editorconfig 43 | (eval +overlay) 44 | lookup 45 | lsp 46 | magit 47 | terraform 48 | 49 | :os 50 | (:if IS-MAC macos) 51 | 52 | :lang 53 | (cc +lsp) 54 | (clojure +lsp) 55 | data 56 | dhall 57 | (elixir +lsp) 58 | emacs-lisp 59 | (go +lsp) 60 | (haskell +lsp) 61 | (javascript +lsp) 62 | (json +lsp) 63 | (latex +lsp) 64 | (lua +lsp) 65 | markdown 66 | nix 67 | (org +roam2) 68 | (python +lsp) 69 | rest 70 | (rust +lsp) 71 | (sh +lsp) 72 | (web +lsp) 73 | (yaml +lsp) 74 | 75 | :email 76 | notmuch 77 | 78 | :app 79 | everywhere 80 | 81 | :config 82 | (default +bindings +smartparens)) 83 | 84 | (setq doom-leader-key "," 85 | doom-leader-alt-key "C-," 86 | doom-localleader-key ", m" 87 | doom-localleader-alt-key "C-, m") 88 | -------------------------------------------------------------------------------- /uim/customs/custom-google-cgiapi-jp-keys1.scm: -------------------------------------------------------------------------------- 1 | (define google-cgiapi-jp-next-segment-key '(generic-go-right-key)) 2 | (define google-cgiapi-jp-next-segment-key? (make-key-predicate '(generic-go-right-key?))) 3 | (define google-cgiapi-jp-prev-segment-key '(generic-go-left-key)) 4 | (define google-cgiapi-jp-prev-segment-key? (make-key-predicate '(generic-go-left-key?))) 5 | (define google-cgiapi-jp-extend-segment-key '("o" "right")) 6 | (define google-cgiapi-jp-extend-segment-key? (make-key-predicate '("o" "right"))) 7 | (define google-cgiapi-jp-shrink-segment-key '("i" "left")) 8 | (define google-cgiapi-jp-shrink-segment-key? (make-key-predicate '("i" "left"))) 9 | (define google-cgiapi-jp-transpose-as-hiragana-key '("F6" "Muhenkan")) 10 | (define google-cgiapi-jp-transpose-as-hiragana-key? (make-key-predicate '("F6" "Muhenkan"))) 11 | (define google-cgiapi-jp-transpose-as-katakana-key '("F7" "Muhenkan")) 12 | (define google-cgiapi-jp-transpose-as-katakana-key? (make-key-predicate '("F7" "Muhenkan"))) 13 | (define google-cgiapi-jp-transpose-as-halfkana-key '("F8" "Muhenkan")) 14 | (define google-cgiapi-jp-transpose-as-halfkana-key? (make-key-predicate '("F8" "Muhenkan"))) 15 | (define google-cgiapi-jp-transpose-as-halfwidth-alnum-key '("F10")) 16 | (define google-cgiapi-jp-transpose-as-halfwidth-alnum-key? (make-key-predicate '("F10"))) 17 | (define google-cgiapi-jp-transpose-as-fullwidth-alnum-key '("F9")) 18 | (define google-cgiapi-jp-transpose-as-fullwidth-alnum-key? (make-key-predicate '("F9"))) 19 | (define google-cgiapi-jp-commit-as-opposite-kana-key '("q")) 20 | (define google-cgiapi-jp-commit-as-opposite-kana-key? (make-key-predicate '("q"))) 21 | -------------------------------------------------------------------------------- /zsh/func/dir_info: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # dir_info(), a function that acts as an intelligent "ls". This function is 4 | # used by univ_open() to display directory contents, but can be used independently. 5 | 6 | dir_info() 7 | { 8 | local file_count 9 | local mode 10 | local deref 11 | local thing 12 | 13 | mode="${1:-}" 14 | 15 | # Add a blank line for legibility. 16 | echo 17 | 18 | # List the contents of the given argument, but use "." (current directory) 19 | # if this argument is blank. If we are given a specific thing to list, make 20 | # sure to dereference any symlinks. 21 | thing="${2:-.}" 22 | if [[ -n "${thing}" ]]; then 23 | # Resolve symlinks. 24 | if [[ -L "${thing}" ]]; then 25 | echo " ${thing} -> $(readlink -f "${thing}")" 26 | echo " ---" 27 | thing="$(readlink -f "${thing}")" 28 | fi 29 | fi 30 | 31 | # NOP if there is nothing to show. 32 | file_count=$(ls -A1 "${thing}" | wc -l) 33 | if (( file_count == 0 )); then 34 | echo "($PWD is empty)" 35 | echo 36 | return 37 | fi 38 | 39 | case "${mode}" in 40 | verbose-by-name) 41 | ls -Aho --time-style=long-iso --color ${thing} \ 42 | | sed -e 's|^| |' 43 | ;; 44 | verbose-by-size) 45 | ls -AhoSr --time-style=long-iso --color ${thing} \ 46 | | sed -e 's|^| |' 47 | ;; 48 | verbose-by-date) 49 | ls -Ahotr --time-style=long-iso --color ${thing} \ 50 | | sed -e 's|^| |' 51 | ;; 52 | brief) 53 | ls -AC -w $((COLUMNS - 2)) --color ${thing} \ 54 | | sed 's|^| |' 55 | ;; 56 | *) 57 | echo >&2 "unrecognized mode \`${mode}'" 58 | return 1 59 | ;; 60 | esac 61 | 62 | # If this is a git root directory, then show a list of all remotes. 63 | if [[ -d .git ]]; then 64 | echo 65 | git remote -v 66 | fi 67 | 68 | # Add a blank line between us and the shell prompt for legibility. 69 | echo 70 | } 71 | -------------------------------------------------------------------------------- /uim/customs/custom-skk-keys2.scm: -------------------------------------------------------------------------------- 1 | (define skk-return-key '(generic-return-key)) 2 | (define skk-return-key? (make-key-predicate '(generic-return-key?))) 3 | (define skk-latin-conv-key '("/")) 4 | (define skk-latin-conv-key? (make-key-predicate '("/"))) 5 | (define skk-conv-wide-latin-key '("q")) 6 | (define skk-conv-wide-latin-key? (make-key-predicate '("q"))) 7 | (define skk-conv-opposite-case-key '("u")) 8 | (define skk-conv-opposite-case-key? (make-key-predicate '("u"))) 9 | (define skk-begin-completion-key '("tab" "i" skk-new-completion-from-current-comp-key)) 10 | (define skk-begin-completion-key? (make-key-predicate '("tab" "i" skk-new-completion-from-current-comp-key?))) 11 | (define skk-next-completion-key '("." "tab" "i")) 12 | (define skk-next-completion-key? (make-key-predicate '("." "tab" "i"))) 13 | (define skk-prev-completion-key '(",")) 14 | (define skk-prev-completion-key? (make-key-predicate '(","))) 15 | (define skk-new-completion-from-current-comp-key '("tab" "i")) 16 | (define skk-new-completion-from-current-comp-key? (make-key-predicate '("tab" "i"))) 17 | (define skk-special-midashi-key '(">" "<" "?")) 18 | (define skk-special-midashi-key? (make-key-predicate '(">" "<" "?"))) 19 | (define skk-vi-escape-key '("escape" "[")) 20 | (define skk-vi-escape-key? (make-key-predicate '("escape" "["))) 21 | (define skk-state-direct-no-preedit-nop-key '("j")) 22 | (define skk-state-direct-no-preedit-nop-key? (make-key-predicate '("j"))) 23 | (define skk-purge-candidate-key '("x")) 24 | (define skk-purge-candidate-key? (make-key-predicate '("x"))) 25 | -------------------------------------------------------------------------------- /nixos/k1/configuration.nix: -------------------------------------------------------------------------------- 1 | # See configuration.nix(5) manpage. 2 | { config, pkgs, ... }: 3 | 4 | { 5 | imports = [ ../extra.nix ./hardware-configuration.nix ]; 6 | 7 | boot.loader.grub.enable = true; 8 | boot.loader.grub.version = 2; 9 | boot.loader.grub.device = 10 | "/dev/disk/by-id/ata-FUJITSU_MHZ2320BH_G2_K623T922A38A"; 11 | boot.initrd.luks.devices = { 12 | root = { 13 | device = "/dev/disk/by-id/ata-FUJITSU_MHZ2320BH_G2_K623T922A38A-part3"; 14 | preLVM = true; 15 | }; 16 | }; 17 | 18 | # List packages installed in system profile. To search by name, run: 19 | # $ nix-env -qaP | grep wget 20 | # 21 | # The ones below help to bootstrap the system upon an initial NixOS install. 22 | environment.systemPackages = with pkgs; [ 23 | dhcpcd 24 | git 25 | gnumake 26 | vim 27 | wpa_supplicant 28 | ]; 29 | 30 | # KNOWN ISSUES 31 | # 32 | # - If we suspend with `systemctl suspend`, and then resume, the wireless 33 | # connection won't work. The command `ping www.google.com` won't work. To fix 34 | # this, manually invoke `systemctl restart network-addresses-wlp3s0.service`. 35 | networking = { 36 | hostName = "k1"; 37 | hostId = "518ab295"; 38 | # Enables wireless support via wpa_supplicant. 39 | wireless.enable = true; 40 | 41 | interfaces.wlp24s0.ipv4.addresses = [{ 42 | address = "10.0.0.5"; 43 | prefixLength = 24; 44 | }]; 45 | defaultGateway = "10.0.0.1"; 46 | nameservers = [ "8.8.8.8" ]; 47 | }; 48 | 49 | services.xserver = { 50 | videoDrivers = [ "intel" ]; 51 | synaptics = { 52 | enable = true; 53 | vertEdgeScroll = true; 54 | }; 55 | config = '' 56 | Section "InputClass" 57 | Identifier "touchpad catchall" 58 | Driver "synaptics" 59 | MatchIsTouchpad "on" 60 | MatchDevicePath "/dev/input/event*" 61 | Option "TapButton1" "0" 62 | Option "TapButton2" "0" 63 | Option "TapButton3" "0" 64 | EndSection 65 | ''; 66 | }; 67 | } 68 | -------------------------------------------------------------------------------- /script/seepr: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -euo pipefail 4 | 5 | # Checkout PR from GitHub into a local (uniquely named) branch for local 6 | # browsing. 7 | 8 | usage() 9 | { 10 | echo >&2 "usage: $(basename "${0}") " 11 | } 12 | 13 | get_desired_branch_name() 14 | { 15 | local remote 16 | local pr_number 17 | local branch 18 | remote="${1}" 19 | pr_number="${2}" 20 | branch="${remote}-PR${pr_number}-v1" 21 | 22 | echo "${branch}" 23 | } 24 | 25 | local_branch_name_exists() 26 | { 27 | git branch | grep -q "${1}" 28 | } 29 | 30 | get_unique_desired_branch_name() 31 | { 32 | local branch 33 | local counter 34 | local counter_len 35 | branch="${1}" 36 | 37 | if ! local_branch_name_exists "${branch}"; then 38 | echo "${branch}" 39 | return 40 | fi 41 | 42 | # If the branch name already exists, append a "-v" to it, like "-v0" or 43 | # "-v1". 44 | if [[ "${branch}" =~ .*-v([0-9]+)$ ]]; then 45 | counter="${BASH_REMATCH[1]}" 46 | counter_len="${#counter}" 47 | 48 | # Make it unique. 49 | if [[ -n "${counter:-}" ]]; then 50 | ((++counter)) 51 | fi 52 | 53 | # Strip the old counter and replace it with the new one to make this branch 54 | # unique. 55 | branch="${branch::-${counter_len}}" 56 | branch="${branch}${counter}" 57 | else 58 | # This should never happen, because we always append a "-v1" in 59 | # get_desired_branch_name. 60 | echo >&2 "error: could not uniquify branch name \`${branch}'" 61 | return 1 62 | fi 63 | 64 | echo "${branch}" 65 | } 66 | 67 | checkout_pr() 68 | { 69 | local branch 70 | local remote 71 | local pr_number 72 | remote="${1}" 73 | pr_number="${2}" 74 | branch=$(get_desired_branch_name "${1}" "${2}") 75 | branch=$(get_unique_desired_branch_name "${branch}") 76 | 77 | echo >&2 "using unique local branch name: \`$branch'" 78 | git fetch "${remote}" "pull/${pr_number}/head:${branch}" 79 | git checkout "${branch}" 80 | } 81 | 82 | main() 83 | { 84 | if (( $# != 2 )); then 85 | usage 86 | exit 1 87 | fi 88 | 89 | checkout_pr "${1}" "${2}" 90 | } 91 | 92 | main "$@" 93 | -------------------------------------------------------------------------------- /script/terminal-themes/renderControlSequences.dhall: -------------------------------------------------------------------------------- 1 | let Enumerated = { index : Natural, value : Text } 2 | 3 | let controlSequence = 4 | λ(forTmux : Bool) → 5 | if forTmux 6 | then { start = "\\x1bPtmux;\\x1b\\x1b]", end = "\\x07\\x1b\\\\" } 7 | else { start = "\\x1b]", end = "\\x07" } 8 | 9 | let setColor = 10 | λ(forTmux : Bool) → 11 | λ(code : Natural) → 12 | λ(color : Text) → 13 | '' 14 | printf '${ (controlSequence forTmux).start 15 | ++ Natural/show code 16 | ++ ";" 17 | ++ color 18 | ++ (controlSequence forTmux).end}' 19 | '' 20 | 21 | in λ(forTmux : Bool) → 22 | λ(theme : ./Theme) → 23 | '' 24 | # Foreground color. (Default text color). 25 | ${setColor forTmux 10 theme.foreground} 26 | 27 | # Background color. 28 | ${setColor forTmux 11 theme.background} 29 | 30 | # Cursor background color. 31 | ${setColor forTmux 12 theme.cursor} 32 | '' 33 | ++ ( if forTmux 34 | then '' 35 | # Set colors for TMUX status bar. We just recycle the colors defined 36 | # for the cursor. 37 | tmux set-environment L_TMUX_COLOR_TEXT "${theme.text}" 38 | tmux set-environment L_TMUX_COLOR_CURSOR "${theme.cursor}" 39 | tmux source-file ~/.tmux/colors.conf 40 | 41 | '' 42 | else '' 43 | export L_TMUX_COLOR_TEXT="${theme.text}" 44 | export L_TMUX_COLOR_CURSOR="${theme.cursor}" 45 | '' 46 | ) 47 | ++ '' 48 | # Remaining 16 colors. 49 | '' 50 | ++ List/fold 51 | Enumerated 52 | (List/indexed Text theme.palette16) 53 | Text 54 | ( λ(a : Enumerated) → 55 | λ(b : Text) → 56 | b ++ setColor forTmux 4 "${Natural/show a.index};${a.value}" 57 | ) 58 | "" 59 | -------------------------------------------------------------------------------- /script/tmux/get_window_format_test.clj: -------------------------------------------------------------------------------- 1 | (ns get-window-format-test 2 | (:require [clojure.test :refer [deftest is testing]] 3 | [get-window-format :as sut])) 4 | (deftest get-window-type 5 | (is (= :other-command (sut/get-window-type "" ""))) 6 | (is (= :other-command (sut/get-window-type "" "some-command"))) 7 | (is (= :zsh (sut/get-window-type "" "zsh"))) 8 | (is (= :ssh (sut/get-window-type "ssh" "some-command"))) 9 | (is (= :ssh (sut/get-window-type "" "ssh"))) 10 | (is (= :manually-named (sut/get-window-type "mnw->foo" "some-command")))) 11 | (deftest get-modified-window-name 12 | (is (= "foo" (sut/get-modified-window-name :manually-named "mnw->foo" "@1" "%2" "some-command" "/path/foo/bar"))) 13 | (is (= "ssh" (sut/get-modified-window-name :ssh "ssh" "@1" "%2" "some-command" "/path/foo/bar"))) 14 | (is (= "ssh->remote" (sut/get-modified-window-name :ssh "ssh->remote" "@1" "%2" "some-command" "/path/foo/bar"))) 15 | (is (= "/path/foo/bar" (sut/get-modified-window-name :zsh "ssh" "@1" "%2" "some-command" "/path/foo/bar"))) 16 | (is (= "some-command" (sut/get-modified-window-name :other-command "" "@1" "%2" "some-command" "/path/foo/bar")))) 17 | (deftest get-window-name-format 18 | (testing "manually named window" 19 | (is (= "#[bold bg=cyan fg=#343c48]*2#[bold bg=brightcyan fg=#343c48] foo #[default]" 20 | (sut/get-window-name-format "zsh" "/path/foo/bar" "mnw->foo" "@1" "%2" "*" "3" "1")))) 21 | (testing "zsh shows path" 22 | (is (= "#[bold bg=yellow fg=#343c48]*2#[bold bg=brightyellow fg=#343c48] /path #[default]" 23 | (sut/get-window-name-format "zsh" "/path" "zsh" "@1" "%2" "*" "3" "1")))) 24 | (testing "ssh" 25 | (is (= "#[bold bg=blue fg=#343c48]*2#[bold bg=brightblue fg=#343c48] ssh #[default]" 26 | (sut/get-window-name-format "ssh" "/path" "ssh" "@1" "%2" "*" "3" "1")))) 27 | (testing "other-command" 28 | (is (= "#[bold bg=green fg=#343c48]*2#[bold bg=brightgreen fg=#343c48] some-command #[default]" 29 | (sut/get-window-name-format "some-command" "/path" "some-command" "@1" "%2" "*" "3" "1"))))) 30 | -------------------------------------------------------------------------------- /notmuch/tags: -------------------------------------------------------------------------------- 1 | # Handle unprocessed ("raw") emails, tagging them as them "inbox" and "unread"; 2 | # but if they are filtered out of the inbox (aka "Skip the Inbox"), do not tag 3 | # them as "inbox" because that will put them back into the Inbox, going against 4 | # the intent of the Gmail filters. 5 | 6 | # For emails that were deleted using the web GUI (from the phone or elsewhere) 7 | # out of band, keep them in the trash. 8 | -raw -- tag:raw and tag:trash 9 | # Mark deleted emails (deleted from Notmuch via Emacs) to be moved to the trash. 10 | # We work with the "deleted" tag because the default "d" keybinding in Emacs for 11 | # notmuch adds the "deleted" tag (and we don't want to bother customizing that). 12 | +trash -inbox -deleted -- tag:deleted 13 | 14 | # Process all spam emails first (by making them ineligible for further 15 | # processing). In particular, this makes the "+unread -raw +inbox" rule avoid 16 | # considering them, keeping them out of the inbox. 17 | -raw -- tag:raw and tag:spam 18 | # Do the same for sent emails (skip processing them). 19 | -raw -- tag:raw and tag:sent 20 | 21 | # Tag all messages related to the git mailing list. Gmail filters will tag these 22 | # with "git" and "git/ci" and so on. Here we additionally give them a "list" tag 23 | # so that we can search across all emails related to the mailing list at once. 24 | +list +git -- tag:raw and to:git@vger.kernel.org 25 | +list +git/ci -- tag:raw and to:ci_activity@noreply.github.com and (to:gitgitgadget/git or to:listx/git) 26 | +list +git/ggg -- tag:raw and from:gitgitgadget 27 | 28 | # Tag all raw mailing list messages as being unread. It's important that we do 29 | # not tag it as "inbox" because that'll put it into the Inbox in Gmail the next 30 | # time lieer syncs. 31 | +unread -raw -inbox -- tag:raw and tag:list 32 | 33 | # Process read emails (don't tag already-read emails as unread). 34 | -raw -- tag:raw and (not tag:unread) 35 | 36 | # Tag all raw non-mailing-list messages as "inbox" and "unread". 37 | +unread -raw +inbox -- tag:raw and (not tag:list) 38 | -------------------------------------------------------------------------------- /script/terminal-themes/toColorMap.dhall: -------------------------------------------------------------------------------- 1 | let Enumerated = { index : Natural, value : Text } 2 | 3 | let Mapped = { mapKey : Text, mapValue : Text } 4 | 5 | let isIndex = 6 | λ(idx : Natural) → 7 | λ(n : Natural) → 8 | Natural/isZero (Natural/subtract n idx) 9 | && Natural/isZero (Natural/subtract idx n) 10 | 11 | let getColorName = 12 | λ(idx : Natural) → 13 | if Natural/isZero idx 14 | then "black" 15 | else if isIndex 1 idx 16 | then "red" 17 | else if isIndex 2 idx 18 | then "green" 19 | else if isIndex 3 idx 20 | then "yellow" 21 | else if isIndex 4 idx 22 | then "blue" 23 | else if isIndex 5 idx 24 | then "magenta" 25 | else if isIndex 6 idx 26 | then "cyan" 27 | else if isIndex 7 idx 28 | then "white" 29 | else if isIndex 8 idx 30 | then "brightblack" 31 | else if isIndex 9 idx 32 | then "brightred" 33 | else if isIndex 10 idx 34 | then "brightgreen" 35 | else if isIndex 11 idx 36 | then "brightyellow" 37 | else if isIndex 12 idx 38 | then "brightblue" 39 | else if isIndex 13 idx 40 | then "brightmagenta" 41 | else if isIndex 14 idx 42 | then "brightcyan" 43 | else if isIndex 15 idx 44 | then "brightwhite" 45 | else "?" 46 | 47 | in λ(theme : ./Theme) → 48 | [ { mapKey = "text", mapValue = theme.text } 49 | , { mapKey = "cursor", mapValue = theme.cursor } 50 | , { mapKey = "background", mapValue = theme.background } 51 | , { mapKey = "foreground", mapValue = theme.foreground } 52 | ] 53 | # List/fold 54 | Enumerated 55 | (List/reverse Enumerated (List/indexed Text theme.palette16)) 56 | (List Mapped) 57 | ( λ(a : Enumerated) → 58 | λ(b : List Mapped) → 59 | b # [ { mapKey = getColorName a.index, mapValue = a.value } ] 60 | ) 61 | ([] : List Mapped) 62 | # toMap theme.paletteExtra 63 | -------------------------------------------------------------------------------- /openvpn/ca.rsa.2048.crt: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIFqzCCBJOgAwIBAgIJAKZ7D5Yv87qDMA0GCSqGSIb3DQEBDQUAMIHoMQswCQYD 3 | VQQGEwJVUzELMAkGA1UECBMCQ0ExEzARBgNVBAcTCkxvc0FuZ2VsZXMxIDAeBgNV 4 | BAoTF1ByaXZhdGUgSW50ZXJuZXQgQWNjZXNzMSAwHgYDVQQLExdQcml2YXRlIElu 5 | dGVybmV0IEFjY2VzczEgMB4GA1UEAxMXUHJpdmF0ZSBJbnRlcm5ldCBBY2Nlc3Mx 6 | IDAeBgNVBCkTF1ByaXZhdGUgSW50ZXJuZXQgQWNjZXNzMS8wLQYJKoZIhvcNAQkB 7 | FiBzZWN1cmVAcHJpdmF0ZWludGVybmV0YWNjZXNzLmNvbTAeFw0xNDA0MTcxNzM1 8 | MThaFw0zNDA0MTIxNzM1MThaMIHoMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0Ex 9 | EzARBgNVBAcTCkxvc0FuZ2VsZXMxIDAeBgNVBAoTF1ByaXZhdGUgSW50ZXJuZXQg 10 | QWNjZXNzMSAwHgYDVQQLExdQcml2YXRlIEludGVybmV0IEFjY2VzczEgMB4GA1UE 11 | AxMXUHJpdmF0ZSBJbnRlcm5ldCBBY2Nlc3MxIDAeBgNVBCkTF1ByaXZhdGUgSW50 12 | ZXJuZXQgQWNjZXNzMS8wLQYJKoZIhvcNAQkBFiBzZWN1cmVAcHJpdmF0ZWludGVy 13 | bmV0YWNjZXNzLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAPXD 14 | L1L9tX6DGf36liA7UBTy5I869z0UVo3lImfOs/GSiFKPtInlesP65577nd7UNzzX 15 | lH/P/CnFPdBWlLp5ze3HRBCc/Avgr5CdMRkEsySL5GHBZsx6w2cayQ2EcRhVTwWp 16 | cdldeNO+pPr9rIgPrtXqT4SWViTQRBeGM8CDxAyTopTsobjSiYZCF9Ta1gunl0G/ 17 | 8Vfp+SXfYCC+ZzWvP+L1pFhPRqzQQ8k+wMZIovObK1s+nlwPaLyayzw9a8sUnvWB 18 | /5rGPdIYnQWPgoNlLN9HpSmsAcw2z8DXI9pIxbr74cb3/HSfuYGOLkRqrOk6h4RC 19 | OfuWoTrZup1uEOn+fw8CAwEAAaOCAVQwggFQMB0GA1UdDgQWBBQv63nQ/pJAt5tL 20 | y8VJcbHe22ZOsjCCAR8GA1UdIwSCARYwggESgBQv63nQ/pJAt5tLy8VJcbHe22ZO 21 | sqGB7qSB6zCB6DELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRMwEQYDVQQHEwpM 22 | b3NBbmdlbGVzMSAwHgYDVQQKExdQcml2YXRlIEludGVybmV0IEFjY2VzczEgMB4G 23 | A1UECxMXUHJpdmF0ZSBJbnRlcm5ldCBBY2Nlc3MxIDAeBgNVBAMTF1ByaXZhdGUg 24 | SW50ZXJuZXQgQWNjZXNzMSAwHgYDVQQpExdQcml2YXRlIEludGVybmV0IEFjY2Vz 25 | czEvMC0GCSqGSIb3DQEJARYgc2VjdXJlQHByaXZhdGVpbnRlcm5ldGFjY2Vzcy5j 26 | b22CCQCmew+WL/O6gzAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBDQUAA4IBAQAn 27 | a5PgrtxfwTumD4+3/SYvwoD66cB8IcK//h1mCzAduU8KgUXocLx7QgJWo9lnZ8xU 28 | ryXvWab2usg4fqk7FPi00bED4f4qVQFVfGfPZIH9QQ7/48bPM9RyfzImZWUCenK3 29 | 7pdw4Bvgoys2rHLHbGen7f28knT2j/cbMxd78tQc20TIObGjo8+ISTRclSTRBtyC 30 | GohseKYpTS9himFERpUgNtefvYHbn70mIOzfOJFTVqfrptf9jXa9N8Mpy3ayfodz 31 | 1wiqdteqFXkTYoSDctgKMiZ6GdocK9nMroQipIQtpnwd4yBDWIyC6Bvlkrq5TQUt 32 | YDQ8z9v+DMO6iwyIDRiU 33 | -----END CERTIFICATE----- 34 | -------------------------------------------------------------------------------- /zsh/func/gd: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | _gd() 4 | { 5 | ! git_contents && return 6 | 7 | local c_green="\x1b[1;32m" 8 | local c_magenta="\x1b[1;35m" 9 | local ce="\x1b[0m" 10 | 11 | local git_diff=$(git diff --color=always) 12 | local git_diff_c=$(git diff --cached --color=always) 13 | 14 | if [[ -z "$git_diff" && -z "$git_diff_c" ]]; then 15 | return 0 16 | fi 17 | 18 | local msg_diff="" 19 | local msg_diff_c="" 20 | if [[ -n "$git_diff" ]]; then 21 | # The sed '/^$/d' below is to remove the extra trailing whitespace 22 | # line that seems to get added into `git diff' but not `git diff 23 | # --cached'. 24 | msg_diff=$(vertical_label \ 25 | "git diff --color=always | sed '/^$/d'" \ 26 | "TREE ------------------------ " \ 27 | "$c_green") 28 | fi 29 | 30 | if [[ -n "$git_diff_c" ]]; then 31 | msg_diff_c=$(vertical_label \ 32 | "git diff --cached --color=always" \ 33 | "INDEX ------------------------ " \ 34 | "$c_magenta") 35 | fi 36 | 37 | if [[ -n "$git_diff" ]] && [[ -n "$git_diff_c" ]]; then 38 | # If we have two buffers to show, force less to pause before 39 | # showing the next one. We do this by unsetting the -F flag set in 40 | # ~/.lesskey. 41 | printf "$msg_diff" | less -+F 42 | printf "$msg_diff_c" | less 43 | elif [[ -n "$git_diff" ]]; then 44 | printf "$msg_diff" | less 45 | elif [[ -n "$git_diff_c" ]]; then 46 | printf "$msg_diff_c" | less 47 | fi 48 | } 49 | 50 | _gd_rs() 51 | { 52 | local git_diff="$(command gd diff --width=${COLUMNS})" 53 | local git_diff_c="$(command gd diff --width=${COLUMNS} --staged)" 54 | 55 | if [[ -z "$git_diff" && -z "$git_diff_c" ]]; then 56 | return 0 57 | fi 58 | 59 | if [[ -n "$git_diff" ]] && [[ -n "$git_diff_c" ]]; then 60 | # If we have two buffers to show, force less to pause before 61 | # showing the next one. We do this by unsetting the -F flag set in 62 | # ~/.lesskey. 63 | printf "$git_diff" | less -+F 64 | printf "$git_diff_c" | less 65 | elif [[ -n "$git_diff" ]]; then 66 | printf "$git_diff" | less 67 | elif [[ -n "$git_diff_c" ]]; then 68 | printf "$git_diff_c" | less 69 | fi 70 | } 71 | 72 | gd() 73 | { 74 | if whence -cp "gd" > /dev/null; then 75 | _gd_rs 76 | else 77 | _gd 78 | fi 79 | } 80 | 81 | 82 | gd 83 | -------------------------------------------------------------------------------- /script/tmux_get_status.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Usage: $0 4 | # 5 | # Generate the status line for tmux. 6 | 7 | set -euo pipefail 8 | 9 | # Imitate emacs evil-mode's "" and "" modal signifiers to help 10 | # distinguish between modes. When we're in "prefix mode", it is normal mode 11 | # "", where we can press any number of other keys without having to first 12 | # press C-b (the prefix key). By default we start out in "insert" mode "" 13 | # which is when keys are passed through to the underlying application. 14 | # 15 | # "" signifies copy-mode. We use "" because copy-mode resembles Vim's 16 | # visual selection mode. 17 | # 18 | # For other key tables, use the format "" if L_TMUX_DEBUG is set 19 | # to 1. 20 | # 21 | # Summary 22 | # 23 | # key-table or mode | indicator 24 | # --------------------+---------- 25 | # root | 26 | # prefix | 27 | # copy-mode/view-mode | 28 | # passthrough |

29 | # other | 30 | main() 31 | { 32 | local session_name 33 | local pane_mode 34 | local client_key_table 35 | 36 | session_name="${1}" 37 | pane_mode="${2}" 38 | client_key_table="${3}" 39 | 40 | local session_format 41 | local style1 42 | 43 | if [[ "${pane_mode}" =~ (copy|view)-mode ]]; then 44 | style1=" #[bg=green fg=${L_TMUX_COLOR_TEXT}] " 45 | elif [[ "${client_key_table}" == prefix ]]; then 46 | style1=" #[bg=blue fg=${L_TMUX_COLOR_TEXT}] " 47 | elif [[ "${client_key_table}" == root ]]; then 48 | style1=" #[bg=${L_TMUX_COLOR_TEXT} fg=${L_TMUX_COLOR_CURSOR}] " 49 | elif [[ "${client_key_table}" == passthrough ]]; then 50 | style1=" #[bg=cyan fg=${L_TMUX_COLOR_TEXT}]

" 51 | else 52 | # Display unrecognized key table names directly. 53 | style1=" #[bg=red fg=${L_TMUX_COLOR_TEXT}] <${client_key_table}> " 54 | fi 55 | 56 | session_format=" ${session_name} " 57 | # If we're SSH'ed into a nested tmux session, colorize the session name a 58 | # bit differently. 59 | if [[ -n "${SSH_CONNECTION:-}" ]]; then 60 | session_format="#[bg=blue] ${session_name} " 61 | fi 62 | 63 | echo "${session_format}#[bg=${L_TMUX_COLOR_TEXT}]${style1}#[bg=${L_TMUX_COLOR_TEXT}] " 64 | } 65 | 66 | main "$@" 67 | -------------------------------------------------------------------------------- /xorg/10-dual-monitor-hybrid-forest.conf: -------------------------------------------------------------------------------- 1 | Section "ServerLayout" 2 | Identifier "Layout0" 3 | Screen 0 "Acer0" 0 370 4 | Screen 1 "Acer1" 1680 0 5 | Option "Xinerama" "1" # XMonad: dual-head won't work properly without this! 6 | EndSection 7 | 8 | Section "Monitor" 9 | Identifier "Monitor0" 10 | VendorName "Unknown" 11 | ModelName "Acer X222W" 12 | HorizSync 31.0 - 81.0 13 | VertRefresh 56.0 - 75.0 14 | Option "DPMS" 15 | Option "Enable" "true" 16 | EndSection 17 | 18 | Section "Monitor" 19 | Identifier "Monitor1" 20 | VendorName "Unknown" 21 | ModelName "Acer X222W" 22 | HorizSync 31.0 - 81.0 23 | VertRefresh 56.0 - 75.0 24 | Option "DPMS" 25 | Option "Enable" "true" 26 | EndSection 27 | 28 | Section "Device" 29 | Identifier "Device0" 30 | Driver "nvidia" 31 | VendorName "NVIDIA Corporation" 32 | BoardName "GeForce 8800 GTS" 33 | BusID "PCI:1:0:0" 34 | Screen 0 35 | Option "NoLogo" "1" 36 | Option "UseEdidDpi" "False" 37 | Option "DPI" "90 x 90" # 22 inch monitor, 1680x1050 38 | EndSection 39 | 40 | Section "Device" 41 | Identifier "Device1" 42 | Driver "nvidia" 43 | VendorName "NVIDIA Corporation" 44 | BoardName "GeForce 8800 GTS" 45 | BusID "PCI:1:0:0" 46 | BusID "PCI:1:0:0" 47 | Screen 1 48 | Option "NoLogo" "1" 49 | Option "UseEdidDpi" "False" 50 | Option "DPI" "90 x 90" 51 | EndSection 52 | 53 | Section "Screen" 54 | Identifier "Acer0" 55 | Device "Device0" 56 | Monitor "Monitor0" 57 | DefaultDepth 24 58 | Option "metamodes" "DFP-1: 1680x1050 +0+0" 59 | SubSection "Display" 60 | Depth 24 61 | EndSubSection 62 | EndSection 63 | 64 | Section "Screen" 65 | Identifier "Acer1" 66 | Device "Device1" 67 | Monitor "Monitor1" 68 | DefaultDepth 24 69 | Option "metamodes" "DFP-0: 1680x1050 +0+0 { Rotation=right }" 70 | SubSection "Display" 71 | Depth 24 72 | EndSubSection 73 | EndSection 74 | -------------------------------------------------------------------------------- /script/find_long_lines_test.clj: -------------------------------------------------------------------------------- 1 | (ns find-long-lines-test 2 | (:require [clojure.test :refer [deftest is]] 3 | [find-long-lines :as subject])) 4 | (deftest expand-tabs 5 | (is (= "" (subject/expand-tabs ""))) 6 | (is (= " foo" (subject/expand-tabs "\tfoo"))) 7 | (is (= " foo" (subject/expand-tabs "\t\tfoo")))) 8 | (deftest truncate-long-urls 9 | (is (= "" (subject/truncate-long-urls ""))) 10 | (is (= "" (subject/truncate-long-urls 11 | "http://aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"))) 12 | (is (= "" (subject/truncate-long-urls 13 | "https://aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")))) 14 | (deftest truncate-long-paths 15 | (is (= "" (subject/truncate-long-paths ""))) 16 | (is (= "" (subject/truncate-long-paths 17 | "aaaaaaa/aaaaaaa/aaaaaaaaaaa/aaaaaaaaaa/aaaaaaaaaaaaaaa/aaaaa")))) 18 | (deftest truncate-long-contiguous-test 19 | (is (= "" (subject/truncate-long-contiguous-text ""))) 20 | (is (= "" (subject/truncate-long-contiguous-text 21 | ",,,,,,1,,2,,3,,,,,,,,,,oooo,,,,,,,,,,,,,,,;,,,,,?,,,,!,,,,,,")))) 22 | (deftest truncate-org-metadata 23 | (is (= "" (subject/truncate-org-metadata ""))) 24 | (is (= "" (subject/truncate-org-metadata "#+HTML_HEAD: foo"))) 25 | (is (= "" (subject/truncate-org-metadata "#+HEADER: foo"))) 26 | (is (= "" (subject/truncate-org-metadata "#+begin_src foo"))) 27 | (is (= " #+HEADER: foo" (subject/truncate-org-metadata " #+HEADER: foo")))) 28 | (deftest truncate-org-table-rows 29 | (is (= "" (subject/truncate-org-table-rows ""))) 30 | (is (= "" (subject/truncate-org-table-rows "| foo |"))) 31 | (is (= "" (subject/truncate-org-table-rows "| foo | bar |")))) 32 | (deftest truncate-org-links 33 | (is (= "" (subject/truncate-org-links ""))) 34 | (is (= "bar" (subject/truncate-org-links "[[foo][bar]]"))) 35 | (is (= "[[foo][bar]" (subject/truncate-org-links "[[foo][bar]")))) 36 | (deftest truncate-quoted-strings 37 | (is (= "" (subject/truncate-quoted-strings ""))) 38 | (is (= "" (subject/truncate-quoted-strings 39 | "'foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar'"))) 40 | (is (= "" (subject/truncate-quoted-strings 41 | "\"foobar foobar foobar foobar 'foobar foobar foobar foobar foobar foobar'\"")))) 42 | -------------------------------------------------------------------------------- /script/terminal-themes/color-tests/256colors2.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | # Author: Todd Larason 3 | # $XFree86: xc/programs/xterm/vttests/256colors2.pl,v 1.2 2002/03/26 01:46:43 dickey Exp $ 4 | 5 | # use the resources for colors 0-15 - usually more-or-less a 6 | # reproduction of the standard ANSI colors, but possibly more 7 | # pleasing shades 8 | 9 | # colors 16-231 are a 6x6x6 color cube 10 | for ($red = 0; $red < 6; $red++) { 11 | for ($green = 0; $green < 6; $green++) { 12 | for ($blue = 0; $blue < 6; $blue++) { 13 | printf("\x1b]4;%d;rgb:%2.2x/%2.2x/%2.2x\x1b\\", 14 | 16 + ($red * 36) + ($green * 6) + $blue, 15 | ($red ? ($red * 40 + 55) : 0), 16 | ($green ? ($green * 40 + 55) : 0), 17 | ($blue ? ($blue * 40 + 55) : 0)); 18 | } 19 | } 20 | } 21 | 22 | # colors 232-255 are a grayscale ramp, intentionally leaving out 23 | # black and white 24 | for ($gray = 0; $gray < 24; $gray++) { 25 | $level = ($gray * 10) + 8; 26 | printf("\x1b]4;%d;rgb:%2.2x/%2.2x/%2.2x\x1b\\", 27 | 232 + $gray, $level, $level, $level); 28 | } 29 | 30 | 31 | # display the colors 32 | 33 | # first the system ones: 34 | print "System colors:\n"; 35 | for ($color = 0; $color < 8; $color++) { 36 | print "\x1b[48;5;${color}m "; 37 | } 38 | 39 | # test basic colors 40 | print "\x1b[0m\n"; 41 | for ($color = 8; $color < 16; $color++) { 42 | print "\x1b[48;5;${color}m "; 43 | } 44 | print "\x1b[0m\n\n"; 45 | for ($color = 0; $color < 16; $color++) { 46 | my $hex = sprintf("%x", $color); 47 | if ($hex eq "0") { 48 | print "\x1b[48;5;${color};38;5;15m${hex}${hex}"; 49 | } elsif ($hex eq "8") { 50 | print "\x1b[48;5;${color};38;5;15m${hex}${hex}"; 51 | } else { 52 | print "\x1b[48;5;${color};38;5;0m${hex}${hex}"; 53 | } 54 | } 55 | print "\x1b[0m\n\n"; 56 | 57 | # now the color cube 58 | print "Color cube, 6x6x6:\n"; 59 | for ($green = 0; $green < 6; $green++) { 60 | for ($red = 0; $red < 6; $red++) { 61 | for ($blue = 0; $blue < 6; $blue++) { 62 | $color = 16 + ($red * 36) + ($green * 6) + $blue; 63 | print "\x1b[48;5;${color}m "; 64 | } 65 | print "\x1b[0m "; 66 | } 67 | print "\n"; 68 | } 69 | 70 | 71 | # now the grayscale ramp 72 | print "Grayscale ramp:\n"; 73 | for ($color = 232; $color < 256; $color++) { 74 | print "\x1b[48;5;${color}m "; 75 | } 76 | print "\x1b[0m\n"; 77 | -------------------------------------------------------------------------------- /xorg/10-dual-monitor-hybrid.conf: -------------------------------------------------------------------------------- 1 | Section "ServerLayout" 2 | Identifier "Layout0" 3 | Screen 0 "Screen0" 0 0 # NOTE: Screen 0 MUST be defined BEFORE Screen 1!!! 4 | Screen 1 "Screen1" 1050 295 # push this screen down (vertically) 295 pixels from the top to match the portrait monitor on the left 5 | Option "Xinerama" "1" # XMonad: dual-head won't work properly without this! 6 | EndSection 7 | 8 | Section "Extensions" 9 | Option "Composite" "Disable" 10 | EndSection 11 | 12 | Section "Monitor" 13 | Identifier "Monitor0" 14 | VendorName "Unknown" 15 | ModelName "Acer X222W" 16 | HorizSync 31.0 - 81.0 17 | VertRefresh 56.0 - 75.0 18 | Option "DPMS" 19 | Option "Enable" "true" 20 | EndSection 21 | 22 | Section "Monitor" 23 | Identifier "Monitor1" 24 | VendorName "Unknown" 25 | ModelName "Acer X222W" 26 | HorizSync 31.0 - 81.0 27 | VertRefresh 56.0 - 75.0 28 | Option "DPMS" 29 | Option "Enable" "true" 30 | EndSection 31 | 32 | Section "Device" 33 | Identifier "Device0" 34 | Driver "nvidia" 35 | VendorName "NVIDIA Corporation" 36 | BoardName "GeForce 8800 GTS" 37 | BusID "PCI:1:0:0" 38 | Screen 0 # i.e., the monitor on the LEFT (physically) 39 | Option "NoLogo" "1" 40 | Option "UseEdidDpi" "False" 41 | Option "DPI" "90 x 90" # 22 inch monitor, 1680x1050 42 | EndSection 43 | 44 | Section "Device" 45 | Identifier "Device1" 46 | Driver "nvidia" 47 | VendorName "NVIDIA Corporation" 48 | BoardName "GeForce 8800 GTS" 49 | BusID "PCI:1:0:0" 50 | Screen 1 # the monitor on the RIGHT (physically) 51 | Option "NoLogo" "1" 52 | Option "UseEdidDpi" "False" 53 | Option "DPI" "90 x 90" 54 | EndSection 55 | 56 | Section "Screen" 57 | 58 | Identifier "Screen0" 59 | Device "Device0" 60 | Monitor "Monitor0" 61 | DefaultDepth 24 62 | Option "metamodes" "DFP-0: 1680x1050 +0+0 { Rotation=left }" 63 | SubSection "Display" 64 | Depth 24 65 | EndSubSection 66 | EndSection 67 | 68 | Section "Screen" 69 | Identifier "Screen1" 70 | Device "Device1" 71 | Monitor "Monitor1" 72 | DefaultDepth 24 73 | Option "metamodes" "DFP-1: 1680x1050 +0+0" 74 | SubSection "Display" 75 | Depth 24 76 | EndSubSection 77 | EndSection 78 | -------------------------------------------------------------------------------- /script/find_long_lines.bb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bb 2 | (ns find-long-lines 3 | (:require [clojure.java.io :as io] 4 | [clojure.string :as str])) 5 | (def max-line-length 100) 6 | (def token-threshold 60) 7 | (def tab-width 8) 8 | (defn expand-tabs [line] 9 | (str/replace line "\t" (apply str (repeat tab-width \space)))) 10 | (defn truncate-long-urls 11 | [line] 12 | (if (re-find (re-pattern (str "https?://\\S{" token-threshold "}")) line) 13 | "" 14 | line)) 15 | (defn truncate-long-paths 16 | "Truncate lines that have long paths in them." 17 | [line] 18 | (if (re-find (re-pattern (str "[A-Za-z0-9-_./]{" token-threshold "}")) line) 19 | "" 20 | line)) 21 | (defn truncate-long-contiguous-text 22 | [line] 23 | (if (re-find (re-pattern (str "\\S{" token-threshold "}")) line) 24 | "" 25 | line)) 26 | (defn truncate-org-metadata [line] 27 | (let [l (str/lower-case line) 28 | ignored-prefixes ["#+html_head: " 29 | "#+header: " 30 | "#+begin_src "] 31 | ignorable (some #(str/starts-with? l %) ignored-prefixes)] 32 | (if ignorable 33 | "" 34 | line))) 35 | (defn truncate-org-table-rows [line] 36 | (if (and 37 | (str/starts-with? line "| ") 38 | (str/ends-with? line " |")) 39 | "" 40 | line)) 41 | (defn truncate-org-links [line] 42 | (str/replace line #"\[\[[^\]]+\]\[([^\]]+)\]\]" "$1")) 43 | (defn truncate-quoted-strings 44 | [line] 45 | (let [rgx #(re-pattern (str % "([^" % "]{" token-threshold ",})" %))] 46 | (-> line 47 | (str/replace (rgx "\"") "") 48 | (str/replace (rgx "'") "")))) 49 | (defn check-line 50 | [filename index line] 51 | (->> line 52 | expand-tabs 53 | truncate-long-urls 54 | truncate-long-paths 55 | truncate-long-contiguous-text 56 | truncate-org-metadata 57 | truncate-org-table-rows 58 | truncate-org-links 59 | truncate-quoted-strings 60 | (#(when (< max-line-length (count %)) 61 | (println (format "%s:%s:[%d] %s" 62 | filename 63 | (inc index) 64 | (count (expand-tabs line)) 65 | line)))))) 66 | (defn check-lines 67 | [filename] 68 | (with-open [rdr (io/reader filename)] 69 | (doseq [[index line] (map-indexed vector (line-seq rdr))] 70 | (check-line filename index line)))) 71 | (defn -main [& args] 72 | (run! check-lines args)) 73 | (when (= *file* (System/getProperty "babashka.file")) 74 | (apply -main *command-line-args*)) 75 | -------------------------------------------------------------------------------- /script/terminal-themes/renderAlacrittyColorYaml.dhall: -------------------------------------------------------------------------------- 1 | let Enumerated = { index : Natural, value : Text } 2 | 3 | let isIndex = 4 | λ(idx : Natural) → 5 | λ(n : Natural) → 6 | Natural/isZero (Natural/subtract n idx) 7 | && Natural/isZero (Natural/subtract idx n) 8 | 9 | let getColorName = 10 | λ(idx : Natural) → 11 | if Natural/isZero idx 12 | then "black: " 13 | else if isIndex 1 idx 14 | then "red: " 15 | else if isIndex 2 idx 16 | then "green: " 17 | else if isIndex 3 idx 18 | then "yellow: " 19 | else if isIndex 4 idx 20 | then "blue: " 21 | else if isIndex 5 idx 22 | then "magenta: " 23 | else if isIndex 6 idx 24 | then "cyan: " 25 | else if isIndex 7 idx 26 | then "white: " 27 | else if isIndex 8 idx 28 | then "black: " 29 | else if isIndex 9 idx 30 | then "red: " 31 | else if isIndex 10 idx 32 | then "green: " 33 | else if isIndex 11 idx 34 | then "yellow: " 35 | else if isIndex 12 idx 36 | then "blue: " 37 | else if isIndex 13 idx 38 | then "magenta: " 39 | else if isIndex 14 idx 40 | then "cyan: " 41 | else if isIndex 15 idx 42 | then "white: " 43 | else "black: " 44 | 45 | in λ(theme : ./Theme) → 46 | '' 47 | colors: 48 | cursor: 49 | text: '${theme.text}' 50 | cursor: '${theme.cursor}' 51 | primary: 52 | background: '${theme.background}' 53 | foreground: '${theme.foreground}' 54 | search: 55 | matches: 56 | foreground: '#000000' 57 | background: '#00ff00' 58 | normal: 59 | '' 60 | ++ List/fold 61 | Enumerated 62 | ( List/reverse 63 | { index : Natural, value : Text } 64 | (List/indexed Text theme.palette16) 65 | ) 66 | Text 67 | ( λ(a : Enumerated) → 68 | λ(b : Text) → 69 | b 70 | ++ ( if isIndex 8 a.index 71 | then '' 72 | bright: 73 | '' 74 | else "" 75 | ) 76 | ++ " " 77 | ++ getColorName a.index 78 | ++ '' 79 | '${a.value}' 80 | '' 81 | ) 82 | "" 83 | -------------------------------------------------------------------------------- /script/tmux_get_window_format.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Usage: $0 4 | # 5 | # Generate the window name and formatting/style/colors for all active and inactive windows. 6 | 7 | set -euo pipefail 8 | 9 | main() 10 | { 11 | local pane_current_command 12 | local pane_current_path 13 | local pane_id 14 | local window_name 15 | local window_id 16 | local window_name_generated 17 | local window_flags 18 | local window_panes 19 | local is_current_window 20 | 21 | pane_current_command="${1}" 22 | pane_current_path="${2}" 23 | window_name="${3}" 24 | window_id="${4}" 25 | pane_id="${5}" 26 | window_flags="${6}" 27 | window_panes="${7}" 28 | is_current_window="${8}" 29 | 30 | local pane_count 31 | local style1 32 | local style2 33 | 34 | # Manually-named windows ("mnw"). 35 | if [[ -n "${window_name:-}" ]] && [[ "${window_name}" =~ mnw-\> ]]; then 36 | window_name_generated="${window_name#mnw->}" 37 | style1="#[bg=black fg=cyan]" 38 | style2="#[bg=black fg=cyan]" 39 | if ((is_current_window)); then 40 | style1="#[bold bg=cyan fg=black]" 41 | style2="#[bold bg=brightcyan fg=black]" 42 | fi 43 | # SSH sessions are named (and colored) specially because they almost always 44 | # entail a nested tmux session. 45 | elif [[ "${window_name}" =~ ^ssh-\> ]]; then 46 | window_name_generated="${window_name}" 47 | style1="#[bg=black fg=blue]" 48 | style2="#[bg=black fg=blue]" 49 | if ((is_current_window)); then 50 | style1="#[bold bg=blue fg=black]" 51 | style2="#[bold bg=brightblue fg=black]" 52 | fi 53 | # Plain shell session --- show the shortened $PWD. 54 | elif [[ "${pane_current_command}" == zsh ]]; then 55 | window_name_generated="$(~/syscfg/script/tmux_pane_pwd_cached.sh "${window_id}" "${pane_id}" "${pane_current_path}")" 56 | style1="#[bg=black fg=yellow]" 57 | style2="#[bg=black fg=yellow]" 58 | if ((is_current_window)); then 59 | style1="#[bold bg=yellow fg=black]" 60 | style2="#[bold bg=brightyellow fg=black]" 61 | fi 62 | # Long-running command. Show the command name. 63 | else 64 | window_name_generated="${pane_current_command}" 65 | style1="#[bg=black fg=green]" 66 | style2="#[bg=black fg=green]" 67 | if ((is_current_window)); then 68 | style1="#[bold bg=green fg=black]" 69 | style2="#[bold bg=brightgreen fg=black]" 70 | fi 71 | fi 72 | 73 | if (("${window_panes}" > 1)); then 74 | pane_count="$((window_panes - 1))" 75 | else 76 | pane_count=" " 77 | fi 78 | 79 | echo "${style1}${window_flags:- }${pane_count}${style2} ${window_name_generated} #[default]" 80 | } 81 | 82 | main "$@" 83 | -------------------------------------------------------------------------------- /tig/.tigrc: -------------------------------------------------------------------------------- 1 | # Appearance. 2 | color cursor 16 green bold 3 | color title-blur 16 blue bold 4 | color title-focus 16 blue bold 5 | 6 | set blame-view = date:relative-compact author:abbreviated,maxwidth=5 id:width=8,color line-number:yes,interval=1 text 7 | set main-view = date:relative-compact author:abbreviated,maxwidth=5 id:width=8 commit-title:yes,graph,refs 8 | set tree-view = date:relative-compact author:abbreviated,maxwidth=5 id:width=8 file-name 9 | set refs-view = date:relative-compact author:abbreviated,maxwidth=5 id:width=8 ref commit-title 10 | 11 | set line-graphics = utf-8 12 | set blame-options = -w 13 | 14 | # Only show the top 500 commits. 15 | set main-options = -n500 16 | 17 | # Only show commits in the main view (don't show spurious, non-committed 18 | # changes). 19 | set show-changes = no 20 | 21 | # Disable conflicting keybindings (otherwise tig complains). 22 | bind generic none 23 | bind generic J none 24 | bind generic K none 25 | bind generic none 26 | bind generic none 27 | # Disable unused bindings. Otherwise they clutter up the [help] view. 28 | bind generic - none 29 | bind generic none 30 | bind generic none 31 | bind generic none 32 | bind generic none 33 | bind generic s none 34 | 35 | # Keybindings. 36 | bind generic , none 37 | bind generic h parent 38 | 39 | bind generic none 40 | bind generic l back 41 | 42 | bind generic none 43 | bind generic next 44 | 45 | bind generic none 46 | bind generic previous 47 | 48 | bind generic view-help 49 | bind generic o view-log 50 | 51 | # Copy 40-char hex string of commit. 52 | bind generic y +bash -c "git rev-parse %(commit) \ 53 | | head -c -1 \ 54 | | ~/syscfg/script/copy-clipboard.sh" 55 | 56 | # Copy human-readable description (short hex string, commit title, date). 57 | bind generic Y +bash -c "git show %(commit) --no-patch --pretty='format:%C(auto)%h (%s, %cd)' --date=short \ 58 | | ~/syscfg/script/copy-clipboard.sh" 59 | 60 | # Same as above, but as an Org-style link. y means Alt+y (M-y in Emacs). 61 | bind generic y +bash -c "git rev-parse %(commit) \ 62 | | head -c -1 \ 63 | | ~/syscfg/script/git/ref-to-org-link.sh \ 64 | | ~/syscfg/script/copy-clipboard.sh" 65 | 66 | # Copy commit message. 67 | bind generic +bash -c "git cat-file commit %(commit) \ 68 | | sed -e '1,/^$/d' \ 69 | | ~/syscfg/script/copy-clipboard.sh" 70 | 71 | # Force branch to point to current commit. 72 | bind main B ?+git branch -f "%(prompt Force branch to point here: )" %(commit) 73 | 74 | bind generic R none 75 | bind generic none 76 | bind generic refresh 77 | 78 | bind main R !git -c commit.verbose=true rebase -i %(commit) 79 | bind generic move-page-up 80 | -------------------------------------------------------------------------------- /nixos/k0/quadmon.conf: -------------------------------------------------------------------------------- 1 | # nvidia-settings: X configuration file generated by nvidia-settings 2 | # nvidia-settings: version 440.100 3 | 4 | Section "ServerLayout" 5 | Identifier "Layout0" 6 | Screen 0 "Screen0" 0 0 7 | InputDevice "Mouse0" "CorePointer" 8 | Option "Xinerama" "0" 9 | # Set up monitor poweroff settings. For our monitors, the option below is 10 | # the same as `xset dpms force off' after 60 minutes of inactivity, which 11 | # makes the screens display nothing but a black image, but does not 12 | # actually turn the monitors off. 13 | # 14 | # Also, suspending seems to do the same thing as stand by, so we disable it. 15 | # We also disable OffTime because it does not work properly on our hardware 16 | # (screen turns off only momentarily before coming back on). We need to set 17 | # these unused values to 0, because otherwise they are set to "10" (minutes) 18 | # by default. See `xset q' under the DPMS section for details. 19 | # 20 | # See https://wiki.archlinux.org/index.php/Display_Power_Management_Signaling 21 | Option "BlankTime" "60" 22 | Option "StandbyTime" "60" 23 | Option "SuspendTime" "0" 24 | Option "OffTime" "0" 25 | EndSection 26 | 27 | Section "InputDevice" 28 | # generated from default 29 | Identifier "Mouse0" 30 | Driver "mouse" 31 | Option "Protocol" "auto" 32 | Option "Device" "/dev/input/mice" 33 | Option "Emulate3Buttons" "no" 34 | Option "ZAxisMapping" "4 5" 35 | EndSection 36 | 37 | Section "Monitor" 38 | # HorizSync source: edid, VertRefresh source: edid 39 | Identifier "Monitor0" 40 | VendorName "Unknown" 41 | ModelName "HYO DUAL-DVI" 42 | HorizSync 88.8 - 88.8 43 | VertRefresh 60.0 44 | Option "DPMS" 45 | EndSection 46 | 47 | Section "Device" 48 | Identifier "Device0" 49 | Driver "nvidia" 50 | VendorName "NVIDIA Corporation" 51 | BoardName "Quadro K1200" 52 | Option "UseEdidDpi" "False" 53 | Option "DPI" "108 x 108" 54 | EndSection 55 | 56 | Section "Screen" 57 | Identifier "Screen0" 58 | Device "Device0" 59 | Monitor "Monitor0" 60 | DefaultDepth 24 61 | Option "Stereo" "0" 62 | Option "metamodes" "DP-6: nvidia-auto-select +0+0 {rotation=left}, DP-7: nvidia-auto-select +1440+0 {rotation=left}, DP-4: nvidia-auto-select +2880+0 {rotation=left}, DP-5: nvidia-auto-select +4320+0 {rotation=left}" 63 | Option "SLI" "Off" 64 | Option "MultiGPU" "Off" 65 | Option "BaseMosaic" "off" 66 | SubSection "Display" 67 | Depth 24 68 | EndSubSection 69 | EndSection 70 | 71 | -------------------------------------------------------------------------------- /uim/.uim: -------------------------------------------------------------------------------- 1 | (require-module "byeoru") 2 | (byeoru-define-layout byeoru-layout-hangul2 3 | 4 | ("a" (jungseong-o . 3)) 5 | ("A" (jungseong-o . 3)) 6 | 7 | ("y" (jungseong-u . 3)) 8 | ("Y" (jungseong-u . 3)) 9 | 10 | ("i" (jungseong-eu . 3)) 11 | ("I" (jungseong-eu . 3)) 12 | 13 | ("x" (jungseong-yo . 1)) 14 | ("X" (jungseong-yo . 1)) 15 | 16 | ("o" (jungseong-eo . 1) (jungseong-eo . 4)) 17 | ("O" (jungseong-eo . 1) (jungseong-eo . 4)) 18 | 19 | ("e" (jungseong-a . 1) (jungseong-a . 4)) 20 | ("E" (jungseong-a . 1) (jungseong-a . 4)) 21 | 22 | ("q" (jungseong-yeo . 1)) 23 | ("Q" (jungseong-yeo . 1)) 24 | 25 | ("p" (jungseong-e . 1) (jungseong-e . 4)) 26 | ("P" (jungseong-ye . 1)) 27 | 28 | ("u" (jungseong-i . 1) (jungseong-i . 4)) 29 | ("U" (jungseong-i . 1) (jungseong-i . 4)) 30 | 31 | ("v" (jungseong-ya . 1)) 32 | ("V" (jungseong-ya . 1)) 33 | 34 | ("w" (jungseong-ae . 1) (jungseong-ae . 4)) 35 | ("W" (jungseong-yae . 1)) 36 | 37 | ("z" (jungseong-yu . 1)) 38 | ("Z" (jungseong-yu . 1)) 39 | 40 | ("f" (choseong-pieup . 1) (jongseong-pieup . 1) (jongseong-pieup . 4)) 41 | ("F" (choseong-pieup . 1) (jongseong-pieup . 1) (jongseong-pieup . 4)) 42 | 43 | ("h" (choseong-digeud . 1) (jongseong-digeud . 1)) 44 | ("H" (choseong-ssangdigeud . 5)) 45 | 46 | ("b" (choseong-kieuk . 1) (jongseong-kieuk . 1)) 47 | ("B" (choseong-kieuk . 1) (jongseong-kieuk . 1)) 48 | 49 | ("d" (choseong-mieum . 1) (jongseong-mieum . 1) (jongseong-mieum . 4)) 50 | ("D" (choseong-mieum . 1) (jongseong-mieum . 1) (jongseong-mieum . 4)) 51 | 52 | ("j" (choseong-nieun . 1) (jongseong-nieun . 3)) 53 | ("J" (choseong-nieun . 1) (jongseong-nieun . 3)) 54 | 55 | ("m" (choseong-tieut . 1) (jongseong-tieut . 1) (jongseong-tieut . 4)) 56 | ("M" (choseong-tieut . 1) (jongseong-tieut . 1) (jongseong-tieut . 4)) 57 | 58 | ("t" (choseong-sios . 1) (jongseong-sios . 1) (jongseong-sios . 4)) 59 | ("T" (choseong-ssangsios . 5) (jongseong-ssangsios . 5)) 60 | 61 | ("k" (choseong-ieung . 1) (jongseong-ieung . 1)) 62 | ("K" (choseong-ieung . 1) (jongseong-ieung . 1)) 63 | 64 | ("g" (choseong-jieuj . 1) (jongseong-jieuj . 1) (jongseong-jieuj . 4)) 65 | ("G" (choseong-ssangjieuj . 5)) 66 | 67 | ("r" (choseong-hieuh . 1) (jongseong-hieuh . 1) (jongseong-hieuh . 4)) 68 | ("R" (choseong-hieuh . 1) (jongseong-hieuh . 1) (jongseong-hieuh . 4)) 69 | 70 | ("l" (choseong-giyeog . 1) (jongseong-giyeog . 3) (jongseong-giyeog . 4)) 71 | ("L" (choseong-ssanggiyeog . 5) (jongseong-ssanggiyeog . 5)) 72 | 73 | ("c" (choseong-bieub . 1) (jongseong-bieub . 3) (jongseong-bieub . 4)) 74 | ("C" (choseong-ssangbieub . 5)) 75 | 76 | ("n" (choseong-rieul . 1) (jongseong-rieul . 3)) 77 | ("N" (choseong-rieul . 1) (jongseong-rieul . 3)) 78 | 79 | ("s" (choseong-chieuch . 1) (jongseong-chieuch . 1)) 80 | ("S" (choseong-chieuch . 1) (jongseong-chieuch . 1)) 81 | 82 | ) 83 | -------------------------------------------------------------------------------- /emacs/doom-cfg/packages.el: -------------------------------------------------------------------------------- 1 | ;; -*- no-byte-compile: t; -*- 2 | ;;; $DOOMDIR/packages.el 3 | 4 | ;; To install a package with Doom you must declare them here and run 'doom sync' 5 | ;; on the command line, then restart Emacs for the changes to take effect -- or 6 | ;; use 'M-x doom/reload'. 7 | 8 | ;; To install SOME-PACKAGE from MELPA, ELPA or emacsmirror: 9 | ;(package! some-package) 10 | 11 | ;; To install a package directly from a remote git repo, you must specify a 12 | ;; `:recipe'. You'll find documentation on what `:recipe' accepts here: 13 | ;; https://github.com/raxod502/straight.el#the-recipe-format 14 | ;(package! another-package 15 | ; :recipe (:host github :repo "username/repo")) 16 | 17 | ;; If the package you are trying to install does not contain a PACKAGENAME.el 18 | ;; file, or is located in a subdirectory of the repo, you'll need to specify 19 | ;; `:files' in the `:recipe': 20 | ;(package! this-package 21 | ; :recipe (:host github :repo "username/repo" 22 | ; :files ("some-file.el" "src/lisp/*.el"))) 23 | 24 | ;; If you'd like to disable a package included with Doom, you can do so here 25 | ;; with the `:disable' property: 26 | ;(package! builtin-package :disable t) 27 | 28 | ;; You can override the recipe of a built in package without having to specify 29 | ;; all the properties for `:recipe'. These will inherit the rest of its recipe 30 | ;; from Doom or MELPA/ELPA/Emacsmirror: 31 | ;(package! builtin-package :recipe (:nonrecursive t)) 32 | ;(package! builtin-package-2 :recipe (:repo "myfork/package")) 33 | 34 | ;; Specify a `:branch' to install a package from a particular branch or tag. 35 | ;; This is required for some packages whose default branch isn't 'master' (which 36 | ;; our package manager can't deal with; see raxod502/straight.el#279) 37 | ;(package! builtin-package :recipe (:branch "develop")) 38 | 39 | ;; Use `:pin' to specify a particular commit to install. 40 | ;(package! builtin-package :pin "1a2b3c4d5e") 41 | 42 | 43 | ;; Doom's packages are pinned to a specific commit and updated from release to 44 | ;; release. The `unpin!' macro allows you to unpin single packages... 45 | ;(unpin! pinned-package) 46 | ;; ...or multiple packages 47 | ;(unpin! pinned-package another-pinned-package) 48 | ;; ...Or *all* packages (NOT RECOMMENDED; will likely break things) 49 | ;(unpin! t) 50 | (package! auto-dim-other-buffers) 51 | (package! citeproc) 52 | (package! hyperbole) 53 | (package! git-gutter) 54 | (package! org-appear) 55 | (package! org-auto-tangle) 56 | (package! org-fancy-priorities) 57 | (package! org-fc 58 | :recipe (:host github :repo "l3kn/org-fc" 59 | :files (:defaults "awk" "demo.org"))) 60 | (package! org-superstar) 61 | (package! protobuf-mode) 62 | (package! solaire-mode :disable t) 63 | (package! vim-empty-lines-mode) 64 | (package! ztree) 65 | -------------------------------------------------------------------------------- /xorg/10-dual-monitor-portrait.conf: -------------------------------------------------------------------------------- 1 | Section "ServerLayout" 2 | Identifier "Layout0" 3 | Screen 0 "Screen0" 0 0 # NOTE: Screen 0 MUST be defined BEFORE Screen 1!!! 4 | Screen 1 "Screen1" 1050 0 # push this screen down (vertically) 295 pixels from the top to match the portrait monitor on the left 5 | Option "Xinerama" "1" # XMonad: dual-head won't work properly without this! 6 | EndSection 7 | 8 | Section "Extensions" 9 | Option "Composite" "Disable" 10 | EndSection 11 | 12 | Section "Monitor" 13 | Identifier "Monitor0" 14 | VendorName "Unknown" 15 | ModelName "Acer X222W" 16 | HorizSync 31.0 - 81.0 17 | VertRefresh 56.0 - 75.0 18 | Option "DPMS" 19 | EndSection 20 | 21 | Section "Monitor" 22 | Identifier "Monitor1" 23 | VendorName "Unknown" 24 | ModelName "Acer X222W" 25 | HorizSync 31.0 - 81.0 26 | VertRefresh 56.0 - 75.0 27 | Option "DPMS" 28 | EndSection 29 | 30 | Section "Device" 31 | Identifier "Device0" 32 | Driver "nvidia" 33 | VendorName "NVIDIA Corporation" 34 | BoardName "GeForce 8800 GTS" 35 | BusID "PCI:2:0:0" 36 | Screen 0 # i.e., the monitor on the LEFT (physically) 37 | Option "NoLogo" "1" 38 | Option "UseEdidDpi" "False" 39 | Option "DPI" "90 x 90" # 22 inch monitor, 1680x1050 40 | EndSection 41 | 42 | Section "Device" 43 | Identifier "Device1" 44 | Driver "nvidia" 45 | VendorName "NVIDIA Corporation" 46 | BoardName "GeForce 8800 GTS" 47 | BusID "PCI:2:0:0" 48 | Screen 1 # the monitor on the RIGHT (physically) 49 | Option "NoLogo" "1" 50 | Option "UseEdidDpi" "False" 51 | Option "DPI" "90 x 90" 52 | EndSection 53 | 54 | Section "Screen" 55 | 56 | Identifier "Screen0" 57 | Device "Device0" 58 | Monitor "Monitor0" 59 | DefaultDepth 24 60 | Option "Stereo" "0" 61 | Option "metamodes" "DVI-I-2: 1680x1050 +0+0 { rotation=left }" 62 | Option "SLI" "Off" 63 | Option "MultiGPU" "Off" 64 | Option "BaseMosaic" "off" 65 | SubSection "Display" 66 | Depth 24 67 | EndSubSection 68 | EndSection 69 | 70 | Section "Screen" 71 | Identifier "Screen1" 72 | Device "Device1" 73 | Monitor "Monitor1" 74 | DefaultDepth 24 75 | Option "Stereo" "0" 76 | Option "metamodes" "DVI-I-3: 1680x1050 +0+0 { rotation=right }" 77 | Option "SLI" "Off" 78 | Option "MultiGPU" "Off" 79 | Option "BaseMosaic" "off" 80 | SubSection "Display" 81 | Depth 24 82 | EndSubSection 83 | EndSection 84 | -------------------------------------------------------------------------------- /notmuch/notmuch-config: -------------------------------------------------------------------------------- 1 | # .notmuch-config - Configuration file for the notmuch mail system 2 | # 3 | # For more information about notmuch, see https://notmuchmail.org 4 | # Database configuration 5 | # 6 | # The only value supported here is 'path' which should be the top-level 7 | # directory where your mail currently exists and to where mail will be 8 | # delivered in the future. Files should be individual email messages. 9 | # Notmuch will store its database within a sub-directory of the path 10 | # configured here named ".notmuch". 11 | # 12 | [database] 13 | # User configuration 14 | # 15 | # Here is where you can let notmuch know how you would like to be 16 | # addressed. Valid settings are 17 | # 18 | # name Your full name. 19 | # primary_email Your primary email address. 20 | # other_email A list (separated by ';') of other email addresses 21 | # at which you receive email. 22 | # 23 | # Notmuch will use the various email addresses configured here when 24 | # formatting replies. It will avoid including your own addresses in the 25 | # recipient list of replies, and will set the From address based on the 26 | # address to which the original email was addressed. 27 | # 28 | [user] 29 | name=Linus Arver 30 | primary_email=linus@ucla.edu 31 | other_email=linusarver@gmail.com 32 | # Configuration for "notmuch new" 33 | # 34 | # The following options are supported here: 35 | # 36 | # tags A list (separated by ';') of the tags that will be 37 | # added to all messages incorporated by "notmuch new". 38 | # 39 | # ignore A list (separated by ';') of file and directory names 40 | # that will not be searched for messages by "notmuch new". 41 | # 42 | # NOTE: *Every* file/directory that goes by one of those 43 | # names will be ignored, independent of its depth/location 44 | # in the mail store. 45 | # 46 | [new] 47 | # Tag all new mails as "raw" (unprocessed). 48 | tags=raw; 49 | # Search configuration 50 | # 51 | # The following option is supported here: 52 | # 53 | # exclude_tags 54 | # A ;-separated list of tags that will be excluded from 55 | # search results by default. Using an excluded tag in a 56 | # query will override that exclusion. 57 | # 58 | [search] 59 | exclude_tags=deleted;trash;spam; 60 | # Maildir compatibility configuration 61 | # 62 | # The following option is supported here: 63 | # 64 | # synchronize_flags Valid values are true and false. 65 | # 66 | # If true, then the following maildir flags (in message filenames) 67 | # will be synchronized with the corresponding notmuch tags: 68 | # 69 | # Flag Tag 70 | # ---- ------- 71 | # D draft 72 | # F flagged 73 | # P passed 74 | # R replied 75 | # S unread (added when 'S' flag is not present) 76 | # 77 | # The "notmuch new" command will notice flag changes in filenames 78 | # and update tags, while the "notmuch tag" and "notmuch restore" 79 | # commands will notice tag changes and update flags in filenames 80 | # 81 | [maildir] 82 | -------------------------------------------------------------------------------- /uim/customs/custom-tutcode-keys1.scm: -------------------------------------------------------------------------------- 1 | (define tutcode-on-key '("\\" generic-on-key)) 2 | (define tutcode-on-key? (make-key-predicate '("\\" generic-on-key?))) 3 | (define tutcode-off-key '("\\" generic-off-key)) 4 | (define tutcode-off-key? (make-key-predicate '("\\" generic-off-key?))) 5 | (define tutcode-kana-toggle-key '("'")) 6 | (define tutcode-kana-toggle-key? (make-key-predicate '("'"))) 7 | (define tutcode-katakana-sequence "") 8 | (define tutcode-hiragana-sequence "") 9 | (define tutcode-kigou-toggle-key '("_")) 10 | (define tutcode-kigou-toggle-key? (make-key-predicate '("_"))) 11 | (define tutcode-kigou2-toggle-key '()) 12 | (define tutcode-kigou2-toggle-key? (make-key-predicate '())) 13 | (define tutcode-mazegaki-start-sequence "alj") 14 | (define tutcode-bushu-start-sequence "ala") 15 | (define tutcode-interactive-bushu-start-sequence "") 16 | (define tutcode-latin-conv-start-sequence "al/") 17 | (define tutcode-kanji-code-input-start-sequence "") 18 | (define tutcode-history-start-sequence "") 19 | (define tutcode-auto-help-redisplay-sequence "") 20 | (define tutcode-auto-help-dump-sequence "") 21 | (define tutcode-katakana-commit-key '()) 22 | (define tutcode-katakana-commit-key? (make-key-predicate '())) 23 | (define tutcode-stroke-help-toggle-key '("/")) 24 | (define tutcode-stroke-help-toggle-key? (make-key-predicate '("/"))) 25 | (define tutcode-begin-completion-key '(".")) 26 | (define tutcode-begin-completion-key? (make-key-predicate '("."))) 27 | (define tutcode-begin-conv-key '(generic-begin-conv-key)) 28 | (define tutcode-begin-conv-key? (make-key-predicate '(generic-begin-conv-key?))) 29 | (define tutcode-commit-key '(generic-commit-key)) 30 | (define tutcode-commit-key? (make-key-predicate '(generic-commit-key?))) 31 | (define tutcode-cancel-key '("u" generic-cancel-key)) 32 | (define tutcode-cancel-key? (make-key-predicate '("u" generic-cancel-key?))) 33 | (define tutcode-next-candidate-key '(generic-next-candidate-key)) 34 | (define tutcode-next-candidate-key? (make-key-predicate '(generic-next-candidate-key?))) 35 | (define tutcode-prev-candidate-key '("delete" generic-prev-candidate-key)) 36 | (define tutcode-prev-candidate-key? (make-key-predicate '("delete" generic-prev-candidate-key?))) 37 | (define tutcode-undo-sequence "") 38 | (define tutcode-help-sequence "") 39 | (define tutcode-help-clipboard-sequence "") 40 | (define tutcode-paste-key '()) 41 | (define tutcode-paste-key? (make-key-predicate '())) 42 | (define tutcode-clipboard-seq2kanji-start-sequence "") 43 | (define tutcode-selection-mazegaki-start-sequence "") 44 | (define tutcode-selection-mazegaki-inflection-start-sequence "") 45 | (define tutcode-selection-katakana-start-sequence "") 46 | (define tutcode-selection-kanji2seq-start-sequence "") 47 | (define tutcode-selection-seq2kanji-start-sequence "") 48 | -------------------------------------------------------------------------------- /uim/customs/custom-tutcode.scm: -------------------------------------------------------------------------------- 1 | (define tutcode-dic-filename "/nix/store/hh2yvp4k0g1mxd77m0hqf2x20w1xxllw-uim-1.8.6/share/tc/mazegaki.dic") 2 | (define tutcode-personal-dic-filename "/home/l/.mazegaki.dic") 3 | (define tutcode-rule-filename "/nix/store/hh2yvp4k0g1mxd77m0hqf2x20w1xxllw-uim-1.8.6/share/uim/tutcode-rule.scm") 4 | (define tutcode-enable-mazegaki-learning? #t) 5 | (define tutcode-mazegaki-fixed-priority-count 0) 6 | (define tutcode-use-recursive-learning? #t) 7 | (define tutcode-use-with-vi? #f) 8 | (define tutcode-show-pending-rk? #f) 9 | (define tutcode-use-dvorak? #f) 10 | (define tutcode-use-kigou2-mode? #f) 11 | (define tutcode-enable-fallback-surrounding-text? #f) 12 | (define tutcode-keep-illegal-sequence? #f) 13 | (define tutcode-delete-leading-delimiter-on-postfix-kanji2seq? #f) 14 | (define tutcode-history-size 0) 15 | (define tutcode-mazegaki-yomi-max 10) 16 | (define tutcode-mazegaki-enable-inflection? #f) 17 | (define tutcode-mazegaki-suffix-max 4) 18 | (define tutcode-bushu-conversion-algorithm 'tc-2.1+ml1925) 19 | (define tutcode-use-interactive-bushu-conversion? #f) 20 | (define tutcode-bushu-index2-filename "/nix/store/hh2yvp4k0g1mxd77m0hqf2x20w1xxllw-uim-1.8.6/share/tc/bushu.index2") 21 | (define tutcode-bushu-expand-filename "/nix/store/hh2yvp4k0g1mxd77m0hqf2x20w1xxllw-uim-1.8.6/share/tc/bushu.expand") 22 | (define tutcode-bushu-help-filename "") 23 | (define tutcode-use-candidate-window? #t) 24 | (define tutcode-use-pseudo-table-style? #f) 25 | (define tutcode-candidate-window-table-layout 'qwerty-jis) 26 | (define tutcode-commit-candidate-by-label-key 'always) 27 | (define tutcode-candidate-op-count 5) 28 | (define tutcode-nr-candidate-max 10) 29 | (define tutcode-nr-candidate-max-for-kigou-mode 10) 30 | (define tutcode-nr-candidate-max-for-prediction 10) 31 | (define tutcode-nr-candidate-max-for-guide 10) 32 | (define tutcode-nr-candidate-max-for-history 10) 33 | (define tutcode-use-stroke-help-window? #f) 34 | (define tutcode-show-stroke-help-window-on-no-input? #t) 35 | (define tutcode-use-auto-help-window? #f) 36 | (define tutcode-auto-help-with-real-keys? #f) 37 | (define tutcode-candidate-window-use-delay? #f) 38 | (define tutcode-candidate-window-activate-delay-for-mazegaki 0) 39 | (define tutcode-candidate-window-activate-delay-for-stroke-help 2) 40 | (define tutcode-candidate-window-activate-delay-for-auto-help 1) 41 | (define tutcode-candidate-window-activate-delay-for-completion 2) 42 | (define tutcode-candidate-window-activate-delay-for-prediction 2) 43 | (define tutcode-candidate-window-activate-delay-for-bushu-prediction 2) 44 | (define tutcode-candidate-window-activate-delay-for-interactive-bushu 1) 45 | (define tutcode-use-completion? #f) 46 | (define tutcode-completion-chars-min 2) 47 | (define tutcode-completion-chars-max 5) 48 | (define tutcode-use-prediction? #f) 49 | (define tutcode-prediction-start-char-count 2) 50 | (define tutcode-use-kanji-combination-guide? #f) 51 | (define tutcode-stroke-help-with-kanji-combination-guide 'disable) 52 | (define tutcode-use-bushu-prediction? #f) 53 | -------------------------------------------------------------------------------- /zsh/func/gsts: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | gsts_print() 4 | { 5 | if [[ $for_prompt == for_prompt ]]; then 6 | print -n $1 7 | else 8 | print -nP $1 9 | fi 10 | } 11 | 12 | gsts_hash() 13 | { 14 | local g_hash=$(git rev-parse --short HEAD) 15 | gsts_print "$g_hash" 16 | } 17 | 18 | gsts_ref() 19 | { 20 | local g_ref=$(git rev-parse --abbrev-ref HEAD) 21 | if [[ $g_ref == HEAD ]]; then 22 | g_ref=" $(git rev-parse HEAD)" 23 | fi 24 | gsts_print "$g_ref" 25 | } 26 | 27 | # Adapted from http://www.zsh.org/mla/users/2016/msg00664.html. 28 | gsts_upstream_divergence() { 29 | git rev-parse @{upstream} >/dev/null 2>&1 || return 30 | local -a x 31 | x=( $(git rev-list --left-right --count HEAD...@{upstream}) ) 32 | if (( x[1] )) || (( x[2] )); then 33 | if (( x[1] )); then 34 | gsts_print "%B%F{green}\u25b2%b%f" 35 | fi 36 | if (( x[2] )); then 37 | gsts_print "%B%F{red}\u25bc%b%f" 38 | fi 39 | else 40 | gsts_print "%B%F{default}\u25cf%b%f" 41 | fi 42 | } 43 | 44 | gsts_bare() 45 | { 46 | local g_ref=$(gsts_ref) 47 | local g_hash=$(gsts_hash) 48 | gsts_print ":$g_hash:$g_ref" 49 | } 50 | 51 | gsts_nonbare() 52 | { 53 | local g_path=$(git rev-parse --show-toplevel) 54 | 55 | local g_ref=$(gsts_ref) 56 | local g_hash=$(gsts_hash) 57 | 58 | local g_diff=$(git diff) 59 | local g_diffc=$(git diff --cached) 60 | local g_changed="-" 61 | if [[ -n $g_diff && -n $g_diffc ]]; then 62 | g_changed="%B%F{208}X%b%f" 63 | elif [[ -n $g_diff ]]; then 64 | g_changed="%B%F{green}C%b%f" 65 | elif [[ -n $g_diffc ]]; then 66 | g_changed="%B%F{magenta}S%b%f" 67 | fi 68 | 69 | local g_untracked=$(git -C "$g_path" ls-files --other --exclude-standard \ 70 | | wc -l) 71 | if (( $g_untracked == 0 )); then 72 | g_untracked="-" 73 | else 74 | if (( $g_untracked > 9 )); then 75 | g_untracked="!" 76 | fi 77 | g_untracked="%B%F{yellow}${g_untracked}%b%f" 78 | fi 79 | 80 | local g_stashed=$(git stash list | wc -l) 81 | if (( $g_stashed == 0 )); then 82 | g_stashed="-" 83 | else 84 | if (( $g_stashed > 9 )); then 85 | g_stashed="!" 86 | fi 87 | g_stashed="%B%F{196}${g_stashed}%b%f" 88 | fi 89 | 90 | local g_assume_unchanged=$(git -C "$g_path" ls-files -v | grep "^[[:lower:]]" | wc -l) 91 | if (( $g_assume_unchanged == 0 )); then 92 | g_assume_unchanged="-" 93 | else 94 | if (( $g_assume_unchanged > 9 )); then 95 | g_assume_unchanged="!" 96 | fi 97 | g_assume_unchanged="%B%F{201}$g_assume_unchanged%b%f" 98 | fi 99 | 100 | gsts_print "$g_hash:$g_changed$g_untracked$g_stashed$g_assume_unchanged" 101 | if [[ $g_ref[1] != ' ' ]]; then 102 | gsts_print ":$g_ref" 103 | fi 104 | gsts_upstream_divergence 105 | } 106 | 107 | local for_prompt=$1 108 | local l_status 109 | 110 | ! git_contents && return 111 | 112 | if [[ $(git rev-parse --is-bare-repository) == true ]]; then 113 | gsts_bare 114 | else 115 | l_status="$(gsts_nonbare)" 116 | if [[ -n "${l_status}" ]]; then 117 | echo "${l_status} " 118 | fi 119 | fi 120 | --------------------------------------------------------------------------------