Compare commits

...

17 Commits

Author SHA1 Message Date
Luca Bilke
2e22448e88
clean up formatting 2024-05-24 20:05:12 +02:00
Luca Bilke
e9697a2589
Merge branch 'master' of https://github.com/lukesmithxyz/voidrice into shortcuts-patch 2024-05-24 19:53:32 +02:00
Luca Bilke
bb1dc77798
port upstream changes
https://github.com/LukeSmithxyz/voidrice/pull/1385
2024-05-24 19:53:15 +02:00
Zmole Cristian
c95a16916d
Add OCR to maimpick (#1415)
Sometimes you just need to grab some text from a video
2024-05-23 17:25:19 +00:00
Luke Smith
28eff887e0
Merge branch 'master' of github.com:LukeSmithxyz/voidrice 2024-05-23 13:03:55 -04:00
Luke Smith
441d26b75d
for legacy vim colorscheme 2024-05-23 13:03:41 -04:00
Ryan F
db6ee8f819
map gh fix (#1414)
map gh doesn't do anything because it doesn't recognize multi-letter commands. mapping H to cd to ~
2024-05-23 16:42:08 +00:00
Luke Smith
487be9193c
remove default rss feeds 2024-05-17 09:13:07 -04:00
poeplva
1f7376c805
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
2024-05-11 14:22:52 +00:00
Stepan Chernov
97f2fa3872
Update sb-clock to fix display issue (#1380)
Co-authored-by: Stepan Chernov <me@chernov.land>
2024-05-11 12:56:27 +00:00
Tri Asep Tumbara
db8ee0df79
Fix the problem when taking a screenshot of the lf window (#1398)
Without -B option, the result of the screenshot is a blank picture.
2024-05-11 12:55:29 +00:00
David Nevado
97687287bd
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")
2024-05-11 12:54:21 +00:00
TheYellowArchitect
5c8d46a4e7
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.
2024-05-11 12:53:48 +00:00
Alessio Artoni
dd6eb37469
Remove unused vim configs and shortcuts (#1385)
Remove: ranger shortcuts, "nocompatible", plain Vim support for
NERDTreeBookmarksFile and vimling configuration.
2024-05-11 12:42:22 +00:00
Emre AKYÜZ
f1915e71e5
[compiler] - streamline | simplify | minimize (#1389)
* [compiler] - streamline | simplify | minimize

* Update compiler
2024-05-11 12:41:19 +00:00
Emre AKYÜZ
92f9fc458c
[getcomproot] - fix | minimize | posix compliance (#1388) 2024-05-11 12:39:43 +00:00
fennomaani
b545443993
Save command to history before it is executed (#1409) 2024-05-11 12:35:28 +00:00
10 changed files with 90 additions and 136 deletions

View File

@ -30,7 +30,7 @@ set autoquit true
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 ;; 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;; text/*|application/json|inode/x-empty|application/x-subrip) $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 ;;
@ -45,8 +45,14 @@ cmd open ${{
video/*) setsid -f mpv $f -quiet >/dev/null 2>&1 ;; 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/pdf|application/vnd.djvu|application/epub*) setsid -f zathura $fx >/dev/null 2>&1 ;;
application/pgp-encrypted) $EDITOR $fx ;; 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 ;; 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 ;;
*) for f in $fx; do setsid -f $OPENER $f >/dev/null 2>&1; done;; 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 esac
}} }}
@ -133,7 +139,7 @@ cmd bulkrename ${{
# Bindings # Bindings
map <c-f> $lf -remote "send $id select \"$(fzf)\"" 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 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 g top
map D delete map D delete
map E extract map E extract
@ -162,7 +168,14 @@ 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 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 <gt> $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 <c-l> unselect
# Source Bookmarks # Source Bookmarks
source "~/.config/lf/shortcutrc" source "~/.config/lf/shortcutrc"

View File

@ -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"

View File

@ -31,10 +31,10 @@ set noshowmode
set noruler set noruler
set laststatus=0 set laststatus=0
set noshowcmd set noshowcmd
colorscheme vim
" Some basics: " Some basics:
nnoremap c "_c nnoremap c "_c
set nocompatible
filetype plugin on filetype plugin on
syntax on syntax on
set encoding=utf-8 set encoding=utf-8
@ -55,22 +55,11 @@ set noshowcmd
" Nerd tree " Nerd tree
map <leader>n :NERDTreeToggle<CR> map <leader>n :NERDTreeToggle<CR>
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
if has('nvim') let NERDTreeBookmarksFile = stdpath('data') . '/NERDTreeBookmarks'
let NERDTreeBookmarksFile = stdpath('data') . '/NERDTreeBookmarks'
else
let NERDTreeBookmarksFile = '~/.vim' . '/NERDTreeBookmarks'
endif
" vimling:
nm <leader>d :call ToggleDeadKeys()<CR>
imap <leader>d <esc>:call ToggleDeadKeys()<CR>a
nm <leader>i :call ToggleIPA()<CR>
imap <leader>i <esc>:call ToggleIPA()<CR>a
nm <leader>q :call ToggleProse()<CR>
" vim-airline " vim-airline
if !exists('g:airline_symbols') if !exists('g:airline_symbols')
let g:airline_symbols = {} let g:airline_symbols = {}
endif endif
let g:airline_symbols.colnr = ' C:' let g:airline_symbols.colnr = ' C:'
let g:airline_symbols.linenr = ' L:' let g:airline_symbols.linenr = ' L:'
@ -116,10 +105,9 @@ set noshowcmd
cabbrev w!! execute 'silent! write !sudo tee % >/dev/null' <bar> edit! cabbrev w!! execute 'silent! write !sudo tee % >/dev/null' <bar> edit!
" Enable Goyo by default for mutt writing " Enable Goyo by default for mutt writing
autocmd BufRead,BufNewFile /tmp/neomutt* let g:goyo_width=80 autocmd BufRead,BufNewFile /tmp/neomutt* :Goyo 80 | call feedkeys("jk")
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 ZZ :Goyo\|x!<CR> autocmd BufRead,BufNewFile /tmp/neomutt* map ZQ :Goyo!\|q!<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 " Automatically deletes all trailing whitespace and newlines at end of file on save. & reset cursor position
autocmd BufWritePre * let currPos = getpos(".") autocmd BufWritePre * let currPos = getpos(".")

View File

@ -11,6 +11,7 @@ setopt interactive_comments
HISTSIZE=10000000 HISTSIZE=10000000
SAVEHIST=10000000 SAVEHIST=10000000
HISTFILE="${XDG_CACHE_HOME:-$HOME/.cache}/zsh/history" HISTFILE="${XDG_CACHE_HOME:-$HOME/.cache}/zsh/history"
setopt inc_append_history
# Load aliases and shortcuts if existent. # 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/shortcutrc" ] && source "${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc"

View File

@ -2,58 +2,51 @@
# This script will compile or run another finishing operation on a document. I # This script will compile or run another finishing operation on a document. I
# have this script run via vim. # have this script run via vim.
#
# Compiles .tex. groff (.mom, .ms), .rmd, .md, .org. Opens .sent files as sent # Compiles .tex. groff (.mom, .ms), .rmd, .md, .org. Opens .sent files as sent
# presentations. Runs scripts based on extension or shebang. # presentations. Runs scripts based on extension or shebang.
#
# Note that .tex files which you wish to compile with XeLaTeX should have the # 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. # string "xelatex" somewhere in a comment/command in the first 5 lines.
file=$(readlink -f "$1") file="${1}"
ext="${file##*.}"
dir=${file%/*} dir=${file%/*}
base="${file%.*}" base="${file%.*}"
ext="${file##*.}"
cd "$dir" || exit 1 cd "${dir}" || exit "1"
textype() { \ case "${ext}" in
textarget="$(getcomproot "$file" || echo "$file")" [0-9]) preconv "${file}" | refer -PS -e | groff -mandoc -T pdf > "${base}.pdf" ;;
echo "$textarget" mom|ms) preconv "${file}" | refer -PS -e | groff -T pdf -m"${ext}" > "${base}.pdf" ;;
command="pdflatex" c) cc "${file}" -o "${base}" && "./${base}" ;;
( head -n5 "$textarget" | grep -qi 'xelatex' ) && command="xelatex" cpp) g++ "${file}" -o "${base}" && "./${base}" ;;
$command --output-directory="${textarget%/*}" "${textarget%.*}" cs) mcs "${file}" && mono "${base}.exe" ;;
grep -qi addbibresource "$textarget" && go) go run "${file}" ;;
biber --input-directory "${textarget%/*}" "${textarget%.*}" && h) sudo make install ;;
$command --output-directory="${textarget%/*}" "${textarget%.*}" && java) javac -d classes "${file}" && java -cp classes "${base}" ;;
$command --output-directory="${textarget%/*}" "${textarget%.*}" m) octave "${file}" ;;
} md) [ -x "$(command -v lowdown)" ] && \
lowdown --parse-no-intraemph "${file}" -Tms | groff -mpdfmark -ms -kept -T pdf > "${base}.pdf" || \
case "$ext" in [ -x "$(command -v groffdown)" ] && \
# Try to keep these cases in alphabetical order. groffdown -i "${file}" | groff -T pdf > "${base}.pdf" || \
[0-9]) preconv "$file" | refer -PS -e | groff -mandoc -T pdf > "$base".pdf ;; pandoc -t ms --highlight-style="kate" -s -o "${base}.pdf" "${file}" ;;
c) cc "$file" -o "$base" && "$base" ;; org) emacs "${file}" --batch -u "${USER}" -f org-latex-export-to-pdf ;;
cpp) g++ "$file" -o "$base" && "$base" ;; py) python "${file}" ;;
cs) mcs "$file" && mono "$base".exe ;; [rR]md) Rscript -e "rmarkdown::render('${file}', quiet=TRUE)" ;;
go) go run "$file" ;; rs) cargo build ;;
h) sudo make install ;; sass) sassc -a "${file}" "${base}.css" ;;
java) javac -d classes "$file" && java -cp classes "${1%.*}" ;; scad) openscad -o "${base}.stl" "${file}" ;;
m) octave "$file" ;; sent) setsid -f sent "${file}" 2> "/dev/null" ;;
md) if [ -x "$(command -v lowdown)" ]; then tex)
lowdown --parse-no-intraemph "$file" -Tms | groff -mpdfmark -ms -kept -T pdf > "$base".pdf textarget="$(getcomproot "${file}" || echo "${file}")"
elif [ -x "$(command -v groffdown)" ]; then command="pdflatex"
groffdown -i "$file" | groff -T pdf > "$base".pdf head -n5 "${textarget}" | grep -qi "xelatex" && command="xelatex"
else ${command} --output-directory="${textarget%/*}" "${textarget%.*}" &&
pandoc -t ms --highlight-style=kate -s -o "$base".pdf "$file" grep -qi addbibresource "${textarget}" &&
fi ; ;; biber --input-directory "${textarget%/*}" "${textarget%.*}" &&
mom) preconv "$file" | refer -PS -e | groff -mom -kept -T pdf > "$base".pdf ;; ${command} --output-directory="${textarget%/*}" "${textarget%.*}" &&
ms) preconv "$file" | refer -PS -e | groff -me -ms -kept -T pdf > "$base".pdf ;; ${command} --output-directory="${textarget%/*}" "${textarget%.*}"
org) emacs "$file" --batch -u "$USER" -f org-latex-export-to-pdf ;; ;;
py) python "$file" ;; *) sed -n '/^#!/s/^#!//p; q' "${file}" | xargs -r -I % "${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" ;;
esac esac

View File

@ -32,7 +32,7 @@ twoscreen() { # If multi-monitor is selected and there are two screens.
else else
primary=$(echo "$screens" | dmenu -i -p "Select primary display:") 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?") 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 xrandr --output "$primary" --auto --scale 1.0x1.0 --output "$secondary" --"$direction"-of "$primary" --auto --scale 1.0x1.0
fi 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. morescreen() { # If multi-monitor is selected and there are more than two screens.
primary=$(echo "$screens" | dmenu -i -p "Select primary display:") 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?") 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 xrandr --output "$primary" --auto --output "$secondary" --"$direction"-of "$primary" --auto --output "$tertiary" --"$(printf "left\\nright" | grep -v "$direction")"-of "$primary" --auto
} }

View File

@ -1,12 +1,9 @@
#!/bin/bash #!/bin/sh
# A helper script for LaTeX/groff files used by `compiler` and `opout`. # 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: # The user can add the root file of a larger project as a comment as below:
# % root = mainfile.tex # % root = mainfile.tex
# And the compiler script will run on that instead of the opened file. # And the compiler script will run on that instead of the opened file.
texroot="$(grep -i "^.\+\s*root\s*=\s*\S\+" "$1")" texroot="$(sed -n 's/^\s*%.*root\s*=\s*\(\S\+\).*/\1/p' "${1}")"
texroot="${texroot##*=}" [ -f "${texroot}" ] && readlink -f "${texroot}" || exit "1"
texroot="${texroot//[\"\' ]}"
[ -f "$texroot" ] && readlink -f "$texroot" || exit 1

View File

@ -7,12 +7,14 @@
# variables # variables
output="$(date '+%y%m%d-%H%M-%S').png" output="$(date '+%y%m%d-%H%M-%S').png"
xclip_cmd="xclip -sel clip -t image/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)" | dmenu -l 6 -i -p "Screenshot which area?")" in
"a selected area") maim -u -s pic-selected-"${output}" ;; "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}" ;; "full screen") maim -q -d 0.2 pic-full-"${output}" ;;
"a selected area (copy)") maim -u -s | ${xclip_cmd} ;; "a selected area (copy)") maim -u -s | ${xclip_cmd} ;;
"current window (copy)") maim -q -d 0.2 -i "$(xdotool getactivewindow)" | ${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} ;; "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 esac

View File

@ -9,7 +9,6 @@ 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" vim_shortcuts="${XDG_CONFIG_HOME:-$HOME/.config}/nvim/shortcuts.vim"
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"
@ -21,35 +20,19 @@ write_dirs() {
path=$(eval "echo $path_raw") path=$(eval "echo $path_raw")
printf "%s=\"cd %s && ls -A\" \\\\\n" \ printf "%s=\"cd %s && ls -A\" \\\\\n" \
"$shortcut" "$path" \ "$shortcut" "$path" >>"$shell_shortcuts"
>>"$shell_shortcuts"
printf "hash -d %s=%s\n" \ printf "hash -d %s=%s\n" \
"$shortcut" "$path" \ "$shortcut" "$path" >>"$zsh_named_dirs"
>>"$zsh_named_dirs"
printf "abbr %s \"cd %s; and ls -A\"\n" \ printf "abbr %s \"cd %s; and ls -A\"\n" \
"$shortcut" "$path" \ "$shortcut" "$path" >>"$fish_shortcuts"
>>"$fish_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" \ 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" \
"$shortcut" "$path" \ "$shortcut" "$path" "$shortcut" "$path" "$shortcut" "$path" "$shortcut" "$path" >>"$vifm_shortcuts"
"$shortcut" "$path" \
"$shortcut" "$path" \
"$shortcut" "$path" \
>>"$vifm_shortcuts"
printf "config.bind(';%s', \"set downloads.location.directory %s ;; hint links download\") \n" \ printf "config.bind(';%s', \"set downloads.location.directory %s ;; hint links download\") \n" \
"$shortcut" "$path" \ "$shortcut" "$path" >>"$qute_shortcuts"
>>"$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" \
"$shortcut" "$path" \
"$shortcut" "$path" \
"$shortcut" "$path" \
"$shortcut" "$path" \
>>"$ranger_shortcuts"
printf "map C%s cd \"%s\"\n" \ printf "map C%s cd \"%s\"\n" \
"$shortcut" "$path" \ "$shortcut" "$path" >>"$lf_shortcuts"
>>"$lf_shortcuts"
printf "cmap ;%s %s\n" \ printf "cmap ;%s %s\n" \
"$shortcut" "$path" \ "$shortcut" "$path" >>"$vim_shortcuts"
>>"$vim_shortcuts"
done done
} }
@ -60,39 +43,26 @@ write_files() {
path=$(eval "echo $path_raw") path=$(eval "echo $path_raw")
printf "%s=\"\$EDITOR %s\" \\\\\n" \ printf "%s=\"\$EDITOR %s\" \\\\\n" \
"$shortcut" "$path" \ "$shortcut" "$path" >>"$shell_shortcuts"
>>"$shell_shortcuts"
printf "hash -d %s=%s \n" \ printf "hash -d %s=%s \n" \
"$shortcut" "$path" \ "$shortcut" "$path" >>"$zsh_named_dirs"
>>"$zsh_named_dirs"
printf "abbr %s \"\$EDITOR %s\" \n" \ printf "abbr %s \"\$EDITOR %s\" \n" \
"$shortcut" "$path" \ "$shortcut" "$path" >>"$fish_shortcuts"
>>"$fish_shortcuts"
printf "map %s :e %s<CR> \n" \ printf "map %s :e %s<CR> \n" \
"$shortcut" "$path" \ "$shortcut" "$path" >>"$vifm_shortcuts"
>>"$vifm_shortcuts"
printf "map %s shell \$EDITOR %s \n" \
"$shortcut" "$path" \
>>"$ranger_shortcuts"
printf "map E%s \$\$EDITOR \"%s\" \n" \ printf "map E%s \$\$EDITOR \"%s\" \n" \
"$shortcut" "$path" \ "$shortcut" "$path" >>"$lf_shortcuts"
>>"$lf_shortcuts"
printf "cmap ;%s %s\n" \ printf "cmap ;%s %s\n" \
"$shortcut" "$path" \ "$shortcut" "$path" >>"$vim_shortcuts"
>>"$vim_shortcuts"
done done
} }
filter() {
input=$1
sed 's/#.*//;/^$/d;s/ \+/ /g' "$input"
}
# 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" "$qute_shortcuts" "$zsh_named_dirs" "$vim_shortcuts" 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"
filter "$bmdirs" | write_dirs # Write shortcuts to files
filter "$bmfiles" | write_files sed 's/#.*//;/^$/d;s/ \+/ /g' <"$bmdirs" | write_dirs
sed 's/#.*//;/^$/d;s/ \+/ /g' <"$bmfiles" | write_files

View File

@ -19,7 +19,7 @@ case "$clock" in
esac esac
case $BLOCK_BUTTON in case $BLOCK_BUTTON in
1) notify-send "This Month" "$(cal | sed "s/\<$(date +'%e')\>/<b><span color='red'>&<\/span><\/b>/")" && notify-send "Appointments" "$(calcurse -d3)" ;; 1) notify-send "This Month" "$(cal | sed "s/\<$(date +'%e'|sed 's/ //g')\>/<b><span color='red'>&<\/span><\/b>/")" && notify-send "Appointments" "$(calcurse -d3)" ;;
2) setsid -f "$TERMINAL" -e calcurse ;; 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\` 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" ;; - Middle click opens calcurse if installed" ;;