From cf4a12acb3a70951fd59d67e0738bf3ab2d1045c Mon Sep 17 00:00:00 2001 From: ewof Date: Thu, 28 Mar 2024 09:13:34 -0400 Subject: [PATCH 01/25] Update xinitrc (#1402) --- .config/x11/xinitrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/x11/xinitrc b/.config/x11/xinitrc index e99da8cc..b183f251 100755 --- a/.config/x11/xinitrc +++ b/.config/x11/xinitrc @@ -15,4 +15,4 @@ else fi # Activate dbus variables dbus-update-activation-environment --all -ssh-agent dwm +dbus-launch ssh-agent dwm From 3fb60852de6d6d9011afdf65b247690ae54dfa5b Mon Sep 17 00:00:00 2001 From: Alaa Eddine <138128843+ArgusGuardian@users.noreply.github.com> Date: Fri, 3 May 2024 12:23:53 +0100 Subject: [PATCH 02/25] Create sb-bghitness, show brightness in the bar. script to add brightness to the dwmblocks. --- .local/bin/statusbar/sb-bghitness | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .local/bin/statusbar/sb-bghitness diff --git a/.local/bin/statusbar/sb-bghitness b/.local/bin/statusbar/sb-bghitness new file mode 100644 index 00000000..afccf3e2 --- /dev/null +++ b/.local/bin/statusbar/sb-bghitness @@ -0,0 +1,13 @@ +#!/bin/sh + +# show the current brightness level. + +case $BLOCK_BUTTON in + 1) setsid -w -f "$TERMINAL" -e brightnessctl; pkill -RTMIN+20 "${STATUSBAR:-dwmblocks}" ;; + 3) notify-send "💡 Brightness module" "\- Shows brightness level ☀️." ;; + 6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;; +esact + +brightness=$(brightnessctl -m | grep -m 1 "backlight" | cut -d "," -f 4) + +echo "💡 $brightness" From 534348e0b69c5bf6bbcf5e0316363ffaaec70bc5 Mon Sep 17 00:00:00 2001 From: Alaa Eddine Date: Sun, 5 May 2024 18:37:51 +0100 Subject: [PATCH 03/25] ditch brightnessctl, more minimalistic --- .local/bin/statusbar/sb-bghitness | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/.local/bin/statusbar/sb-bghitness b/.local/bin/statusbar/sb-bghitness index afccf3e2..913387bb 100644 --- a/.local/bin/statusbar/sb-bghitness +++ b/.local/bin/statusbar/sb-bghitness @@ -1,13 +1,23 @@ #!/bin/sh -# show the current brightness level. +# current brightness +curr_brightness=$(cat /sys/class/backlight/*/brightness) + +# max_brightness +max_brightness=$(cat /sys/class/backlight/*/max_brightness) + +# brightness percentage +brightness_per=$((100 * curr_brightness / max_brightness)) case $BLOCK_BUTTON in - 1) setsid -w -f "$TERMINAL" -e brightnessctl; pkill -RTMIN+20 "${STATUSBAR:-dwmblocks}" ;; - 3) notify-send "💡 Brightness module" "\- Shows brightness level ☀️." ;; - 6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;; -esact + 1) + ;; + 3) + notify-send "💡 Brightness module" "\- Shows current brightness level ☀️." + ;; + 6) + setsid -f "$TERMINAL" -e "$EDITOR" "$0" + ;; +esac -brightness=$(brightnessctl -m | grep -m 1 "backlight" | cut -d "," -f 4) - -echo "💡 $brightness" +echo "💡 ${brightness_per}%" From b545443993b1fed2665a9359033ccd2fea5efb8f Mon Sep 17 00:00:00 2001 From: fennomaani <160141733+fennomaani@users.noreply.github.com> Date: Sat, 11 May 2024 15:35:28 +0300 Subject: [PATCH 04/25] Save command to history before it is executed (#1409) --- .config/zsh/.zshrc | 1 + 1 file changed, 1 insertion(+) diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index c46f51d8..8af5d134 100644 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -11,6 +11,7 @@ setopt interactive_comments HISTSIZE=10000000 SAVEHIST=10000000 HISTFILE="${XDG_CACHE_HOME:-$HOME/.cache}/zsh/history" +setopt inc_append_history # Load aliases and shortcuts if existent. [ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc" ] && source "${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc" From 92f9fc458cb6ed9287f59df3eb0b5daee5468c09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emre=20AKY=C3=9CZ?= Date: Sat, 11 May 2024 15:39:43 +0300 Subject: [PATCH 05/25] [getcomproot] - fix | minimize | posix compliance (#1388) --- .local/bin/getcomproot | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.local/bin/getcomproot b/.local/bin/getcomproot index d34a2e42..dbee3482 100755 --- a/.local/bin/getcomproot +++ b/.local/bin/getcomproot @@ -1,12 +1,9 @@ -#!/bin/bash +#!/bin/sh # A helper script for LaTeX/groff files used by `compiler` and `opout`. # The user can add the root file of a larger project as a comment as below: # % root = mainfile.tex # And the compiler script will run on that instead of the opened file. -texroot="$(grep -i "^.\+\s*root\s*=\s*\S\+" "$1")" -texroot="${texroot##*=}" -texroot="${texroot//[\"\' ]}" - -[ -f "$texroot" ] && readlink -f "$texroot" || exit 1 +texroot="$(sed -n 's/^\s*%.*root\s*=\s*\(\S\+\).*/\1/p' "${1}")" +[ -f "${texroot}" ] && readlink -f "${texroot}" || exit "1" From f1915e71e559b6171c478a62f9016554d5081787 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emre=20AKY=C3=9CZ?= Date: Sat, 11 May 2024 15:41:19 +0300 Subject: [PATCH 06/25] [compiler] - streamline | simplify | minimize (#1389) * [compiler] - streamline | simplify | minimize * Update compiler --- .local/bin/compiler | 83 +++++++++++++++++++++------------------------ 1 file changed, 38 insertions(+), 45 deletions(-) diff --git a/.local/bin/compiler b/.local/bin/compiler index 8420e25f..57135906 100755 --- a/.local/bin/compiler +++ b/.local/bin/compiler @@ -2,58 +2,51 @@ # This script will compile or run another finishing operation on a document. I # have this script run via vim. -# + # Compiles .tex. groff (.mom, .ms), .rmd, .md, .org. Opens .sent files as sent # presentations. Runs scripts based on extension or shebang. -# + # Note that .tex files which you wish to compile with XeLaTeX should have the # string "xelatex" somewhere in a comment/command in the first 5 lines. -file=$(readlink -f "$1") +file="${1}" +ext="${file##*.}" dir=${file%/*} base="${file%.*}" -ext="${file##*.}" -cd "$dir" || exit 1 +cd "${dir}" || exit "1" -textype() { \ - textarget="$(getcomproot "$file" || echo "$file")" - echo "$textarget" - command="pdflatex" - ( head -n5 "$textarget" | grep -qi 'xelatex' ) && command="xelatex" - $command --output-directory="${textarget%/*}" "${textarget%.*}" - grep -qi addbibresource "$textarget" && - biber --input-directory "${textarget%/*}" "${textarget%.*}" && - $command --output-directory="${textarget%/*}" "${textarget%.*}" && - $command --output-directory="${textarget%/*}" "${textarget%.*}" -} - -case "$ext" in - # Try to keep these cases in alphabetical order. - [0-9]) preconv "$file" | refer -PS -e | groff -mandoc -T pdf > "$base".pdf ;; - c) cc "$file" -o "$base" && "$base" ;; - cpp) g++ "$file" -o "$base" && "$base" ;; - cs) mcs "$file" && mono "$base".exe ;; - go) go run "$file" ;; - h) sudo make install ;; - java) javac -d classes "$file" && java -cp classes "${1%.*}" ;; - m) octave "$file" ;; - md) if [ -x "$(command -v lowdown)" ]; then - lowdown --parse-no-intraemph "$file" -Tms | groff -mpdfmark -ms -kept -T pdf > "$base".pdf - elif [ -x "$(command -v groffdown)" ]; then - groffdown -i "$file" | groff -T pdf > "$base".pdf - else - pandoc -t ms --highlight-style=kate -s -o "$base".pdf "$file" - fi ; ;; - mom) preconv "$file" | refer -PS -e | groff -mom -kept -T pdf > "$base".pdf ;; - ms) preconv "$file" | refer -PS -e | groff -me -ms -kept -T pdf > "$base".pdf ;; - org) emacs "$file" --batch -u "$USER" -f org-latex-export-to-pdf ;; - py) python "$file" ;; - [rR]md) Rscript -e "rmarkdown::render('$file', quiet=TRUE)" ;; - rs) cargo build ;; - sass) sassc -a "$file" "$base".css ;; - scad) openscad -o "$base".stl "$file" ;; - sent) setsid -f sent "$file" 2>/dev/null ;; - tex) textype "$file" ;; - *) sed -n '/^#!/s/^#!//p; q' "$file" | xargs -r -I % "$file" ;; +case "${ext}" in + [0-9]) preconv "${file}" | refer -PS -e | groff -mandoc -T pdf > "${base}.pdf" ;; + mom|ms) preconv "${file}" | refer -PS -e | groff -T pdf -m"${ext}" > "${base}.pdf" ;; + c) cc "${file}" -o "${base}" && "./${base}" ;; + cpp) g++ "${file}" -o "${base}" && "./${base}" ;; + cs) mcs "${file}" && mono "${base}.exe" ;; + go) go run "${file}" ;; + h) sudo make install ;; + java) javac -d classes "${file}" && java -cp classes "${base}" ;; + m) octave "${file}" ;; + md) [ -x "$(command -v lowdown)" ] && \ + lowdown --parse-no-intraemph "${file}" -Tms | groff -mpdfmark -ms -kept -T pdf > "${base}.pdf" || \ + [ -x "$(command -v groffdown)" ] && \ + groffdown -i "${file}" | groff -T pdf > "${base}.pdf" || \ + pandoc -t ms --highlight-style="kate" -s -o "${base}.pdf" "${file}" ;; + org) emacs "${file}" --batch -u "${USER}" -f org-latex-export-to-pdf ;; + py) python "${file}" ;; + [rR]md) Rscript -e "rmarkdown::render('${file}', quiet=TRUE)" ;; + rs) cargo build ;; + sass) sassc -a "${file}" "${base}.css" ;; + scad) openscad -o "${base}.stl" "${file}" ;; + sent) setsid -f sent "${file}" 2> "/dev/null" ;; + tex) + textarget="$(getcomproot "${file}" || echo "${file}")" + command="pdflatex" + head -n5 "${textarget}" | grep -qi "xelatex" && command="xelatex" + ${command} --output-directory="${textarget%/*}" "${textarget%.*}" && + grep -qi addbibresource "${textarget}" && + biber --input-directory "${textarget%/*}" "${textarget%.*}" && + ${command} --output-directory="${textarget%/*}" "${textarget%.*}" && + ${command} --output-directory="${textarget%/*}" "${textarget%.*}" + ;; + *) sed -n '/^#!/s/^#!//p; q' "${file}" | xargs -r -I % "${file}" ;; esac From dd6eb3746958acb99e1262467bca85696b67d31e Mon Sep 17 00:00:00 2001 From: Alessio Artoni <34690870+aartoni@users.noreply.github.com> Date: Sat, 11 May 2024 14:42:22 +0200 Subject: [PATCH 07/25] Remove unused vim configs and shortcuts (#1385) Remove: ranger shortcuts, "nocompatible", plain Vim support for NERDTreeBookmarksFile and vimling configuration. --- .config/nvim/init.vim | 16 ++-------------- .local/bin/shortcuts | 5 +---- 2 files changed, 3 insertions(+), 18 deletions(-) diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index 8346777b..8f6d0d7e 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -34,7 +34,6 @@ set noshowcmd " Some basics: nnoremap c "_c - set nocompatible filetype plugin on syntax on set encoding=utf-8 @@ -55,22 +54,11 @@ set noshowcmd " Nerd tree map n :NERDTreeToggle autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif - if has('nvim') - let NERDTreeBookmarksFile = stdpath('data') . '/NERDTreeBookmarks' - else - let NERDTreeBookmarksFile = '~/.vim' . '/NERDTreeBookmarks' - endif + let NERDTreeBookmarksFile = stdpath('data') . '/NERDTreeBookmarks' -" vimling: - nm d :call ToggleDeadKeys() - imap d :call ToggleDeadKeys()a - nm i :call ToggleIPA() - imap i :call ToggleIPA()a - nm q :call ToggleProse() - " vim-airline if !exists('g:airline_symbols') - let g:airline_symbols = {} + let g:airline_symbols = {} endif let g:airline_symbols.colnr = ' C:' let g:airline_symbols.linenr = ' L:' diff --git a/.local/bin/shortcuts b/.local/bin/shortcuts index 7d7a1904..0c7cf75d 100755 --- a/.local/bin/shortcuts +++ b/.local/bin/shortcuts @@ -8,13 +8,12 @@ shell_shortcuts="${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc" zsh_named_dirs="${XDG_CONFIG_HOME:-$HOME/.config}/shell/zshnameddirrc" lf_shortcuts="${XDG_CONFIG_HOME:-$HOME/.config}/lf/shortcutrc" vim_shortcuts="${XDG_CONFIG_HOME:-$HOME/.config}/nvim/shortcuts.vim" -ranger_shortcuts="/dev/null" qute_shortcuts="/dev/null" fish_shortcuts="/dev/null" vifm_shortcuts="/dev/null" # Remove, prepare files -rm -f "$lf_shortcuts" "$ranger_shortcuts" "$qute_shortcuts" "$zsh_named_dirs" "$vim_shortcuts" 2>/dev/null +rm -f "$lf_shortcuts" "$qute_shortcuts" "$zsh_named_dirs" "$vim_shortcuts" 2>/dev/null printf "# vim: filetype=sh\\n" > "$fish_shortcuts" printf "# vim: filetype=sh\\nalias " > "$shell_shortcuts" printf "\" vim: filetype=vim\\n" > "$vifm_shortcuts" @@ -27,7 +26,6 @@ awk "!/^\s*#/ && !/^\s*\$/ {gsub(\"\\\s*#.*$\",\"\"); printf(\"abbr %s \42cd %s; and ls -A\42\n\",\$1,\$2) >> \"$fish_shortcuts\" ; printf(\"map g%s :cd %s\nmap t%s :cd %s\nmap M%s :cd %s:mo\nmap Y%s :cd %s:co \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 g%s cd %s\nmap t%s tab_new %s\nmap m%s shell mv -v %%s %s\nmap Y%s shell cp -rv %%s %s \n\",\$1,\$2,\$1,\$2, \$1, \$2, \$1, \$2) >> \"$ranger_shortcuts\" ; printf(\"map C%s cd \42%s\42 \n\",\$1,\$2) >> \"$lf_shortcuts\" ; printf(\"cmap ;%s %s\n\",\$1,\$2) >> \"$vim_shortcuts\" }" @@ -38,6 +36,5 @@ awk "!/^\s*#/ && !/^\s*\$/ {gsub(\"\\\s*#.*$\",\"\"); printf(\"hash -d %s=%s \n\",\$1,\$2) >> \"$zsh_named_dirs\" ; printf(\"abbr %s \42\$EDITOR %s\42 \n\",\$1,\$2) >> \"$fish_shortcuts\" ; printf(\"map %s :e %s \n\",\$1,\$2) >> \"$vifm_shortcuts\" ; - printf(\"map %s shell \$EDITOR %s \n\",\$1,\$2) >> \"$ranger_shortcuts\" ; printf(\"map E%s \$\$EDITOR \42%s\42 \n\",\$1,\$2) >> \"$lf_shortcuts\" ; printf(\"cmap ;%s %s\n\",\$1,\$2) >> \"$vim_shortcuts\" }" From 5c8d46a4e7c68e0c4b359ce35efcf7cd8b4dd721 Mon Sep 17 00:00:00 2001 From: TheYellowArchitect Date: Sat, 11 May 2024 12:53:48 +0000 Subject: [PATCH 08/25] Added 5 new mappings, 3 of which pipe to clipboard (#1373) 1. Copies the selected filename instead of the filepath, and pipes it to clipboard. 2. Copies the selected filename and if it matches the yt-dlp downloaded video format [1234567891011], gets the full youtube URL and pipes it to clipboard. 3. Copies the selected filename and if it matches the yt-dlp downloaded video format [1234567891011], gets the full piped.video URL and pipes it to the clipboard. (piped.video is a mirror of youtube, even includes comments) 4. Opens current folder in full picture mode. Think windows large icons mode. Good for browsing quickly through image albums. 5. Ctrl+l to unselect all selections so the behaviour matches the terminal. --- .config/lf/lfrc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.config/lf/lfrc b/.config/lf/lfrc index e783d728..bb15c62d 100644 --- a/.config/lf/lfrc +++ b/.config/lf/lfrc @@ -162,7 +162,14 @@ map V push :!nvim map W $setsid -f $TERMINAL >/dev/null 2>&1 -map Y $printf "%s" "$fx" | xclip -selection clipboard +map U $printf "%s" "$fx" | xclip -selection clipboard +map u $printf "%s" "$fx" | sed 's/.*\///' | xclip -selection clipboard +map . $printf "%s" "$fx" | sed -E 's/^.+\[/https:\/\/www.youtube.com\/watch?v=/' | sed -E 's/\]\..+//' | xclip -selection clipboard +map $printf "%s" "$fx" | sed -E 's/^.+\[/https:\/\/piped.video\/watch?v=/' | sed -E 's/\]\..+//' | xclip -selection clipboard +map T $sxiv -t "$(pwd)" # opens thumbnail mode +map unselect + + # Source Bookmarks source "~/.config/lf/shortcutrc" From 97687287bdfd332398b82a196b5f1feaec73f1d7 Mon Sep 17 00:00:00 2001 From: David Nevado Date: Sat, 11 May 2024 14:54:21 +0200 Subject: [PATCH 09/25] fix: grep pattern to avoid unintended matches (#1383) added `^` and `$` to the pattern used in `grep -v` in order to avoid matching displays whose name contains some other display name. e.g ("DPI", "eDPI") --- .local/bin/displayselect | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.local/bin/displayselect b/.local/bin/displayselect index 0227a32b..51dd4683 100755 --- a/.local/bin/displayselect +++ b/.local/bin/displayselect @@ -32,7 +32,7 @@ twoscreen() { # If multi-monitor is selected and there are two screens. else primary=$(echo "$screens" | dmenu -i -p "Select primary display:") - secondary=$(echo "$screens" | grep -v "$primary") + secondary=$(echo "$screens" | grep -v ^"$primary"$) direction=$(printf "left\\nright" | dmenu -i -p "What side of $primary should $secondary be on?") xrandr --output "$primary" --auto --scale 1.0x1.0 --output "$secondary" --"$direction"-of "$primary" --auto --scale 1.0x1.0 fi @@ -40,9 +40,9 @@ twoscreen() { # If multi-monitor is selected and there are two screens. morescreen() { # If multi-monitor is selected and there are more than two screens. primary=$(echo "$screens" | dmenu -i -p "Select primary display:") - secondary=$(echo "$screens" | grep -v "$primary" | dmenu -i -p "Select secondary display:") + secondary=$(echo "$screens" | grep -v ^"$primary"$ | dmenu -i -p "Select secondary display:") direction=$(printf "left\\nright" | dmenu -i -p "What side of $primary should $secondary be on?") - tertiary=$(echo "$screens" | grep -v "$primary" | grep -v "$secondary" | dmenu -i -p "Select third display:") + tertiary=$(echo "$screens" | grep -v ^"$primary"$ | grep -v ^"$secondary"$ | dmenu -i -p "Select third display:") xrandr --output "$primary" --auto --output "$secondary" --"$direction"-of "$primary" --auto --output "$tertiary" --"$(printf "left\\nright" | grep -v "$direction")"-of "$primary" --auto } From db8ee0df793246ed99152c490d29cdd21d45ed12 Mon Sep 17 00:00:00 2001 From: Tri Asep Tumbara <57649797+triaseptmbr@users.noreply.github.com> Date: Sat, 11 May 2024 19:55:29 +0700 Subject: [PATCH 10/25] Fix the problem when taking a screenshot of the lf window (#1398) Without -B option, the result of the screenshot is a blank picture. --- .local/bin/maimpick | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.local/bin/maimpick b/.local/bin/maimpick index 5de26c17..77175012 100755 --- a/.local/bin/maimpick +++ b/.local/bin/maimpick @@ -10,7 +10,7 @@ xclip_cmd="xclip -sel clip -t image/png" case "$(printf "a selected area\\ncurrent window\\nfull screen\\na selected area (copy)\\ncurrent window (copy)\\nfull screen (copy)" | dmenu -l 6 -i -p "Screenshot which area?")" in "a selected area") maim -u -s pic-selected-"${output}" ;; - "current window") maim -q -d 0.2 -i "$(xdotool getactivewindow)" pic-window-"${output}" ;; + "current window") maim -B -q -d 0.2 -i "$(xdotool getactivewindow)" pic-window-"${output}" ;; "full screen") maim -q -d 0.2 pic-full-"${output}" ;; "a selected area (copy)") maim -u -s | ${xclip_cmd} ;; "current window (copy)") maim -q -d 0.2 -i "$(xdotool getactivewindow)" | ${xclip_cmd} ;; From 97f2fa3872da7b173daa9650d747a25ee41fc47f Mon Sep 17 00:00:00 2001 From: Stepan Chernov <58429587+pikodd@users.noreply.github.com> Date: Sat, 11 May 2024 15:56:27 +0300 Subject: [PATCH 11/25] Update sb-clock to fix display issue (#1380) Co-authored-by: Stepan Chernov --- .local/bin/statusbar/sb-clock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.local/bin/statusbar/sb-clock b/.local/bin/statusbar/sb-clock index ac12aac1..85f1d345 100755 --- a/.local/bin/statusbar/sb-clock +++ b/.local/bin/statusbar/sb-clock @@ -19,7 +19,7 @@ case "$clock" in esac case $BLOCK_BUTTON in - 1) notify-send "This Month" "$(cal | sed "s/\<$(date +'%e')\>/&<\/span><\/b>/")" && notify-send "Appointments" "$(calcurse -d3)" ;; + 1) notify-send "This Month" "$(cal | sed "s/\<$(date +'%e'|sed 's/ //g')\>/&<\/span><\/b>/")" && notify-send "Appointments" "$(calcurse -d3)" ;; 2) setsid -f "$TERMINAL" -e calcurse ;; 3) notify-send "📅 Time/date module" "\- Left click to show upcoming appointments for the next three days via \`calcurse -d3\` and show the month via \`cal\` - Middle click opens calcurse if installed" ;; From 1f7376c805cb57daef05713412f8e562141eead8 Mon Sep 17 00:00:00 2001 From: poeplva <132710624+poeplva@users.noreply.github.com> Date: Sat, 11 May 2024 14:22:52 +0000 Subject: [PATCH 12/25] Corrects "application/octet-stream is for arbitrary binary files" (#1337) * Corrects the syntax error in "application/octet-stream is for arbitrary binary files" #1321 had a syntax error, this commit correct it. * Update lfrc support for ts --- .config/lf/lfrc | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.config/lf/lfrc b/.config/lf/lfrc index bb15c62d..320f9bd5 100644 --- a/.config/lf/lfrc +++ b/.config/lf/lfrc @@ -30,7 +30,7 @@ set autoquit true cmd open ${{ case $(file --mime-type "$(readlink -f $f)" -b) in application/vnd.openxmlformats-officedocument.spreadsheetml.sheet) localc $fx ;; - image/vnd.djvu|application/pdf|application/octet-stream|application/postscript) setsid -f zathura $fx >/dev/null 2>&1 ;; + image/vnd.djvu|application/pdf|application/postscript) setsid -f zathura $fx >/dev/null 2>&1 ;; text/*|application/json|inode/x-empty|application/x-subrip) $EDITOR $fx;; image/x-xcf) setsid -f gimp $f >/dev/null 2>&1 ;; image/svg+xml) display -- $f ;; @@ -45,8 +45,14 @@ cmd open ${{ video/*) setsid -f mpv $f -quiet >/dev/null 2>&1 ;; application/pdf|application/vnd.djvu|application/epub*) setsid -f zathura $fx >/dev/null 2>&1 ;; application/pgp-encrypted) $EDITOR $fx ;; - application/vnd.openxmlformats-officedocument.wordprocessingml.document|application/vnd.oasis.opendocument.text|application/vnd.openxmlformats-officedocument.spreadsheetml.sheet|application/octet-stream|application/vnd.oasis.opendocument.spreadsheet|application/vnd.oasis.opendocument.spreadsheet-template|application/vnd.openxmlformats-officedocument.presentationml.presentation|application/vnd.oasis.opendocument.presentation-template|application/vnd.oasis.opendocument.presentation|application/vnd.ms-powerpoint|application/vnd.oasis.opendocument.graphics|application/vnd.oasis.opendocument.graphics-template|application/vnd.oasis.opendocument.formula|application/vnd.oasis.opendocument.database) setsid -f libreoffice $fx >/dev/null 2>&1 ;; - *) for f in $fx; do setsid -f $OPENER $f >/dev/null 2>&1; done;; + application/vnd.openxmlformats-officedocument.wordprocessingml.document|application/vnd.oasis.opendocument.text|application/vnd.openxmlformats-officedocument.spreadsheetml.sheet|application/vnd.oasis.opendocument.spreadsheet|application/vnd.oasis.opendocument.spreadsheet-template|application/vnd.openxmlformats-officedocument.presentationml.presentation|application/vnd.oasis.opendocument.presentation-template|application/vnd.oasis.opendocument.presentation|application/vnd.ms-powerpoint|application/vnd.oasis.opendocument.graphics|application/vnd.oasis.opendocument.graphics-template|application/vnd.oasis.opendocument.formula|application/vnd.oasis.opendocument.database) setsid -f libreoffice $fx >/dev/null 2>&1 ;; + application/octet-stream) case ${f##*.} in + doc|docx|xls|xlsx|odt|ppt|pptx) setsid -f libreoffice $fx >/dev/null 2>&1 ;; + ghw) setsid -f gtkwave $f >/dev/null 2>&1 ;; + ts) setsid -f mpv $f -quiet >/dev/null 2>&1 ;; + *) setsid -f zathura $fx >/dev/null 2>&1 ;; + esac ;; + *) for f in $fx; do setsid -f $OPENER $f >/dev/null 2>&1; done;; esac }} From 487be9193cecbe56a39b2e33475c113456788f7b Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Fri, 17 May 2024 09:13:07 -0400 Subject: [PATCH 13/25] remove default rss feeds --- .config/newsboat/urls | 10 ---------- 1 file changed, 10 deletions(-) delete mode 100644 .config/newsboat/urls diff --git a/.config/newsboat/urls b/.config/newsboat/urls deleted file mode 100644 index 497e4946..00000000 --- a/.config/newsboat/urls +++ /dev/null @@ -1,10 +0,0 @@ -https://lukesmith.xyz/rss.xml -https://videos.lukesmith.xyz/feeds/videos.xml?videoChannelId=2 "~Luke Smith (Videos)" -https://www.youtube.com/feeds/videos.xml?channel_id=UC2eYFnH61tmytImy1mTYvhA "~Luke Smith (YouTube)" -https://lindypress.net/rss -https://notrelated.xyz/rss -https://landchad.net/rss.xml -https://based.cooking/index.xml -https://artixlinux.org/feed.php "tech" -https://www.archlinux.org/feeds/news/ "tech" -https://github.com/LukeSmithxyz/voidrice/commits/master.atom "~LARBS dotfiles" From db6ee8f8197dec0d0e3333f9c912bef38387a3e7 Mon Sep 17 00:00:00 2001 From: Ryan F <65836248+public-void-ryan@users.noreply.github.com> Date: Thu, 23 May 2024 11:42:08 -0500 Subject: [PATCH 14/25] map gh fix (#1414) map gh doesn't do anything because it doesn't recognize multi-letter commands. mapping H to cd to ~ --- .config/lf/lfrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/lf/lfrc b/.config/lf/lfrc index 320f9bd5..fb43a051 100644 --- a/.config/lf/lfrc +++ b/.config/lf/lfrc @@ -139,7 +139,7 @@ cmd bulkrename ${{ # Bindings map $lf -remote "send $id select \"$(fzf)\"" map J $lf -remote "send $id cd $(sed -e 's/\s*#.*//' -e '/^$/d' -e 's/^\S*\s*//' ${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-dirs | fzf)" -map gh +map H cd ~ map g top map D delete map E extract From 441d26b75d535bf9291b7f994f46f30e35e0c090 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Thu, 23 May 2024 13:03:41 -0400 Subject: [PATCH 15/25] for legacy vim colorscheme --- .config/nvim/init.vim | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index 5b0bd4e7..a222567b 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -31,6 +31,7 @@ set noshowmode set noruler set laststatus=0 set noshowcmd +colorscheme vim " Some basics: nnoremap c "_c @@ -108,10 +109,9 @@ set noshowcmd cabbrev w!! execute 'silent! write !sudo tee % >/dev/null' edit! " Enable Goyo by default for mutt writing - autocmd BufRead,BufNewFile /tmp/neomutt* let g:goyo_width=80 - autocmd BufRead,BufNewFile /tmp/neomutt* :Goyo | set bg=light - autocmd BufRead,BufNewFile /tmp/neomutt* map ZZ :Goyo\|x! - autocmd BufRead,BufNewFile /tmp/neomutt* map ZQ :Goyo\|q! + autocmd BufRead,BufNewFile /tmp/neomutt* :Goyo 80 | call feedkeys("jk") + autocmd BufRead,BufNewFile /tmp/neomutt* map ZZ :Goyo!\|x! + autocmd BufRead,BufNewFile /tmp/neomutt* map ZQ :Goyo!\|q! " Automatically deletes all trailing whitespace and newlines at end of file on save. & reset cursor position autocmd BufWritePre * let currPos = getpos(".") From c95a16916d5c71288e5e49a78d0621943c89a682 Mon Sep 17 00:00:00 2001 From: Zmole Cristian <101431599+ZmoleCristian@users.noreply.github.com> Date: Thu, 23 May 2024 20:25:19 +0300 Subject: [PATCH 16/25] Add OCR to maimpick (#1415) Sometimes you just need to grab some text from a video --- .local/bin/maimpick | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.local/bin/maimpick b/.local/bin/maimpick index 77175012..e9918998 100755 --- a/.local/bin/maimpick +++ b/.local/bin/maimpick @@ -7,6 +7,7 @@ # variables output="$(date '+%y%m%d-%H%M-%S').png" xclip_cmd="xclip -sel clip -t image/png" +ocr_cmd="xclip -sel clip" case "$(printf "a selected area\\ncurrent window\\nfull screen\\na selected area (copy)\\ncurrent window (copy)\\nfull screen (copy)" | dmenu -l 6 -i -p "Screenshot which area?")" in "a selected area") maim -u -s pic-selected-"${output}" ;; @@ -15,4 +16,5 @@ case "$(printf "a selected area\\ncurrent window\\nfull screen\\na selected area "a selected area (copy)") maim -u -s | ${xclip_cmd} ;; "current window (copy)") maim -q -d 0.2 -i "$(xdotool getactivewindow)" | ${xclip_cmd} ;; "full screen (copy)") maim -q -d 0.2 | ${xclip_cmd} ;; + "a selected area (OCR)") tmpfile=$(mktemp /tmp/ocr-XXXXXX.png) && maim -u -s > "$tmpfile" && tesseract "$tmpfile" - -l eng | ${ocr_cmd} && rm "$tmpfile" ;; esac From 7a9bfe6f699805980e79d0bf7674a5866be2b083 Mon Sep 17 00:00:00 2001 From: thetubster99 <159262428+thetubster99@users.noreply.github.com> Date: Thu, 23 May 2024 22:23:16 +0000 Subject: [PATCH 17/25] Tiny fix and optimization --- .config/lf/lfrc | 2 +- .local/bin/statusbar/sb-clock | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/lf/lfrc b/.config/lf/lfrc index fb43a051..dad917df 100644 --- a/.config/lf/lfrc +++ b/.config/lf/lfrc @@ -172,7 +172,7 @@ map U $printf "%s" "$fx" | xclip -selection clipboard map u $printf "%s" "$fx" | sed 's/.*\///' | xclip -selection clipboard map . $printf "%s" "$fx" | sed -E 's/^.+\[/https:\/\/www.youtube.com\/watch?v=/' | sed -E 's/\]\..+//' | xclip -selection clipboard map $printf "%s" "$fx" | sed -E 's/^.+\[/https:\/\/piped.video\/watch?v=/' | sed -E 's/\]\..+//' | xclip -selection clipboard -map T $sxiv -t "$(pwd)" # opens thumbnail mode +map T $nsxiv -t "$(pwd)" # opens thumbnail mode map unselect diff --git a/.local/bin/statusbar/sb-clock b/.local/bin/statusbar/sb-clock index 85f1d345..e9c2fe63 100755 --- a/.local/bin/statusbar/sb-clock +++ b/.local/bin/statusbar/sb-clock @@ -19,7 +19,7 @@ case "$clock" in esac case $BLOCK_BUTTON in - 1) notify-send "This Month" "$(cal | sed "s/\<$(date +'%e'|sed 's/ //g')\>/&<\/span><\/b>/")" && notify-send "Appointments" "$(calcurse -d3)" ;; + 1) notify-send "This Month" "$(cal | sed "s/\<$(date +'%e'|tr -d ' ')\>/&<\/span><\/b>/")" && notify-send "Appointments" "$(calcurse -d3)" ;; 2) setsid -f "$TERMINAL" -e calcurse ;; 3) notify-send "📅 Time/date module" "\- Left click to show upcoming appointments for the next three days via \`calcurse -d3\` and show the month via \`cal\` - Middle click opens calcurse if installed" ;; From 475e4abb4084008198f1d9a23de6450e02b074a9 Mon Sep 17 00:00:00 2001 From: venatio <72844565+v3natio@users.noreply.github.com> Date: Sun, 2 Jun 2024 22:40:47 +0200 Subject: [PATCH 18/25] (lf,maimpick) added preview for .xcf files, fixed OCR selection in dmenu script (#1420) --- .config/lf/scope | 5 +++++ .local/bin/maimpick | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.config/lf/scope b/.config/lf/scope index 8265a879..0d1e673e 100755 --- a/.config/lf/scope +++ b/.config/lf/scope @@ -30,6 +30,11 @@ image/svg+xml) [ ! -f "$CACHE" ] && inkscape --convert-dpi-method=none -o "$CACHE.png" --export-overwrite -D --export-png-color-mode=RGBA_16 "$1" image "$CACHE.png" "$2" "$3" "$4" "$5" "$1" ;; + image/x-xcf) + CACHE="${XDG_CACHE_HOME:-$HOME/.cache}/lf/thumb.$(stat --printf '%n\0%i\0%F\0%s\0%W\0%Y' -- "$(readlink -f "$1")" | sha256sum | awk '{print $1}')" + [ ! -f "$CACHE.jpg" ] && convert "$1[0]" "$CACHE.jpg" + image "$CACHE.jpg" "$2" "$3" "$4" "$5" "$1" + ;; image/*) image "$1" "$2" "$3" "$4" "$5" "$1" ;; text/html) lynx -width="$4" -display_charset=utf-8 -dump "$1" ;; text/troff) man ./ "$1" | col -b ;; diff --git a/.local/bin/maimpick b/.local/bin/maimpick index e9918998..ef0e3b7b 100755 --- a/.local/bin/maimpick +++ b/.local/bin/maimpick @@ -9,7 +9,7 @@ output="$(date '+%y%m%d-%H%M-%S').png" xclip_cmd="xclip -sel clip -t image/png" ocr_cmd="xclip -sel clip" -case "$(printf "a selected area\\ncurrent window\\nfull screen\\na selected area (copy)\\ncurrent window (copy)\\nfull screen (copy)" | dmenu -l 6 -i -p "Screenshot which area?")" in +case "$(printf "a selected area\\ncurrent window\\nfull screen\\na selected area (copy)\\ncurrent window (copy)\\nfull screen (copy)\\nOCR a selected area (copy)" | dmenu -l 7 -i -p "Screenshot which area?")" in "a selected area") maim -u -s pic-selected-"${output}" ;; "current window") maim -B -q -d 0.2 -i "$(xdotool getactivewindow)" pic-window-"${output}" ;; "full screen") maim -q -d 0.2 pic-full-"${output}" ;; From 6556ef5c4d78b55d80b5e59f187d7a39f973afa0 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Mon, 15 Jul 2024 13:02:59 -0400 Subject: [PATCH 19/25] close #1423 --- .config/lf/scope | 6 +++--- .config/nsxiv/exec/key-handler | 6 +++--- .local/bin/slider | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.config/lf/scope b/.config/lf/scope index 0d1e673e..332b07ef 100755 --- a/.config/lf/scope +++ b/.config/lf/scope @@ -19,11 +19,11 @@ image() { case "$(file --dereference --brief --mime-type -- "$1")" in image/avif) CACHE="${XDG_CACHE_HOME:-$HOME/.cache}/lf/thumb.$(stat --printf '%n\0%i\0%F\0%s\0%W\0%Y' -- "$(readlink -f "$1")" | sha256sum | cut -d' ' -f1)" - [ ! -f "$CACHE" ] && convert "$1" "$CACHE.jpg" + [ ! -f "$CACHE" ] && magick "$1" "$CACHE.jpg" image "$CACHE.jpg" "$2" "$3" "$4" "$5" "$1" ;; image/vnd.djvu) CACHE="${XDG_CACHE_HOME:-$HOME/.cache}/lf/thumb.$(stat --printf '%n\0%i\0%F\0%s\0%W\0%Y' -- "$(readlink -f "$1")" | sha256sum | cut -d' ' -f1)" - [ ! -f "$CACHE" ] && djvused "$1" -e 'select 1; save-page-with /dev/stdout' | convert -density 200 - "$CACHE.jpg" > /dev/null 2>&1 + [ ! -f "$CACHE" ] && djvused "$1" -e 'select 1; save-page-with /dev/stdout' | magick -density 200 - "$CACHE.jpg" > /dev/null 2>&1 image "$CACHE.jpg" "$2" "$3" "$4" "$5" "$1" ;; image/svg+xml) CACHE="${XDG_CACHE_HOME:-$HOME/.cache}/lf/thumb.$(stat --printf '%n\0%i\0%F\0%s\0%W\0%Y' -- "$(readlink -f "$1")" | sha256sum | cut -d' ' -f1)" @@ -32,7 +32,7 @@ image/svg+xml) ;; image/x-xcf) CACHE="${XDG_CACHE_HOME:-$HOME/.cache}/lf/thumb.$(stat --printf '%n\0%i\0%F\0%s\0%W\0%Y' -- "$(readlink -f "$1")" | sha256sum | awk '{print $1}')" - [ ! -f "$CACHE.jpg" ] && convert "$1[0]" "$CACHE.jpg" + [ ! -f "$CACHE.jpg" ] && magick "$1[0]" "$CACHE.jpg" image "$CACHE.jpg" "$2" "$3" "$4" "$5" "$1" ;; image/*) image "$1" "$2" "$3" "$4" "$5" "$1" ;; diff --git a/.config/nsxiv/exec/key-handler b/.config/nsxiv/exec/key-handler index 4c78f18b..c743be42 100755 --- a/.config/nsxiv/exec/key-handler +++ b/.config/nsxiv/exec/key-handler @@ -14,11 +14,11 @@ do mv "$file" "$destdir" && notify-send -i "$(readlink -f "$file")" "$file moved to $destdir." & ;; "r") - convert -rotate 90 "$file" "$file" ;; + magick -rotate 90 "$file" "$file" ;; "R") - convert -rotate -90 "$file" "$file" ;; + magick -rotate -90 "$file" "$file" ;; "f") - convert -flop "$file" "$file" ;; + magick -flop "$file" "$file" ;; "y") printf "%s" "$file" | tr -d '\n' | xclip -selection clipboard && notify-send "$file copied to clipboard" & ;; diff --git a/.local/bin/slider b/.local/bin/slider index 3460c777..b412e95a 100755 --- a/.local/bin/slider +++ b/.local/bin/slider @@ -67,7 +67,6 @@ if [ -n "${audio+x}" ]; then *) echo "That doesn't look like an audio file."; exit 1 ;; esac totseconds="$(date '+%s' -d $(ffmpeg -i "$audio" 2>&1 | awk '/Duration/ {print $2}' | sed s/,//))" - endtime="$((totseconds-seconds))" fi prepdir="${prepdir:-$cache/$file}" @@ -95,10 +94,10 @@ do # If images have already been made in a previous run, do not recreate # them unless -r was given. { [ ! -f "$prepdir/$base" ] || [ -n "${redo+x}" ] ;} && - convert -size "${res:-1920x1080}" canvas:"${bgc:-black}" -gravity center "$content" -resize 1920x1080 -composite "$prepdir/$base" + magick -size "${res:-1920x1080}" canvas:"${bgc:-black}" -gravity center "$content" -resize 1920x1080 -composite "$prepdir/$base" else { [ ! -f "$prepdir/$base" ] || [ -n "${redo+x}" ] ;} && - convert -size "${res:-1920x1080}" -background "${bgc:-black}" -fill "${fgc:-white}" -font "${font:-Sans}" -pointsize "${ppt:-150}" -gravity center label:"$content" "$prepdir/$base" + magick -size "${res:-1920x1080}" -background "${bgc:-black}" -fill "${fgc:-white}" -font "${font:-Sans}" -pointsize "${ppt:-150}" -gravity center label:"$content" "$prepdir/$base" fi # If the first line, do not write yet. @@ -111,6 +110,7 @@ duration $duration" prevseconds="$(date '+%s' -d "$prevtime")" done < "$file" # Do last file which must be given twice as follows +endtime="$((totseconds-seconds))" echo "file '$base' duration ${endtime:-5} file '$base'" From dda032a37d654557fbf2542d8b0385ba79584a4b Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Mon, 15 Jul 2024 13:12:36 -0400 Subject: [PATCH 20/25] close #1416 --- .local/bin/maimpick | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.local/bin/maimpick b/.local/bin/maimpick index ef0e3b7b..67b9983c 100755 --- a/.local/bin/maimpick +++ b/.local/bin/maimpick @@ -9,12 +9,12 @@ output="$(date '+%y%m%d-%H%M-%S').png" xclip_cmd="xclip -sel clip -t image/png" ocr_cmd="xclip -sel clip" -case "$(printf "a selected area\\ncurrent window\\nfull screen\\na selected area (copy)\\ncurrent window (copy)\\nfull screen (copy)\\nOCR a selected area (copy)" | dmenu -l 7 -i -p "Screenshot which area?")" in +case "$(printf "a selected area\\ncurrent window\\nfull screen\\na selected area (copy)\\ncurrent window (copy)\\nfull screen (copy)\\ncopy selected image to text" | dmenu -l 7 -i -p "Screenshot which area?")" in "a selected area") maim -u -s pic-selected-"${output}" ;; "current window") maim -B -q -d 0.2 -i "$(xdotool getactivewindow)" pic-window-"${output}" ;; "full screen") maim -q -d 0.2 pic-full-"${output}" ;; "a selected area (copy)") maim -u -s | ${xclip_cmd} ;; "current window (copy)") maim -q -d 0.2 -i "$(xdotool getactivewindow)" | ${xclip_cmd} ;; "full screen (copy)") maim -q -d 0.2 | ${xclip_cmd} ;; - "a selected area (OCR)") tmpfile=$(mktemp /tmp/ocr-XXXXXX.png) && maim -u -s > "$tmpfile" && tesseract "$tmpfile" - -l eng | ${ocr_cmd} && rm "$tmpfile" ;; + "copy selected image to text") tmpfile=$(mktemp /tmp/ocr-XXXXXX.png) && maim -u -s > "$tmpfile" && tesseract "$tmpfile" - -l eng | ${ocr_cmd} && rm "$tmpfile" ;; esac From e8ba78c518ac501d4de4275607748cb55394407f Mon Sep 17 00:00:00 2001 From: zetef Date: Mon, 15 Jul 2024 20:14:25 +0300 Subject: [PATCH 21/25] Fix sb-volume (toggle mute, scroll volume change) (#1411) the current wpctl version does not support @DEFAULT_AUDIO_SINK@, but works with @DEFAULT_SINK@ quick fix --- .local/bin/statusbar/sb-volume | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.local/bin/statusbar/sb-volume b/.local/bin/statusbar/sb-volume index e66dea77..f9d406bb 100755 --- a/.local/bin/statusbar/sb-volume +++ b/.local/bin/statusbar/sb-volume @@ -4,9 +4,9 @@ case $BLOCK_BUTTON in 1) setsid -w -f "$TERMINAL" -e pulsemixer; pkill -RTMIN+10 "${STATUSBAR:-dwmblocks}" ;; - 2) wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle ;; - 4) wpctl set-volume @DEFAULT_AUDIO_SINK@ 1%+ ;; - 5) wpctl set-volume @DEFAULT_AUDIO_SINK@ 1%- ;; + 2) wpctl set-mute @DEFAULT_SINK@ toggle ;; + 4) wpctl set-volume @DEFAULT_SINK@ 1%+ ;; + 5) wpctl set-volume @DEFAULT_SINK@ 1%- ;; 3) notify-send "📢 Volume module" "\- Shows volume 🔊, 🔇 if muted. - Middle click to mute. - Scroll to change." ;; From b4b462029cca2b2066e6065495cf407d107739a1 Mon Sep 17 00:00:00 2001 From: Visrut Date: Mon, 15 Jul 2024 22:45:55 +0530 Subject: [PATCH 22/25] shortcuts: zathura full screen mode shortcuts should work as before (#1396) * shortcuts work in full-screen mode * update wal template --- .config/wal/templates/zathurarc | 10 ++++++++++ .config/zathura/zathurarc | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/.config/wal/templates/zathurarc b/.config/wal/templates/zathurarc index 8f0b16fa..66527a8c 100644 --- a/.config/wal/templates/zathurarc +++ b/.config/wal/templates/zathurarc @@ -13,6 +13,16 @@ map J zoom out map i recolor map p print map g goto top +map [fullscreen] u scroll half-up +map [fullscreen] d scroll half-down +map [fullscreen] D toggle_page_mode +map [fullscreen] r reload +map [fullscreen] R rotate +map [fullscreen] K zoom in +map [fullscreen] J zoom out +map [fullscreen] i recolor +map [fullscreen] p print +map [fullscreen] g goto top set default-bg "{background}" set default-fg "{foreground}" diff --git a/.config/zathura/zathurarc b/.config/zathura/zathurarc index 452e1168..de92e4de 100644 --- a/.config/zathura/zathurarc +++ b/.config/zathura/zathurarc @@ -13,3 +13,13 @@ map J zoom out map i recolor map p print map g goto top +map [fullscreen] u scroll half-up +map [fullscreen] d scroll half-down +map [fullscreen] D toggle_page_mode +map [fullscreen] r reload +map [fullscreen] R rotate +map [fullscreen] K zoom in +map [fullscreen] J zoom out +map [fullscreen] i recolor +map [fullscreen] p print +map [fullscreen] g goto top From 22141ca7543e98c21ec721acaa3f9f4ff42157bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emre=20AKY=C3=9CZ?= Date: Mon, 15 Jul 2024 20:18:02 +0300 Subject: [PATCH 23/25] [texclear] - minimize | streamline (#1390) --- .local/bin/texclear | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/.local/bin/texclear b/.local/bin/texclear index 4cdb02e2..6ad3c12e 100755 --- a/.local/bin/texclear +++ b/.local/bin/texclear @@ -3,14 +3,7 @@ # Clears the build files of a LaTeX/XeLaTeX build. # I have vim run this file whenever I exit a .tex file. -case "$1" in - *.tex) - file=$(readlink -f "$1") - dir=$(dirname "$file") - base="${file%.*}" - find "$dir" -maxdepth 1 -type f -regextype gnu-awk -regex "^$base\\.(4tc|xref|tmp|pyc|pyg|pyo|fls|vrb|fdb_latexmk|bak|swp|aux|log|synctex\\(busy\\)|lof|lot|maf|idx|mtc|mtc0|nav|out|snm|toc|bcf|run\\.xml|synctex\\.gz|blg|bbl)" -delete - rm -rdf "$dir/_minted-$(basename -- "$base")" - ;; - *) printf "Give .tex file as argument.\\n" ;; -esac +[ "${1##*.}" = "tex" ] && { + find "$(dirname "${1}")" -regex '.*\(_minted.*\|.*\.\(4tc\|xref\|tmp\|pyc\|pyg\|pyo\|fls\|vrb\|fdb_latexmk\|bak\|swp\|aux\|log\|synctex\(busy\)\|lof\|lot\|maf\|idx\|mtc\|mtc0\|nav\|out\|snm\|toc\|bcf\|run\.xml\|synctex\.gz\|blg\|bbl\)\)' -delete +} || printf "Provide a .tex file.\n" From c771c66b18f12fdbe4b2ecaf1987db1a63555a01 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Mon, 15 Jul 2024 13:20:18 -0400 Subject: [PATCH 24/25] filename and exec fix --- .local/bin/statusbar/{sb-bghitness => sb-brightness} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .local/bin/statusbar/{sb-bghitness => sb-brightness} (100%) mode change 100644 => 100755 diff --git a/.local/bin/statusbar/sb-bghitness b/.local/bin/statusbar/sb-brightness old mode 100644 new mode 100755 similarity index 100% rename from .local/bin/statusbar/sb-bghitness rename to .local/bin/statusbar/sb-brightness From 368d3583a6c2e067491a160553c4130187fd0127 Mon Sep 17 00:00:00 2001 From: appeasementPolitik <108810900+appeasementPolitik@users.noreply.github.com> Date: Mon, 15 Jul 2024 17:28:50 +0000 Subject: [PATCH 25/25] weath: Add option to get forecast from a different location (#1327) * weath: Add option to get forecast from a different location * Remove retry and make max time lower because it is interactive * Give weath 'cp' option to copy forecast as plain text for sharing * Make weath a separate script --- .config/shell/aliasrc | 3 +-- .local/bin/weath | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 .local/bin/weath diff --git a/.config/shell/aliasrc b/.config/shell/aliasrc index 09f9a327..07683372 100644 --- a/.config/shell/aliasrc +++ b/.config/shell/aliasrc @@ -16,7 +16,7 @@ done; unset command se() { choice="$(find ~/.local/bin -mindepth 1 -printf '%P\n' | fzf)" [ -f "$HOME/.local/bin/$choice" ] && $EDITOR "$HOME/.local/bin/$choice" - ;} + } # Verbosity and settings that you pretty much just always are going to want. alias \ @@ -58,4 +58,3 @@ alias \ lf="lfub" \ magit="nvim -c MagitOnly" \ ref="shortcuts >/dev/null; source ${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc ; source ${XDG_CONFIG_HOME:-$HOME/.config}/shell/zshnameddirrc" \ - weath="less -S ${XDG_CACHE_HOME:-$HOME/.cache}/weatherreport" \ diff --git a/.local/bin/weath b/.local/bin/weath new file mode 100644 index 00000000..a5264110 --- /dev/null +++ b/.local/bin/weath @@ -0,0 +1,25 @@ +#!/bin/sh +# +# Get the weather on the terminal. You can pass an alternative location as a parameter, +# and/or use the 'cp' option to copy the forecast as plaintext to the clipboard. + +report="${XDG_CACHE_HOME:-$HOME/.cache}/weatherreport" + +if [ "$1" = 'cp' ]; then + # shellcheck disable=SC2015 + [ -z "$2" ] && sed 's/\x1b\[[^m]*m//g' "$report" | xclip -selection clipboard && + notify-send "Weather forecast for '${LOCATION:-$(head -n 1 "$report" | cut -d' ' -f3-)}' copied to clipboard." || + { data="$(curl -sfm 5 "${WTTRURL:-wttr.in}/$2?T")" && + notify-send "Weather forecast for '$2' copied to clipboard." && + echo "$data" | xclip -selection clipboard || + notify-send 'Failed to get weather forecast!' 'Check your internet connection and the supplied location.'; } +else + [ -n "$2" ] && + notify-send "Invalid option '$1'! The only valid option is 'cp'." && + exit 1 + + # shellcheck disable=SC2015 + [ -z "$1" ] && less -S "$report" || + data="$(curl -sfm 5 "${WTTRURL:-wttr.in}/$1")" && echo "$data" | less -S || + notify-send 'Failed to get weather forecast!' 'Check your internet connection and the supplied location.' +fi