Merge branch 'master' of github.com:lucic71/voidrice

This commit is contained in:
Lucian Popescu 2022-04-07 09:35:16 +03:00
commit b6cb14e470
20 changed files with 1954 additions and 1962 deletions

View File

@ -1,48 +1,27 @@
# Luke's lf settings
# Note on Image Previews
# For those wanting image previews, like this system, there are four steps to
# set it up. These are done automatically for LARBS users, but I will state
# them here for others doing it manually.
#
# 1. ueberzug must be installed.
# 2. The scope file (~/.config/lf/scope for me), must have a command similar to
# mine to generate ueberzug images.
# 3. A `set cleaner` line as below is a cleaner script.
# 4. lf should be started through a wrapper script (~/.local/bin/lfub for me)
# that creates the environment for ueberzug. This command can be be aliased
# in your shellrc (`alias lf="lfub") or if set to a binding, should be
# called directly instead of normal lf.
# Basic vars # Basic vars
set shell bash
set shellopts '-eu' set shellopts '-eu'
set ifs "\n" set ifs "\n"
set scrolloff 10 set scrolloff 10
set icons set icons
set period 1 set period 1
set hiddenfiles ".*:*.aux:*.log:*.bbl:*.bcf:*.blg:*.run.xml" set hiddenfiles ".*:*.aux:*.log:*.bbl:*.bcf:*.blg:*.run.xml"
set cleaner '~/.config/lf/cleaner'
set previewer '~/.config/lf/scope' # Vars that depend on environmental variables
$lf -remote "send $id set previewer ${XDG_CONFIG_HOME:-$HOME/.config}/lf/scope"
# cmds/functions # cmds/functions
cmd open ${{ cmd open ${{
case $(file --mime-type "$(readlink -f $f)" -b) in 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 evince $fx >/dev/null 2>&1 ;;
image/vnd.djvu|application/pdf|application/octet-stream|application/postscript) setsid -f zathura $fx >/dev/null 2>&1 ;; text/*) $EDITOR $fx;;
text/*|application/json|inode/x-empty) $EDITOR $fx;;
image/x-xcf) setsid -f gimp $f >/dev/null 2>&1 ;; image/x-xcf) setsid -f gimp $f >/dev/null 2>&1 ;;
image/svg+xml) display -- $f ;; image/svg+xml) display -- $f ;;
image/*) rotdir $f | grep -i "\.\(png\|jpg\|jpeg\|gif\|webp\|tif\|ico\)\(_large\)*$" | image/*) rotdir $f | grep -i "\.\(png\|jpg\|jpeg\|gif\|webp\|tif\|ico\)\(_large\)*$" | setsid -f sxiv -aio 2>/dev/null | lf-select & ;;
setsid -f sxiv -aio 2>/dev/null | while read -r file; do
[ -z "$file" ] && continue
lf -remote "send select \"$file\""
lf -remote "send toggle"
done &
;;
audio/*) mpv --audio-display=no $f ;; audio/*) mpv --audio-display=no $f ;;
video/*) setsid -f mpv $f -quiet >/dev/null 2>&1 ;; video/*) setsid -f mpv $f -quiet >/dev/null 2>&1 ;;
application/pdf|application/vnd*|application/epub*) setsid -f zathura $fx >/dev/null 2>&1 ;; application/pdf|application/vnd*|application/epub*) setsid -f evince $fx >/dev/null 2>&1 ;;
application/pgp-encrypted) $EDITOR $fx ;; application/pgp-encrypted) $EDITOR $fx ;;
*) for f in $fx; do setsid -f $OPENER $f >/dev/null 2>&1; done;; *) for f in $fx; do setsid -f $OPENER $f >/dev/null 2>&1; done;;
esac esac
@ -114,8 +93,8 @@ map O $mimeopen --ask $f
map A rename # at the very end map A rename # at the very end
map c push A<c-u> # new rename map c push A<c-u> # new rename
map I push A<c-a> # at the very beginning map I push A<c-a> # at the very beginning
map i push A<a-b><a-b><a-f> # before extention map i push A<a-b><a-b><a-f> # before extension
map a push A<a-b> # after extention map a push A<a-b> # after extension
map B bulkrename map B bulkrename
map b $setbg $f map b $setbg $f
@ -125,7 +104,5 @@ map V push :!nvim<space>
map W $setsid -f $TERMINAL >/dev/null 2>&1 map W $setsid -f $TERMINAL >/dev/null 2>&1
map Y $printf "%s" "$fx" | xclip -selection clipboard
# Source Bookmarks # Source Bookmarks
source "~/.config/lf/shortcutrc" source "~/.config/lf/shortcutrc"

View File

@ -1,44 +1,58 @@
#!/bin/sh #!/bin/bash
# File preview handler for lf. set -C -f -u
#IFS=$'\n'
set -C -f
IFS="$(printf '%b_' '\n')"; IFS="${IFS%_}" IFS="$(printf '%b_' '\n')"; IFS="${IFS%_}"
image() { # ANSI color codes are supported.
if [ -n "$DISPLAY" ] && [ -z "$WAYLAND_DISPLAY" ] && command -V ueberzug >/dev/null 2>&1; then # STDIN is disabled, so interactive scripts won't work properly
printf '{"action": "add", "identifier": "PREVIEW", "x": "%s", "y": "%s", "width": "%s", "height": "%s", "scaler": "contain", "path": "%s"}\n' "$4" "$5" "$(($2-1))" "$(($3-1))" "$1" > "$FIFO_UEBERZUG"
else # This script is considered a configuration file and must be updated manually.
mediainfo "$1"
# Meanings of exit codes:
# code | meaning | action of ranger
# -----+------------+-------------------------------------------
# 0 | success | Display stdout as preview
# 1 | no preview | Display no preview at all
# 2 | plain text | Display the plain content of the file
# Script arguments
FILE_PATH="${1}" # Full path of the highlighted file
HEIGHT="${2}"
#FILE_EXTENSION="${FILE_PATH##*.}"
#FILE_EXTENSION_LOWER=$(echo ${FILE_EXTENSION} | tr '[:upper:]' '[:lower:]')
# Settings
HIGHLIGHT_SIZE_MAX=262143 # 256KiB
HIGHLIGHT_TABWIDTH=8
HIGHLIGHT_STYLE='pablo'
handle_mime() {
local mimetype="${1}"
case "${mimetype}" in
text/html) w3m -dump "${FILE_PATH}" ;;
text/troff) man ./ "${FILE_PATH}" | col -b ;;
text/* | */xml)
if [ "$( stat --printf='%s' -- "${FILE_PATH}" )" -gt "${HIGHLIGHT_SIZE_MAX}" ]; then
exit 2
fi fi
} if [ "$( tput colors )" -ge 256 ]; then
local highlight_format='xterm256'
ifub() { else
[ -n "$DISPLAY" ] && [ -z "$WAYLAND_DISPLAY" ] && command -V ueberzug >/dev/null 2>&1 local highlight_format='ansi'
} fi
highlight --replace-tabs="${HIGHLIGHT_TABWIDTH}" --out-format="${highlight_format}" \
# Note that the cache file name is a function of file information, meaning if --style="${HIGHLIGHT_STYLE}" --force -- "${FILE_PATH}" ;;
# an image appears in multiple places across the machine, it will not have to application/zip) atool --list -- "${FILE_PATH}" ;;
# be regenerated once seen. image/*) chafa --fill=block --symbols=block -c 256 -s 80x"${HEIGHT}" "${FILE_PATH}" || exit 1;;
video/* | audio/*|application/octet-stream) mediainfo "${FILE_PATH}" || exit 1;;
case "$(file --dereference --brief --mime-type -- "$1")" in */pdf) pdftotext -l 10 -nopgbrk -q -- "${FILE_PATH}" - ;;
image/*) image "$1" "$2" "$3" "$4" "$5" ;; *opendocument*) odt2txt "${FILE_PATH}" ;;
text/html) lynx -width="$4" -display_charset=utf-8 -dump "$1" ;;
text/troff) man ./ "$1" | col -b ;;
text/* | */xml | application/json) bat --terminal-width "$4" -f "$1" ;;
application/zip) atool --list -- "$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 | awk '{print $1}')"
[ ! -f "$CACHE" ] && ffmpegthumbnailer -i "$1" -o "$CACHE" -s 0
image "$CACHE" "$2" "$3" "$4" "$5"
;;
*/pdf)
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" ] && pdftoppm -jpeg -f 1 -singlefile "$1" "$CACHE"
image "$CACHE.jpg" "$2" "$3" "$4" "$5"
;;
*opendocument*) odt2txt "$1" ;;
application/pgp-encrypted) gpg -d -- "$1" ;;
esac esac
}
MIMETYPE="$( file --dereference --brief --mime-type -- "${FILE_PATH}" )"
handle_mime "${MIMETYPE}"
exit 1 exit 1

View File

@ -32,7 +32,7 @@ color article white default bold
browser linkhandler browser linkhandler
macro , open-in-browser macro , open-in-browser
macro t set browser "qndl" ; open-in-browser ; set browser linkhandler macro t set browser "qndl" ; open-in-browser ; set browser linkhandler
macro a set browser "tsp yt-dlp --embed-metadata -xic -f bestaudio/best" ; open-in-browser ; set browser linkhandler macro a set browser "tsp youtube-dl --add-metadata -xic -f bestaudio/best" ; open-in-browser ; set browser linkhandler
macro v set browser "setsid -f mpv" ; open-in-browser ; set browser linkhandler macro v set browser "setsid -f mpv" ; open-in-browser ; set browser linkhandler
macro w set browser "lynx" ; open-in-browser ; set browser linkhandler macro w set browser "lynx" ; open-in-browser ; set browser linkhandler
macro d set browser "dmenuhandler" ; open-in-browser ; set browser linkhandler macro d set browser "dmenuhandler" ; open-in-browser ; set browser linkhandler

View File

@ -23,7 +23,7 @@ set title
set bg=light set bg=light
set go=a set go=a
set mouse=a set mouse=a
set nohlsearch set hlsearch
set clipboard+=unnamedplus set clipboard+=unnamedplus
set noshowmode set noshowmode
set noruler set noruler
@ -149,8 +149,3 @@ function! ToggleHiddenAll()
endif endif
endfunction endfunction
nnoremap <leader>h :call ToggleHiddenAll()<CR> nnoremap <leader>h :call ToggleHiddenAll()<CR>
" Load command shortcuts generated from bm-dirs and bm-files via shortcuts script.
" Here leader is ";".
" So ":vs ;cfz" will expand into ":vs /home/<user>/.config/zsh/.zshrc"
" if typed fast without the timeout.
source ~/.config/nvim/shortcuts.vim

View File

@ -18,7 +18,7 @@ alias \
rm="rm -vI" \ rm="rm -vI" \
bc="bc -ql" \ bc="bc -ql" \
mkd="mkdir -pv" \ mkd="mkdir -pv" \
yt="yt-dlp --embed-metadata -i" \ yt="youtube-dl --add-metadata -i" \
yta="yt -x -f bestaudio/best" \ yta="yt -x -f bestaudio/best" \
ffmpeg="ffmpeg -hide_banner" ffmpeg="ffmpeg -hide_banner"
@ -27,8 +27,7 @@ alias \
ls="ls -hN --color=auto --group-directories-first" \ ls="ls -hN --color=auto --group-directories-first" \
grep="grep --color=auto" \ grep="grep --color=auto" \
diff="diff --color=auto" \ diff="diff --color=auto" \
ccat="highlight --out-format=ansi" \ ccat="highlight --out-format=ansi"
ip="ip -color=auto"
# These common commands are just too long! Abbreviate them. # These common commands are just too long! Abbreviate them.
alias \ alias \
@ -46,7 +45,6 @@ alias \
z="zathura" z="zathura"
alias \ alias \
lf="lfub" \
magit="nvim -c MagitOnly" \ 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/zshnameddirrc" \
weath="less -S ${XDG_DATA_HOME:-$HOME/.local/share}/weatherreport" \ weath="less -S ${XDG_DATA_HOME:-$HOME/.local/share}/weatherreport" \

View File

@ -1 +1,15 @@
# This file is written by xdg-user-dirs-update
# If you want to change or add directories, just edit the line you're
# interested in. All local changes will be retained on the next run.
# Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped
# homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an
# absolute path. No other format is supported.
#
XDG_DESKTOP_DIR="$HOME/" XDG_DESKTOP_DIR="$HOME/"
XDG_DOWNLOAD_DIR="$HOME/Downloads"
XDG_TEMPLATES_DIR="$HOME/Templates"
XDG_PUBLICSHARE_DIR="$HOME/Public"
XDG_DOCUMENTS_DIR="$HOME/Documents"
XDG_MUSIC_DIR="$HOME/Music"
XDG_PICTURES_DIR="$HOME/Pictures"
XDG_VIDEOS_DIR="$HOME/Videos"

View File

@ -75,3 +75,29 @@ bindkey '^e' edit-command-line
# Load syntax highlighting; should be last. # Load syntax highlighting; should be last.
source /usr/share/zsh/plugins/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh 2>/dev/null source /usr/share/zsh/plugins/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh 2>/dev/null
$HOME/.local/bin/jp-quote
# Enable reverse search
bindkey -v
bindkey '^R' history-incremental-search-backward
# Access last parameter from the previous command using Alt + .
bindkey '\e.' insert-last-word
_alarm() {
( \speaker-test --frequency $1 --test sine )&
pid=$!
\sleep ${2}s
\kill -9 $pid
}
function countdown(){
date1=$((`date +%s` + $1));
while [ "$date1" -ge `date +%s` ]; do
echo -ne "$(date -u --date @$(($date1 - `date +%s`)) +%H:%M:%S)\r";
sleep 0.1
done
_alarm 1000 3
}

View File

@ -4,13 +4,13 @@
# some choice programs to use to open it. # some choice programs to use to open it.
feed="${1:-$(printf "%s" | dmenu -p 'Paste URL or file path')}" feed="${1:-$(printf "%s" | dmenu -p 'Paste URL or file path')}"
case "$(printf "Copy URL\\nsxiv\\nsetbg\\nPDF\\nbrowser\\nlynx\\nvim\\nmpv\\nmpv loop\\nmpv float\\nqueue download\\nqueue yt-dlp\\nqueue yt-dlp audio" | dmenu -i -p "Open it with?")" in case "$(printf "Copy URL\\nsxiv\\nsetbg\\nPDF\\nbrowser\\nlynx\\nvim\\nmpv\\nmpv loop\\nmpv float\\nqueue download\\nqueue yt-dl\\nqueue yt-dl audio" | dmenu -i -p "Open it with?")" in
"Copy URL") echo "$feed" | xclip -selection clipboard ;; "Copy URL") echo "$feed" | xclip -selection clipboard ;;
mpv) setsid -f mpv -quiet "$feed" >/dev/null 2>&1 ;; mpv) setsid -f mpv -quiet "$feed" >/dev/null 2>&1 ;;
"mpv loop") setsid -f mpv -quiet --loop "$feed" >/dev/null 2>&1 ;; "mpv loop") setsid -f mpv -quiet --loop "$feed" >/dev/null 2>&1 ;;
"mpv float") setsid -f "$TERMINAL" -e mpv --geometry=+0-0 --autofit=30% --title="mpvfloat" "$feed" >/dev/null 2>&1 ;; "mpv float") setsid -f "$TERMINAL" -e mpv --geometry=+0-0 --autofit=30% --title="mpvfloat" "$feed" >/dev/null 2>&1 ;;
"queue yt-dlp") qndl "$feed" >/dev/null 2>&1 ;; "queue yt-dl") qndl "$feed" >/dev/null 2>&1 ;;
"queue yt-dlp audio") qndl "$feed" 'yt-dlp --embed-metadata -icx -f bestaudio/best' >/dev/null 2>&1 ;; "queue yt-dl audio") qndl "$feed" 'youtube-dl --add-metadata -icx -f bestaudio/best' >/dev/null 2>&1 ;;
"queue download") qndl "$feed" 'curl -LO' >/dev/null 2>&1 ;; "queue download") qndl "$feed" 'curl -LO' >/dev/null 2>&1 ;;
PDF) curl -sL "$feed" > "/tmp/$(echo "$feed" | sed "s/.*\///;s/%20/ /g")" && zathura "/tmp/$(echo "$feed" | sed "s/.*\///;s/%20/ /g")" >/dev/null 2>&1 ;; PDF) curl -sL "$feed" > "/tmp/$(echo "$feed" | sed "s/.*\///;s/%20/ /g")" && zathura "/tmp/$(echo "$feed" | sed "s/.*\///;s/%20/ /g")" >/dev/null 2>&1 ;;
sxiv) curl -sL "$feed" > "/tmp/$(echo "$feed" | sed "s/.*\///;s/%20/ /g")" && sxiv -a "/tmp/$(echo "$feed" | sed "s/.*\///;s/%20/ /g")" >/dev/null 2>&1 ;; sxiv) curl -sL "$feed" > "/tmp/$(echo "$feed" | sed "s/.*\///;s/%20/ /g")" && sxiv -a "/tmp/$(echo "$feed" | sed "s/.*\///;s/%20/ /g")" >/dev/null 2>&1 ;;

18
.local/bin/jp-quote Executable file
View File

@ -0,0 +1,18 @@
#!/bin/sh
quotes=(
"Tell the truth."
"Pay attention."
"Don't be to civilized."
"Be precise in your speech."
"Promote the best in people."
"Do not do things that you hate."
"Don't let bullies get away with it."
"Nothing well done is insignificant."
"Dress like the person you want to be."
"Be grateful in spite of your suffering."
"Maintain your connections with people."
)
selectedQuote=${quotes[$RANDOM % ${#quotes[@]}]}
echo $selectedQuote

9
.local/bin/lf-select Executable file
View File

@ -0,0 +1,9 @@
#!/bin/sh
# Reads file names from stdin and selects them in lf.
while read -r file; do
[ -z "$file" ] && continue
lf -remote "send select \"$file\""
lf -remote "send toggle"
done

View File

@ -5,7 +5,7 @@
base="$(basename "$1")" base="$(basename "$1")"
notify-send "⏳ Queuing $base..." notify-send "⏳ Queuing $base..."
cmd="$2" cmd="$2"
[ -z "$cmd" ] && cmd="yt-dlp --embed-metadata -ic" [ -z "$cmd" ] && cmd="youtube-dl --add-metadata -ic"
idnum="$(tsp $cmd "$1")" idnum="$(tsp $cmd "$1")"
realname="$(echo "$base" | sed "s/?\(source\|dest\).*//;s/%20/ /g")" realname="$(echo "$base" | sed "s/?\(source\|dest\).*//;s/%20/ /g")"
tsp -D "$idnum" mv "$base" "$realname" tsp -D "$idnum" mv "$base" "$realname"

View File

@ -4,9 +4,9 @@
# Increase key speed via a rate change # Increase key speed via a rate change
xset r rate 300 50 xset r rate 300 50
# Map the caps lock key to super... # Map the caps lock key to super...
setxkbmap -option caps:super #setxkbmap -option caps:super
# But when it is pressed only once, treat it as escape. # But when it is pressed only once, treat it as escape.
killall xcape 2>/dev/null ; xcape -e 'Super_L=Escape' #killall xcape 2>/dev/null ; xcape -e 'Super_L=Escape'
# Map the menu button to right super as well. # Map the menu button to right super as well.
xmodmap -e 'keycode 135 = Super_R' xmodmap -e 'keycode 135 = Super_R'
# Turn off the caps lock if on since there is no longer a key for it. # Turn off the caps lock if on since there is no longer a key for it.

View File

@ -7,7 +7,7 @@
# If wal is installed, also generates a colorscheme. # If wal is installed, also generates a colorscheme.
# Location of link to wallpaper link. # Location of link to wallpaper link.
bgloc="${XDG_DATA_HOME:-$HOME/.local/share}/bg" bgloc="${XDG_DATA_HOME:-$HOME/.local/share/}/bg"
# Configuration files of applications that have their themes changed by pywal. # Configuration files of applications that have their themes changed by pywal.
dunstconf="${XDG_CONFIG_HOME:-$HOME/.config}/dunst/dunstrc" dunstconf="${XDG_CONFIG_HOME:-$HOME/.config}/dunst/dunstrc"

View File

@ -7,14 +7,13 @@ bmfiles="${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-files"
shell_shortcuts="${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc" shell_shortcuts="${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc"
zsh_named_dirs="${XDG_CONFIG_HOME:-$HOME/.config}/shell/zshnameddirrc" zsh_named_dirs="${XDG_CONFIG_HOME:-$HOME/.config}/shell/zshnameddirrc"
lf_shortcuts="${XDG_CONFIG_HOME:-$HOME/.config}/lf/shortcutrc" lf_shortcuts="${XDG_CONFIG_HOME:-$HOME/.config}/lf/shortcutrc"
vim_shortcuts="${XDG_CONFIG_HOME:-$HOME/.config}/nvim/shortcuts.vim"
ranger_shortcuts="/dev/null" ranger_shortcuts="/dev/null"
qute_shortcuts="/dev/null" qute_shortcuts="/dev/null"
fish_shortcuts="/dev/null" fish_shortcuts="/dev/null"
vifm_shortcuts="/dev/null" vifm_shortcuts="/dev/null"
# Remove, prepare files # Remove, prepare files
rm -f "$lf_shortcuts" "$ranger_shortcuts" "$qute_shortcuts" "$zsh_named_dirs" "$vim_shortcuts" 2>/dev/null rm -f "$lf_shortcuts" "$ranger_shortcuts" "$qute_shortcuts" "$zsh_named_dirs" 2>/dev/null
printf "# vim: filetype=sh\\n" > "$fish_shortcuts" printf "# vim: filetype=sh\\n" > "$fish_shortcuts"
printf "# vim: filetype=sh\\nalias " > "$shell_shortcuts" printf "# vim: filetype=sh\\nalias " > "$shell_shortcuts"
printf "\" vim: filetype=vim\\n" > "$vifm_shortcuts" printf "\" vim: filetype=vim\\n" > "$vifm_shortcuts"
@ -28,8 +27,7 @@ awk "!/^\s*#/ && !/^\s*\$/ {gsub(\"\\\s*#.*$\",\"\");
printf(\"map g%s :cd %s<CR>\nmap t%s <tab>:cd %s<CR><tab>\nmap M%s <tab>:cd %s<CR><tab>:mo<CR>\nmap Y%s <tab>:cd %s<CR><tab>:co<CR> \n\",\$1,\$2, \$1, \$2, \$1, \$2, \$1, \$2) >> \"$vifm_shortcuts\" ; printf(\"map g%s :cd %s<CR>\nmap t%s <tab>:cd %s<CR><tab>\nmap M%s <tab>:cd %s<CR><tab>:mo<CR>\nmap Y%s <tab>:cd %s<CR><tab>:co<CR> \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(\"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 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(\"map C%s cd \42%s\42 \n\",\$1,\$2) >> \"$lf_shortcuts\" }"
printf(\"cmap ;%s %s\n\",\$1,\$2) >> \"$vim_shortcuts\" }"
# Format the `files` file in the correct syntax and sent it to both configs. # Format the `files` file in the correct syntax and sent it to both configs.
eval "echo \"$(cat "$bmfiles")\"" | \ eval "echo \"$(cat "$bmfiles")\"" | \
@ -39,5 +37,4 @@ awk "!/^\s*#/ && !/^\s*\$/ {gsub(\"\\\s*#.*$\",\"\");
printf(\"abbr %s \42\$EDITOR %s\42 \n\",\$1,\$2) >> \"$fish_shortcuts\" ; printf(\"abbr %s \42\$EDITOR %s\42 \n\",\$1,\$2) >> \"$fish_shortcuts\" ;
printf(\"map %s :e %s<CR> \n\",\$1,\$2) >> \"$vifm_shortcuts\" ; printf(\"map %s :e %s<CR> \n\",\$1,\$2) >> \"$vifm_shortcuts\" ;
printf(\"map %s shell \$EDITOR %s \n\",\$1,\$2) >> \"$ranger_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(\"map E%s \$\$EDITOR \42%s\42 \n\",\$1,\$2) >> \"$lf_shortcuts\" }"
printf(\"cmap ;%s %s\n\",\$1,\$2) >> \"$vim_shortcuts\" }"

View File

@ -1,248 +1,194 @@
#!/bin/sh #!/bin/sh
# Show a Doppler RADAR of a user's preferred location. # Show a Doppler RADAR of an American user's preferred location.
secs=600 # Download a new doppler radar if one hasn't been downloaded in $secs seconds. secs=600 # Download a new doppler radar if one hasn't been downloaded in $secs seconds.
radarloc="${XDG_CACHE_HOME:-$HOME/.cache}/radar" radarloc="${XDG_CACHE_HOME:-$HOME/.cache}/radar"
doppler="${XDG_CACHE_HOME:-$HOME/.cache}/doppler.gif" doppler="${XDG_CACHE_HOME:-$HOME/.cache}/doppler.gif"
pickloc() { chosen="$(echo "US: Northeast pickloc() { chosen="$(echo "Northeast
US: Southeast Southeast
US: PacNorthWest PacNorthWest
US: PacSouthWest PacSouthWest
US: UpperMissVly UpperMissVly
US: SouthMissVly SouthMissVly
US: SouthPlains SouthPlains
US: NorthRockies NorthRockies
US: SouthRockies SouthRockies
US: Alaska Alaska
US: Carib Carib
US: Hawaii Hawaii
US: CentGrLakes CentGrLakes
US: Conus-Large Conus-Large
US: KABR: Aberdeen, SD KABR: Aberdeen, SD
US: KBIS: Bismarck, ND KBIS: Bismarck, ND
US: KFTG: Denver/Boulder, CO KFTG: Denver/Boulder, CO
US: KDMX: Des Moines, IA KDMX: Des Moines, IA
US: KDTX: Detroit, MI KDTX: Detroit, MI
US: KDDC: Dodge City, KS KDDC: Dodge City, KS
US: KDLH: Duluth, MN KDLH: Duluth, MN
US: KCYS: Cheyenne, WY KCYS: Cheyenne, WY
US: KLOT: Chicago, IL KLOT: Chicago, IL
US: KGLD: Goodland, KS KGLD: Goodland, KS
US: KUEX: Hastings, NE KUEX: Hastings, NE
US: KGJX: Grand Junction, CO KGJX: Grand Junction, CO
US: KGRR: Grand Rapids, MI KGRR: Grand Rapids, MI
US: KMVX: Fargo/Grand Forks, ND KMVX: Fargo/Grand Forks, ND
US: KGRB: Green Bay, WI KGRB: Green Bay, WI
US: KIND: Indianapolis, IN KIND: Indianapolis, IN
US: KJKL: Jackson, KY KJKL: Jackson, KY
US: KARX: La Crosse, WI KARX: La Crosse, WI
US: KILX: Lincoln/Central Illinois, IL KILX: Lincoln/Central Illinois, IL
US: KLVX: Louisville, KY KLVX: Louisville, KY
US: KMQT: Marquette KMQT: Marquette
US: KMKX: Milwaukee, WI KMKX: Milwaukee, WI
US: KMPX: Minneapolis, MN KMPX: Minneapolis, MN
US: KAPX: Gaylord/Alpena, MI KAPX: Gaylord/Alpena, MI
US: KLNX: North Platte, NE KLNX: North Platte, NE
US: KIWX: N. Webster/Northern, IN KIWX: N. Webster/Northern, IN
US: KOAX: Omaha, NE KOAX: Omaha, NE
US: KPAH: Paducah, KY KPAH: Paducah, KY
US: KEAX: Pleasant Hill, MO KEAX: Pleasant Hill, MO
US: KPUX: Pueblo, CO KPUX: Pueblo, CO
US: KDVN: Quad Cities, IA KDVN: Quad Cities, IA
US: KUDX: Rapid City, SD KUDX: Rapid City, SD
US: KRIW: Riverton, WY KRIW: Riverton, WY
US: KSGF: Springfield, MO KSGF: Springfield, MO
US: KLSX: St. LOUIS, MO KLSX: St. LOUIS, MO
US: KFSD: Sioux Falls, IA KFSD: Sioux Falls, IA
US: KTWX: Topeka, KS KTWX: Topeka, KS
US: KICT: Wichita, KS KICT: Wichita, KS
US: KVWX: Paducah, KY KVWX: Paducah, KY
US: ICAO: Responsible Wfo ICAO: Responsible Wfo
US: KLTX: WILMINGTON, NC KLTX: WILMINGTON, NC
US: KCCX: State College/Central, PA KCCX: State College/Central, PA
US: KLWX: Sterling, VA KLWX: Sterling, VA
US: KFCX: Blacksburg/Roanoke, VA KFCX: Blacksburg/Roanoke, VA
US: KRAX: Raleigh/Durham, NC KRAX: Raleigh/Durham, NC
US: KGYX: Portland, ME KGYX: Portland, ME
US: KDIX: Mt Holly/Philadelphia, PA KDIX: Mt Holly/Philadelphia, PA
US: KPBZ: Pittsburgh, PA KPBZ: Pittsburgh, PA
US: KAKQ: Wakefield, VA KAKQ: Wakefield, VA
US: KMHX: Morehead City, NC KMHX: Morehead City, NC
US: KGSP: Greer/Greenville/Sprtbg, SC KGSP: Greer/Greenville/Sprtbg, SC
US: KILN: Wilmington/Cincinnati, OH KILN: Wilmington/Cincinnati, OH
US: KCLE: Cleveland, OH KCLE: Cleveland, OH
US: KCAE: Columbia, SC KCAE: Columbia, SC
US: KBGM: Binghamton, NY KBGM: Binghamton, NY
US: KENX: Albany, NY KENX: Albany, NY
US: KBUF: Buffalo, NY KBUF: Buffalo, NY
US: KCXX: Burlington, VT KCXX: Burlington, VT
US: KCBW: Caribou, ME KCBW: Caribou, ME
US: KBOX: Boston /Taunton, MA KBOX: Boston /Taunton, MA
US: KOKX: New York City, NY KOKX: New York City, NY
US: KCLX: Charleston, SC KCLX: Charleston, SC
US: KRLX: Charleston, WV KRLX: Charleston, WV
US: ICAO: Responsible WFO ICAO: Responsible WFO
US: KBRO: Brownsville, TX KBRO: Brownsville, TX
US: KABX: Albuquerque, NM KABX: Albuquerque, NM
US: KAMA: Amarillo, TX KAMA: Amarillo, TX
US: KFFC: Peachtree City/Atlanta, GA KFFC: Peachtree City/Atlanta, GA
US: KEWX: Austin/Sanantonio, TX KEWX: Austin/Sanantonio, TX
US: KBMX: Birmingham, AL KBMX: Birmingham, AL
US: KCRP: Corpus Christi, TX KCRP: Corpus Christi, TX
US: KFWS: Dallas / Ft. Worth, TX KFWS: Dallas / Ft. Worth, TX
US: KEPZ: El Paso, TX KEPZ: El Paso, TX
US: KHGX: Houston/ Galveston, TX KHGX: Houston/ Galveston, TX
US: KJAX: Jacksonville, FL KJAX: Jacksonville, FL
US: KBYX: Key West, FL KBYX: Key West, FL
US: KMRX: Morristown/knoxville, TN KMRX: Morristown/knoxville, TN
US: KLBB: Lubbock, TX KLBB: Lubbock, TX
US: KLZK: Little Rock, AR KLZK: Little Rock, AR
US: KLCH: Lake Charles, LA KLCH: Lake Charles, LA
US: KOHX: Nashville, TN KOHX: Nashville, TN
US: KMLB: Melbourne, FL KMLB: Melbourne, FL
US: KNQA: Memphis, TN KNQA: Memphis, TN
US: KAMX: Miami, FL KAMX: Miami, FL
US: KMAF: Midland/odessa, TX KMAF: Midland/odessa, TX
US: KTLX: Norman, OK KTLX: Norman, OK
US: KHTX: Huntsville, AL KHTX: Huntsville, AL
US: KMOB: Mobile, AL KMOB: Mobile, AL
US: KTLH: Tallahassee, FL KTLH: Tallahassee, FL
US: KTBW: Tampa Bay Area, FL KTBW: Tampa Bay Area, FL
US: KSJT: San Angelo, TX KSJT: San Angelo, TX
US: KINX: Tulsa, OK KINX: Tulsa, OK
US: KSRX: Tulsa, OK KSRX: Tulsa, OK
US: KLIX: New Orleans/slidell, LA KLIX: New Orleans/slidell, LA
US: KDGX: Jackson, MS KDGX: Jackson, MS
US: KSHV: Shreveport, LA KSHV: Shreveport, LA
US: ICAO: Responsible WFO ICAO: Responsible WFO
US: KLGX: Seattle / Tacoma, WA KLGX: Seattle / Tacoma, WA
US: KOTX: Spokane, WA KOTX: Spokane, WA
US: KEMX: Tucson, AZ KEMX: Tucson, AZ
US: KYUX: Phoenix, AZ KYUX: Phoenix, AZ
US: KNKX: San Diego, CA KNKX: San Diego, CA
US: KMUX: Monterey/san Francisco, CA KMUX: Monterey/san Francisco, CA
US: KHNX: San Joaquin/hanford, CA KHNX: San Joaquin/hanford, CA
US: KSOX: San Diego, CA KSOX: San Diego, CA
US: KATX: Seattle / Tacoma, WA KATX: Seattle / Tacoma, WA
US: KIWA: Phoenix, AZ KIWA: Phoenix, AZ
US: KRTX: Portland, OR KRTX: Portland, OR
US: KSFX: Pocatello, ID KSFX: Pocatello, ID
US: KRGX: Reno, NV KRGX: Reno, NV
US: KDAX: Sacramento, CA KDAX: Sacramento, CA
US: KMTX: Salt Lake City, UT KMTX: Salt Lake City, UT
US: KPDT: Pendleton, OR KPDT: Pendleton, OR
US: KMSX: Missoula, MT KMSX: Missoula, MT
US: KESX: Las Vegas, NV KESX: Las Vegas, NV
US: KVTX: Los Angeles, CA KVTX: Los Angeles, CA
US: KMAX: Medford, OR KMAX: Medford, OR
US: KFSX: Flagstaff, AZ KFSX: Flagstaff, AZ
US: KGGW: Glasgow, MT KGGW: Glasgow, MT
US: KLRX: Elko, NV KLRX: Elko, NV
US: KBHX: Eureka, CA KBHX: Eureka, CA
US: KTFX: Great Falls, MT KTFX: Great Falls, MT
US: KCBX: Boise, ID KCBX: Boise, ID
US: KBLX: Billings, MT KBLX: Billings, MT
US: KICX: Salt Lake City, UT KICX: Salt Lake City, UT
US: ICAO: Responsible Wfo W/ MSCF ICAO: Responsible Wfo W/ MSCF
US: PABC: Anchorage, AK PABC: Anchorage, AK
US: PAPD: Fairbanks, AK PAPD: Fairbanks, AK
US: PHKM: Honolulu, HI PHKM: Honolulu, HI
US: PAHG: Anchorage, AK PAHG: Anchorage, AK
US: PAKC: Anchorage, AK PAKC: Anchorage, AK
US: PAIH: Anchorage, AK PAIH: Anchorage, AK
US: PHMO: Honolulu, HI PHMO: Honolulu, HI
US: PAEC: Fairbanks, AK PAEC: Fairbanks, AK
US: TJUA: San Juan, PR TJUA: San Juan, PR
US: PACG: Juneau, AK PACG: Juneau, AK
US: PHKI: Honolulu, HI PHKI: Honolulu, HI
US: PHWA: Honolulu, HI PHWA: Honolulu, HI
US: ICAO: Responsible Wfo W/ MSCF ICAO: Responsible Wfo W/ MSCF
US: KFDR: Norman, OK KFDR: Norman, OK
US: PGUA: Guam PGUA: Guam
US: KBBX: Sacramento, CA KBBX: Sacramento, CA
US: KFDX: Albuquerque, NM KFDX: Albuquerque, NM
US: KGWX: Jackson, MS KGWX: Jackson, MS
US: KDOX: Wakefield, VA KDOX: Wakefield, VA
US: KDYX: San Angelo, TX KDYX: San Angelo, TX
US: KEYX: Las Vegas, NV KEYX: Las Vegas, NV
US: KEVX: Mobile, AL KEVX: Mobile, AL
US: KHPX: Paducah, KY KHPX: Paducah, KY
US: KTYX: Burlington, VT KTYX: Burlington, VT
US: KGRK: Dallas / Ft. Worth, TX KGRK: Dallas / Ft. Worth, TX
US: KPOE: Lake Charles, LA KPOE: Lake Charles, LA
US: KEOX: Tallahassee, FL KEOX: Tallahassee, FL
US: KHDX: El Paso, TX KHDX: El Paso, TX
US: KDFX: San Antonio, TX KDFX: San Antonio, TX
US: KMXX: Birmingham, AL KMXX: Birmingham, AL
US: KMBX: Bismarck, ND KMBX: Bismarck, ND
US: KVAX: Jacksonville, FL KVAX: Jacksonville, FL
US: KJGX: Peachtree City/atlanta, GA KJGX: Peachtree City/atlanta, GA
US: KVNX: Norman, OK KVNX: Norman, OK
US: KVBX: Vandenberg Afb: Orcutt, CA KVBX: Vandenberg Afb: Orcutt, CA" | dmenu -r -i -l 50 -p "Select a National Weather Service radar to use as default:" | sed "s/:.*//" | tr "[:lower:]" "[:upper:]")"
EU: Europe
EU: GB: Great Brittain
EU: SCAN: Scandinavia
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" | dmenu -r -i -l 50 -p "Select a radar to use as default:" | tr "[:lower:]" "[:upper:]")"
# Set continent code and radar code.
continentcode=$(echo "$chosen" | sed "s/:.*//")
radarcode=$(echo "$chosen" | sed "s/..: // ; s/:.*//")
# Sanity check of selection and ensure user did not escape. # Sanity check of selection and ensure user did not escape.
echo "$radarcode" | grep -q "^[A-Z]\+$" && printf "%s,%s\\n" "$continentcode" "$radarcode" > "$radarloc" ;} echo "$chosen" | grep -q "^[A-Z]\+$" && echo "$chosen" > "$radarloc" ;}
getdoppler() { getdoppler() {
cont="$(sed "s/,.*//" "$radarloc")" loc="$(cat "$radarloc")"
loc="$(cut -c 4- "$radarloc")"
notify-send "🌦️ Doppler RADAR" "Pulling most recent Doppler RADAR for $loc." notify-send "🌦️ Doppler RADAR" "Pulling most recent Doppler RADAR for $loc."
if [ "$cont" = "US" ] ; then curl -sL "https://radar.weather.gov/ridge/lite/${loc}_loop.gif" > "$doppler" ;}
curl -sL "https://radar.weather.gov/ridge/lite/${loc}_loop.gif" > "$doppler" ;
elif [ "$cont" = "EU" ] ; then
curl -sL "https://api.sat24.com/animated/${loc}/rainTMC/2/" > "$doppler" ;
elif [ "$cont" = "AF" ] ; then
curl -sL "https://api.sat24.com/animated/${loc}/rain/2/" > "$doppler" ;
fi
}
showdoppler() { setsid -f mpv --no-osc --loop=inf --no-terminal "$doppler" ;} showdoppler() { setsid -f mpv --no-osc --loop=inf --no-terminal "$doppler" ;}
@ -252,7 +198,7 @@ case $BLOCK_BUTTON in
showdoppler ;; showdoppler ;;
2) pickloc && getdoppler && showdoppler ;; 2) pickloc && getdoppler && showdoppler ;;
3) notify-send "🗺️ Doppler RADAR module" "\- Left click for local Doppler RADAR. 3) notify-send "🗺️ Doppler RADAR module" "\- Left click for local Doppler RADAR.
- Middle click to update RADAR location. - Middle click to update change RADAR location.
After $secs seconds, new clicks will also automatically update the doppler RADAR." ;; After $secs seconds, new clicks will also automatically update the doppler RADAR." ;;
6) "$TERMINAL" -e "$EDITOR" "$0" ;; 6) "$TERMINAL" -e "$EDITOR" "$0" ;;
esac esac

View File

@ -26,4 +26,4 @@ update() {
rx=$(update /sys/class/net/[ew]*/statistics/rx_bytes) rx=$(update /sys/class/net/[ew]*/statistics/rx_bytes)
tx=$(update /sys/class/net/[ew]*/statistics/tx_bytes) tx=$(update /sys/class/net/[ew]*/statistics/tx_bytes)
printf "🔻%4sB 🔺%4sB\\n" $(numfmt --to=iec $rx $tx) printf "🔻%4sB 🔺%4sB\\n" $(numfmt --to=iec $rx) $(numfmt --to=iec $tx)

View File

@ -14,7 +14,7 @@ i3 (old window manager) https://videos.lukesmith.xyz/videos/watch/b861525c-7ada-
neomutt (email) https://videos.lukesmith.xyz/videos/watch/83122e83-52d9-4278-ae1a-7d1beeb50c8e neomutt (email) https://videos.lukesmith.xyz/videos/watch/83122e83-52d9-4278-ae1a-7d1beeb50c8e
ncmpcpp (music player) https://videos.lukesmith.xyz/videos/watch/b5ac6f0d-a220-4433-88e3-e98fc791dc0a ncmpcpp (music player) https://videos.lukesmith.xyz/videos/watch/b5ac6f0d-a220-4433-88e3-e98fc791dc0a
newsboat (RSS reader) https://videos.lukesmith.xyz/videos/watch/bd2c3fff-40fa-47ea-aa98-5b1ec0c903b6 newsboat (RSS reader) https://videos.lukesmith.xyz/videos/watch/bd2c3fff-40fa-47ea-aa98-5b1ec0c903b6
lf (file manager) https://videos.lukesmith.xyz/w/rKeHsF5ZHDNDbR1buUKB1c ranger (file manager) https://videos.lukesmith.xyz/videos/watch/785d914f-8cbd-4a3d-a1f6-d75675fc7549
zathura (pdf viewer) https://videos.lukesmith.xyz/videos/watch/c780f75a-11f6-48a9-a191-d079ebc36ea4 zathura (pdf viewer) https://videos.lukesmith.xyz/videos/watch/c780f75a-11f6-48a9-a191-d079ebc36ea4
gpg keys https://videos.lukesmith.xyz/videos/watch/040f5530-4830-4583-9ddc-2080b421531b gpg keys https://videos.lukesmith.xyz/videos/watch/040f5530-4830-4583-9ddc-2080b421531b
calcurse (calendar) https://videos.lukesmith.xyz/videos/watch/4b937e8b-7654-46e3-8d01-79392ec5b3d1 calcurse (calendar) https://videos.lukesmith.xyz/videos/watch/4b937e8b-7654-46e3-8d01-79392ec5b3d1

View File

@ -1,4 +1,4 @@
[Desktop Entry] [Desktop Entry]
Type=Application Type=Application
Name=File Manager Name=File Manager
Exec=/usr/local/bin/st -e lfub %u Exec=/usr/local/bin/st -e lf %u

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,35 @@
_ __ __ _ _ __ __ _ ___ _ __
| '__/ _` | '_ \ / _` |/ _ \ '__|
| | | (_| | | | | (_| | __/ |
|_| \__,_|_| |_|\__, |\___|_|
|___/
ranger is the file manager.
j/k - Down/up
h - Left/higher in directory structure
l - Right/open/lower in directory structure
gg - Go to top
G - Go to bottom
cw - Rename file
I - Rename file, with cursor at beginning
A - Rename file, with cursor at end
aa - Rename file, with cursor right before extension
mkd - Make directory
bg - Change background/wallpaper to selected file
X - Extract archive
Z - Compress into tar.gz
Space - Highlight/select file
va - Highlight/(de)select all
vs - Toggle visual selection mode
uv - Deselect all
dd - Cut file(s)
yy - Yank/copy file(s)
pp - Paste cut/copied file(s)
po - Paste cut/copied file(s), overwriting originals
cW - Rename all selected files in text editor
D - Delete file(s) (press enter to confirm)
dD - Delete file(s) (press enter to confirm)
ctrl-f - Fuzzy find (fzf)
ctrl-l - Search via mlocate
q - Quit
Q - Immediate quit