mirror of
https://github.com/LukeSmithxyz/voidrice.git
synced 2026-01-30 09:48:11 +01:00
Compare commits
20 Commits
c95eeed25b
...
41ca7e2767
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
41ca7e2767 | ||
|
|
c95a16916d | ||
|
|
28eff887e0 | ||
|
|
441d26b75d | ||
|
|
db6ee8f819 | ||
|
|
487be9193c | ||
|
|
0afc70a07c | ||
|
|
1500ec504e | ||
|
|
b5317fdaf2 | ||
|
|
92d3560888 | ||
|
|
b0dbb1d1f6 | ||
|
|
36d40adb8d | ||
|
|
de863bf0f0 | ||
|
|
b7dc644e1a | ||
|
|
fead6d66ce | ||
|
|
b1ddd9548e | ||
|
|
e3a5d38200 | ||
|
|
0e237592d7 | ||
|
|
060c093deb | ||
|
|
d1054d839e |
@ -139,7 +139,7 @@ cmd bulkrename ${{
|
||||
# Bindings
|
||||
map <c-f> $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
|
||||
|
||||
@ -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"
|
||||
@ -31,6 +31,7 @@ set noshowmode
|
||||
set noruler
|
||||
set laststatus=0
|
||||
set noshowcmd
|
||||
colorscheme vim
|
||||
|
||||
" Some basics:
|
||||
nnoremap c "_c
|
||||
@ -104,10 +105,9 @@ set noshowcmd
|
||||
cabbrev w!! execute 'silent! write !sudo tee % >/dev/null' <bar> 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!<CR>
|
||||
autocmd BufRead,BufNewFile /tmp/neomutt* map ZQ :Goyo\|q!<CR>
|
||||
autocmd BufRead,BufNewFile /tmp/neomutt* :Goyo 80 | call feedkeys("jk")
|
||||
autocmd BufRead,BufNewFile /tmp/neomutt* map ZZ :Goyo!\|x!<CR>
|
||||
autocmd BufRead,BufNewFile /tmp/neomutt* map ZQ :Goyo!\|q!<CR>
|
||||
|
||||
" Automatically deletes all trailing whitespace and newlines at end of file on save. & reset cursor position
|
||||
autocmd BufWritePre * let currPos = getpos(".")
|
||||
|
||||
@ -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
|
||||
|
||||
@ -7,11 +7,11 @@ url="${WTTRURL:-wttr.in}"
|
||||
weatherreport="${XDG_CACHE_HOME:-$HOME/.cache}/weatherreport"
|
||||
|
||||
# Get a weather report from 'wttr.in' and save it locally.
|
||||
getforecast() { timeout --signal=1 2s curl -sf "$url/$LOCATION" > "$weatherreport" || exit 1; }
|
||||
getforecast() { curl -sf "$url/$LOCATION" --output "$weatherreport" && touch "$weatherreport"; }
|
||||
|
||||
# Forecast should be updated only once a day.
|
||||
checkforecast() {
|
||||
[ -s "$weatherreport" ] && [ "$(stat -c %y "$weatherreport" 2>/dev/null |
|
||||
[ "$(stat -c %y "$weatherreport" 2>/dev/null |
|
||||
cut -d' ' -f1)" = "$(date '+%Y-%m-%d')" ]
|
||||
}
|
||||
|
||||
@ -48,6 +48,9 @@ case $BLOCK_BUTTON in
|
||||
6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;;
|
||||
esac
|
||||
|
||||
checkforecast || getforecast
|
||||
|
||||
showweather
|
||||
checkforecast && showweather ||
|
||||
( flock -n 9 &&
|
||||
( until { [ "$(cat /sys/class/net/w*/operstate)" = 'up' ] || [ "$(cat /sys/class/net/e*/operstate)" = 'up' ]; } &&
|
||||
getforecast; do sleep 60; done &&
|
||||
pkill -RTMIN+"${1:-5}" "${STATUSBAR:-dwmblocks}" ) &
|
||||
echo ) 9>"${XDG_RUNTIME_DIR}/sb-forecast.lock"
|
||||
|
||||
@ -5,10 +5,15 @@
|
||||
#
|
||||
# https://www.maketecheasier.com/ip-address-geolocation-lookups-linux/
|
||||
|
||||
set -e
|
||||
ifinstalled "geoip" || exit 1
|
||||
|
||||
ifinstalled "geoip"
|
||||
addr="$(geoiplookup "$(curl -sfm 1 ifconfig.me 2>/dev/null)")"
|
||||
ipfile="$XDG_RUNTIME_DIR/iplocate"
|
||||
addr=$(cat "$ipfile" 2>/dev/null) && addr=$(geoiplookup "$addr" 2>/dev/null) && rm "$ipfile" ||
|
||||
( flock -n 9 &&
|
||||
( until { [ "$(cat /sys/class/net/w*/operstate)" = 'up' ] || [ "$(cat /sys/class/net/e*/operstate)" = 'up' ]; } &&
|
||||
curl -sf api.ipify.org --output "$ipfile"; do sleep 60; done &&
|
||||
pkill -RTMIN+"${1:-27}" "${STATUSBAR:-dwmblocks}" ) &
|
||||
echo; exit ) 9>"${XDG_RUNTIME_DIR}/sb-iplocate.lock"
|
||||
name="${addr##*, }"
|
||||
flag="$(grep "flag: $name" "${XDG_DATA_HOME:-$HOME/.local/share}/larbs/emoji")"
|
||||
flag="${flag%% *}"
|
||||
|
||||
@ -4,8 +4,12 @@
|
||||
|
||||
moonfile="${XDG_DATA_HOME:-$HOME/.local/share}/moonphase"
|
||||
|
||||
[ -s "$moonfile" ] && [ "$(stat -c %y "$moonfile" 2>/dev/null | cut -d' ' -f1)" = "$(date '+%Y-%m-%d')" ] ||
|
||||
{ curl -sf "wttr.in/?format=%m" > "$moonfile" || exit 1 ;}
|
||||
[ "$(stat -c %y "$moonfile" 2>/dev/null | cut -d' ' -f1)" = "$(date '+%Y-%m-%d')" ] ||
|
||||
( flock -n 9 &&
|
||||
( until { [ "$(cat /sys/class/net/w*/operstate)" = 'up' ] || [ "$(cat /sys/class/net/e*/operstate)" = 'up' ]; } &&
|
||||
curl -sf "wttr.in/?format=%m" --output "$moonfile" && touch "$moonfile"; do sleep 60; done &&
|
||||
pkill -RTMIN+"${1:-17}" "${STATUSBAR:-dwmblocks}" ) &
|
||||
echo; exit ) 9>"${XDG_RUNTIME_DIR}/sb-moonphase.lock"
|
||||
|
||||
icon="$(cat "$moonfile")"
|
||||
|
||||
|
||||
@ -28,8 +28,7 @@ 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" ||
|
||||
rm -f "$pricefile" "$chartfile" ;}
|
||||
updateprice() { curl -sf --fail-early $denom.$url/{1$target,$target$interval} --output "$pricefile" --output "$chartfile" && touch "$pricefile" "$chartfile"; }
|
||||
|
||||
[ "${filestat%% *}" != "$(date '+%Y-%m-%d')" ] &&
|
||||
updateme="1"
|
||||
@ -48,9 +47,16 @@ case $BLOCK_BUTTON in
|
||||
esac
|
||||
|
||||
[ -n "$updateme" ] &&
|
||||
updateprice "$target" &&
|
||||
[ -n "$showupdate" ] &&
|
||||
notify-send "$icon Update complete." "$name price is now
|
||||
\$$(cat "$pricefile")"
|
||||
if [ -n "$showupdate" ]; then
|
||||
updateprice && notify-send "$icon Update complete." "$name price is now \$$(cat "$pricefile")"
|
||||
else
|
||||
[ -n "$4" ] &&
|
||||
( flock -n 9 &&
|
||||
( until { [ "$(cat /sys/class/net/w*/operstate)" = 'up' ] || [ "$(cat /sys/class/net/e*/operstate)" = 'up' ]; } &&
|
||||
updateprice; do sleep 60; done &&
|
||||
pkill -RTMIN+"$4" "${STATUSBAR:-dwmblocks}" ) &
|
||||
echo; exit ) 9>"${XDG_RUNTIME_DIR}/sb-price.lock" ||
|
||||
updateprice
|
||||
fi
|
||||
|
||||
[ -f "$pricefile" ] && printf "%s%s%0.2f" "$icon" "$symb" "$(cat "$pricefile")"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user