From 5c92a1770f1a496cfa188632e2bf3d34bd325ad4 Mon Sep 17 00:00:00 2001 From: Mathieu Rollet Date: Wed, 12 Apr 2023 14:10:42 +0200 Subject: [PATCH 1/5] Set GOMODCACHE to comply with XDG (#1299) If GOMODCACHE is not set, it defaults to $GOPATH/pkg/mod cf. https://go.dev/ref/mod#environment-variables --- .config/shell/profile | 1 + 1 file changed, 1 insertion(+) diff --git a/.config/shell/profile b/.config/shell/profile index e78f21e6..55089430 100644 --- a/.config/shell/profile +++ b/.config/shell/profile @@ -39,6 +39,7 @@ export TMUX_TMPDIR="$XDG_RUNTIME_DIR" export ANDROID_SDK_HOME="$XDG_CONFIG_HOME/android" export CARGO_HOME="$XDG_DATA_HOME/cargo" export GOPATH="$XDG_DATA_HOME/go" +export GOMODCACHE="$XDG_CACHE_HOME/go/mod" export ANSIBLE_CONFIG="$XDG_CONFIG_HOME/ansible/ansible.cfg" export UNISON="$XDG_DATA_HOME/unison" export HISTFILE="$XDG_DATA_HOME/history" From d4ff2ebaf3e88efe20cae0d1e592fddfc433c96e Mon Sep 17 00:00:00 2001 From: snailed Date: Wed, 12 Apr 2023 12:11:29 +0000 Subject: [PATCH 2/5] fix shellcheck (#1301) Shellcheck wines when printf doesn't get an argument --- .local/bin/dmenuhandler | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.local/bin/dmenuhandler b/.local/bin/dmenuhandler index 0b3c7138..acfd71bf 100755 --- a/.local/bin/dmenuhandler +++ b/.local/bin/dmenuhandler @@ -2,7 +2,7 @@ # Feed this script a link and it will give dmenu # some choice programs to use to open it. -feed="${1:-$(printf "%s" | dmenu -p 'Paste URL or file path')}" +feed="${1:-$(true | dmenu -p 'Paste URL or file path')}" case "$(printf "copy url\\nsxiv\\nsetbg\\nPDF\\nbrowser\\nlynx\\nvim\\nmpv\\nmpv loop\\nmpv float\\nqueue download\\nqueue yt-dlp\\nqueue yt-dlp audio" | dmenu -i -p "Open it with?")" in "copy url") echo "$feed" | xclip -selection clipboard ;; From c08949ebd2aeeec220b63da6a32542a0210bac38 Mon Sep 17 00:00:00 2001 From: anggatd <128944502+anggatd@users.noreply.github.com> Date: Thu, 20 Apr 2023 19:32:31 +0700 Subject: [PATCH 3/5] Change LibreOffice binaries to libreoffice (#1294) In the current update, the libreoffice package doesn't have any binary for libreoffice writer, calc, impress, draw, etc. So it's better to open all of the document using the 'libreoffice' binary as it can work in the old version of libreoffice as well as the new one. --- .config/lf/lfrc | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.config/lf/lfrc b/.config/lf/lfrc index 6017255d..63418f61 100644 --- a/.config/lf/lfrc +++ b/.config/lf/lfrc @@ -45,12 +45,7 @@ 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) setsid -f lowriter $fx >/dev/null 2>&1 ;; - application/vnd.openxmlformats-officedocument.spreadsheetml.sheet|application/octet-stream|application/vnd.oasis.opendocument.spreadsheet|application/vnd.oasis.opendocument.spreadsheet-template) setsid -f localc $fx >/dev/null 2>&1 ;; - application/vnd.openxmlformats-officedocument.presentationml.presentation|application/vnd.oasis.opendocument.presentation-template|application/vnd.oasis.opendocument.presentation|application/vnd.ms-powerpoint) setsid -f loimpress $fx >/dev/null 2>&1 ;; - application/vnd.oasis.opendocument.graphics|application/vnd.oasis.opendocument.graphics-template) setsid -f lodraw $fx >/dev/null 2>&1 ;; - application/vnd.oasis.opendocument.formula) setsid -f lomath $fx >/dev/null 2>&1 ;; - application/vnd.oasis.opendocument.database) setsid -f lobase $fx >/dev/null 2>&1 ;; + application/vnd.openxmlformats-officedocument.wordprocessingml.document|application/vnd.oasis.opendocument.text|application/vnd.openxmlformats-officedocument.spreadsheetml.sheet|application/octet-stream|application/vnd.oasis.opendocument.spreadsheet|application/vnd.oasis.opendocument.spreadsheet-template|application/vnd.openxmlformats-officedocument.presentationml.presentation|application/vnd.oasis.opendocument.presentation-template|application/vnd.oasis.opendocument.presentation|application/vnd.ms-powerpoint|application/vnd.oasis.opendocument.graphics|application/vnd.oasis.opendocument.graphics-template|application/vnd.oasis.opendocument.formula|application/vnd.oasis.opendocument.database) setsid -f libreoffice $fx >/dev/null 2>&1 ;; *) for f in $fx; do setsid -f $OPENER $f >/dev/null 2>&1; done;; esac }} From b719590427681e977b2a13e8490971e1e1b166b8 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Thu, 20 Apr 2023 08:47:39 -0400 Subject: [PATCH 4/5] use built-ins, close #1297 --- .local/bin/statusbar/sb-iplocate | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.local/bin/statusbar/sb-iplocate b/.local/bin/statusbar/sb-iplocate index 02adab8d..a9043e32 100755 --- a/.local/bin/statusbar/sb-iplocate +++ b/.local/bin/statusbar/sb-iplocate @@ -5,6 +5,11 @@ # # https://www.maketecheasier.com/ip-address-geolocation-lookups-linux/ -ifinstalled "geoip" || exit -addr="$(curl ifconfig.me 2>/dev/null)" || exit -grep "flag: " "${XDG_DATA_HOME:-$HOME/.local/share}/larbs/emoji" | grep "$(geoiplookup "$addr" | sed 's/.*, //')" | sed "s/flag: //;s/;.*//" +set -e + +ifinstalled "geoip" +addr="$(geoiplookup "$(curl -sfm 1 ifconfig.me 2>/dev/null)")" +name="${addr##*, }" +flag="$(grep "flag: $name" "${XDG_DATA_HOME:-$HOME/.local/share}/larbs/emoji")" +flag="${flag%% *}" +printf "%s %s\\n" "$flag" "$name" From 65378ab9443401e0e895d50ad894d66ba4c3ff31 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Thu, 20 Apr 2023 08:48:34 -0400 Subject: [PATCH 5/5] sb-price improvements --- .local/bin/statusbar/sb-price | 43 +++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/.local/bin/statusbar/sb-price b/.local/bin/statusbar/sb-price index 9dc2d527..f95c8152 100755 --- a/.local/bin/statusbar/sb-price +++ b/.local/bin/statusbar/sb-price @@ -1,24 +1,34 @@ #!/bin/sh # Usage: -# price -# price bat "Basic Attention Token" 🦁 +# price +# price bat-btc "Basic Attention Token" 🦁 24 +# This will give the price of BAT denominated in BTC and will update on +# signal 24. # When the name of the currency is multi-word, put it in quotes. -[ -z "$3" ] && exit 1 +[ -z "$1" ] && exit 1 -# use $4 as currency, if not passed in use "usd" as default url="${CRYPTOURL:-rate.sx}" -currency="${4:-usd}" +target="${1%%-*}" +denom="${1##*-}" +name="${2:-$1}" +icon="${3:-💰}" +case "$denom" in + "$target"|usd) denom="usd"; symb="$" ;; + gbp) symb="£" ;; + eur) symb="€" ;; + btc) symb="" ;; +esac interval="@14d" # History contained in chart preceded by '@' (7d = 7 days) dir="${XDG_CACHE_HOME:-$HOME/.cache}/crypto-prices" -pricefile="$dir/$1-$currency" -chartfile="$dir/$1-$currency-chart" +pricefile="$dir/$target-$denom" +chartfile="$dir/$target-$denom-chart" filestat="$(stat -c %x "$pricefile" 2>/dev/null)" [ -d "$dir" ] || mkdir -p "$dir" -updateprice() { curl -sf -m 1 --fail-early $currency.$url/{1$1,$1$interval} --output "$pricefile" --output "$chartfile" || +updateprice() { curl -sf -m 1 --fail-early $denom.$url/{1$target,$target$interval} --output "$pricefile" --output "$chartfile" || rm -f "$pricefile" "$chartfile" ;} [ "${filestat%% *}" != "$(date '+%Y-%m-%d')" ] && @@ -26,9 +36,9 @@ updateprice() { curl -sf -m 1 --fail-early $currency.$url/{1$1,$1$interval} --ou case $BLOCK_BUTTON in 1) setsid "$TERMINAL" -e less -Srf "$chartfile" ;; - 2) notify-send -u low "$3 Updating..." "Updating $2 price..." ; updateme="1" ; showupdate="1" ;; + 2) notify-send -u low "$icon Updating..." "Updating $name price..." ; updateme="1" ; showupdate="1" ;; 3) uptime="$(date -d "$filestat" '+%D at %T' | sed "s|$(date '+%D')|Today|")" - notify-send "$3 $2 module" "\- Exact price: \$$(cat "$pricefile") + notify-send "$icon $name module" "\- Exact price: \$$(cat "$pricefile") - Left click for chart of changes. - Middle click to update. - Shows 🔃 if updating prices. @@ -38,16 +48,9 @@ case $BLOCK_BUTTON in esac [ -n "$updateme" ] && - updateprice "$1" && + updateprice "$target" && [ -n "$showupdate" ] && - notify-send "$3 Update complete." "$2 price is now + notify-send "$icon Update complete." "$name price is now \$$(cat "$pricefile")" -case "$currency" in - usd) symb="$" ;; - gbp) symb="£" ;; - eur) symb="€" ;; - btc) symb="" ;; -esac - -[ -f "$pricefile" ] && printf "$3$symb%0.2f" "$(cat "$pricefile")" +[ -f "$pricefile" ] && printf "%s%s%0.2f" "$icon" "$symb" "$(cat "$pricefile")"