diff options
| author | Mike Vink <ivi@vinkies.net> | 2025-06-30 19:47:04 +0200 |
|---|---|---|
| committer | Mike Vink <ivi@vinkies.net> | 2025-06-30 19:47:04 +0200 |
| commit | e52c488b31ac5cdebcc2ee770026d49e52a40fe4 (patch) | |
| tree | 5dd075965f28eacd0090b0f6179ef5dfb3453355 /.local | |
| parent | 49c4a121cc6ca89a79eb55149719edd5ae08dffe (diff) | |
bunch of cool things
Diffstat (limited to '.local')
| -rwxr-xr-x | .local/bin/rk | 2 | ||||
| -rwxr-xr-x | .local/bin/sb-clock | 2 | ||||
| -rwxr-xr-x | .local/bin/sb-pomodoro | 15 | ||||
| -rwxr-xr-x | .local/bin/shortcuts | 5 | ||||
| -rwxr-xr-x | .local/bin/vis-clipboard | 2 |
5 files changed, 16 insertions, 10 deletions
diff --git a/.local/bin/rk b/.local/bin/rk index 63b05cd..d2b072d 100755 --- a/.local/bin/rk +++ b/.local/bin/rk @@ -1,3 +1,3 @@ #!/bin/sh rg --vimgrep "$@" | - c s -e 'db! *grep*; rename-buffer *grep*; set-option window filetype grep; evaluate-commands -try-client %opt{toolsclient} %{ buffer *grep*; set-option window filetype grep }' + c "${KAKOUNE_SESSION:-s}" -e 'db! *grep*; rename-buffer *grep*; set-option window filetype grep; evaluate-commands -try-client %opt{toolsclient} %{ buffer *grep*; set-option window filetype grep }' diff --git a/.local/bin/sb-clock b/.local/bin/sb-clock index e7dc172..b4b9aec 100755 --- a/.local/bin/sb-clock +++ b/.local/bin/sb-clock @@ -20,7 +20,7 @@ esac case $BLOCK_BUTTON in 1) notify-send "This Month" "$(cal --color=always | sed "s/..7m/<b><span color=\"cyan\">/;s|..0m|</span></b>|")" && { - msg="$(khal list now 14d -f "{calendar-color} {start-time} {title} {status} {description} + msg="$(khal list now 14d -f "{calendar-color} {start-time} {title} {status} {title} " | sed "s/..7m/<b><span color=\"cyan\">/;s|..0m|</span></b>|")" [ -n "$msg" ] && notify-send -t 100000 "$msg" } diff --git a/.local/bin/sb-pomodoro b/.local/bin/sb-pomodoro index 1eb222a..5f3a870 100755 --- a/.local/bin/sb-pomodoro +++ b/.local/bin/sb-pomodoro @@ -4,14 +4,18 @@ # When clicked, brings up `newsboat`. case $BLOCK_BUTTON in - 1) setsid -f pomodoro start >/dev/null ;; - 2) setsid -f pomodoro finish >/dev/null ;; + 1) setsid -f pomodoro start >/dev/null ; pkill -RTMIN+26 dwmblocks ;; + 2) + setsid -f pomodoro finish >/dev/null + sh -c 'pomodoro break >/dev/null; notify-send -t 100000 "Breaktime over" "Fight against time compression. Build psychic depth. Remember."' & + pkill -RTMIN+26 dwmblocks + ;; 3) notify-send "🍅 Pomodoro module" "\- Shows current pomodoro status - Shows ⏱ if a Pomodoro is running - Left click starts a new Pomodoro - Middle click finishes a Pomodoro early -- Shift click opens ~/.pomodoro in editor" ;; - 6) "$TERMINAL" -e "$EDITOR" "$HOME/.pomodoro" ;; +- Shift click opens ~/.pomodoro in editor" ; pkill -RTMIN+26 dwmblocks ;; + 6) "$TERMINAL" -e "lf" "$HOME/.pomodoro" ;; esac if ! status=$(pomodoro status); then @@ -25,7 +29,8 @@ if [ -z "$status" ]; then msg="$daily_completed/$daily_total🍅" if [ "$daily_completed" -ne "0" ]; then seconds_since_last_started="$(( $(date +%s -u) - $(tail -n1 ~/.pomodoro/history | cut -f1 -d' ' | xargs -I{} date -d"{}" +%s -u) ))" - seconds_since_last="$(( "$seconds_since_last_started" - 60*$(tail -n1 ~/.pomodoro/history | cut -f2 -d' ' | cut -f2 -d'=')))" + duration="$(tail -n1 ~/.pomodoro/history | cut -f2 -d' ' | cut -f2 -d'=')" + seconds_since_last="$(( "$seconds_since_last_started" - 60*${duration:-0} ))" if [ "$seconds_since_last" -lt 0 ]; then seconds_since_last=0 fi diff --git a/.local/bin/shortcuts b/.local/bin/shortcuts index 4d53bc5..692e95d 100755 --- a/.local/bin/shortcuts +++ b/.local/bin/shortcuts @@ -22,12 +22,13 @@ printf "alias " > "$shell_shortcuts" eval "echo \"$(cat "$bmdirs"; for i in "$bmdirs_dir"/*; do cat $i; done)\"" | \ awk "!/^\s*#/ && !/^\s*\$/ {gsub(\"\\\s*#.*$\",\"\"); printf(\"%s=\42cd %s && ls -A\42 \\\\\n\",\$1,\$2) >> \"$shell_shortcuts\" ; - printf(\"[ -n \42%s\42 ] && export %s=\42%s\42 \n\",\$1,\$1,\$2) >> \"$shell_env_shortcuts\" }" + printf(\"[ -n \42%s\42 ] && export %s=\42%s\42 \n\",\$1,\$1,\$2) >> \"$shell_env_shortcuts\" ; + printf(\"map C%s cd \42%s\42 \n\",\$1,\$2) >> \"$lf_shortcuts\" ; }" # " printf(\"hash -d %s=%s \n\",\$1,\$2) >> \"$zsh_named_dirs\" ; # printf(\"abbr %s \42cd %s; and ls -A\42\n\",\$1,\$2) >> \"$fish_shortcuts\" ; # printf(\"map g%s :cd %s<CR>\nmap t%s <tab>:cd %s<CR><tab>\nmap M%s <tab>:cd %s<CR><tab>:mo<CR>\nmap Y%s <tab>:cd %s<CR><tab>:co<CR> \n\",\$1,\$2, \$1, \$2, \$1, \$2, \$1, \$2) >> \"$vifm_shortcuts\" ; # printf(\"config.bind(';%s', \42set downloads.location.directory %s ;; hint links download\42) \n\",\$1,\$2) >> \"$qute_shortcuts\" ; -# printf(\"map C%s cd \42%s\42 \n\",\$1,\$2) >> \"$lf_shortcuts\" ; + # printf(\"cmap ;%s %s\n\",\$1,\$2) >> \"$vim_shortcuts\" " # Format the `files` file in the correct syntax and sent it to both configs. diff --git a/.local/bin/vis-clipboard b/.local/bin/vis-clipboard index 4642761..d948832 100755 --- a/.local/bin/vis-clipboard +++ b/.local/bin/vis-clipboard @@ -22,7 +22,7 @@ Options: } vc_determine_command() { - if command -v osc >/dev/null 2>&1; then + if command -v osc >/dev/null 2>&1 && [ -t 1 ]; then echo 'osc' return 0 fi |
