From 708d6c67317ca90138681d4a7892cc5db2e092cc Mon Sep 17 00:00:00 2001 From: appeasementPolitik <108810900+appeasementPolitik@users.noreply.github.com> Date: Wed, 4 Oct 2023 20:01:05 +0000 Subject: [PATCH 01/60] Change remaining tremc entry in script to stig (#1364) --- .local/bin/statusbar/sb-torrent | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.local/bin/statusbar/sb-torrent b/.local/bin/statusbar/sb-torrent index 65270050..08c9173c 100755 --- a/.local/bin/statusbar/sb-torrent +++ b/.local/bin/statusbar/sb-torrent @@ -11,9 +11,9 @@ transmission-remote -l | grep % | sort -h | uniq -c | awk '{print $3 $1}' | paste -sd ' ' - case $BLOCK_BUTTON in - 1) setsid -f "$TERMINAL" -e tremc ;; + 1) setsid -f "$TERMINAL" -e stig ;; 2) td-toggle ;; - 3) notify-send "🌱 Torrent module" "\- Left click to open tremc. + 3) notify-send "🌱 Torrent module" "\- Left click to open stig. - Middle click to toggle transmission. - Shift click to edit script. Module shows number of torrents: From 42f3efb4b0c57003d8c49e8e946948b458bea873 Mon Sep 17 00:00:00 2001 From: Dawid Potocki Date: Sat, 28 Oct 2023 07:52:44 +1300 Subject: [PATCH 02/60] Add xdg-terminal-exec script to launch "$TERMINAL" for .desktop files (#1302) --- .local/bin/xdg-terminal-exec | 3 +++ 1 file changed, 3 insertions(+) create mode 100755 .local/bin/xdg-terminal-exec diff --git a/.local/bin/xdg-terminal-exec b/.local/bin/xdg-terminal-exec new file mode 100755 index 00000000..12b18ffc --- /dev/null +++ b/.local/bin/xdg-terminal-exec @@ -0,0 +1,3 @@ +#!/bin/sh + +"$TERMINAL" -e "$@" From bca6b403eb61df8f36e543a95ea48a07e546a9d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emre=20AKY=C3=9CZ?= Date: Fri, 27 Oct 2023 21:54:15 +0300 Subject: [PATCH 03/60] Unpack Function for LF Without Aunpack (#1334) We can simply eliminate the usage of an external tool by adding a simple case statement to handle different types of compressed files. --- .config/lf/lfrc | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/.config/lf/lfrc b/.config/lf/lfrc index 56a41825..e104591b 100644 --- a/.config/lf/lfrc +++ b/.config/lf/lfrc @@ -58,7 +58,22 @@ cmd extract ${{ printf "%s\n\t" "$fx" printf "extract?[y/N]" read ans - [ $ans = "y" ] && aunpack $fx + [ $ans = "y" ] && { + case $fx in + *.tar.bz2) tar xjf $fx ;; + *.tar.gz) tar xzf $fx ;; + *.bz2) bunzip2 $fx ;; + *.rar) unrar e $fx ;; + *.gz) gunzip $fx ;; + *.tar) tar xf $fx ;; + *.tbz2) tar xjf $fx ;; + *.tgz) tar xzf $fx ;; + *.zip) unzip $fx ;; + *.Z) uncompress $fx ;; + *.7z) 7z x $fx ;; + *.tar.xz) tar xf $fx ;; + esac + } }} cmd delete ${{ From 54c0aa2af8e0b998d1666a13bd86e6abcd08a291 Mon Sep 17 00:00:00 2001 From: poeplva <132710624+poeplva@users.noreply.github.com> Date: Fri, 27 Oct 2023 21:58:05 +0300 Subject: [PATCH 04/60] none of the encrypted devices are listed if no drives are decrypted already (#1338) The part ``` for open in $decrypted; do [ "$uuid" = "$open" ] && break 1 done ``` exits with `0` if the variable `$decrypted` is empty, causing none of the encrypted devices to be put into the `$unopenedluks` variable. This commit fixes this problem. --- .local/bin/mounter | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.local/bin/mounter b/.local/bin/mounter index b532e08f..756d04db 100755 --- a/.local/bin/mounter +++ b/.local/bin/mounter @@ -36,7 +36,7 @@ filter() { sed "s/ /:/g" | awk -F':' '$7==""{printf "%s%s (%s) %s\n",$1,$3,$5,$6 unopenedluks="$(for drive in $allluks; do uuid="${drive%% *}" uuid="${uuid//-}" # This is a bashism. - for open in $decrypted; do + [ -n "$decrypted" ] && for open in $decrypted; do [ "$uuid" = "$open" ] && break 1 done && continue 1 echo "πŸ”’ $drive" From ca8cb1f6a7513e52b112b99a686844a587cebd89 Mon Sep 17 00:00:00 2001 From: appeasementPolitik <108810900+appeasementPolitik@users.noreply.github.com> Date: Fri, 27 Oct 2023 18:58:40 +0000 Subject: [PATCH 05/60] Update sb-mailbox in statusbar on closing neomutt (#1329) --- .local/bin/statusbar/sb-mailbox | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.local/bin/statusbar/sb-mailbox b/.local/bin/statusbar/sb-mailbox index 2132184c..88522f25 100755 --- a/.local/bin/statusbar/sb-mailbox +++ b/.local/bin/statusbar/sb-mailbox @@ -4,7 +4,7 @@ # When clicked, brings up `neomutt`. case $BLOCK_BUTTON in - 1) setsid -f "$TERMINAL" -e neomutt ;; + 1) setsid -w -f "$TERMINAL" -e neomutt; pkill -RTMIN+12 "${STATUSBAR:-dwmblocks}" ;; 2) setsid -f mw -Y >/dev/null ;; 3) notify-send "πŸ“¬ Mail module" "\- Shows unread mail - Shows πŸ”ƒ if syncing mail From 1e3adf9c03b2e563e81a13d6907ffd5ca20b887a Mon Sep 17 00:00:00 2001 From: Lalle <29478339+LalleSX@users.noreply.github.com> Date: Fri, 27 Oct 2023 21:42:32 +0200 Subject: [PATCH 06/60] Launch dwm in a dbus session (#1340) * Launch dwm in a dbus session * Add ssh-agent * Update dbus env * Update xprofile --- .config/x11/xinitrc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.config/x11/xinitrc b/.config/x11/xinitrc index 2debc017..e99da8cc 100755 --- a/.config/x11/xinitrc +++ b/.config/x11/xinitrc @@ -13,5 +13,6 @@ if [ -f "${XDG_CONFIG_HOME:-$HOME/.config}/x11/xprofile" ]; then else . "$HOME/.xprofile" fi - +# Activate dbus variables +dbus-update-activation-environment --all ssh-agent dwm From 6ba48b27339d47732519476333712bb4b2cde87f Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sat, 28 Oct 2023 08:41:26 -0400 Subject: [PATCH 07/60] fix #1366 --- .config/{sxiv => nsxiv}/exec/key-handler | 0 .config/sxiv | 1 + 2 files changed, 1 insertion(+) rename .config/{sxiv => nsxiv}/exec/key-handler (100%) create mode 120000 .config/sxiv diff --git a/.config/sxiv/exec/key-handler b/.config/nsxiv/exec/key-handler similarity index 100% rename from .config/sxiv/exec/key-handler rename to .config/nsxiv/exec/key-handler diff --git a/.config/sxiv b/.config/sxiv new file mode 120000 index 00000000..42529649 --- /dev/null +++ b/.config/sxiv @@ -0,0 +1 @@ +nsxiv \ No newline at end of file From ea3e1e14cc49d68c9900fb05d9ee7bb9e719688e Mon Sep 17 00:00:00 2001 From: Joey-Pepperoni <91891926+Joey-Pepperoni@users.noreply.github.com> Date: Sun, 29 Oct 2023 07:21:47 -0500 Subject: [PATCH 08/60] Update sb-music (#1367) The s/\\&/&/g operation only effect is to add "amp;" after any ampersand in the artist or song name. "&" displays just fine anyways, so there's no reason to include an operation to replace it. --- .local/bin/statusbar/sb-music | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.local/bin/statusbar/sb-music b/.local/bin/statusbar/sb-music index d164b4be..266b9160 100755 --- a/.local/bin/statusbar/sb-music +++ b/.local/bin/statusbar/sb-music @@ -1,6 +1,6 @@ #!/bin/sh -filter() { sed "/^volume:/d;s/\\&/&/g;s/\\[paused\\].*/⏸/g;/\\[playing\\].*/d;/^ERROR/Q" | paste -sd ' ' -;} +filter() { sed "/^volume:/d;s/\\[paused\\].*/⏸/g;/\\[playing\\].*/d;/^ERROR/Q" | paste -sd ' ' -;} pidof -x sb-mpdup >/dev/null 2>&1 || sb-mpdup >/dev/null 2>&1 & From 031938a792ac3107a512e89504929ef9e3e8ed6a Mon Sep 17 00:00:00 2001 From: Dominik Date: Sat, 4 Nov 2023 13:33:18 +0100 Subject: [PATCH 09/60] Update dmenurecord (#1370) --- .local/bin/dmenurecord | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.local/bin/dmenurecord b/.local/bin/dmenurecord index 990b7b3c..ca6b0117 100755 --- a/.local/bin/dmenurecord +++ b/.local/bin/dmenurecord @@ -9,7 +9,7 @@ # # If there is already a running instance, user will be prompted to end it. -getdim() { xrandr | sed -n "s/\s*\([0-9]\+x[0-9]\+\).*\*.*/\1/p" ;} +getdim() { xrandr | grep -oP '(?<=current ).*(?=,)' | tr -d ' ' ;} updateicon() { \ echo "$1" > /tmp/recordingicon From 50e72a1a0306d4343360b31f941ef73b4c2e8ba5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emre=20AKY=C3=9CZ?= Date: Mon, 13 Nov 2023 16:30:08 +0300 Subject: [PATCH 10/60] An unnecessary(?), small improvement for lf mkdir command (#1372) The new method is more robust and better handles directory names with spaces and special characters. It's more minimal. --- .config/lf/lfrc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/lf/lfrc b/.config/lf/lfrc index e104591b..e783d728 100644 --- a/.config/lf/lfrc +++ b/.config/lf/lfrc @@ -50,7 +50,7 @@ cmd open ${{ esac }} -cmd mkdir $mkdir -p "$(echo $* | tr ' ' '\ ')" +cmd mkdir $mkdir -p "$@" cmd extract ${{ clear; tput cup $(($(tput lines)/3)); tput bold @@ -139,7 +139,7 @@ map D delete map E extract map C copyto map M moveto -map push :mkdir +map push :mkdir"" map reload map set hidden! map shell From 0db54f96180c312bcefb7931632d5f8005e0772b Mon Sep 17 00:00:00 2001 From: thirtysix <109920169+thirtysixpw@users.noreply.github.com> Date: Wed, 15 Nov 2023 04:34:29 +0300 Subject: [PATCH 11/60] Fix pdf and plain text previws in lf (#1369) * Fix pdf and plain text previws in lf Pdf previws don't appear because are generated with wrong filename. Plain text previws with `bat` don't respect terminal theme and have annoying border. * Revert pdf cache filename to work properly --- .config/lf/scope | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.config/lf/scope b/.config/lf/scope index cc556697..16fca21e 100755 --- a/.config/lf/scope +++ b/.config/lf/scope @@ -13,10 +13,6 @@ image() { fi } -ifub() { - [ -n "$DISPLAY" ] && [ -z "$WAYLAND_DISPLAY" ] && command -V ueberzug >/dev/null 2>&1 -} - # Note that the cache file name is a function of file information, meaning if # an image appears in multiple places across the machine, it will not have to # be regenerated once seen. @@ -32,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 | application/x-ndjson) bat --terminal-width "$(($4-2))" -f "$1" ;; + text/* | */xml | application/json | application/x-ndjson) bat -p --theme ansi --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 52fab9d50a898cf1818fffdc1eacb46e336c0eac Mon Sep 17 00:00:00 2001 From: thirtysix <109920169+thirtysixpw@users.noreply.github.com> Date: Wed, 15 Nov 2023 04:35:14 +0300 Subject: [PATCH 12/60] Make shell profile POSIX, remove unnecessary variable fallbacks (#1368) --- .config/shell/profile | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/.config/shell/profile b/.config/shell/profile index 55089430..872e312a 100644 --- a/.config/shell/profile +++ b/.config/shell/profile @@ -1,14 +1,12 @@ -#!/bin/zsh +#!/bin/sh +# shellcheck disable=SC2155 -# profile file. Runs on login. Environmental variables are set here. +# Profile file, runs on login. Environmental variables are set here. -# If you don't plan on reverting to bash, you can remove the link in ~/.profile -# to clean up. +# Add all directories in `~/.local/bin` to $PATH +export PATH="$PATH:$(find ~/.local/bin -type d | paste -sd ':' -)" -# Adds `~/.local/bin` to $PATH -export PATH="$PATH:${$(find ~/.local/bin -type d -printf %p:)%%:}" - -unsetopt PROMPT_SP +unsetopt PROMPT_SP 2>/dev/null # Default programs: export EDITOR="nvim" @@ -52,7 +50,7 @@ export SQLITE_HISTORY="$XDG_DATA_HOME/sqlite_history" export DICS="/usr/share/stardict/dic/" export SUDO_ASKPASS="$HOME/.local/bin/dmenupass" export FZF_DEFAULT_OPTS="--layout=reverse --height 40%" -export LESS=-R +export LESS="R" export LESS_TERMCAP_mb="$(printf '%b' '')" export LESS_TERMCAP_md="$(printf '%b' '')" export LESS_TERMCAP_me="$(printf '%b' '')" @@ -61,15 +59,15 @@ export LESS_TERMCAP_se="$(printf '%b' '')" export LESS_TERMCAP_us="$(printf '%b' '')" export LESS_TERMCAP_ue="$(printf '%b' '')" export LESSOPEN="| /usr/bin/highlight -O ansi %s 2>/dev/null" -export QT_QPA_PLATFORMTHEME="gtk2" # Have QT use gtk2 theme. -export MOZ_USE_XINPUT2="1" # Mozilla smooth scrolling/touchpads. +export QT_QPA_PLATFORMTHEME="gtk2" # Have QT use gtk2 theme. +export MOZ_USE_XINPUT2=1 # Mozilla smooth scrolling/touchpads. export AWT_TOOLKIT="MToolkit wmname LG3D" # May have to install wmname -export _JAVA_AWT_WM_NONREPARENTING=1 # Fix for Java applications in dwm +export _JAVA_AWT_WM_NONREPARENTING=1 # Fix for Java applications in dwm -[ ! -f ${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc ] && setsid shortcuts >/dev/null 2>&1 +[ ! -f "$XDG_CONFIG_HOME/shell/shortcutrc" ] && setsid -f shortcuts >/dev/null 2>&1 # Start graphical server on user's current tty if not already running. [ "$(tty)" = "/dev/tty1" ] && ! pidof -s Xorg >/dev/null 2>&1 && exec startx "$XINITRC" # Switch escape and caps if tty and no passwd required: -sudo -n loadkeys ${XDG_DATA_HOME:-$HOME/.local/share}/larbs/ttymaps.kmap 2>/dev/null +sudo -n loadkeys "$XDG_DATA_HOME/larbs/ttymaps.kmap" 2>/dev/null From bbcbac64faac20b2aaa0ac9293af6577b176a6d4 Mon Sep 17 00:00:00 2001 From: appeasementPolitik <108810900+appeasementPolitik@users.noreply.github.com> Date: Wed, 15 Nov 2023 01:35:53 +0000 Subject: [PATCH 13/60] Fix unsupported characters in vim-airline (#1317) --- .config/nvim/init.vim | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index 5b0bd4e7..8346777b 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -67,6 +67,14 @@ set noshowcmd nm i :call ToggleIPA() imap i :call ToggleIPA()a nm q :call ToggleProse() + +" vim-airline + if !exists('g:airline_symbols') + let g:airline_symbols = {} + endif + let g:airline_symbols.colnr = ' C:' + let g:airline_symbols.linenr = ' L:' + let g:airline_symbols.maxlinenr = '☰ ' " Shortcutting split navigation, saving a keypress: map h From 07952026753f1bbeaf5b6c4eb5414a9c51536041 Mon Sep 17 00:00:00 2001 From: Luciano Date: Tue, 14 Nov 2023 22:37:39 -0300 Subject: [PATCH 14/60] lf-scope: adds SVG preview creating cache. (#1360) --- .config/lf/scope | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.config/lf/scope b/.config/lf/scope index 16fca21e..8265a879 100755 --- a/.config/lf/scope +++ b/.config/lf/scope @@ -25,6 +25,11 @@ case "$(file --dereference --brief --mime-type -- "$1")" in 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/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)" + [ ! -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/*) 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 7a96fb100cf385e05c211937b509d2bf166299e6 Mon Sep 17 00:00:00 2001 From: Jameson <108906685+2084x@users.noreply.github.com> Date: Sun, 31 Dec 2023 04:04:51 +1100 Subject: [PATCH 15/60] script fixes (#1386) * fix typo in lfub * use setsid when editing scripts * fix immediate exit on middle click --------- Co-authored-by: 2084x <2084x@noreply.codeberg.org> --- .local/bin/lfub | 2 +- .local/bin/statusbar/sb-battery | 2 +- .local/bin/statusbar/sb-clock | 2 +- .local/bin/statusbar/sb-cpu | 2 +- .local/bin/statusbar/sb-cpubars | 2 +- .local/bin/statusbar/sb-disk | 2 +- .local/bin/statusbar/sb-doppler | 2 +- .local/bin/statusbar/sb-forecast | 2 +- .local/bin/statusbar/sb-help-icon | 2 +- .local/bin/statusbar/sb-internet | 2 +- .local/bin/statusbar/sb-kbselect | 2 +- .local/bin/statusbar/sb-mailbox | 2 +- .local/bin/statusbar/sb-memory | 2 +- .local/bin/statusbar/sb-moonphase | 2 +- .local/bin/statusbar/sb-music | 2 +- .local/bin/statusbar/sb-nettraf | 2 +- .local/bin/statusbar/sb-news | 4 ++-- .local/bin/statusbar/sb-pacpackages | 2 +- .local/bin/statusbar/sb-price | 2 +- .local/bin/statusbar/sb-tasks | 2 +- .local/bin/statusbar/sb-torrent | 2 +- .local/bin/statusbar/sb-volume | 2 +- 22 files changed, 23 insertions(+), 23 deletions(-) diff --git a/.local/bin/lfub b/.local/bin/lfub index 9012f506..f9bb2df9 100755 --- a/.local/bin/lfub +++ b/.local/bin/lfub @@ -1,6 +1,6 @@ #!/bin/sh -# This is a wrapper script for lb that allows it to create image previews with +# This is a wrapper script for lf that allows it to create image previews with # ueberzug. This works in concert with the lf configuration file and the # lf-cleaner script. diff --git a/.local/bin/statusbar/sb-battery b/.local/bin/statusbar/sb-battery index 93cbe088..79030bcc 100755 --- a/.local/bin/statusbar/sb-battery +++ b/.local/bin/statusbar/sb-battery @@ -13,7 +13,7 @@ case $BLOCK_BUTTON in - Scroll to change adjust xbacklight." ;; 4) xbacklight -inc 10 ;; 5) xbacklight -dec 10 ;; - 6) "$TERMINAL" -e "$EDITOR" "$0" ;; + 6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;; esac # Loop through all attached batteries and format the info diff --git a/.local/bin/statusbar/sb-clock b/.local/bin/statusbar/sb-clock index 93f8aea9..ac12aac1 100755 --- a/.local/bin/statusbar/sb-clock +++ b/.local/bin/statusbar/sb-clock @@ -23,7 +23,7 @@ case $BLOCK_BUTTON in 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" ;; - 6) "$TERMINAL" -e "$EDITOR" "$0" ;; + 6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;; esac date "+%Y %b %d (%a) $icon%I:%M%p" diff --git a/.local/bin/statusbar/sb-cpu b/.local/bin/statusbar/sb-cpu index 1572b527..5b8fb933 100755 --- a/.local/bin/statusbar/sb-cpu +++ b/.local/bin/statusbar/sb-cpu @@ -6,7 +6,7 @@ case $BLOCK_BUTTON in 3) notify-send "πŸ–₯ CPU module " "\- Shows CPU temperature. - Click to show intensive processes. - Middle click to open htop." ;; - 6) "$TERMINAL" -e "$EDITOR" "$0" ;; + 6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;; esac sensors | awk '/Core 0/ {print "🌑" $3}' diff --git a/.local/bin/statusbar/sb-cpubars b/.local/bin/statusbar/sb-cpubars index 297424e7..40158934 100755 --- a/.local/bin/statusbar/sb-cpubars +++ b/.local/bin/statusbar/sb-cpubars @@ -12,7 +12,7 @@ case $BLOCK_BUTTON in 2) setsid -f "$TERMINAL" -e htop ;; 3) notify-send "πŸͺ¨ CPU load module" "Each bar represents one CPU core";; - 6) "$TERMINAL" -e "$EDITOR" "$0" ;; + 6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;; esac # id total idle diff --git a/.local/bin/statusbar/sb-disk b/.local/bin/statusbar/sb-disk index e947509d..7f3ff798 100755 --- a/.local/bin/statusbar/sb-disk +++ b/.local/bin/statusbar/sb-disk @@ -11,7 +11,7 @@ case $BLOCK_BUTTON in 1) notify-send "πŸ’½ Disk space" "$(df -h --output=target,used,size)" ;; 3) notify-send "πŸ’½ Disk module" "\- Shows used hard drive space. - Click to show all disk info." ;; - 6) "$TERMINAL" -e "$EDITOR" "$0" ;; + 6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;; esac case "$location" in diff --git a/.local/bin/statusbar/sb-doppler b/.local/bin/statusbar/sb-doppler index f58b744e..a687c681 100755 --- a/.local/bin/statusbar/sb-doppler +++ b/.local/bin/statusbar/sb-doppler @@ -274,7 +274,7 @@ case $BLOCK_BUTTON in 3) notify-send "πŸ—ΊοΈ Doppler RADAR module" "\- Left click for local Doppler RADAR. - Middle click to update RADAR location. After $secs seconds, new clicks will also automatically update the doppler RADAR." ;; - 6) "$TERMINAL" -e "$EDITOR" "$0" ;; + 6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;; esac echo πŸŒ… diff --git a/.local/bin/statusbar/sb-forecast b/.local/bin/statusbar/sb-forecast index d8a16aad..52256019 100755 --- a/.local/bin/statusbar/sb-forecast +++ b/.local/bin/statusbar/sb-forecast @@ -45,7 +45,7 @@ case $BLOCK_BUTTON in β˜”: Chance of rain/snow πŸ₯Ά: Daily low 🌞: Daily high" ;; - 6) "$TERMINAL" -e "$EDITOR" "$0" ;; + 6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;; esac checkforecast || getforecast diff --git a/.local/bin/statusbar/sb-help-icon b/.local/bin/statusbar/sb-help-icon index 8fa4a52c..8372e6f8 100755 --- a/.local/bin/statusbar/sb-help-icon +++ b/.local/bin/statusbar/sb-help-icon @@ -13,5 +13,5 @@ case $BLOCK_BUTTON in 2) restartwm ;; 3) notify-send "❓ Help module" "\- Left click to open LARBS guide. - Middle click to refresh window manager." ;; - 6) "$TERMINAL" -e "$EDITOR" "$0" ;; + 6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;; esac; echo "❓" diff --git a/.local/bin/statusbar/sb-internet b/.local/bin/statusbar/sb-internet index 5440a52d..6d0c5133 100755 --- a/.local/bin/statusbar/sb-internet +++ b/.local/bin/statusbar/sb-internet @@ -14,7 +14,7 @@ case $BLOCK_BUTTON in 🌐: ethernet working πŸ”’: vpn is active " ;; - 6) "$TERMINAL" -e "$EDITOR" "$0" ;; + 6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;; esac # Wifi diff --git a/.local/bin/statusbar/sb-kbselect b/.local/bin/statusbar/sb-kbselect index ab2140c3..df455c14 100755 --- a/.local/bin/statusbar/sb-kbselect +++ b/.local/bin/statusbar/sb-kbselect @@ -11,7 +11,7 @@ case $BLOCK_BUTTON in pkill -RTMIN+30 "${STATUSBAR:-dwmblocks}";; 3) notify-send "⌨ Keyboard/language module" "$(printf "%s" "\- Current layout: $(setxkbmap -query | grep -oP 'layout:\s*\K\w+')") - Left click to change keyboard.";; - 6) "$TERMINAL" -e "$EDITOR" "$0" ;; + 6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;; esac echo "$kb" diff --git a/.local/bin/statusbar/sb-mailbox b/.local/bin/statusbar/sb-mailbox index 88522f25..7483aa48 100755 --- a/.local/bin/statusbar/sb-mailbox +++ b/.local/bin/statusbar/sb-mailbox @@ -10,7 +10,7 @@ case $BLOCK_BUTTON in - Shows πŸ”ƒ if syncing mail - Left click opens neomutt - Middle click syncs mail" ;; - 6) "$TERMINAL" -e "$EDITOR" "$0" ;; + 6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;; esac unread="$(find "${XDG_DATA_HOME:-$HOME/.local/share}"/mail/*/[Ii][Nn][Bb][Oo][Xx]/new/* -type f | wc -l 2>/dev/null)" diff --git a/.local/bin/statusbar/sb-memory b/.local/bin/statusbar/sb-memory index 01d3daf9..8178b10b 100755 --- a/.local/bin/statusbar/sb-memory +++ b/.local/bin/statusbar/sb-memory @@ -6,7 +6,7 @@ case $BLOCK_BUTTON in 3) notify-send "🧠 Memory module" "\- Shows Memory Used/Total. - Click to show memory hogs. - Middle click to open htop." ;; - 6) "$TERMINAL" -e "$EDITOR" "$0" ;; + 6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;; esac free --mebi | sed -n '2{p;q}' | awk '{printf ("🧠%2.2fGiB/%2.2fGiB\n", ( $3 / 1024), ($2 / 1024))}' diff --git a/.local/bin/statusbar/sb-moonphase b/.local/bin/statusbar/sb-moonphase index 99adaee8..d496ae22 100755 --- a/.local/bin/statusbar/sb-moonphase +++ b/.local/bin/statusbar/sb-moonphase @@ -33,5 +33,5 @@ case $BLOCK_BUTTON in - πŸŒ–: Waning Gibbous - πŸŒ—: Last Quarter - 🌘: Waning Crescent" ;; - 6) "$TERMINAL" -e "$EDITOR" "$0" ;; + 6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;; esac diff --git a/.local/bin/statusbar/sb-music b/.local/bin/statusbar/sb-music index 266b9160..6734eeb7 100755 --- a/.local/bin/statusbar/sb-music +++ b/.local/bin/statusbar/sb-music @@ -14,6 +14,6 @@ case $BLOCK_BUTTON in - Scroll changes track.";; # right click, pause/unpause 4) mpc prev | filter ;; # scroll up, previous 5) mpc next | filter ;; # scroll down, next - 6) mpc status | filter ; "$TERMINAL" -e "$EDITOR" "$0" ;; + 6) mpc status | filter ; setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;; *) mpc status | filter ;; esac diff --git a/.local/bin/statusbar/sb-nettraf b/.local/bin/statusbar/sb-nettraf index 178f6773..08cb8299 100755 --- a/.local/bin/statusbar/sb-nettraf +++ b/.local/bin/statusbar/sb-nettraf @@ -8,7 +8,7 @@ case $BLOCK_BUTTON in 1) setsid -f "$TERMINAL" -e bmon ;; 3) notify-send "🌐 Network traffic module" "πŸ”»: Traffic received πŸ”Ί: Traffic transmitted" ;; - 6) "$TERMINAL" -e "$EDITOR" "$0" ;; + 6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;; esac update() { diff --git a/.local/bin/statusbar/sb-news b/.local/bin/statusbar/sb-news index fe701db6..cc481e1e 100755 --- a/.local/bin/statusbar/sb-news +++ b/.local/bin/statusbar/sb-news @@ -5,13 +5,13 @@ case $BLOCK_BUTTON in 1) setsid "$TERMINAL" -e newsboat ;; - 2) setsid -f newsup >/dev/null exit ;; + 2) setsid -f newsup >/dev/null && exit ;; 3) notify-send "πŸ“° News module" "\- Shows unread news items - Shows πŸ”ƒ if updating with \`newsup\` - Left click opens newsboat - Middle click syncs RSS feeds Note: Only one instance of newsboat (including updates) may be running at a time." ;; - 6) "$TERMINAL" -e "$EDITOR" "$0" ;; + 6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;; esac cat /tmp/newsupdate 2>/dev/null || echo "$(newsboat -x print-unread | awk '{ if($1>0) print "πŸ“°" $1}')$(cat "${XDG_CONFIG_HOME:-$HOME/.config}"/newsboat/.update 2>/dev/null)" diff --git a/.local/bin/statusbar/sb-pacpackages b/.local/bin/statusbar/sb-pacpackages index 37ebed32..6acdce68 100755 --- a/.local/bin/statusbar/sb-pacpackages +++ b/.local/bin/statusbar/sb-pacpackages @@ -23,7 +23,7 @@ case $BLOCK_BUTTON in 3) notify-send "🎁 Upgrade module" "πŸ“¦: number of upgradable packages - Left click to upgrade packages - Middle click to show upgradable packages" ;; - 6) "$TERMINAL" -e "$EDITOR" "$0" ;; + 6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;; esac pacman -Qu | grep -Fcv "[ignored]" | sed "s/^/πŸ“¦/;s/^πŸ“¦0$//g" diff --git a/.local/bin/statusbar/sb-price b/.local/bin/statusbar/sb-price index f95c8152..611ec36f 100755 --- a/.local/bin/statusbar/sb-price +++ b/.local/bin/statusbar/sb-price @@ -44,7 +44,7 @@ case $BLOCK_BUTTON in - Shows πŸ”ƒ if updating prices. - Last updated: $uptime" ;; - 6) "$TERMINAL" -e "$EDITOR" "$0" ;; + 6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;; esac [ -n "$updateme" ] && diff --git a/.local/bin/statusbar/sb-tasks b/.local/bin/statusbar/sb-tasks index 586300ee..4beb2d09 100755 --- a/.local/bin/statusbar/sb-tasks +++ b/.local/bin/statusbar/sb-tasks @@ -13,7 +13,7 @@ case $BLOCK_BUTTON in 1) setsid -f "$TERMINAL" -e tsp -l ;; 3) notify-send "Tasks module" "πŸ€–: number of running/queued background tasks - Left click opens tsp" ;; # Right click - 2) $EDITOR "$0" ;; # Middle click + 6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;; esac [ "$num" != "0(0)" ] && diff --git a/.local/bin/statusbar/sb-torrent b/.local/bin/statusbar/sb-torrent index 08c9173c..493631bc 100755 --- a/.local/bin/statusbar/sb-torrent +++ b/.local/bin/statusbar/sb-torrent @@ -23,5 +23,5 @@ Module shows number of torrents: πŸ”½: downloading βœ…: done 🌱: done and seeding" ;; - 6) "$TERMINAL" -e "$EDITOR" "$0" ;; + 6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;; esac diff --git a/.local/bin/statusbar/sb-volume b/.local/bin/statusbar/sb-volume index fa0abcd5..e66dea77 100755 --- a/.local/bin/statusbar/sb-volume +++ b/.local/bin/statusbar/sb-volume @@ -10,7 +10,7 @@ case $BLOCK_BUTTON in 3) notify-send "πŸ“’ Volume module" "\- Shows volume πŸ”Š, πŸ”‡ if muted. - Middle click to mute. - Scroll to change." ;; - 6) "$TERMINAL" -e "$EDITOR" "$0" ;; + 6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;; esac vol="$(wpctl get-volume @DEFAULT_AUDIO_SINK@)" From cf4a12acb3a70951fd59d67e0738bf3ab2d1045c Mon Sep 17 00:00:00 2001 From: ewof Date: Thu, 28 Mar 2024 09:13:34 -0400 Subject: [PATCH 16/60] 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 17/60] 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 18/60] 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 19/60] 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 20/60] [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 21/60] [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 22/60] 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 23/60] 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 24/60] 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 25/60] 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 26/60] 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 27/60] 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 28/60] 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 29/60] 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 30/60] 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 31/60] 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 32/60] 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 33/60] (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 34/60] 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 35/60] 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 36/60] 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 37/60] 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 38/60] [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 39/60] 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 40/60] 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 From 131dcce2689f9fe45572212803b36be11ff2eb4e Mon Sep 17 00:00:00 2001 From: Kipras Melnikovas Date: Mon, 15 Jul 2024 20:37:04 +0300 Subject: [PATCH 41/60] shortcuts: export env vars for each shortcut (#1395) useful if want to use shortcuts w/ different progs instead of their default behavior (cd / $EDITOR), e.g.: ```sh cd ~/Downloads mv foo.mp3 $music ``` Co-authored-by: Luke Smith --- .config/shell/aliasrc | 2 +- .config/zsh/.zshrc | 1 + .local/bin/shortcuts | 4 ++++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.config/shell/aliasrc b/.config/shell/aliasrc index 07683372..75327bf7 100644 --- a/.config/shell/aliasrc +++ b/.config/shell/aliasrc @@ -57,4 +57,4 @@ alias \ 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" \ + ref="shortcuts >/dev/null; source ${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc ; source ${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutenvrc ; source ${XDG_CONFIG_HOME:-$HOME/.config}/shell/zshnameddirrc" diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index 8af5d134..ff7d4ae5 100644 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -15,6 +15,7 @@ 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" +[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutenvrc" ] && source "${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutenvrc" [ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/aliasrc" ] && source "${XDG_CONFIG_HOME:-$HOME/.config}/shell/aliasrc" [ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/zshnameddirrc" ] && source "${XDG_CONFIG_HOME:-$HOME/.config}/shell/zshnameddirrc" diff --git a/.local/bin/shortcuts b/.local/bin/shortcuts index 0c7cf75d..08a2f57d 100755 --- a/.local/bin/shortcuts +++ b/.local/bin/shortcuts @@ -5,6 +5,7 @@ bmfiles="${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-files" # Output locations. Unactivated progs should go to /dev/null. shell_shortcuts="${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc" +shell_env_shortcuts="${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutenvrc" 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" @@ -16,12 +17,14 @@ vifm_shortcuts="/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=sh\\n" > "$shell_env_shortcuts" printf "\" vim: filetype=vim\\n" > "$vifm_shortcuts" # Format the `directories` file in the correct syntax and sent it to all three configs. eval "echo \"$(cat "$bmdirs")\"" | \ 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(\"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\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\" ; @@ -33,6 +36,7 @@ awk "!/^\s*#/ && !/^\s*\$/ {gsub(\"\\\s*#.*$\",\"\"); eval "echo \"$(cat "$bmfiles")\"" | \ awk "!/^\s*#/ && !/^\s*\$/ {gsub(\"\\\s*#.*$\",\"\"); printf(\"%s=\42\$EDITOR %s\42 \\\\\n\",\$1,\$2) >> \"$shell_shortcuts\" ; + printf(\"[ -n \42%s\42 ] && export %s=\42%s\42 \n\",\$1,\$1,\$2) >> \"$shell_env_shortcuts\" ; 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\" ; From 779ef2f5feb3221a1e29262234fafa13c4db5ab7 Mon Sep 17 00:00:00 2001 From: fennomaani <160141733+fennomaani@users.noreply.github.com> Date: Mon, 15 Jul 2024 20:37:38 +0300 Subject: [PATCH 42/60] Update mpd to use PipeWire (#1412) per https://wiki.archlinux.org/title/Music_Player_Daemon#Audio_configuration --- .config/mpd/mpd.conf | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.config/mpd/mpd.conf b/.config/mpd/mpd.conf index bf329d61..1cc2cc81 100644 --- a/.config/mpd/mpd.conf +++ b/.config/mpd/mpd.conf @@ -7,10 +7,8 @@ restore_paused "yes" max_output_buffer_size "16384" audio_output { - type "pulse" - name "pulse" - #type "alsa" - #name "ALSA" + type "pipewire" + name "PipeWire Sound Server" } audio_output { From a9cde940c2a956f98b6a5cd8496d24fe7de58e64 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Mon, 15 Jul 2024 13:46:30 -0400 Subject: [PATCH 43/60] close #1292 --- .local/bin/mounter | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.local/bin/mounter b/.local/bin/mounter index 756d04db..389f2d34 100755 --- a/.local/bin/mounter +++ b/.local/bin/mounter @@ -79,8 +79,13 @@ case "$chosen" in πŸ’Ύ*) chosen="${chosen%% *}" chosen="${chosen:1}" # This is a bashism. + parttype="$(echo "$lsblkoutput" | grep "$chosen")" attemptmount || getmount - sudo -A mount "$chosen" "$mp" -o uid="$(id -u)",gid="$(id -g)" + case "${parttype##* }" in + vfat) sudo -A mount -t vfat "$chosen" "$mp" -o rw,umask=0000 ;; + btrfs) sudo -A mount "$chosen" "$mp" ;; + *) sudo -A mount "$chosen" "$mp" -o uid="$(id -u)",gid="$(id -g)" ;; + esac notify-send "πŸ’ΎDrive Mounted." "$chosen mounted to $mp." ;; From 61026e18de13b27a37337359d596f5ebfdb0f294 Mon Sep 17 00:00:00 2001 From: Rokosun <79040025+futureisfoss@users.noreply.github.com> Date: Tue, 22 Oct 2024 18:34:33 +0000 Subject: [PATCH 44/60] Fix dangerous copy/move script in lf (#1437) Context: I accidentally pressed the C key on my .config directory and was presented with a list of directories to copy it to, then I pressed escape to quit the fzf menu without choosing anything - instead of doing nothing the script copied all of the contents inside my .config directory into my home directory. After dealing with that mess I decided to make this PR which does the following: - Allow users to escape out of the fzf menu without unexpected copies - Asks the user for confirmation before copying/moving files - Some improvements in the UI --- .config/lf/lfrc | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/.config/lf/lfrc b/.config/lf/lfrc index dad917df..5598a307 100644 --- a/.config/lf/lfrc +++ b/.config/lf/lfrc @@ -92,25 +92,37 @@ cmd delete ${{ }} cmd moveto ${{ - clear; tput cup $(($(tput lines)/3)); tput bold set -f - clear; echo "Move to where?" - dest="$(sed -e 's/\s*#.*//' -e '/^$/d' -e 's/^\S*\s*//' ${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-dirs | fzf | sed 's|~|$HOME|')" && + dest=$(sed -e 's/\s*#.*//' -e '/^$/d' -e 's/^\S*\s*//' "${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-dirs" | fzf --prompt 'Move to where? ' | sed 's|~|$HOME|') + [ -z "$dest" ] && exit + destpath=$(eval printf '%s' \"$dest\") + clear; tput cup $(($(tput lines)/3)); tput bold + echo "From:" + echo "$fx" | sed 's/^/ /' + printf "To:\n %s\n\n\tmove?[y/N]" "$destpath" + read -r ans + [ "$ans" != "y" ] && exit for x in $fx; do - eval mv -iv \"$x\" \"$dest\" + mv -iv "$x" "$destpath" done && - notify-send "🚚 File(s) moved." "File(s) moved to $dest." + notify-send "🚚 File(s) moved." "File(s) moved to $destpath." }} cmd copyto ${{ - clear; tput cup $(($(tput lines)/3)); tput bold set -f - clear; echo "Copy to where?" - dest="$(sed -e 's/\s*#.*//' -e '/^$/d' -e 's/^\S*\s*//' ${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-dirs | fzf | sed 's|~|$HOME|')" && + dest=$(sed -e 's/\s*#.*//' -e '/^$/d' -e 's/^\S*\s*//' "${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-dirs" | fzf --prompt 'Copy to where? ' | sed 's|~|$HOME|') + [ -z "$dest" ] && exit + destpath=$(eval printf '%s' \"$dest\") + clear; tput cup $(($(tput lines)/3)); tput bold + echo "From:" + echo "$fx" | sed 's/^/ /' + printf "To:\n %s\n\n\tcopy?[y/N]" "$destpath" + read -r ans + [ "$ans" != "y" ] && exit for x in $fx; do - eval cp -ivr \"$x\" \"$dest\" + cp -ivr "$x" "$destpath" done && - notify-send "πŸ“‹ File(s) copied." "File(s) copies to $dest." + notify-send "πŸ“‹ File(s) copied." "File(s) copied to $destpath." }} cmd setbg "$1" From 6f67789b8b6fa909f3572771d7fe7f221d2d33cd Mon Sep 17 00:00:00 2001 From: appeasementPolitik <108810900+appeasementPolitik@users.noreply.github.com> Date: Tue, 22 Oct 2024 20:46:41 +0200 Subject: [PATCH 45/60] Clean up pipewire conf (#1427) * Clean up pipewire.conf * Needs extra newline --- .config/pipewire/pipewire.conf | 247 ------------------ .../pipewire.conf.d/user-session.conf | 4 + 2 files changed, 4 insertions(+), 247 deletions(-) delete mode 100644 .config/pipewire/pipewire.conf create mode 100644 .config/pipewire/pipewire.conf.d/user-session.conf diff --git a/.config/pipewire/pipewire.conf b/.config/pipewire/pipewire.conf deleted file mode 100644 index b8a36725..00000000 --- a/.config/pipewire/pipewire.conf +++ /dev/null @@ -1,247 +0,0 @@ -# Daemon config file for PipeWire version "0.3.40" # -# -# Copy and edit this file in /etc/pipewire for system-wide changes -# or in ~/.config/pipewire for local changes. - -context.properties = { - ## Configure properties in the system. - #library.name.system = support/libspa-support - #context.data-loop.library.name.system = support/libspa-support - #support.dbus = true - #link.max-buffers = 64 - link.max-buffers = 16 # version < 3 clients can't handle more - #mem.warn-mlock = false - #mem.allow-mlock = true - #mem.mlock-all = false - #clock.power-of-two-quantum = true - #log.level = 2 - #cpu.zero.denormals = true - - core.daemon = true # listening for socket connections - core.name = pipewire-0 # core name and socket name - - ## Properties for the DSP configuration. - #default.clock.rate = 48000 - #default.clock.allowed-rates = [ 48000 ] - #default.clock.quantum = 1024 - #default.clock.min-quantum = 32 - #default.clock.max-quantum = 8192 - #default.video.width = 640 - #default.video.height = 480 - #default.video.rate.num = 25 - #default.video.rate.denom = 1 - # - # These overrides are only applied when running in a vm. - vm.overrides = { - default.clock.min-quantum = 1024 - } -} - -context.spa-libs = { - # = - # - # Used to find spa factory names. It maps an spa factory name - # regular expression to a library name that should contain - # that factory. - # - audio.convert.* = audioconvert/libspa-audioconvert - api.alsa.* = alsa/libspa-alsa - api.v4l2.* = v4l2/libspa-v4l2 - api.libcamera.* = libcamera/libspa-libcamera - api.bluez5.* = bluez5/libspa-bluez5 - api.vulkan.* = vulkan/libspa-vulkan - api.jack.* = jack/libspa-jack - support.* = support/libspa-support - #videotestsrc = videotestsrc/libspa-videotestsrc - #audiotestsrc = audiotestsrc/libspa-audiotestsrc -} - -context.modules = [ - #{ name = - # [ args = { = ... } ] - # [ flags = [ [ ifexists ] [ nofail ] ] - #} - # - # Loads a module with the given parameters. - # If ifexists is given, the module is ignored when it is not found. - # If nofail is given, module initialization failures are ignored. - # - - # Uses RTKit to boost the data thread priority. - { name = libpipewire-module-rtkit - args = { - #nice.level = -11 - #rt.prio = 88 - #rt.time.soft = 2000000 - #rt.time.hard = 2000000 - } - flags = [ ifexists nofail ] - } - - # Set thread priorities without using RTKit. - #{ name = libpipewire-module-rt - # args = { - # nice.level = -11 - # rt.prio = 88 - # rt.time.soft = 2000000 - # rt.time.hard = 2000000 - # } - # flags = [ ifexists nofail ] - #} - - # The native communication protocol. - { name = libpipewire-module-protocol-native } - - # The profile module. Allows application to access profiler - # and performance data. It provides an interface that is used - # by pw-top and pw-profiler. - { name = libpipewire-module-profiler } - - # Allows applications to create metadata objects. It creates - # a factory for Metadata objects. - { name = libpipewire-module-metadata } - - # Creates a factory for making devices that run in the - # context of the PipeWire server. - { name = libpipewire-module-spa-device-factory } - - # Creates a factory for making nodes that run in the - # context of the PipeWire server. - { name = libpipewire-module-spa-node-factory } - - # Allows creating nodes that run in the context of the - # client. Is used by all clients that want to provide - # data to PipeWire. - { name = libpipewire-module-client-node } - - # Allows creating devices that run in the context of the - # client. Is used by the session manager. - { name = libpipewire-module-client-device } - - # The portal module monitors the PID of the portal process - # and tags connections with the same PID as portal - # connections. - { name = libpipewire-module-portal - flags = [ ifexists nofail ] - } - - # The access module can perform access checks and block - # new clients. - { name = libpipewire-module-access - args = { - # access.allowed to list an array of paths of allowed - # apps. - #access.allowed = [ - # /usr/bin/pipewire-media-session - #] - - # An array of rejected paths. - #access.rejected = [ ] - - # An array of paths with restricted access. - #access.restricted = [ ] - - # Anything not in the above lists gets assigned the - # access.force permission. - #access.force = flatpak - } - } - - # Makes a factory for wrapping nodes in an adapter with a - # converter and resampler. - { name = libpipewire-module-adapter } - - # Makes a factory for creating links between ports. - { name = libpipewire-module-link-factory } - - # Provides factories to make session manager objects. - { name = libpipewire-module-session-manager } -] - -context.objects = [ - #{ factory = - # [ args = { = ... } ] - # [ flags = [ [ nofail ] ] - #} - # - # Creates an object from a PipeWire factory with the given parameters. - # If nofail is given, errors are ignored (and no object is created). - # - #{ factory = spa-node-factory args = { factory.name = videotestsrc node.name = videotestsrc Spa:Pod:Object:Param:Props:patternType = 1 } } - #{ factory = spa-device-factory args = { factory.name = api.jack.device foo=bar } flags = [ nofail ] } - #{ factory = spa-device-factory args = { factory.name = api.alsa.enum.udev } } - #{ factory = spa-node-factory args = { factory.name = api.alsa.seq.bridge node.name = Internal-MIDI-Bridge } } - #{ factory = adapter args = { factory.name = audiotestsrc node.name = my-test } } - #{ factory = spa-node-factory args = { factory.name = api.vulkan.compute.source node.name = my-compute-source } } - - # A default dummy driver. This handles nodes marked with the "node.always-driver" - # property when no other driver is currently active. JACK clients need this. - { factory = spa-node-factory - args = { - factory.name = support.node.driver - node.name = Dummy-Driver - node.group = pipewire.dummy - priority.driver = 20000 - } - } - { factory = spa-node-factory - args = { - factory.name = support.node.driver - node.name = Freewheel-Driver - priority.driver = 19000 - node.group = pipewire.freewheel - node.freewheel = true - } - } - # This creates a new Source node. It will have input ports - # that you can link, to provide audio for this source. - #{ factory = adapter - # args = { - # factory.name = support.null-audio-sink - # node.name = "my-mic" - # node.description = "Microphone" - # media.class = "Audio/Source/Virtual" - # audio.position = "FL,FR" - # } - #} - - # This creates a single PCM source device for the given - # alsa device path hw:0. You can change source to sink - # to make a sink in the same way. - #{ factory = adapter - # args = { - # factory.name = api.alsa.pcm.source - # node.name = "alsa-source" - # node.description = "PCM Source" - # media.class = "Audio/Source" - # api.alsa.path = "hw:0" - # api.alsa.period-size = 1024 - # api.alsa.headroom = 0 - # api.alsa.disable-mmap = false - # api.alsa.disable-batch = false - # audio.format = "S16LE" - # audio.rate = 48000 - # audio.channels = 2 - # audio.position = "FL,FR" - # } - #} -] - -context.exec = [ - #{ path = [ args = "" ] } - # - # Execute the given program with arguments. - # - # You can optionally start the session manager here, - # but it is better to start it as a systemd service. - # Run the session manager with -h for options. - # - { path = "/usr/bin/wireplumber" args = "" } - # - # You can optionally start the pulseaudio-server here as well - # but it is better to start it as a systemd service. - # It can be interesting to start another daemon here that listens - # on another address with the -a option (eg. -a tcp:4713). - # - { path = "/usr/bin/pipewire" args = "-c pipewire-pulse.conf" } -] diff --git a/.config/pipewire/pipewire.conf.d/user-session.conf b/.config/pipewire/pipewire.conf.d/user-session.conf new file mode 100644 index 00000000..85b3778a --- /dev/null +++ b/.config/pipewire/pipewire.conf.d/user-session.conf @@ -0,0 +1,4 @@ +context.exec = [ + { path = "/usr/bin/wireplumber" args = "" condition = [ { exec.session-manager = null } { exec.session-manager = true } ] } + { path = "/usr/bin/pipewire" args = "-c pipewire-pulse.conf" condition = [ { exec.pipewire-pulse = null } { exec.pipewire-pulse = true } ] } +] From c43f390f07098c42db5efce654b07870951b512a Mon Sep 17 00:00:00 2001 From: appeasementPolitik <108810900+appeasementPolitik@users.noreply.github.com> Date: Tue, 22 Oct 2024 20:47:41 +0200 Subject: [PATCH 46/60] Fix sb-price after bash -> dash change (#1426) --- .local/bin/statusbar/sb-price | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.local/bin/statusbar/sb-price b/.local/bin/statusbar/sb-price index 611ec36f..6a79f8ab 100755 --- a/.local/bin/statusbar/sb-price +++ b/.local/bin/statusbar/sb-price @@ -28,7 +28,9 @@ filestat="$(stat -c %x "$pricefile" 2>/dev/null)" [ -d "$dir" ] || mkdir -p "$dir" -updateprice() { curl -sf -m 1 --fail-early $denom.$url/{1$target,$target$interval} --output "$pricefile" --output "$chartfile" || +updateprice() { curl -sf \ + --fail-early "${denom}.${url}/1${target}" "${denom}.${url}/${target}${interval}" \ + --output "$pricefile" --output "$chartfile" || rm -f "$pricefile" "$chartfile" ;} [ "${filestat%% *}" != "$(date '+%Y-%m-%d')" ] && From f1c74050126755ca07299ed3438eccac3613812b Mon Sep 17 00:00:00 2001 From: aartoni Date: Sat, 9 Nov 2024 14:43:31 +0700 Subject: [PATCH 47/60] latexmk --- .config/latexmk/latexmkrc | 10 ++++++++++ .config/nvim/init.vim | 2 +- .local/bin/compiler | 14 +------------- 3 files changed, 12 insertions(+), 14 deletions(-) create mode 100644 .config/latexmk/latexmkrc diff --git a/.config/latexmk/latexmkrc b/.config/latexmk/latexmkrc new file mode 100644 index 00000000..b658c5f8 --- /dev/null +++ b/.config/latexmk/latexmkrc @@ -0,0 +1,10 @@ +$bibtex_use = 1.5; +$cleanup_includes_cusdep_generated = 1; +$cleanup_includes_generated = 1; +$out_dir = "out"; +$pdf_mode = 5; +$silent = 1; + +# SyncTeX +push(@generated_exts, ("synctex.*")); +push(@extra_xelatex_options, '-synctex=1') ; diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index 61deed66..6cf6a3ac 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -91,7 +91,7 @@ colorscheme vim map p :!opout "%:p" " Runs a script that cleans out tex build files whenever I close out of a .tex file. - autocmd VimLeave *.tex !texclear % + autocmd VimLeave *.tex !latexmk -c % " Ensure files are read as what I want: let g:vimwiki_ext2syntax = {'.Rmd': 'markdown', '.rmd': 'markdown','.md': 'markdown', '.markdown': 'markdown', '.mdown': 'markdown'} diff --git a/.local/bin/compiler b/.local/bin/compiler index 57135906..7497ad29 100755 --- a/.local/bin/compiler +++ b/.local/bin/compiler @@ -6,9 +6,6 @@ # 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="${1}" ext="${file##*.}" dir=${file%/*} @@ -38,15 +35,6 @@ case "${ext}" in 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%.*}" - ;; + tex) latexmk ;; *) sed -n '/^#!/s/^#!//p; q' "${file}" | xargs -r -I % "${file}" ;; esac From 21c0122597ad67da79d4935f9a4bd61d919f20ae Mon Sep 17 00:00:00 2001 From: Alessio Artoni <34690870+aartoni@users.noreply.github.com> Date: Fri, 28 Feb 2025 15:11:42 +0100 Subject: [PATCH 48/60] Removes the arkenfox-auto-update script (#1442) --- .local/bin/arkenfox-auto-update | 23 ----------------------- 1 file changed, 23 deletions(-) delete mode 100755 .local/bin/arkenfox-auto-update diff --git a/.local/bin/arkenfox-auto-update b/.local/bin/arkenfox-auto-update deleted file mode 100755 index 7664a4fc..00000000 --- a/.local/bin/arkenfox-auto-update +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh - -# A wrapper for the arkenfox-updater that runs it on all pre-existing Arkenfox -# user.js files on the machine. - -# On installation of LARBS, this file is copied to /usr/local/lib/ where it is -# run by a pacman hook set up. The user should not have to run this manually. - -# Search for all Firefox and Librewolf profiles using Arkenfox. -profiles="$(grep -sH "arkenfox user.js" \ - /home/*/.librewolf/*.default-release/user.js \ - /home/*/.mozilla/firefox/*.default-release/user.js)" - -IFS=' -' - -# Update each found profile. -for profile in $profiles; do - userjs=${profile%%/user.js*} - user=$(stat -c '%U' "$userjs") || continue - - su -l "$user" -c "arkenfox-updater -c -p $userjs -s" -done From 85801d095f6a87a6d7554162848025cdfbd76d6a Mon Sep 17 00:00:00 2001 From: pa-d-v Date: Fri, 28 Feb 2025 14:25:56 +0000 Subject: [PATCH 49/60] Fix breaking height and preferred offset syntax in dunstrc since v1.12.0 (#1453) --- .config/dunst/dunstrc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dunst/dunstrc b/.config/dunst/dunstrc index d03af62c..94eee7cf 100644 --- a/.config/dunst/dunstrc +++ b/.config/dunst/dunstrc @@ -2,8 +2,8 @@ monitor = 0 follow = keyboard width = 370 - height = 350 - offset = 0x19 + height = (0,350) + offset = (0,19) padding = 2 horizontal_padding = 2 transparency = 25 From 407e9d8a84aa2aff6cfd21a3be3042ac326e9b08 Mon Sep 17 00:00:00 2001 From: xsmh Date: Fri, 28 Feb 2025 17:29:29 +0300 Subject: [PATCH 50/60] Group multi-process program usage (#1444) Programs like Chrome run multiple processes that take up the entire notification window. This commit solves this issue by grouping and aggregating CPU and memory usage for multi-process programs into single entries. --- .local/bin/statusbar/sb-cpu | 2 +- .local/bin/statusbar/sb-memory | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.local/bin/statusbar/sb-cpu b/.local/bin/statusbar/sb-cpu index 5b8fb933..598b04f7 100755 --- a/.local/bin/statusbar/sb-cpu +++ b/.local/bin/statusbar/sb-cpu @@ -1,7 +1,7 @@ #!/bin/sh case $BLOCK_BUTTON in - 1) notify-send "πŸ–₯ CPU hogs" "$(ps axch -o cmd:15,%cpu --sort=-%cpu | head)\\n(100% per core)" ;; + 1) notify-send "πŸ–₯ CPU hogs" "$(ps axch -o cmd,%cpu | awk '{cmd[$1]+=$2} END {for (i in cmd) print i, cmd[i]}' | sort -nrk2 | head)\\n(100% per core)" ;; 2) setsid -f "$TERMINAL" -e htop ;; 3) notify-send "πŸ–₯ CPU module " "\- Shows CPU temperature. - Click to show intensive processes. diff --git a/.local/bin/statusbar/sb-memory b/.local/bin/statusbar/sb-memory index 8178b10b..ac0a5bd3 100755 --- a/.local/bin/statusbar/sb-memory +++ b/.local/bin/statusbar/sb-memory @@ -1,7 +1,7 @@ #!/bin/sh case $BLOCK_BUTTON in - 1) notify-send "🧠 Memory hogs" "$(ps axch -o cmd:15,%mem --sort=-%mem | head)" ;; + 1) notify-send "🧠 Memory hogs" "$(ps axch -o cmd,%mem | awk '{cmd[$1]+=$2} END {for (i in cmd) print i, cmd[i]}' | sort -nrk2 | head)" ;; 2) setsid -f "$TERMINAL" -e htop ;; 3) notify-send "🧠 Memory module" "\- Shows Memory Used/Total. - Click to show memory hogs. From e83e5ecef01ca14fe7f1ebf34962b56805f39252 Mon Sep 17 00:00:00 2001 From: Luke Bubar <43391582+lukerb52@users.noreply.github.com> Date: Fri, 28 Feb 2025 14:56:00 +0000 Subject: [PATCH 51/60] Update compiler to include instruction for the Rink calculator (#1452) * Update compiler to include instruction for the Rink calculator Added a compiler option for rink calculator files. Rink is a unit-conversion calculator written in Rust. * Update compiler to include COBOL instructions --- .local/bin/compiler | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.local/bin/compiler b/.local/bin/compiler index 57135906..214c98ce 100755 --- a/.local/bin/compiler +++ b/.local/bin/compiler @@ -20,6 +20,7 @@ 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}" ;; + cob) cobc -x -o "$base" "$file" && "$base" ;; cpp) g++ "${file}" -o "${base}" && "./${base}" ;; cs) mcs "${file}" && mono "${base}.exe" ;; go) go run "${file}" ;; @@ -33,6 +34,7 @@ case "${ext}" in 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}" ;; + rink) rink -f "${file}" ;; [rR]md) Rscript -e "rmarkdown::render('${file}', quiet=TRUE)" ;; rs) cargo build ;; sass) sassc -a "${file}" "${base}.css" ;; From 53f1df79e5bfa6374ea699f3aa1e71fabee079d6 Mon Sep 17 00:00:00 2001 From: Alessio Artoni <34690870+aartoni@users.noreply.github.com> Date: Fri, 28 Feb 2025 15:57:16 +0100 Subject: [PATCH 52/60] Fix magick related actions in nsxiv (#1449) --- .config/nsxiv/exec/key-handler | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.config/nsxiv/exec/key-handler b/.config/nsxiv/exec/key-handler index c743be42..fbbf2899 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") - magick -rotate 90 "$file" "$file" ;; + magick "$file" -rotate 90 "$file" ;; "R") - magick -rotate -90 "$file" "$file" ;; + magick "$file" -rotate -90 "$file" ;; "f") - magick -flop "$file" "$file" ;; + magick "$file" -flop "$file" ;; "y") printf "%s" "$file" | tr -d '\n' | xclip -selection clipboard && notify-send "$file copied to clipboard" & ;; From e7c02d972617826149d360b76eece07d89e59c9c Mon Sep 17 00:00:00 2001 From: xsmh Date: Fri, 28 Feb 2025 18:05:56 +0300 Subject: [PATCH 53/60] Enhance locking mechanism (#1446) This is a (subjectively) preferable behavior for locking the system. - Pause all media players and mute audio when the system is locked. Unmute after unlocking. Co-authored-by: Shahram <80352285+ShahramMohammed@users.noreply.github.com> --- .local/bin/sysact | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.local/bin/sysact b/.local/bin/sysact index 64c2f320..85488e5e 100755 --- a/.local/bin/sysact +++ b/.local/bin/sysact @@ -13,8 +13,18 @@ wmpid(){ # This function is needed if there are multiple instances of the window echo "${tree%%)*}" } +lock(){ + mpc pause + pauseallmpv + wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle + kill -44 $(pidof dwmblocks) + slock + wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle + kill -44 $(pidof dwmblocks) +} + case "$(printf "πŸ”’ lock\nπŸšͺ leave $WM\n♻️ renew $WM\n🐻 hibernate\nπŸ”ƒ reboot\nπŸ–₯️shutdown\nπŸ’€ sleep\nπŸ“Ί display off" | dmenu -i -p 'Action: ')" in - 'πŸ”’ lock') slock ;; + 'πŸ”’ lock') lock ;; "πŸšͺ leave $WM") kill -TERM "$(wmpid)" ;; "♻️ renew $WM") kill -HUP "$(wmpid)" ;; '🐻 hibernate') slock $ctl hibernate -i ;; From 4606e9156a85c89e5113429efec774f299d8e2a4 Mon Sep 17 00:00:00 2001 From: Rokosun <79040025+futureisfoss@users.noreply.github.com> Date: Fri, 28 Feb 2025 19:10:40 +0000 Subject: [PATCH 54/60] Improve UI for move/copy in lf (#1438) * Clear screen before move/copy Quick fix for https://github.com/LukeSmithxyz/voidrice/pull/1437#issuecomment-2430008043 * More UI improvements --- .config/lf/lfrc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.config/lf/lfrc b/.config/lf/lfrc index 5598a307..d877ab67 100644 --- a/.config/lf/lfrc +++ b/.config/lf/lfrc @@ -93,7 +93,8 @@ cmd delete ${{ cmd moveto ${{ set -f - dest=$(sed -e 's/\s*#.*//' -e '/^$/d' -e 's/^\S*\s*//' "${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-dirs" | fzf --prompt 'Move to where? ' | sed 's|~|$HOME|') + clear; tput cup $(($(tput lines)/3)) + dest=$(sed -e 's/\s*#.*//' -e '/^$/d' -e 's/^\S*\s*//' "${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-dirs" | fzf --layout=reverse --height 40% --prompt 'Move to where? ' | sed 's|~|$HOME|') [ -z "$dest" ] && exit destpath=$(eval printf '%s' \"$dest\") clear; tput cup $(($(tput lines)/3)); tput bold @@ -110,7 +111,8 @@ cmd moveto ${{ cmd copyto ${{ set -f - dest=$(sed -e 's/\s*#.*//' -e '/^$/d' -e 's/^\S*\s*//' "${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-dirs" | fzf --prompt 'Copy to where? ' | sed 's|~|$HOME|') + clear; tput cup $(($(tput lines)/3)) + dest=$(sed -e 's/\s*#.*//' -e '/^$/d' -e 's/^\S*\s*//' "${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-dirs" | fzf --layout=reverse --height 40% --prompt 'Copy to where? ' | sed 's|~|$HOME|') [ -z "$dest" ] && exit destpath=$(eval printf '%s' \"$dest\") clear; tput cup $(($(tput lines)/3)); tput bold From e2d787992ed8cdd3105fdf8d45ab2d695796238b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emre=20AKY=C3=9CZ?= Date: Fri, 28 Feb 2025 20:11:57 +0100 Subject: [PATCH 55/60] aliasrc | improve se() (#1433) * aliasrc | improve se() 1. Remove external commands like find. 2. Remove extensions and path (if present) from the names in fzf. 3. Only open Nvim if there is a selection. Do all of these without using find, sed, grep. - First line creates an array with the files in the scripts directory. - Second line removes path (:t) and the extensions (:r) from the scripts. - [[ "${c}" ]] checks if this variable is non-empty. - ${${(M)s:#*/${c}*}[1]} (M) enables "match" mode. :# anchors the pattern to the start of each array element. */${c}* matches any path containing the selected basename. [1] selects the first matching item. * capture sub-directories too --- .config/shell/aliasrc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.config/shell/aliasrc b/.config/shell/aliasrc index 75327bf7..5347fcd1 100644 --- a/.config/shell/aliasrc +++ b/.config/shell/aliasrc @@ -14,9 +14,10 @@ for command in mount umount sv pacman updatedb su shutdown poweroff reboot ; do done; unset command se() { - choice="$(find ~/.local/bin -mindepth 1 -printf '%P\n' | fzf)" - [ -f "$HOME/.local/bin/$choice" ] && $EDITOR "$HOME/.local/bin/$choice" - } + s=("${HOME}/.local/bin/"**/*(.)) + c="$(print -lnr ${s:t:r} | fzf)" + [[ "${c}" ]] && "${EDITOR}" ${${(M)s:#*/${c}*}[1]} +} # Verbosity and settings that you pretty much just always are going to want. alias \ From 15071db7fae30e1fa52851b8ebb772fc913b4780 Mon Sep 17 00:00:00 2001 From: thetubster99 <159262428+thetubster99@users.noreply.github.com> Date: Sun, 2 Mar 2025 15:47:31 +0000 Subject: [PATCH 56/60] Remove non-working sat24 doppler provider, and add the Netherlands (#1397) --- .local/bin/statusbar/sb-doppler | 69 +++++++-------------------------- 1 file changed, 14 insertions(+), 55 deletions(-) diff --git a/.local/bin/statusbar/sb-doppler b/.local/bin/statusbar/sb-doppler index a687c681..58f17a45 100755 --- a/.local/bin/statusbar/sb-doppler +++ b/.local/bin/statusbar/sb-doppler @@ -182,48 +182,6 @@ US: KVAX: Jacksonville, FL US: KJGX: Peachtree City/atlanta, GA US: KVNX: Norman, OK US: KVBX: Vandenberg Afb: Orcutt, CA -EU: Europe -EU: GB: Great Brittain -EU: SCAN: Scandinavia. Norway, Sweden And Denmark -EU: ALPS: The Alps -EU: NL: The Netherlands -EU: DE: Germany -EU: SP: Spain -EU: FR: France -EU: IT: Italy -EU: PL: Poland -EU: GR: Greece -EU: TU: Turkey -EU: RU: Russia -EU: BA: Bahrain -EU: BC: Botswana -EU: SE: Republic of Seychelles -EU: HU: Hungary -EU: UK: Ukraine -AF: AF: Africa -AF: WA: West Africa -AF: ZA: South Africa -AF: DZ: Algeria -AF: CE: Canary Islands -AF: NG: Nigeria -AF: TD: Chad -AF: CG: Democratic Republic of Congo -AF: EG: Egypt -AF: ET: Ethiopia -AF: CM: Cameroon -AF: IS: Israel -AF: LY: Libya -AF: MG: Madagascar -AF: MO: Morocco -AF: BW: Namibia -AF: SA: Saudi Arabia -AF: SO: Somalia -AF: SD: Sudan -AF: TZ: Tanzania -AF: TN: Tunisia -AF: ZM: Zambia -AF: KE: Kenya -AF: AO: Angola DE: BAW: Baden-WΓΌrttemberg DE: BAY: Bavaria DE: BBB: Berlin @@ -239,28 +197,29 @@ DE: SAC: Saxony DE: SAA: Saxony-Anhalt DE: SHH: Schleswig-Holstein DE: SHH: Hamburg -DE: THU: Thuringia" | dmenu -r -i -l 50 -p "Select a radar to use as default:" | tr "[:lower:]" "[:upper:]")" +DE: THU: Thuringia +NL: The Netherlands" | dmenu -r -i -l 50 -p "Select a radar to use as default:")" # Ensure user did not escape. [ -z "$chosen" ] && exit 1 -# Set continent code and radar code. -continentcode=${chosen%%:*} +# Set country code and radar code. +countrycode=${chosen%%:*} radarcode=${chosen#* } radarcode=${radarcode%:*} # Print codes to $radarloc file. - printf "%s,%s\\n" "$continentcode" "$radarcode" > "$radarloc" ;} + printf "%s,%s\\n" "$countrycode" "$radarcode" > "$radarloc" ;} getdoppler() { - cont=$(cut -c -2 "$radarloc") - loc=$(cut -c 4- "$radarloc") - notify-send "🌦️ Doppler RADAR" "Pulling most recent Doppler RADAR for $loc." - case "$cont" in - "US") curl -sL "https://radar.weather.gov/ridge/standard/${loc}_loop.gif" > "$doppler" ;; - "EU") curl -sL "https://api.sat24.com/animated/${loc}/rainTMC/2/" > "$doppler" ;; - "AF") curl -sL "https://api.sat24.com/animated/${loc}/rain/2/" > "$doppler" ;; - "DE") loc="$(echo "$loc" | tr "[:upper:]" "[:lower:]")" - curl -sL "https://www.dwd.de/DWD/wetter/radar/radfilm_${loc}_akt.gif" > "$doppler" ;; + country=$(cut -c -2 "$radarloc") + province=$(cut -c 4- "$radarloc") + notify-send "🌦️ Doppler RADAR" "Pulling most recent Doppler RADAR for $province." + case "$country" in + "US") province="$(echo "$province" | tr "[:lower:]" "[:upper:]")" + curl -sL "https://radar.weather.gov/ridge/standard/${province}_loop.gif" > "$doppler" ;; + "DE") province="$(echo "$province" | tr "[:upper:]" "[:lower:]")" + curl -sL "https://www.dwd.de/DWD/wetter/radar/radfilm_${province}_akt.gif" > "$doppler" ;; + "NL") curl -sL "https://cdn.knmi.nl/knmi/map/general/weather-map.gif" > "$doppler" ;; esac } From 7d262506579f04e0a42fa82c049dc922b45b58f1 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sun, 2 Mar 2025 16:52:56 +0100 Subject: [PATCH 57/60] delete texclear --- .local/bin/texclear | 9 --------- 1 file changed, 9 deletions(-) delete mode 100755 .local/bin/texclear diff --git a/.local/bin/texclear b/.local/bin/texclear deleted file mode 100755 index 6ad3c12e..00000000 --- a/.local/bin/texclear +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -# Clears the build files of a LaTeX/XeLaTeX build. -# I have vim run this file whenever I exit a .tex file. - -[ "${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 59632a5668f1af956ec325f8d8455d312727b8a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emre=20AKY=C3=9CZ?= Date: Sun, 2 Mar 2025 16:54:50 +0100 Subject: [PATCH 58/60] Even More Improvements for Getbib (Including Prior) (#1314) * Even More Improvements for Getbib (Including Prior) I have used and benefited from the "getbib" script and the instructions on LaTeX from Luke for a long time. So, I have put a lot of thought into this script, since I am very interested in academia. Hope you all like this. Justifications for Improvements This script stands out as a highly valuable (at least in my opinion) and efficient tool for managing and fetching BibTeX entries for DOIs found in PDF files or provided directly. The robust design and comprehensive functionality make it an indispensable asset for researchers. The main reasons for its superiority are as follows: - Exceptional time-saving: By automating the process of extracting DOIs and fetching BibTeX entries, the script drastically reduces the manual effort involved in managing citations, thereby saving users an incredible amount of time and energy. - Outstanding versatility: The script's ability to handle various input types, including directories containing PDF files, single PDF files, and DOIs, sets it apart from other solutions. This adaptability allows users to process numerous scenarios with ease, making it the go-to tool for all their citation needs. - Unparalleled consistency: The script ensures that DOIs are uniformly processed and normalized, improving the consistency of the entries in the BibTeX file. This feature is crucial for maintaining a clean and professional bibliography that adheres to high academic standards. It inserts an empty line between entries inside the BIB_FILE, as well as, making the author name lower case. It also removes any special characters and the first 2 numbers of the year from the first line. So it is easier to read, maintain and easier to use inside a LaTeX document. Normalizing also helps to check for duplicate entries. It prevents some weird entries escaping from getting caught as a duplicate. - Remarkable duplicate prevention: The script's built-in functionality to check for duplicate entries before appending them to the BibTeX file demonstrates a keen attention to detail. This feature ensures that the bibliography remains free of redundancies, streamlining the citation management process. - The use of functions and modular design in the script makes the code highly readable, maintainable, and extendable. This strong foundation allows for seamless adaptation to future changes and requirements. - Provides users with an exceptional level of automation, versatility, and reliability. - You can provide the DOI address even in very wrong forms and get a correct output. You can even feed it a website URL such as: https://doi.org/10.1038/s41594-023-00968-y and all of the DOI handling is done by a single "sed" command. - Robust notification system to learn more about the errors or other types of feedback. - The "curl" output is in red in order to separate the output and the notification better and to improve readability. Details BIB_FILE: The path to the BibTeX file where entries will be saved. CORRECTION_METHOD: A very powerful sed command to extract and correct the DOI from the input even in harsher cases. get_doi_from_pdf function: Extracts a DOI from the provided PDF file using pdfinfo and pdftotext commands. If pdfinfo doesn't find a DOI, it uses pdftotext to extract it from the first page of the PDF. normalize_doi function: Normalizes the DOI by converting it to lowercase. process_doi function: Fetches the BibTeX entry for the given DOI using the Crossref with a curl command. Prints the output of the curl command in red using ANSI escape codes. Checks if the fetched BibTeX entry is valid and not empty. If the fetched BibTeX entry is not in the BIB_FILE, it appends the entry to the file. The script processes input arguments, which can be a directory, a PDF file, or a DOI: a) If it's a directory, the script processes all PDF files in the directory. b) If it's a PDF file, the script processes the single PDF file. c) If it's a DOI, the script processes the DOI directly. More details on the correction method (sed command), from my prior pull request Very Detailed Explanation (I realized that escaped backslashes do not appear. There is a backslash if you see nothing.) (For people who wonder about it, or try to learn. It could take a tremendous amount of time to learn all of it without explanation, so it would be better to explain): sed The sed command is a stream editor that can be used to perform basic text transformations on an input file or from a pipeline. You can see Luke uses it a lot in his videos. It can also modify files' content if you want for other purposes. That function is used a lot for bootstrapping scripts for changing config files automatically if necessary. -n This option tells sed not to print lines by default. We'll only print lines when we specify the p command in the script. -E This option enables the use of extended regular expressions, which allows for more readable and flexible regex patterns. 's/ This starts the sed script and defines the s command (substitute). It is used to find a regex pattern in the input and replace it with a specified string. .* This regex pattern matches any character (except a newline) zero or more times. In this case, it matches all characters before "doi" or "DOI". ( This paranthesis opens a capturing group, which allows us to refer back to the matched text later in the script. (DOI|doi) This regex pattern matches either "DOI" or "doi". The | symbol is used as an OR operator in regular expressions. ( This next paranthesis opens another capturing group. (.(org))? This regex pattern matches an optional ".org". The . is an escaped period, and (org) matches the string "org". The ? following the group makes it optional. Escaping is needed for most of non-alphanumeric characters. You can test and practice them on vim, trying to use the "substitute" function to change some text. /? This regex pattern matches an optional "/", with the ? making it optional. The prior backslash is for escaping. Again, some characters need to be escaped to be able to used in commands. Escaped means they have ** before them. Spaces may be the most escaped characters. | This symbol, later, also acts as an OR operator, indicating that the pattern before or after it can be matched. **:? *** This regex pattern matches an optional colon (":") followed by zero or more spaces. The ? makes the colon optional, and ***** matches zero or more spaces. ) This closes the capturing group started earlier. ) This closes the outer capturing group. ([^: ]+[^ .]) This regex pattern matches any character except colons and spaces one or more times ([^: ]+) Plus symbol here shows one or more times. If it is a star then it means zero or more times. It is then followed by a single alphanumeric character ([^ .]) Single because there are no plus or star symbol next to it. This part as a whole ensures that the last character of the matched text is alphanumeric. .* This regex pattern matches any character (except a newline) zero or more times. In this case, it matches all remaining characters in the input line. / This delimiter separates the regex pattern from the replacement string in the s command. s command needs a separator that is a forward slash. doi:\6 This is the replacement string. The text "doi:" is followed by the 6th captured group from the regex pattern, which contains the characters after "doi" or "DOI" and the colon, "/", or space(s). /p This delimiter separates the replacement string from the p command, which tells sed to print the modified line if a substitution has been made. The substitution mentioned here is the change of ".org/" to ":". This helps turning URLs into doi addresses. ; This separates different commands within the sed script. T This command branches to the end of the script if no substitution was made since the last input line was read or conditional branch was taken. In this case, it ensures that the q command is only executed if a matching line has been found and a substitution was made. This is one of the most important parts to get the doi address from the urls such as "https://doi.org/10.1038/s41594-023-00968-5". Because we don't always have URLs for doi addresses. In this way, this function only works when we work with URLs. So in this case it helps changing .org/ with : This makes the part of the doi address as this: "doi:" rather than this: "doi.org/". q This command tells sed to quit processing after the first match, ensuring that only the first matching line in the file is processed. Otherwise, we would get all doi addresses in a scientific study because there are lots of doi addresses in them. ' This closes the other ' TL;DR: Basically this whole command ensures that the output we get starts with "doi:", then it can have every type of character in it except spaces and ".org/" , then it will end with an alphanumeric character [A-Z, a-z or 0-9]. That ensures removing the trailing dots from some doi addresses that have them. * Update getbib * Use DASH | Remove IFs | Minimize * minor corrections & improvements * Improve && Minimize * Make the duplicate matching case insensitive * Formatting change. * Reformat | Add custom .bib --- .local/bin/getbib | 79 ++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 68 insertions(+), 11 deletions(-) diff --git a/.local/bin/getbib b/.local/bin/getbib index 121dd6ee..03a50cda 100755 --- a/.local/bin/getbib +++ b/.local/bin/getbib @@ -1,14 +1,71 @@ #!/bin/sh -[ -z "$1" ] && echo "Give either a pdf file or a DOI as an argument." && exit -if [ -f "$1" ]; then - # Try to get DOI from pdfinfo or pdftotext output. - doi=$(pdfinfo "$1" | grep -io "doi:.*") || - doi=$(pdftotext "$1" 2>/dev/null - | sed -n '/[dD][oO][iI]:/{s/.*[dD][oO][iI]:\s*\(\S\+[[:alnum:]]\).*/\1/p;q}') || - exit 1 -else - doi="$1" -fi +BIB_FILE="${HOME}/latex/uni.bib" +[ -f "${BIB_FILE}" ] || BIB_FILE="${2:-$(find "${HOME}" -path "${HOME}/.*" \ + -prune -o -type "f" -name "*.bib" -print -quit)}" -# Check crossref.org for the bib citation. -curl -s "https://api.crossref.org/works/$doi/transform/application/x-bibtex" -w "\\n" +{ [ -f "${BIB_FILE}" ] || [ "${2}" ]; } || { + printf "%s\n" "Create a .bib file or provide as \$2." && exit "1" +} + +filter() { + sed -n -E 's/.*((DOI|doi)((\.(org))?\/?|:? *))([^: ]+[^ .]).*/\6/p; T; q' +} + +fpdf() { + pdf="${1}" + doi="$(pdfinfo "${pdf}" 2> "/dev/null" | filter)" + + [ "${doi}" ] || doi="$(pdftotext -q -l "2" "${pdf}" - 2> "/dev/null" | filter)" + + [ "${doi}" ] || printf "%s\n" "No DOI found for PDF: ${pdf}" >&2 + + printf "%s\n" "${doi}" +} + +arrange() { + sed 's/\}, /\},\n /g + s/, /,\n / + s/ }/\n}/ + s/,\s*pages=/,\n\tpages=/' | + sed '1s/^ *// + 1s/[0-9]*\([0-9]\{2\}\)/\1/ + 1s/_// + 1s/.*/\L&/ + s/.*=/\L&/ + s/=/ = /' +} + +doi2bib() { + doi="${1#doi:}" + url="https://api.crossref.org/works/${doi}/transform/application/x-bibtex" + entry="$(curl -kLsS --no-fail "${url}" | arrange)" + red='\033[0;31m' + reset='\033[0m' + + printf "${red}%s${reset}\n" "${entry}" + + [ "${entry%"${entry#?}"}" != "@" ] && { + printf "%s\n" "Failed to fetch bibtex entry for DOI: ${doi}" + return "1" + } + + grep -iFq "doi = {${doi}}" "${BIB_FILE}" 2> "/dev/null" && { + printf "%s\n" "Bibtex entry for DOI: ${doi} already exists in the file." + } || { + [ -s "${BIB_FILE}" ] && printf "\n" >> "${BIB_FILE}" + printf "%s\n" "${entry}" >> "${BIB_FILE}" + printf "%s\n" "Added bibtex entry for DOI: ${doi}" + } +} + +[ "${1}" ] || { + printf "%s\n" "Give either a pdf file or a DOI or a directory path that has PDFs as an argument." + exit "1" +} + +[ -f "${1}" ] && doi="$(fpdf "${1}")" && doi2bib "${doi}" && exit "0" + +[ -d "${1}" ] && for i in "${1}"/*.pdf; do doi="$(fpdf "${i}")" && doi2bib "${doi}"; done && exit "0" + +doi="$(printf "%s\n" "${1}" | filter)" && doi2bib "${doi}" From 51baf2e6b33240caf22252443262efa5e24a400e Mon Sep 17 00:00:00 2001 From: Oleksandr Miliukhin <116528386+miliukhin@users.noreply.github.com> Date: Wed, 5 Mar 2025 10:21:41 +0000 Subject: [PATCH 59/60] rssget - search the website for RSS feeds and add them to newsboat url list using rssadd. Also gets links to feeds on some sites that don't provide those links. (#1430) --- .local/bin/rssget | 115 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100755 .local/bin/rssget diff --git a/.local/bin/rssget b/.local/bin/rssget new file mode 100755 index 00000000..877d14f2 --- /dev/null +++ b/.local/bin/rssget @@ -0,0 +1,115 @@ +#!/bin/sh + +# Searches the website for RSS feeds and adds them to newsboat url list. Can +# also find hidden RSS feeds on various websites, namely Youtube, Reddit, +# Vimeo, Github, Gitlab and Medium. Gets site url as $1 or (if not present) +# from X clipboard. Gets tags as $2. If it finds more than one feed, calls +# dmenu for the user to choose which one to add. I have bound it to a keyboard +# shortcut so i copy a site link and easily add its feed to the reader. + +# Inspired by and based on the logic of this extension: +# https://github.com/shevabam/get-rss-feed-url-extension + +# This script requires rssadd to add feeds to the list. + +getlink () { + local url="$1" + feeds="$(curl -s "$url" | grep -Ex '.*type=.*(rss|rdf|atom).*' | sed 's/ //g')" + url="$(echo $url | sed 's|^\(https://[^/]*/\).*|\1|')" + + for rsspath in $feeds; do + rsspath="$(echo $rsspath | sed -n "s|.*href=['\"]\([^'\"]*\)['\"].*|\1|p")" + if echo "$rsspath" | grep "http" > /dev/null; then + link="$rsspath" + elif echo "$rsspath" | grep -E "^/" > /dev/null; then + link="$url$(echo $rsspath | sed 's|^/||')" + else + link="$url$rsspath" + fi + echo $link + done +} + +getRedditRss() { + echo "${1%/}.rss" +} + +getYoutubeRss() { + local url="$1" + path=$(echo "$url" | sed -e 's|^http[s]*://||') + case "$path" in + *"/channel/"*) channel_id="$(echo $path | sed -r 's|.*channel/([^/]*).*|\1|')" && feed="https://www.youtube.com/feeds/videos.xml?channel_id=${channel_id}" ;; + *"/c/"*|*"/user/"*) + feed=$(wget -q "$url" -O tmp_rssget_yt \ + && sed -n 's|.*\("rssUrl":"[^"]*\).*|\1|; p' tmp_rssget_yt \ + | grep rssUrl \ + | sed 's|"rssUrl":"||') ;; + esac + echo "$feed" +} + +getVimeoRss() { + local url="$1" + if echo "$url" | grep -q "/videos$"; then + feed_url=$(echo "$url" | sed 's/\/videos$//' | sed 's/\/$/\/rss/') + else + feed_url="${url}/videos/rss" + fi + echo "$feed_url" +} + +getGithubRss () { + local url="${1%/}" + if echo $url | grep -E "github.com/[^/]*/[a-zA-Z0-9].*" >/dev/null ; then + echo "${url}/commits.atom" + echo "${url}/releases.atom" + echo "${url}/tags.atom" + elif echo $url | grep -E "github.com/[^/]*(/)" >/dev/null ; then + echo "${url}.atom" + fi +} + +getGitlabRss () { + local url="${1%/}" + echo "${url}.atom" +} + +getMediumRss () { + echo $1 | sed 's|/tag/|/feed/|' +} + + +if [ -n "$1" ] ; then + url="$1" +else + url="$(xclip -selection clipboard -o)" + [ -z "$url" ] && echo "usage: $0 url 'tag1 tag2 tag3'" && exit 1 +fi + +declare -a list=() + +yt_regex="^(http(s)?://)?((w){3}\.)?(youtube\.com|invidio\.us|invidious\.flokinet\.to|invidious\.materialio\.us|iv\.datura\.network|invidious\.perennialte\.ch|invidious\.fdn\.fr|invidious\.private\.coffee|invidious\.protokolla\.fi|invidious\.privacyredirect\.com|yt\.artemislena\.eu|yt\.drgnz\.club|invidious\.incogniweb\.net|yewtu\.be|inv\.tux\.pizza|invidious\.reallyaweso\.me|iv\.melmac\.space|inv\.us\.projectsegfau\.lt|inv\.nadeko\.net|invidious\.darkness\.services|invidious\.jing\.rocks|invidious\.privacydev\.net|inv\.in\.projectsegfau\.lt|invidious\.drgns\.space)/(channel|user|c).+" +reddit_regex="^(http(s)?://)?((w){3}\.)?reddit\.com.*" +vimeo_regex="^(http(s)?://)?((w){3}.)?vimeo\.com.*" +if echo $url | grep -Ex "$yt_regex" >/dev/null ; then + list="$(getYoutubeRss "$url")" +elif echo $url | grep -Ex "$reddit_regex" >/dev/null ; then + list="$(getRedditRss "$url")" +# vimeo actually works with getlink +elif echo $url | grep -E "$vimeo_regex" >/dev/null ; then + list="$(getVimeoRss "$url")" +elif echo $url | grep -E "github.com" >/dev/null ; then + list="$(getGithubRss "$url")" +# gitlab also works with getlink +elif echo $url | grep -E "gitlab.com/[a-zA-Z0-9].*" >/dev/null ; then + list="$(getGitlabRss "$url")" +elif echo $url | grep -E "medium.com/tag" >/dev/null ; then + list="$(getMediumRss "$url")" +else + list="$(getlink "$url")" +fi + +[ "$(echo "$list" | wc -l)" -eq 1 ] && chosen_link="$list" || chosen_link=$(printf '%s\n' "${list[@]}" | dmenu -p "Choose a feed:") +tags="$2" +ifinstalled rssadd && rssadd "$chosen_link" "$tags" +echo "$chosen_link" "$tags" From 1e750084e5194375002433e3aee554814beef4c1 Mon Sep 17 00:00:00 2001 From: Nicholas Gorden Date: Wed, 5 Mar 2025 14:01:04 +0000 Subject: [PATCH 60/60] New: create sb-ticker (#1436) * 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 * shortcuts: export env vars for each shortcut (#1395) useful if want to use shortcuts w/ different progs instead of their default behavior (cd / $EDITOR), e.g.: ```sh cd ~/Downloads mv foo.mp3 $music ``` Co-authored-by: Luke Smith * Update mpd to use PipeWire (#1412) per https://wiki.archlinux.org/title/Music_Player_Daemon#Audio_configuration * New: create sb-ticker --------- Co-authored-by: appeasementPolitik <108810900+appeasementPolitik@users.noreply.github.com> Co-authored-by: Kipras Melnikovas Co-authored-by: Luke Smith Co-authored-by: fennomaani <160141733+fennomaani@users.noreply.github.com> --- .local/bin/statusbar/sb-ticker | 50 ++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100755 .local/bin/statusbar/sb-ticker diff --git a/.local/bin/statusbar/sb-ticker b/.local/bin/statusbar/sb-ticker new file mode 100755 index 00000000..4042a3d6 --- /dev/null +++ b/.local/bin/statusbar/sb-ticker @@ -0,0 +1,50 @@ +#!/bin/bash + +# Usage +# sb-ticker +# Sample output +# ^DJI: 0.09% +# CL=F: -1.88% +# Description +# displays/retrieves the latest percent-change in stock market quotes listed in $XDG_CONFIG_HOME/tickers. +# defaults to S&P 500, Dow Jones Industrial, and the Nasdaq +# +# intended to be used in the statusbar, which will display the first quote price in the output + +url="terminal-stocks.dev" +pricefile="${XDG_CACHE_HOME:-$HOME/.cache}/stock-prices" +tickerfile="${XDG_CONFIG_HOME:-$HOME/.config}/tickers" + +[ -f "$tickerfile" ] && tickers="$(cat "$tickerfile")" || tickers="^GSPC,^DJI,^IXIC"; + +checkprice() { + [ -s "$pricefile" ] && [ "$(stat -c %y "$pricefile" 2>/dev/null | + cut -d':' -f1)" != "$(date '+%Y-%m-%d %H')" ] +} + +getchange() { + mapfile -t changes < <(sed -e 's/ / /g' "$pricefile" | grep -oe '[m-]\+[0-9]\+\.[0-9]\+' | sed 's/[m ]/;/g') + IFS=',' read -ra TICKER <<< "$tickers" + for idx in "${!TICKER[@]}"; do + printf "%s: %s%%\n" "${TICKER[$idx]}" "${changes[$idx]//;/}" + done +} + +updateprice() { curl -sfm 10 "$url/$tickers" --output "$pricefile" || rm -f "$pricefile" ; } + +case $BLOCK_BUTTON in + 1) setsid "$TERMINAL" -e less -Srf "$pricefile" ;; + 2) notify-send -u low "Updating..." "Updating prices" ; updateme="1" ;; + 3) notify-send "Current prices:" "Current stock prices:\n$(getchange) + +LEFT MOUSE BUTTON: show price file +MIDDLE MOUSE BUTTON: update stock prices +RIGHT MOUSE BUTTON: Get stock overview" ;; + 6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;; +esac + +[ -n "$updateme" ] && updateprice + +[ -f "$pricefile" ] && getchange + +checkprice && updateprice