5 files changed,
32 insertions(+),
16 deletions(-)
Author:
Oleksandr Smirnov
olexsmir@gmail.com
Committed at:
2026-06-05 23:10:46 +0300
Authored at:
2026-06-01 14:25:22 +0300
Parent:
bc8e747
M
bin/time.sh
··· 7 7 # sudo chmod 664 /etc/hosts 8 8 9 9 readonly TC="$HOME/org/time.timeclock" 10 -readonly CATS=("stop" "WORK" "WASTE") 10 +readonly CATS=("stop" "WORK" "SEMI-WASTE" "WASTE") 11 11 readonly BLOCKED=("news.ycombinator.com" "lobste.rs" "www.reddit.com" "www.chess.com" "www.lichess.org" 12 - "discord.com" "www.x.com" "www.bsky.app" "www.twitch.tv" "www.youtube.com" "youtube.com") 12 + "discord.com" "www.x.com" "bsky.app" "www.youtube.com" "youtube.com" "www.twitch.tv") 13 13 14 14 now() { date '+%Y-%m-%d %H:%M:%S'; } 15 15 current() { awk '/^[io]/ { last_type=$1; last_cat=$4 } END { if (last_type == "i") print last_cat }' "$TC"; } ··· 17 17 18 18 block_sites() { 19 19 for domain in "${BLOCKED[@]}"; do 20 - hostess "$1" "$domain" "::1" >/dev/null 2>&1 20 + grep -qF "::1 $domain" /etc/hosts 2>/dev/null || printf '%s\t%s\n' '::1' "$domain" >>/etc/hosts 21 21 done 22 22 } 23 23 24 +unblock_sites() { 25 + local pattern 26 + for domain in "${BLOCKED[@]}"; do 27 + pattern+="/^::1[[:space:]]\+$domain\([[:space:]]\|$\)/d;" 28 + done 29 + sed "$pattern" /etc/hosts >/tmp/hosts.tmp && cat /tmp/hosts.tmp >/etc/hosts 30 +} 31 + 24 32 update_tmux() { 25 33 [[ -z "${TMUX:-}" ]] && return 26 34 local curr=$(tmux show -gqv status-right 2>/dev/null || true) ··· 40 48 cat=$(printf '%s\n' "${CATS[@]}" | fzf --reverse --no-info) || exit 41 49 stop_tracking 42 50 43 - [[ -z "$cat" || "$cat" == stop ]] && { block_sites rm; update_tmux ""; exit; } 51 + [[ -z "$cat" || "$cat" == stop ]] && { unblock_sites; update_tmux ""; exit; } 44 52 45 53 printf 'i %s t:%s\n' "$(now)" "$cat" >> "$TC" 46 - [[ "$cat" == WASTE ]] && block_sites rm || block_sites add 54 + [[ "$cat" == WASTE ]] && unblock_sites || block_sites 47 55 update_tmux "$cat" 48 56 ;; 49 57 esac
M
bin/tmux-open-git.sh
··· 2 2 3 3 p="$(tmux run 'echo #{pane_current_path}')" 4 4 cd "$p" 5 -url=$(git remote get-url origin 2>/dev/null) || { echo "No remote 'origin' found in $p"; exit 1; } 5 +url=$(git remote get-url origin 2>/dev/null) \ 6 + || url=$(git remote get-url olexsmir 2>/dev/null) \ 7 + || url=$(git remote get-url upstream 2>/dev/null) \ 8 + || { echo "No remote 'origin', 'olexsmir', or 'upstream' found in $p"; exit 1; } 6 9 7 10 if [[ $url == git@* ]]; then 8 11 url="${url#git@}"
M
config/tmux/tmux.conf
··· 7 7 set -ag terminal-overrides ",xterm-kitty:Tc:U8=0,xterm*:extkeys" 8 8 set -g set-clipboard on 9 9 set -g allow-passthrough on 10 +set -ga terminal-overrides ",*:sync=yes" 10 11 set -g detach-on-destroy off 11 12 set -ga terminal-overrides ",*256col*:Tc" 12 13 ··· 37 38 38 39 bind e run "tmux neww ~/bin/time.sh" 39 40 bind g run "~/bin/tmux-open-git.sh" 41 +bind a run "~/bin/tmux-todo-popup.sh" 40 42 bind R source-file ~/.config/tmux/tmux.conf \; display 'Reloaded tmux config' 41 43 unbind c; bind t new-window -c "#{pane_current_path}"; 42 44 unbind <; bind < swap-window -t -1; ··· 78 80 79 81 set -g status-position top 80 82 set -g status-left-length 85 81 -set -g status-left ' #[fg=blue,bold] #S#[fg=gray,nobold] #{?client_prefix,█,|} #[default]' 83 +set -g status-left ' #[fg=blue]#S#[fg=gray] #{?client_prefix,█,|} #[default]' 82 84 set -g status-right '' 83 85 # }}} 84 86 # plugins {{{ 85 87 set -g @plugin 'tmux-plugins/tpm' 86 88 set -g @plugin 'tmux-plugins/tmux-yank' 87 -set -g @plugin 'olexsmir/tmux-stare' 88 89 89 90 set -g @stare-pick 'o' 90 91 set -g @stare-start 'pick' 92 +run-shell '/home/olex/code/tmux-stare/stare.tmux' 91 93 92 94 if "test ! -d ~/.config/tmux/plugins/tpm" "run 'git clone https://github.com/tmux-plugins/tpm ~/.config/tmux/plugins/tpm && ~/.config/tmux/plugins/tpm/bin/install_plugins'" 93 95 run '~/.config/tmux/plugins/tpm/tpm'