From e1302c897ea404bfd7275cae38699fb986045c19 Mon Sep 17 00:00:00 2001 From: Austen <30375170+jausten95@users.noreply.github.com> Date: Mon, 1 May 2023 16:15:11 +0000 Subject: [PATCH 01/22] dwmblocks update on song change (#1318) --- .config/ncmpcpp/config | 1 + 1 file changed, 1 insertion(+) diff --git a/.config/ncmpcpp/config b/.config/ncmpcpp/config index 36324960..3111aabb 100644 --- a/.config/ncmpcpp/config +++ b/.config/ncmpcpp/config @@ -30,3 +30,4 @@ progressbar_color = black:b progressbar_elapsed_color = blue:b statusbar_color = red statusbar_time_color = cyan:b +execute_on_song_change="pkill -RTMIN+11 dwmblocks" From b2833f8a67c421d1d5ba3327c8594a445b8aa386 Mon Sep 17 00:00:00 2001 From: pony-montana <96387969+pony-montana@users.noreply.github.com> Date: Tue, 2 May 2023 19:49:56 +0000 Subject: [PATCH 02/22] change requested by lf-git after update. (#1319) --- .config/lf/lfrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/lf/lfrc b/.config/lf/lfrc index 63418f61..e3bace6d 100644 --- a/.config/lf/lfrc +++ b/.config/lf/lfrc @@ -24,7 +24,7 @@ set period 1 set hiddenfiles ".*:*.aux:*.log:*.bbl:*.bcf:*.blg:*.run.xml" set cleaner '~/.config/lf/cleaner' set previewer '~/.config/lf/scope' -set autoquit on +set autoquit true # cmds/functions cmd open ${{ From 991b052a558c11182c279612f3db42d187304132 Mon Sep 17 00:00:00 2001 From: appeasementPolitik <108810900+appeasementPolitik@users.noreply.github.com> Date: Thu, 11 May 2023 14:00:08 +0000 Subject: [PATCH 03/22] Don't wrap horizontally on short terminal (#1325) --- .local/bin/statusbar/sb-forecast | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.local/bin/statusbar/sb-forecast b/.local/bin/statusbar/sb-forecast index 2b41b3d7..368c17f7 100755 --- a/.local/bin/statusbar/sb-forecast +++ b/.local/bin/statusbar/sb-forecast @@ -38,7 +38,7 @@ showweather() { } case $BLOCK_BUTTON in - 1) setsid -f "$TERMINAL" -e less -Srf "$weatherreport" ;; + 1) setsid -f "$TERMINAL" -e less -Sf "$weatherreport" ;; 2) getforecast && showweather ;; 3) notify-send "🌈 Weather module" "\- Left click for full forecast. - Middle click to update forecast. From 0a29cfbf4facff29569535040a4ce90f2f033dd3 Mon Sep 17 00:00:00 2001 From: Mahdi Nayef Date: Wed, 24 May 2023 16:28:56 +0300 Subject: [PATCH 04/22] Fix rename key bindings in lf (#1331) --- .config/lf/lfrc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.config/lf/lfrc b/.config/lf/lfrc index e3bace6d..d1c9402b 100644 --- a/.config/lf/lfrc +++ b/.config/lf/lfrc @@ -113,11 +113,11 @@ map X !$f map o &mimeopen "$f" map O $mimeopen --ask "$f" -map A rename # at the very end +map A :rename; cmd-end # at the very end map c push A # new rename -map I push A # at the very beginning -map i push A # before extension -map a push A # after extension +map I :rename; cmd-home # at the very beginning +map i :rename # before extension +map a :rename; cmd-right # after extension map B bulkrename map b $setbg $f From ce1f0bfa0597881a640ef32b5334087425d65d16 Mon Sep 17 00:00:00 2001 From: Spenser Truex Date: Thu, 25 May 2023 03:40:55 +0000 Subject: [PATCH 05/22] Re-add whitespace to some buffer types as needed. (#1333) Very arcane. C ANSI standard requires a newline at the end. GCC will complain. Email signatures should have a space after the -- according to the standard. Neomutt does this automatically for you if you have a signature. Co-authored-by: Spenser Truex --- .config/nvim/init.vim | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index d9c6fe61..5b0bd4e7 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -117,6 +117,8 @@ set noshowcmd autocmd BufWritePre * let currPos = getpos(".") autocmd BufWritePre * %s/\s\+$//e autocmd BufWritePre * %s/\n\+\%$//e + autocmd BufWritePre *.[ch] %s/\%$/\r/e " add trailing newline for ANSI C standard + autocmd BufWritePre *neomutt* %s/^--$/-- /e " dash-dash-space signature delimiter in emails autocmd BufWritePre * cal cursor(currPos[1], currPos[2]) " When shortcut files are updated, renew bash and ranger configs with new material: From 1633233c9d8df7d5e4c53c078addcbfced017ae1 Mon Sep 17 00:00:00 2001 From: Mahdi Nayef Date: Sat, 27 May 2023 01:08:43 +0300 Subject: [PATCH 06/22] bulkrename using built-ins instead of using a completely separate program (#1330) * bulkrename using bult-ins instead of using a completely separate program * Make it more efficient --- .config/lf/lfrc | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/.config/lf/lfrc b/.config/lf/lfrc index d1c9402b..25fb3d1e 100644 --- a/.config/lf/lfrc +++ b/.config/lf/lfrc @@ -93,7 +93,27 @@ cmd copyto ${{ }} cmd setbg "$1" -cmd bulkrename $vidir + +cmd bulkrename ${{ + tmpfile_old="$(mktemp)" + tmpfile_new="$(mktemp)" + + [ -n "$fs" ] && fs=$(basename -a $fs) || fs=$(ls) + + echo "$fs" > "$tmpfile_old" + echo "$fs" > "$tmpfile_new" + $EDITOR "$tmpfile_new" + + [ "$(wc -l < "$tmpfile_old")" -eq "$(wc -l < "$tmpfile_new")" ] || { rm -f "$tmpfile_old" "$tmpfile_new"; exit 1; } + + paste "$tmpfile_old" "$tmpfile_new" | while IFS="$(printf '\t')" read -r src dst + do + [ "$src" = "$dst" ] || [ -e "$dst" ] || mv -- "$src" "$dst" + done + + rm -f "$tmpfile_old" "$tmpfile_new" + lf -remote "send $id unselect" +}} # Bindings map $lf -remote "send $id select \"$(fzf)\"" From af2710799b069486d04ba23c5bdab9cf6c4d6b04 Mon Sep 17 00:00:00 2001 From: poeplva <132710624+poeplva@users.noreply.github.com> Date: Sat, 27 May 2023 01:10:29 +0300 Subject: [PATCH 07/22] application/octet-stream is for arbitrary binary files (#1321) application/octet-stream mime-type is used for arbitrary binary files, so the best guess at opening those kind of should be based on the extension. before this all of this kind of files were tried to be opened with zathura, now it is the last resort in case the file extension is unknown. --- .config/lf/lfrc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.config/lf/lfrc b/.config/lf/lfrc index 25fb3d1e..046a3e4c 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,13 @@ 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 ;; + *) 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 08639706a9bc239dfdeff78f88a9ced7d932cec4 Mon Sep 17 00:00:00 2001 From: appeasementPolitik <108810900+appeasementPolitik@users.noreply.github.com> Date: Fri, 26 May 2023 22:11:06 +0000 Subject: [PATCH 08/22] Make sure sb-volume module is updated when closed after opening (#1316) --- .local/bin/statusbar/sb-volume | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.local/bin/statusbar/sb-volume b/.local/bin/statusbar/sb-volume index acdf7a9e..fa0abcd5 100755 --- a/.local/bin/statusbar/sb-volume +++ b/.local/bin/statusbar/sb-volume @@ -3,7 +3,7 @@ # Prints the current volume or πŸ”‡ if muted. case $BLOCK_BUTTON in - 1) setsid -f "$TERMINAL" -e pulsemixer ;; + 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%- ;; From 07de33840d9ce0f554c0e5555ac27250be0895c2 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sat, 27 May 2023 01:46:54 +0000 Subject: [PATCH 09/22] Revert "application/octet-stream is for arbitrary binary files (#1321)" (#1336) This reverts commit af2710799b069486d04ba23c5bdab9cf6c4d6b04. --- .config/lf/lfrc | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/.config/lf/lfrc b/.config/lf/lfrc index 046a3e4c..25fb3d1e 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/postscript) setsid -f zathura $fx >/dev/null 2>&1 ;; + image/vnd.djvu|application/pdf|application/octet-stream|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,13 +45,8 @@ 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/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 ;; - *) setsid -f zathura $fx >/dev/null 2>&1 ;; - esac - *) 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/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;; esac }} From 9a85d328ccf29f4cebb104e4eeeba1b20a896f6b Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sat, 15 Jul 2023 18:57:12 +0200 Subject: [PATCH 10/22] nsxiv replaces unmaintained sxiv --- .config/lf/lfrc | 2 +- .config/shell/bm-files | 2 +- .local/bin/dmenuhandler | 4 ++-- .local/bin/linkhandler | 4 ++-- .local/bin/rotdir | 4 ++-- .local/bin/tutorialvids | 2 +- .local/share/applications/img.desktop | 2 +- .local/share/larbs/getkeys/{sxiv => nsxiv} | 13 ++++++------- README.md | 2 +- 9 files changed, 17 insertions(+), 18 deletions(-) rename .local/share/larbs/getkeys/{sxiv => nsxiv} (50%) diff --git a/.config/lf/lfrc b/.config/lf/lfrc index 25fb3d1e..56a41825 100644 --- a/.config/lf/lfrc +++ b/.config/lf/lfrc @@ -35,7 +35,7 @@ cmd open ${{ image/x-xcf) setsid -f gimp $f >/dev/null 2>&1 ;; image/svg+xml) display -- $f ;; image/*) rotdir $f | grep -i "\.\(png\|jpg\|jpeg\|gif\|webp\|avif\|tif\|ico\)\(_large\)*$" | - setsid -f sxiv -aio 2>/dev/null | while read -r file; do + setsid -f nsxiv -aio 2>/dev/null | while read -r file; do [ -z "$file" ] && continue lf -remote "send select \"$file\"" lf -remote "send toggle" diff --git a/.config/shell/bm-files b/.config/shell/bm-files index 7acbb666..2e8864b1 100644 --- a/.config/shell/bm-files +++ b/.config/shell/bm-files @@ -20,4 +20,4 @@ cfmb ${XDG_CONFIG_HOME:-$HOME/.config}/ncmpcpp/bindings # ncmpcpp (music player) cfmc ${XDG_CONFIG_HOME:-$HOME/.config}/ncmpcpp/config # ncmpcpp (music player) config cfl ${XDG_CONFIG_HOME:-$HOME/.config}/lf/lfrc # lf (file browser) config cfL ${XDG_CONFIG_HOME:-$HOME/.config}/lf/scope # lf's scope/preview file -cfX ${XDG_CONFIG_HOME:-$HOME/.config}/sxiv/exec/key-handler # sxiv (image viewer) key/script handler +cfX ${XDG_CONFIG_HOME:-$HOME/.config}/nsxiv/exec/key-handler # nsxiv (image viewer) key/script handler diff --git a/.local/bin/dmenuhandler b/.local/bin/dmenuhandler index acfd71bf..e50178ac 100755 --- a/.local/bin/dmenuhandler +++ b/.local/bin/dmenuhandler @@ -4,7 +4,7 @@ # some choice programs to use to open it. feed="${1:-$(true | dmenu -p 'Paste URL or file path')}" -case "$(printf "copy url\\nsxiv\\nsetbg\\nPDF\\nbrowser\\nlynx\\nvim\\nmpv\\nmpv loop\\nmpv float\\nqueue download\\nqueue yt-dlp\\nqueue yt-dlp audio" | dmenu -i -p "Open it with?")" in +case "$(printf "copy url\\nnsxiv\\nsetbg\\nPDF\\nbrowser\\nlynx\\nvim\\nmpv\\nmpv loop\\nmpv float\\nqueue download\\nqueue yt-dlp\\nqueue yt-dlp audio" | dmenu -i -p "Open it with?")" in "copy url") echo "$feed" | xclip -selection clipboard ;; mpv) setsid -f mpv -quiet "$feed" >/dev/null 2>&1 ;; "mpv loop") setsid -f mpv -quiet --loop "$feed" >/dev/null 2>&1 ;; @@ -13,7 +13,7 @@ case "$(printf "copy url\\nsxiv\\nsetbg\\nPDF\\nbrowser\\nlynx\\nvim\\nmpv\\nmpv "queue yt-dlp audio") qndl "$feed" 'yt-dlp -o "%(title)s.%(ext)s" -f bestaudio --embed-metadata --restrict-filenames' ;; "queue download") qndl "$feed" 'curl -LO' >/dev/null 2>&1 ;; PDF) curl -sL "$feed" > "/tmp/$(echo "$feed" | sed "s|.*/||;s/%20/ /g")" && zathura "/tmp/$(echo "$feed" | sed "s|.*/||;s/%20/ /g")" >/dev/null 2>&1 ;; - sxiv) curl -sL "$feed" > "/tmp/$(echo "$feed" | sed "s|.*/||;s/%20/ /g")" && sxiv -a "/tmp/$(echo "$feed" | sed "s|.*/||;s/%20/ /g")" >/dev/null 2>&1 ;; + nsxiv) curl -sL "$feed" > "/tmp/$(echo "$feed" | sed "s|.*/||;s/%20/ /g")" && nsxiv -a "/tmp/$(echo "$feed" | sed "s|.*/||;s/%20/ /g")" >/dev/null 2>&1 ;; vim) curl -sL "$feed" > "/tmp/$(echo "$feed" | sed "s|.*/||;s/%20/ /g")" && setsid -f "$TERMINAL" -e "$EDITOR" "/tmp/$(echo "$feed" | sed "s|.*/||;s/%20/ /g")" >/dev/null 2>&1 ;; setbg) curl -L "$feed" > $XDG_CACHE_HOME/pic ; xwallpaper --zoom $XDG_CACHE_HOME/pic >/dev/null 2>&1 ;; browser) setsid -f "$BROWSER" "$feed" >/dev/null 2>&1 ;; diff --git a/.local/bin/linkhandler b/.local/bin/linkhandler index f62b5812..84b2e285 100755 --- a/.local/bin/linkhandler +++ b/.local/bin/linkhandler @@ -1,7 +1,7 @@ #!/bin/sh # Feed script a url or file location. -# If an image, it will view in sxiv, +# If an image, it will view in nsxiv, # if a video or gif, it will view in mpv # if a music file or pdf, it will download, # otherwise it opens link in browser. @@ -16,7 +16,7 @@ case "$url" in *mkv|*webm|*mp4|*youtube.com/watch*|*youtube.com/playlist*|*youtube.com/shorts*|*youtu.be*|*hooktube.com*|*bitchute.com*|*videos.lukesmith.xyz*|*odysee.com*) setsid -f mpv -quiet "$url" >/dev/null 2>&1 ;; *png|*jpg|*jpe|*jpeg|*gif) - curl -sL "$url" > "/tmp/$(echo "$url" | sed "s/.*\///;s/%20/ /g")" && sxiv -a "/tmp/$(echo "$url" | sed "s/.*\///;s/%20/ /g")" >/dev/null 2>&1 & ;; + curl -sL "$url" > "/tmp/$(echo "$url" | sed "s/.*\///;s/%20/ /g")" && nsxiv -a "/tmp/$(echo "$url" | sed "s/.*\///;s/%20/ /g")" >/dev/null 2>&1 & ;; *pdf|*cbz|*cbr) curl -sL "$url" > "/tmp/$(echo "$url" | sed "s/.*\///;s/%20/ /g")" && zathura "/tmp/$(echo "$url" | sed "s/.*\///;s/%20/ /g")" >/dev/null 2>&1 & ;; *mp3|*flac|*opus|*mp3?source*) diff --git a/.local/bin/rotdir b/.local/bin/rotdir index 86da6dbe..d171f299 100755 --- a/.local/bin/rotdir +++ b/.local/bin/rotdir @@ -1,11 +1,11 @@ #!/bin/sh -# When I open an image from the file manager in sxiv (the image viewer), I want +# When I open an image from the file manager in nsxiv (the image viewer), I want # to be able to press the next/previous keys to key through the rest of the # images in the same directory. This script "rotates" the content of a # directory based on the first chosen file, so that if I open the 15th image, # if I press next, it will go to the 16th etc. Autistic, I know, but this is -# one of the reasons that sxiv is great for being able to read standard input. +# one of the reasons that nsxiv is great for being able to read standard input. [ -z "$1" ] && echo "usage: rotdir regex 2>&1" && exit 1 base="$(basename "$1")" diff --git a/.local/bin/tutorialvids b/.local/bin/tutorialvids index 8d1dc471..1bac3df9 100755 --- a/.local/bin/tutorialvids +++ b/.local/bin/tutorialvids @@ -8,7 +8,7 @@ vidlist=" dwm (window manager) https://videos.lukesmith.xyz/videos/watch/f6b78db7-b368-4647-bc64-28c08fff1988 dwmblocks (status bar) https://videos.lukesmith.xyz/w/mmxHMbqZZEr5FManB57Yy1 pacman (installing/managing programs) https://videos.lukesmith.xyz/videos/watch/8e7cadb9-0fed-47ce-a2a8-6635fa48614b -sxiv (image viewer) https://videos.lukesmith.xyz/videos/watch/ad4c8d85-90c3-4f3d-a1f3-89129e64a3c2 +sxiv/nsxiv (image viewer) https://videos.lukesmith.xyz/videos/watch/ad4c8d85-90c3-4f3d-a1f3-89129e64a3c2 st (terminal) https://videos.lukesmith.xyz/videos/watch/efddd39d-bac5-4599-b572-177beb4ce6e8 i3 (old window manager) https://videos.lukesmith.xyz/videos/watch/b861525c-7ada-40ee-a2bb-b5e1ffe0f48b neomutt (email) https://videos.lukesmith.xyz/videos/watch/83122e83-52d9-4278-ae1a-7d1beeb50c8e diff --git a/.local/share/applications/img.desktop b/.local/share/applications/img.desktop index 42aa81e0..57831070 100644 --- a/.local/share/applications/img.desktop +++ b/.local/share/applications/img.desktop @@ -1,4 +1,4 @@ [Desktop Entry] Type=Application Name=Image viewer -Exec=/usr/bin/sxiv -a %f +Exec=/usr/bin/nsxiv -a %f diff --git a/.local/share/larbs/getkeys/sxiv b/.local/share/larbs/getkeys/nsxiv similarity index 50% rename from .local/share/larbs/getkeys/sxiv rename to .local/share/larbs/getkeys/nsxiv index df5cb1e0..176a65a7 100644 --- a/.local/share/larbs/getkeys/sxiv +++ b/.local/share/larbs/getkeys/nsxiv @@ -1,9 +1,8 @@ - _ - _____ _(_)_ __ -/ __\ \/ / \ \ / / -\__ \> <| |\ V / -|___/_/\_\_| \_/ -sxiv is the image viewer. + _ __ _____ _(_)_ __ +| '_ \/ __\ \/ / \ \ / / +| | | \__ \> <| |\ V / +|_| |_|___/_/\_\_| \_/ +nsxiv is the image viewer. h/j/k/l - Pan image -/+ - Zoom out/in Enter - Toggle thumbnail mode @@ -12,4 +11,4 @@ sxiv is the image viewer. r - Reload image if changed m - Mark/unmark image w - Zoom to fit window - ctrl-x - Run external command (see ~/.config/sxiv/exec/key-handler for options) + ctrl-x - Run external command (see ~/.config/nsxiv/exec/key-handler for options) diff --git a/README.md b/README.md index 135a8e49..1e2f7802 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ These are the dotfiles deployed by [LARBS](https://larbs.xyz) and as seen on - zsh (shell) - lf (file manager) - mpd/ncmpcpp (music) - - sxiv (image/gif viewer) + - nsxiv (image/gif viewer) - mpv (video player) - other stuff like xdg default programs, inputrc and more, etc. - I try to minimize what's directly in `~` so: From 6f6b749d0e4e54d8b0f98cfff39f6847f4c4a0b7 Mon Sep 17 00:00:00 2001 From: "Gunnar K. Halvorsen" Date: Sun, 23 Jul 2023 23:02:14 +0000 Subject: [PATCH 11/22] Fixed formatting bug with notify-send (#1344) * Fixed formatting bug with notify-send * Update sb-clock Fix suggested by 'mhdna' --- .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 e1ca8c74..93f8aea9 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 --color=always | sed "s/..7m//;s|..27m||")" && notify-send "Appointments" "$(calcurse -d3)" ;; + 1) notify-send "This Month" "$(cal | sed "s/\<$(date +'%e')\>/&<\/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 0497dcd51c46403e4e7c5e9cbf66d7afa70d6d2b Mon Sep 17 00:00:00 2001 From: Lalle <29478339+LalleSX@users.noreply.github.com> Date: Mon, 24 Jul 2023 01:02:33 +0200 Subject: [PATCH 12/22] Add jsonl to lf (#1345) --- .config/lf/scope | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/lf/scope b/.config/lf/scope index 87b560a0..12c1792d 100755 --- a/.config/lf/scope +++ b/.config/lf/scope @@ -28,7 +28,7 @@ case "$(file --dereference --brief --mime-type -- "$1")" in 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 ;; - text/* | */xml | application/json) bat --terminal-width "$(($4-2))" -f "$1" ;; + text/* | */xml | application/json | application/x-ndjson) bat --terminal-width "$(($4-2))" -f "$1" ;; audio/* | application/octet-stream) mediainfo "$1" || exit 1 ;; video/* ) 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)" From d8a8970715070f73bcb6333e3fe851b6802ac702 Mon Sep 17 00:00:00 2001 From: poeplva <132710624+poeplva@users.noreply.github.com> Date: Mon, 24 Jul 2023 02:06:04 +0300 Subject: [PATCH 13/22] djvu files cannot be previewed (#1335) added support for previewing books in djvu format. --- .config/lf/scope | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.config/lf/scope b/.config/lf/scope index 12c1792d..cc556697 100755 --- a/.config/lf/scope +++ b/.config/lf/scope @@ -25,6 +25,10 @@ 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" 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 + 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 ;; From 44cb5f12e6c28aaada521d8b2918be9735c402c0 Mon Sep 17 00:00:00 2001 From: appeasementPolitik <108810900+appeasementPolitik@users.noreply.github.com> Date: Wed, 16 Aug 2023 13:55:59 +0000 Subject: [PATCH 14/22] Give setbg parameter to make notifications silent (#1350) --- .local/bin/setbg | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.local/bin/setbg b/.local/bin/setbg index b72dc7d5..c2888958 100755 --- a/.local/bin/setbg +++ b/.local/bin/setbg @@ -13,11 +13,18 @@ bgloc="${XDG_DATA_HOME:-$HOME/.local/share}/bg" dunstconf="${XDG_CONFIG_HOME:-$HOME/.config}/dunst/dunstrc" zathuraconf="${XDG_CONFIG_HOME:-$HOME/.config}/zathura/zathurarc" +# Give -s as parameter to make notifications silent. +while getopts "s" o; do case "${o}" in + s) silent='1' ;; +esac done + +shift $((OPTIND - 1)) + trueloc="$(readlink -f "$1")" && case "$(file --mime-type -b "$trueloc")" in - image/* ) ln -sf "$(readlink -f "$1")" "$bgloc" && notify-send -i "$bgloc" "Changing wallpaper..." ;; - inode/directory ) ln -sf "$(find "$trueloc" -iregex '.*.\(jpg\|jpeg\|png\|gif\)' -type f | shuf -n 1)" "$bgloc" && notify-send -i "$bgloc" "Random Wallpaper chosen." ;; - *) notify-send "πŸ–ΌοΈ Error" "Not a valid image or directory." ; exit 1;; + image/* ) ln -sf "$trueloc" "$bgloc" && [ -z "$silent" ] && notify-send -i "$bgloc" "Changing wallpaper..." ;; + inode/directory ) ln -sf "$(find "$trueloc" -iregex '.*.\(jpg\|jpeg\|png\|gif\)' -type f | shuf -n 1)" "$bgloc" && [ -z "$silent" ] && notify-send -i "$bgloc" "Random Wallpaper chosen." ;; + *) [ -z "$silent" ] && notify-send "πŸ–ΌοΈ Error" "Not a valid image or directory." ; exit 1;; esac # If pywal is installed, use it. From ec8e82745e4a7ee6076e115dc578a370d29914e2 Mon Sep 17 00:00:00 2001 From: appeasementPolitik <108810900+appeasementPolitik@users.noreply.github.com> Date: Wed, 16 Aug 2023 14:38:10 +0000 Subject: [PATCH 15/22] sb-internet: replace grep/sed commands for more efficiency (#1349) --- .local/bin/statusbar/sb-internet | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/.local/bin/statusbar/sb-internet b/.local/bin/statusbar/sb-internet index 94b7da27..4c8131ce 100755 --- a/.local/bin/statusbar/sb-internet +++ b/.local/bin/statusbar/sb-internet @@ -17,10 +17,17 @@ case $BLOCK_BUTTON in 6) "$TERMINAL" -e "$EDITOR" "$0" ;; esac -if grep -xq 'up' /sys/class/net/w*/operstate 2>/dev/null ; then +# Wifi +if [ "$(cat /sys/class/net/w*/operstate 2>/dev/null)" = 'up' ] ; then wifiicon="$(awk '/^\s*w/ { print "πŸ“Ά", int($3 * 100 / 70) "% " }' /proc/net/wireless)" -elif grep -xq 'down' /sys/class/net/w*/operstate 2>/dev/null ; then - grep -xq '0x1003' /sys/class/net/w*/flags && wifiicon="πŸ“‘ " || wifiicon="❌ " +elif [ "$(cat /sys/class/net/w*/operstate 2>/dev/null)" = 'down' ] ; then + [ "$(cat /sys/class/net/w*/flags 2>/dev/null)" = '0x1003' ] && wifiicon="πŸ“‘ " || wifiicon="❌ " fi -printf "%s%s%s\n" "$wifiicon" "$(sed "s/down/❎/;s/up/🌐/" /sys/class/net/e*/operstate 2>/dev/null)" "$(sed "s/.*/πŸ”’/" /sys/class/net/tun*/operstate 2>/dev/null)" +# Ethernet +[ "$(cat /sys/class/net/e*/operstate 2>/dev/null)" = 'up' ] && ethericon="🌐 " || ethericon="❎ " + +# TUN +[ -n "$(cat /sys/class/net/tun*/operstate 2>/dev/null)" ] && tunicon="πŸ”’ " + +printf "%s%s%s\n" "$wifiicon" "$ethericon" "$tunicon" From ed9633da3f876b6c9dae13434fb7ea30208a5b5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Nikolai=20Var=C3=B8y?= <97204480+SimonVaroy@users.noreply.github.com> Date: Wed, 16 Aug 2023 14:39:40 +0000 Subject: [PATCH 16/22] added webp to image formats in linkhandler (#1347) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Simon Nikolai VarΓΈy --- .local/bin/linkhandler | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.local/bin/linkhandler b/.local/bin/linkhandler index 84b2e285..d372d84c 100755 --- a/.local/bin/linkhandler +++ b/.local/bin/linkhandler @@ -15,7 +15,7 @@ fi case "$url" in *mkv|*webm|*mp4|*youtube.com/watch*|*youtube.com/playlist*|*youtube.com/shorts*|*youtu.be*|*hooktube.com*|*bitchute.com*|*videos.lukesmith.xyz*|*odysee.com*) setsid -f mpv -quiet "$url" >/dev/null 2>&1 ;; - *png|*jpg|*jpe|*jpeg|*gif) + *png|*jpg|*jpe|*jpeg|*gif|*webp) curl -sL "$url" > "/tmp/$(echo "$url" | sed "s/.*\///;s/%20/ /g")" && nsxiv -a "/tmp/$(echo "$url" | sed "s/.*\///;s/%20/ /g")" >/dev/null 2>&1 & ;; *pdf|*cbz|*cbr) curl -sL "$url" > "/tmp/$(echo "$url" | sed "s/.*\///;s/%20/ /g")" && zathura "/tmp/$(echo "$url" | sed "s/.*\///;s/%20/ /g")" >/dev/null 2>&1 & ;; From f26e5678e626e604ed586fc6420b944dc023d3f2 Mon Sep 17 00:00:00 2001 From: appeasementPolitik <108810900+appeasementPolitik@users.noreply.github.com> Date: Fri, 18 Aug 2023 12:20:05 +0000 Subject: [PATCH 17/22] Fix arkenfox pacman hook complaining about root (#1351) The previous pull request on LARBS turned out not to work, so make sure `arkenfox-auto-update` runs `arkenfox-update` as the user of the firefox profile. Otherwise it complains that it's running as root and stops. The way of getting the username is safe, because it gets the username from the owner of the user.js file of that profile. --- .local/bin/arkenfox-auto-update | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.local/bin/arkenfox-auto-update b/.local/bin/arkenfox-auto-update index 05f4ca7f..7664a4fc 100755 --- a/.local/bin/arkenfox-auto-update +++ b/.local/bin/arkenfox-auto-update @@ -16,5 +16,8 @@ IFS=' # Update each found profile. for profile in $profiles; do - arkenfox-updater -p "${profile%%/user.js*}" -s + userjs=${profile%%/user.js*} + user=$(stat -c '%U' "$userjs") || continue + + su -l "$user" -c "arkenfox-updater -c -p $userjs -s" done From 8315e4c885aaf3de5a1f30bc8ed0e1f3c72a24f0 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Wed, 23 Aug 2023 12:28:42 +0200 Subject: [PATCH 18/22] libertinus replaces libertine --- .config/fontconfig/fonts.conf | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.config/fontconfig/fonts.conf b/.config/fontconfig/fonts.conf index d7efc385..d7048ba2 100755 --- a/.config/fontconfig/fonts.conf +++ b/.config/fontconfig/fonts.conf @@ -4,7 +4,7 @@ serif - Linux Libertine + Libertinus Serif Joy Pixels Noto Color Emoji FontAwesome @@ -13,7 +13,7 @@ sans-serif - Linux Biolinum + Libertinus Sans Joy Pixels Noto Color Emoji FontAwesome @@ -22,7 +22,7 @@ sans - Linux Biolinum + Libertinus Sans Joy Pixels Noto Color Emoji FontAwesome @@ -32,7 +32,7 @@ monospace Noto Sans Mono - Liberation Mono + Liberatinus Mono FontAwesome Braille From 798ba175d0edd50a696edc8467b2eedeaf881a4c Mon Sep 17 00:00:00 2001 From: Alessio Artoni <34690870+aartoni@users.noreply.github.com> Date: Fri, 25 Aug 2023 07:53:59 +0000 Subject: [PATCH 19/22] Fix wrong font name (#1353) --- .config/fontconfig/fonts.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/fontconfig/fonts.conf b/.config/fontconfig/fonts.conf index d7048ba2..761ae00a 100755 --- a/.config/fontconfig/fonts.conf +++ b/.config/fontconfig/fonts.conf @@ -32,7 +32,7 @@ monospace Noto Sans Mono - Liberatinus Mono + Libertinus Mono FontAwesome Braille From 86f05abcce1fd270032975775adb40040c746cfe Mon Sep 17 00:00:00 2001 From: appeasementPolitik <108810900+appeasementPolitik@users.noreply.github.com> Date: Fri, 25 Aug 2023 07:56:50 +0000 Subject: [PATCH 20/22] Fix the extra space between sb-internet and the block on the right of sb-internet (#1352) --- .local/bin/statusbar/sb-internet | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.local/bin/statusbar/sb-internet b/.local/bin/statusbar/sb-internet index 4c8131ce..5440a52d 100755 --- a/.local/bin/statusbar/sb-internet +++ b/.local/bin/statusbar/sb-internet @@ -25,9 +25,9 @@ elif [ "$(cat /sys/class/net/w*/operstate 2>/dev/null)" = 'down' ] ; then fi # Ethernet -[ "$(cat /sys/class/net/e*/operstate 2>/dev/null)" = 'up' ] && ethericon="🌐 " || ethericon="❎ " +[ "$(cat /sys/class/net/e*/operstate 2>/dev/null)" = 'up' ] && ethericon="🌐" || ethericon="❎" # TUN -[ -n "$(cat /sys/class/net/tun*/operstate 2>/dev/null)" ] && tunicon="πŸ”’ " +[ -n "$(cat /sys/class/net/tun*/operstate 2>/dev/null)" ] && tunicon=" πŸ”’" printf "%s%s%s\n" "$wifiicon" "$ethericon" "$tunicon" From c550a7c6e54fba8d4cf6024b2ffcf2a475367bd3 Mon Sep 17 00:00:00 2001 From: Hylke Hellinga Date: Sun, 3 Sep 2023 09:20:13 +0200 Subject: [PATCH 21/22] Fixed Booksplit for termux (#1358) Co-authored-by: Simbaclaws --- .local/bin/booksplit | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.local/bin/booksplit b/.local/bin/booksplit index a6845f73..079d85f2 100755 --- a/.local/bin/booksplit +++ b/.local/bin/booksplit @@ -12,7 +12,7 @@ inputaudio="$1" ext="${1##*.}" # Get a safe file name from the book. -escbook="$(echo "$booktitle" | iconv -cf UTF-8 -t ASCII//TRANSLIT | tr -d '[:punct:]' | tr '[:upper:]' '[:lower:]' | tr ' ' '-' | sed "s/-\+/-/g;s/\(^-\|-\$\)//g")" +escbook="$(echo "$booktitle" | iconv -c -f UTF-8 -t ASCII//TRANSLIT | tr -d '[:punct:]' | tr '[:upper:]' '[:lower:]' | tr ' ' '-' | sed "s/-\+/-/g;s/\(^-\|-\$\)//g")" ! mkdir -p "$escbook" && echo "Do you have write access in this directory?" && @@ -31,7 +31,7 @@ do cmd="$cmd -metadata artist=\"$author\" -metadata title=\"$title\" -metadata album=\"$booktitle\" -metadata year=\"$year\" -metadata track=\"$track\" -metadata total=\"$total\" -ss \"$start\" -to \"$end\" -vn -c:a copy \"$file\" " fi title="$(echo "$x" | cut -d' ' -f2-)" - esctitle="$(echo "$title" | iconv -cf UTF-8 -t ASCII//TRANSLIT | tr -d '[:punct:]' | tr '[:upper:]' '[:lower:]' | tr ' ' '-' | sed "s/-\+/-/g;s/\(^-\|-\$\)//g")" + esctitle="$(echo "$title" | iconv -c -f UTF-8 -t ASCII//TRANSLIT | tr -d '[:punct:]' | tr '[:upper:]' '[:lower:]' | tr ' ' '-' | sed "s/-\+/-/g;s/\(^-\|-\$\)//g")" track="$((track+1))" start="$end" done < "$2" From b8cd0ab4953d053fef09c48ba04f2fbb2df57aa4 Mon Sep 17 00:00:00 2001 From: sban <30375170+mr-sban@users.noreply.github.com> Date: Tue, 5 Sep 2023 07:51:05 +0000 Subject: [PATCH 22/22] Timeout added to forecast module, ncmpcpp now tracks player state (#1359) * Added timeout to getforecast to prevent status bar breakage. A 2 second timeout is used in the case that wttr.in is inaccessible when dwm is started; as otherwise it tries to curl wttr.in indefinitely, not allowing other status bar modules to be loaded. * Update music status bar module on player state change --- .config/ncmpcpp/config | 1 + .local/bin/statusbar/sb-forecast | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.config/ncmpcpp/config b/.config/ncmpcpp/config index 3111aabb..1e2a8b02 100644 --- a/.config/ncmpcpp/config +++ b/.config/ncmpcpp/config @@ -31,3 +31,4 @@ progressbar_elapsed_color = blue:b statusbar_color = red statusbar_time_color = cyan:b execute_on_song_change="pkill -RTMIN+11 dwmblocks" +execute_on_player_state_change="pkill -RTMIN+11 dwmblocks" diff --git a/.local/bin/statusbar/sb-forecast b/.local/bin/statusbar/sb-forecast index 368c17f7..d8a16aad 100755 --- a/.local/bin/statusbar/sb-forecast +++ b/.local/bin/statusbar/sb-forecast @@ -7,7 +7,7 @@ url="${WTTRURL:-wttr.in}" weatherreport="${XDG_CACHE_HOME:-$HOME/.cache}/weatherreport" # Get a weather report from 'wttr.in' and save it locally. -getforecast() { curl -sf "$url/$LOCATION" > "$weatherreport" || exit 1; } +getforecast() { timeout --signal=1 2s curl -sf "$url/$LOCATION" > "$weatherreport" || exit 1; } # Forecast should be updated only once a day. checkforecast() {