dotfiles

configurations and scripts
git clone https://riazj.com/git/dotfiles
Log | Files | Refs | LICENSE

commit b7d6832d7167f7384c2349f6f67b094f4120b6f6
Author: Riaz <riaz@riazj.com>
Date:   Mon,  7 Jul 2025 18:00:40 -0700

Initial commit

Diffstat:
A.config/git/config | 8++++++++
A.config/nvim/init.vim | 24++++++++++++++++++++++++
A.config/sxhkd/sxhkdrc | 11+++++++++++
A.config/w3m/config | 15+++++++++++++++
A.config/w3m/keymap | 5+++++
A.config/w3m/mailcap | 2++
A.config/wikiman/wikiman.conf | 2++
A.config/xinitrc | 2++
A.config/zsh/.zprofile | 1+
A.config/zsh/.zshenv | 19+++++++++++++++++++
A.config/zsh/.zshrc | 19+++++++++++++++++++
A.local/bin/def | 5+++++
A.local/bin/new-article | 28++++++++++++++++++++++++++++
A.local/bin/quran | 3+++
A.local/bin/td | 8++++++++
A.local/bin/tldr | 9+++++++++
16 files changed, 161 insertions(+), 0 deletions(-)

diff --git a/.config/git/config b/.config/git/config @@ -0,0 +1,8 @@ +[user] + email = riaz@riazj.com + name = Riaz +[init] + defaultBranch = master +[log] + decorate = no + date = human diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim @@ -0,0 +1,24 @@ +set noshowmode noshowcmd nowrap noruler laststatus=0 shortmess+=I +set clipboard=unnamedplus textwidth=79 wildmode=longest,list,full +set lazyredraw ignorecase smartcase number relativenumber + +imap <C-g> <C-x><C-p> +imap jk <Esc> +nmap ; : +nmap Z :silent! %s/\s\+$//e <bar> x<CR> +nmap S :%s///g<Left><Left><Left> +nmap s :setlocal spell! spelllang=en_us<CR> +nmap ,w :setlocal wrap linebreak textwidth=0 columns=80<CR> +nmap ,a :0r ~/.local/share/snippets/article.html<CR>4jf>a +xmap ,p :!sed 's/</\&lt;/g; s/>/\&gt;/g'<CR> +nnoremap c "_c + +autocmd InsertEnter * let @/ = "" | normal zz +autocmd TextChanged,InsertLeave * silent! update + +autocmd FileType html imap ;; <Esc>/++<CR>c2l +autocmd FileType html imap ;t <Esc>lyT>i;;<Esc>pi;; +autocmd FileType html imap ;p <Esc>o<p></p><Esc>cit +autocmd FileType html imap ;h2 <Esc>o<h2></h2><CR><p>++</p><Esc>kcit +autocmd FileType html imap ;a <a href="">++</a>++<Esc>F"i +autocmd FileType html imap ;l <li></li><Esc>cit diff --git a/.config/sxhkd/sxhkdrc b/.config/sxhkd/sxhkdrc @@ -0,0 +1,11 @@ +XF86Audio{Raise,Lower}Volume + wpctl set-volume @DEFAULT_SINK@ 10%{+,-} + +XF86AudioMute + wpctl set-mute @DEFAULT_SINK@ toggle + +alt + {_,shift + } w + {st w3m -v,librewolf} + +alt + z + zathura diff --git a/.config/w3m/config b/.config/w3m/config @@ -0,0 +1,15 @@ +display_link_number 1 +display_image 0 +high-intensity 1 +confirm_qq 0 +mailcap ~/.config/w3m/mailcap +editor nvim +extbrowser sh -c 'printf %s "$0" | xclip -selection clipboard' +extbrowser2 surf +no_referer 1 +cross_origin_referer 0 +accept_language en-US,en;q=0.5 +accept_encoding gzip, deflate +accept_media text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 +no_cache 1 +use_cookie 0 diff --git a/.config/w3m/keymap b/.config/w3m/keymap @@ -0,0 +1,5 @@ +keymap B PREV +keymap C-o UNDO +keymap j NEXT_PAGE +keymap k PREV_PAGE +keymap f COMMAND "RESHAPE; LINK_BEGIN; GOTO_LINK" diff --git a/.config/w3m/mailcap b/.config/w3m/mailcap @@ -0,0 +1,2 @@ +image/*; /usr/bin/xdg-open %s +application/pdf; zathura %s diff --git a/.config/wikiman/wikiman.conf b/.config/wikiman/wikiman.conf @@ -0,0 +1,2 @@ +sources = arch +tui_preview = false diff --git a/.config/xinitrc b/.config/xinitrc @@ -0,0 +1,2 @@ +while xsetroot -name "$(cat /sys/class/power_supply/BAT0/capacity)% | $(date +%I:%M) | $(uptime -p)"; do sleep 1m; done & +setxkbmap -option 'compose:menu' & xhidecursor & sxhkd & exec dwm diff --git a/.config/zsh/.zprofile b/.config/zsh/.zprofile @@ -0,0 +1 @@ +[ "$(tty)" = "/dev/tty1" ] && startx diff --git a/.config/zsh/.zshenv b/.config/zsh/.zshenv @@ -0,0 +1,19 @@ +export PATH="$HOME/.local/bin:$PATH" +export XDG_CACHE_HOME="$HOME/.cache" +export XDG_CONFIG_HOME="$HOME/.config" +export XDG_DATA_HOME="$HOME/.local/share" +export XDG_STATE_HOME="$HOME/.local/state" +export PULSE_COOKIE="$XDG_CACHE_HOME/pulse" +export PARALLEL_HOME="$XDG_CACHE_HOME/parallel" +export XAUTHORITY="$XDG_RUNTIME_DIR/Xauthority" +export CALCHISTFILE="$XDG_RUNTIME_DIR/calc" +export PASSWORD_STORE_DIR="$XDG_DATA_HOME/pass" +export GNUPGHOME="$XDG_DATA_HOME/gnupg" +export XINITRC="$XDG_CONFIG_HOME/xinitrc" +export W3M_DIR="$XDG_CONFIG_HOME/w3m" +export HISTFILE="$XDG_STATE_HOME/zsh" +export HISTSIZE=500 +export SAVEHIST=500 +export LESSHISTFILE=- +export LESS="-iRF" +export EDITOR="nvim" diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc @@ -0,0 +1,19 @@ +setopt hist_ignore_dups +setopt autocd +setopt vi + +bindkey -M viins 'jk' vi-cmd-mode + +alias vi="nvim" +alias grep="grep --color -iI" +alias diff="diff --color=always" +alias copy="xclip -selection clipboard" +alias dot="git --git-dir=$HOME/repos/dotfiles/.git --work-tree=$HOME" + +autoload -U compinit +[ -d "$XDG_CACHE_HOME/zsh" ] || mkdir -p "$XDG_CACHE_HOME/zsh" +[ -d "$XDG_STATE_HOME" ] || mkdir -p "$XDG_STATE_HOME" +zstyle ':completion:*' use-cache on +zstyle ':completion:*' cache-path "$XDG_CACHE_HOME/zsh/zcompcache" +compinit -d "$XDG_CACHE_HOME/zsh/zcompdump-$ZSH_VERSION" +_comp_options+=(globdots) diff --git a/.local/bin/def b/.local/bin/def @@ -0,0 +1,5 @@ +#!/bin/sh -e + +[ $# -eq 0 ] && { echo "usage: def phrase"; exit; } +letter="$(printf "%.1s" "$*" | tr '[:lower:]' '[:upper:]')" +sed -n "/<p><ent>$*<\/ent><br\//I,/^$/p" "$HOME/data/books/dictionary/$letter" | w3m -dump -T text/html diff --git a/.local/bin/new-article b/.local/bin/new-article @@ -0,0 +1,28 @@ +#!/bin/sh -e + +error() { + echo "new-article: $1" >&2; exit 1 +} + +cd ~/repos/riazj.com/articles + +gitstat="$(git status -s .)" +[ -z "$gitstat" ] && error "no new articles" + +article="${gitstat#* }" +[ "$(printf "%s\n" "$article" | wc -l)" -ne 1 ] && + error "found more than one article" + +grep -q '<meta name="description" content="">' "$article" && + error "no article description" + +tidy -mq -wrap --tidy-mark no "$article" + +title="$(grep -im1 "<title>" "$article")" +title="${title#*>}"; title="${title% |*}" +article="${article%.html}" + +sed -i "/<ul>/a\<li><time datetime=\"$(date +%F)\">$(date +'%Y %b %d')</time>\ + <a href=\"/articles/$article\">$title</a></li>" "../index.html" + +git add -A; git commit -m "Write article about $*"; git push diff --git a/.local/bin/quran b/.local/bin/quran @@ -0,0 +1,3 @@ +#!/bin/sh + +~/repos/quran/quran "$@" | fold -s | less diff --git a/.local/bin/td b/.local/bin/td @@ -0,0 +1,8 @@ +#!/bin/sh -e + +TODO="$HOME/todo" +TEMP="/tmp/todo.tmp" + +[ $# -eq 0 ] && { nl -nln -ba "$TODO"; exit; } +[ "$1" != "rm" ] && { echo "$*" >> "$TODO"; exit; } +shift; sed "$*d" "$TODO" > "$TEMP" && mv "$TEMP" "$TODO" diff --git a/.local/bin/tldr b/.local/bin/tldr @@ -0,0 +1,9 @@ +#!/bin/sh -e + +PAGES="$XDG_CACHE_HOME/tldr/pages" + +[ $# -eq 0 ] && { echo "usage: tldr command [platform]"; exit; } +[ -d "$PAGES/$2" ] && page="$(find "$PAGES/$2" -name "$1.md" | head -1)" +[ -f "$page" ] && { cat "$page"; exit; } + +printf "tldr: %s not found\n" "$1"; exit 1