Compare commits

...

55 Commits

Author SHA1 Message Date
Emre AKYÜZ
0aa8dcb49d
Merge 5c346d90ac91abf485d0d62dc5f45265f761a2c8 into c95a16916d5c71288e5e49a78d0621943c89a682 2024-05-23 20:17:52 +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
ewof
cf4a12acb3
Update xinitrc (#1402) 2024-03-28 13:13:34 +00:00
Jameson
7a96fb100c
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>
2023-12-30 17:04:51 +00:00
Luciano
0795202675
lf-scope: adds SVG preview creating cache. (#1360) 2023-11-15 01:37:39 +00:00
appeasementPolitik
bbcbac64fa
Fix unsupported characters in vim-airline (#1317) 2023-11-15 01:35:53 +00:00
thirtysix
52fab9d50a
Make shell profile POSIX, remove unnecessary variable fallbacks (#1368) 2023-11-15 01:35:14 +00:00
thirtysix
0db54f9618
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
2023-11-15 01:34:29 +00:00
Emre AKYÜZ
50e72a1a03
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.
2023-11-13 13:30:08 +00:00
Dominik
031938a792
Update dmenurecord (#1370) 2023-11-04 12:33:18 +00:00
Joey-Pepperoni
ea3e1e14cc
Update sb-music (#1367)
The s/\\&/&amp;/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.
2023-10-29 12:21:47 +00:00
Luke Smith
0cc589bcad
Merge branch 'master' of github.com:LukeSmithxyz/voidrice 2023-10-28 08:41:43 -04:00
Luke Smith
6ba48b2733
fix #1366 2023-10-28 08:41:26 -04:00
Lalle
1e3adf9c03
Launch dwm in a dbus session (#1340)
* Launch dwm in a dbus session

* Add ssh-agent

* Update dbus env

* Update xprofile
2023-10-27 19:42:32 +00:00
appeasementPolitik
ca8cb1f6a7
Update sb-mailbox in statusbar on closing neomutt (#1329) 2023-10-27 18:58:40 +00:00
poeplva
54c0aa2af8
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.
2023-10-27 18:58:05 +00:00
Emre AKYÜZ
bca6b403eb
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.
2023-10-27 18:54:15 +00:00
Dawid Potocki
42f3efb4b0
Add xdg-terminal-exec script to launch "$TERMINAL" for .desktop files (#1302) 2023-10-27 18:52:44 +00:00
appeasementPolitik
708d6c6731
Change remaining tremc entry in script to stig (#1364) 2023-10-04 20:01:05 +00:00
sban
b8cd0ab495
Timeout added to forecast module, ncmpcpp now tracks player state (#1359)
* Added timeout to getforecast to prevent status bar breakage.

A 2 second timeout is used in the case that wttr.in is inaccessible when dwm is started; as otherwise it tries to curl wttr.in indefinitely, not allowing other status bar modules to be loaded.

* Update music status bar module on player state change
2023-09-05 07:51:05 +00:00
Hylke Hellinga
c550a7c6e5
Fixed Booksplit for termux (#1358)
Co-authored-by: Simbaclaws <h.hellinga@inner-join.nl>
2023-09-03 07:20:13 +00:00
appeasementPolitik
86f05abcce
Fix the extra space between sb-internet and the block on the right of sb-internet (#1352) 2023-08-25 07:56:50 +00:00
Alessio Artoni
798ba175d0
Fix wrong font name (#1353) 2023-08-25 07:53:59 +00:00
Luke Smith
a360fadd5f
Merge branch 'master' of github.com:LukeSmithxyz/voidrice 2023-08-23 12:28:53 +02:00
Luke Smith
8315e4c885
libertinus replaces libertine 2023-08-23 12:28:42 +02:00
appeasementPolitik
f26e5678e6
Fix arkenfox pacman hook complaining about root (#1351)
The previous pull request on LARBS turned out not to work, so make sure `arkenfox-auto-update` runs `arkenfox-update` as the user of the firefox profile. Otherwise it complains that it's running as root and stops.

The way of getting the username is safe, because it gets the username from the owner of the user.js file of that profile.
2023-08-18 12:20:05 +00:00
Simon Nikolai Varøy
ed9633da3f
added webp to image formats in linkhandler (#1347)
Co-authored-by: Simon Nikolai Varøy <simon@simonvaroy.xyz>
2023-08-16 14:39:40 +00:00
appeasementPolitik
ec8e82745e
sb-internet: replace grep/sed commands for more efficiency (#1349) 2023-08-16 14:38:10 +00:00
appeasementPolitik
44cb5f12e6
Give setbg parameter to make notifications silent (#1350) 2023-08-16 13:55:59 +00:00
poeplva
d8a8970715
djvu files cannot be previewed (#1335)
added support for previewing books in djvu format.
2023-07-23 23:06:04 +00:00
Lalle
0497dcd51c
Add jsonl to lf (#1345) 2023-07-23 23:02:33 +00:00
Gunnar K. Halvorsen
6f6b749d0e
Fixed formatting bug with notify-send (#1344)
* Fixed formatting bug with notify-send

* Update sb-clock

Fix suggested by 'mhdna'
2023-07-23 23:02:14 +00:00
Luke Smith
9a85d328cc
nsxiv replaces unmaintained sxiv 2023-07-15 18:57:12 +02:00
Luke Smith
07de33840d
Revert "application/octet-stream is for arbitrary binary files (#1321)" (#1336)
This reverts commit af2710799b069486d04ba23c5bdab9cf6c4d6b04.
2023-05-27 01:46:54 +00:00
appeasementPolitik
08639706a9
Make sure sb-volume module is updated when closed after opening (#1316) 2023-05-26 22:11:06 +00:00
poeplva
af2710799b
application/octet-stream is for arbitrary binary files (#1321)
application/octet-stream mime-type is used for arbitrary binary files, so the best guess at opening those kind of should be based on the extension. before this all of this kind of files were tried to be opened with zathura, now it is the last resort in case the file extension is unknown.
2023-05-26 22:10:29 +00:00
Mahdi Nayef
1633233c9d
bulkrename using built-ins instead of using a completely separate program (#1330)
* bulkrename using bult-ins instead of using a completely separate program

* Make it more efficient
2023-05-26 22:08:43 +00:00
Spenser Truex
ce1f0bfa05
Re-add whitespace to some buffer types as needed. (#1333)
Very arcane.

C ANSI standard requires a newline at the end. GCC will complain.

Email signatures should have a space after the -- according to the
standard. Neomutt does this automatically for you if you have a
signature.

Co-authored-by: Spenser Truex <truex@equwal.com>
2023-05-25 03:40:55 +00:00
Mahdi Nayef
0a29cfbf4f
Fix rename key bindings in lf (#1331) 2023-05-24 13:28:56 +00:00
appeasementPolitik
991b052a55
Don't wrap horizontally on short terminal (#1325) 2023-05-11 14:00:08 +00:00
pony-montana
b2833f8a67
change requested by lf-git after update. (#1319) 2023-05-02 19:49:56 +00:00
Austen
e1302c897e
dwmblocks update on song change (#1318) 2023-05-01 16:15:11 +00:00
52 changed files with 238 additions and 186 deletions

View File

@ -4,7 +4,7 @@
<alias>
<family>serif</family>
<prefer>
<family>Linux Libertine</family>
<family>Libertinus Serif</family>
<family>Joy Pixels</family>
<family>Noto Color Emoji</family>
<family>FontAwesome</family>
@ -13,7 +13,7 @@
<alias>
<family>sans-serif</family>
<prefer>
<family>Linux Biolinum</family>
<family>Libertinus Sans</family>
<family>Joy Pixels</family>
<family>Noto Color Emoji</family>
<family>FontAwesome</family>
@ -22,7 +22,7 @@
<alias>
<family>sans</family>
<prefer>
<family>Linux Biolinum</family>
<family>Libertinus Sans</family>
<family>Joy Pixels</family>
<family>Noto Color Emoji</family>
<family>FontAwesome</family>
@ -32,7 +32,7 @@
<family>monospace</family>
<prefer>
<family>Noto Sans Mono</family>
<family>Liberation Mono</family>
<family>Libertinus Mono</family>
<family>FontAwesome</family>
<family>Braille</family>
</prefer>

View File

@ -24,18 +24,18 @@ set period 1
set hiddenfiles ".*:*.aux:*.log:*.bbl:*.bcf:*.blg:*.run.xml"
set cleaner '~/.config/lf/cleaner'
set previewer '~/.config/lf/scope'
set autoquit on
set autoquit true
# cmds/functions
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 ;;
image/*) rotdir $f | grep -i "\.\(png\|jpg\|jpeg\|gif\|webp\|avif\|tif\|ico\)\(_large\)*$" |
setsid -f sxiv -aio 2>/dev/null | while read -r file; do
setsid -f nsxiv -aio 2>/dev/null | while read -r file; do
[ -z "$file" ] && continue
lf -remote "send select \"$file\""
lf -remote "send toggle"
@ -45,12 +45,18 @@ 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
}}
cmd mkdir $mkdir -p "$(echo $* | tr ' ' '\ ')"
cmd mkdir $mkdir -p "$@"
cmd extract ${{
clear; tput cup $(($(tput lines)/3)); tput bold
@ -58,7 +64,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 ${{
@ -93,18 +114,38 @@ cmd copyto ${{
}}
cmd setbg "$1"
cmd bulkrename $vidir
cmd bulkrename ${{
tmpfile_old="$(mktemp)"
tmpfile_new="$(mktemp)"
[ -n "$fs" ] && fs=$(basename -a $fs) || fs=$(ls)
echo "$fs" > "$tmpfile_old"
echo "$fs" > "$tmpfile_new"
$EDITOR "$tmpfile_new"
[ "$(wc -l < "$tmpfile_old")" -eq "$(wc -l < "$tmpfile_new")" ] || { rm -f "$tmpfile_old" "$tmpfile_new"; exit 1; }
paste "$tmpfile_old" "$tmpfile_new" | while IFS="$(printf '\t')" read -r src dst
do
[ "$src" = "$dst" ] || [ -e "$dst" ] || mv -- "$src" "$dst"
done
rm -f "$tmpfile_old" "$tmpfile_new"
lf -remote "send $id unselect"
}}
# 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
map C copyto
map M moveto
map <c-n> push :mkdir<space>
map <c-n> push :mkdir<space>""<left>
map <c-r> reload
map <c-s> set hidden!
map <enter> shell
@ -113,11 +154,11 @@ map X !$f
map o &mimeopen "$f"
map O $mimeopen --ask "$f"
map A rename # at the very end
map A :rename; cmd-end # at the very end
map c push A<c-u> # new rename
map I push A<c-a> # at the very beginning
map i push A<a-b><a-b><a-f> # before extension
map a push A<a-b> # after extension
map I :rename; cmd-home # at the very beginning
map i :rename # before extension
map a :rename; cmd-right # after extension
map B bulkrename
map b $setbg $f
@ -127,7 +168,14 @@ map V push :!nvim<space>
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 "~/.config/lf/shortcutrc"

View File

@ -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.
@ -25,10 +21,19 @@ 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"
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
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 ;;
text/* | */xml | application/json) 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)"

View File

@ -30,3 +30,5 @@ progressbar_color = black:b
progressbar_elapsed_color = blue:b
statusbar_color = red
statusbar_time_color = cyan:b
execute_on_song_change="pkill -RTMIN+11 dwmblocks"
execute_on_player_state_change="pkill -RTMIN+11 dwmblocks"

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 laststatus=0
set noshowcmd
colorscheme vim
" Some basics:
nnoremap c "_c
set nocompatible
filetype plugin on
syntax on
set encoding=utf-8
@ -55,18 +55,15 @@ set noshowcmd
" Nerd tree
map <leader>n :NERDTreeToggle<CR>
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 <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
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 <C-h> <C-w>h
@ -108,15 +105,16 @@ 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(".")
autocmd BufWritePre * %s/\s\+$//e
autocmd BufWritePre * %s/\n\+\%$//e
autocmd BufWritePre *.[ch] %s/\%$/\r/e " add trailing newline for ANSI C standard
autocmd BufWritePre *neomutt* %s/^--$/-- /e " dash-dash-space signature delimiter in emails
autocmd BufWritePre * cal cursor(currPos[1], currPos[2])
" When shortcut files are updated, renew bash and ranger configs with new material:

View File

@ -20,4 +20,4 @@ cfmb ${XDG_CONFIG_HOME:-$HOME/.config}/ncmpcpp/bindings # ncmpcpp (music player)
cfmc ${XDG_CONFIG_HOME:-$HOME/.config}/ncmpcpp/config # ncmpcpp (music player) config
cfl ${XDG_CONFIG_HOME:-$HOME/.config}/lf/lfrc # lf (file browser) config
cfL ${XDG_CONFIG_HOME:-$HOME/.config}/lf/scope # lf's scope/preview file
cfX ${XDG_CONFIG_HOME:-$HOME/.config}/sxiv/exec/key-handler # sxiv (image viewer) key/script handler
cfX ${XDG_CONFIG_HOME:-$HOME/.config}/nsxiv/exec/key-handler # nsxiv (image viewer) key/script handler

View File

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

1
.config/sxiv Symbolic link
View File

@ -0,0 +1 @@
nsxiv

View File

@ -13,5 +13,6 @@ if [ -f "${XDG_CONFIG_HOME:-$HOME/.config}/x11/xprofile" ]; then
else
. "$HOME/.xprofile"
fi
ssh-agent dwm
# Activate dbus variables
dbus-update-activation-environment --all
dbus-launch ssh-agent dwm

View File

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

View File

@ -16,5 +16,8 @@ IFS='
# Update each found profile.
for profile in $profiles; do
arkenfox-updater -p "${profile%%/user.js*}" -s
userjs=${profile%%/user.js*}
user=$(stat -c '%U' "$userjs") || continue
su -l "$user" -c "arkenfox-updater -c -p $userjs -s"
done

View File

@ -12,7 +12,7 @@ inputaudio="$1"
ext="${1##*.}"
# Get a safe file name from the book.
escbook="$(echo "$booktitle" | iconv -cf UTF-8 -t ASCII//TRANSLIT | tr -d '[:punct:]' | tr '[:upper:]' '[:lower:]' | tr ' ' '-' | sed "s/-\+/-/g;s/\(^-\|-\$\)//g")"
escbook="$(echo "$booktitle" | iconv -c -f UTF-8 -t ASCII//TRANSLIT | tr -d '[:punct:]' | tr '[:upper:]' '[:lower:]' | tr ' ' '-' | sed "s/-\+/-/g;s/\(^-\|-\$\)//g")"
! mkdir -p "$escbook" &&
echo "Do you have write access in this directory?" &&
@ -31,7 +31,7 @@ do
cmd="$cmd -metadata artist=\"$author\" -metadata title=\"$title\" -metadata album=\"$booktitle\" -metadata year=\"$year\" -metadata track=\"$track\" -metadata total=\"$total\" -ss \"$start\" -to \"$end\" -vn -c:a copy \"$file\" "
fi
title="$(echo "$x" | cut -d' ' -f2-)"
esctitle="$(echo "$title" | iconv -cf UTF-8 -t ASCII//TRANSLIT | tr -d '[:punct:]' | tr '[:upper:]' '[:lower:]' | tr ' ' '-' | sed "s/-\+/-/g;s/\(^-\|-\$\)//g")"
esctitle="$(echo "$title" | iconv -c -f UTF-8 -t ASCII//TRANSLIT | tr -d '[:punct:]' | tr '[:upper:]' '[:lower:]' | tr ' ' '-' | sed "s/-\+/-/g;s/\(^-\|-\$\)//g")"
track="$((track+1))"
start="$end"
done < "$2"

View File

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

View File

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

View File

@ -4,7 +4,7 @@
# some choice programs to use to open it.
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
case "$(printf "copy url\\nnsxiv\\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 ;;
mpv) setsid -f mpv -quiet "$feed" >/dev/null 2>&1 ;;
"mpv loop") setsid -f mpv -quiet --loop "$feed" >/dev/null 2>&1 ;;
@ -13,7 +13,7 @@ case "$(printf "copy url\\nsxiv\\nsetbg\\nPDF\\nbrowser\\nlynx\\nvim\\nmpv\\nmpv
"queue yt-dlp audio") qndl "$feed" 'yt-dlp -o "%(title)s.%(ext)s" -f bestaudio --embed-metadata --restrict-filenames' ;;
"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 ;;
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 ;;
nsxiv) curl -sL "$feed" > "/tmp/$(echo "$feed" | sed "s|.*/||;s/%20/ /g")" && nsxiv -a "/tmp/$(echo "$feed" | sed "s|.*/||;s/%20/ /g")" >/dev/null 2>&1 ;;
vim) curl -sL "$feed" > "/tmp/$(echo "$feed" | sed "s|.*/||;s/%20/ /g")" && setsid -f "$TERMINAL" -e "$EDITOR" "/tmp/$(echo "$feed" | sed "s|.*/||;s/%20/ /g")" >/dev/null 2>&1 ;;
setbg) curl -L "$feed" > $XDG_CACHE_HOME/pic ; xwallpaper --zoom $XDG_CACHE_HOME/pic >/dev/null 2>&1 ;;
browser) setsid -f "$BROWSER" "$feed" >/dev/null 2>&1 ;;

View File

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

View File

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

View File

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

View File

@ -1,7 +1,7 @@
#!/bin/sh
# Feed script a url or file location.
# If an image, it will view in sxiv,
# If an image, it will view in nsxiv,
# if a video or gif, it will view in mpv
# if a music file or pdf, it will download,
# otherwise it opens link in browser.
@ -15,8 +15,8 @@ fi
case "$url" in
*mkv|*webm|*mp4|*youtube.com/watch*|*youtube.com/playlist*|*youtube.com/shorts*|*youtu.be*|*hooktube.com*|*bitchute.com*|*videos.lukesmith.xyz*|*odysee.com*)
setsid -f mpv -quiet "$url" >/dev/null 2>&1 ;;
*png|*jpg|*jpe|*jpeg|*gif)
curl -sL "$url" > "/tmp/$(echo "$url" | sed "s/.*\///;s/%20/ /g")" && sxiv -a "/tmp/$(echo "$url" | sed "s/.*\///;s/%20/ /g")" >/dev/null 2>&1 & ;;
*png|*jpg|*jpe|*jpeg|*gif|*webp)
curl -sL "$url" > "/tmp/$(echo "$url" | sed "s/.*\///;s/%20/ /g")" && nsxiv -a "/tmp/$(echo "$url" | sed "s/.*\///;s/%20/ /g")" >/dev/null 2>&1 & ;;
*pdf|*cbz|*cbr)
curl -sL "$url" > "/tmp/$(echo "$url" | sed "s/.*\///;s/%20/ /g")" && zathura "/tmp/$(echo "$url" | sed "s/.*\///;s/%20/ /g")" >/dev/null 2>&1 & ;;
*mp3|*flac|*opus|*mp3?source*)

View File

@ -7,12 +7,14 @@
# 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}" ;;
"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} ;;
"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

View File

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

View File

@ -1,11 +1,11 @@
#!/bin/sh
# When I open an image from the file manager in sxiv (the image viewer), I want
# When I open an image from the file manager in nsxiv (the image viewer), I want
# to be able to press the next/previous keys to key through the rest of the
# images in the same directory. This script "rotates" the content of a
# directory based on the first chosen file, so that if I open the 15th image,
# if I press next, it will go to the 16th etc. Autistic, I know, but this is
# one of the reasons that sxiv is great for being able to read standard input.
# one of the reasons that nsxiv is great for being able to read standard input.
[ -z "$1" ] && echo "usage: rotdir regex 2>&1" && exit 1
base="$(basename "$1")"

View File

@ -13,11 +13,18 @@ bgloc="${XDG_DATA_HOME:-$HOME/.local/share}/bg"
dunstconf="${XDG_CONFIG_HOME:-$HOME/.config}/dunst/dunstrc"
zathuraconf="${XDG_CONFIG_HOME:-$HOME/.config}/zathura/zathurarc"
# Give -s as parameter to make notifications silent.
while getopts "s" o; do case "${o}" in
s) silent='1' ;;
esac done
shift $((OPTIND - 1))
trueloc="$(readlink -f "$1")" &&
case "$(file --mime-type -b "$trueloc")" in
image/* ) ln -sf "$(readlink -f "$1")" "$bgloc" && notify-send -i "$bgloc" "Changing wallpaper..." ;;
inode/directory ) ln -sf "$(find "$trueloc" -iregex '.*.\(jpg\|jpeg\|png\|gif\)' -type f | shuf -n 1)" "$bgloc" && notify-send -i "$bgloc" "Random Wallpaper chosen." ;;
*) notify-send "🖼️ Error" "Not a valid image or directory." ; exit 1;;
image/* ) ln -sf "$trueloc" "$bgloc" && [ -z "$silent" ] && notify-send -i "$bgloc" "Changing wallpaper..." ;;
inode/directory ) ln -sf "$(find "$trueloc" -iregex '.*.\(jpg\|jpeg\|png\|gif\)' -type f | shuf -n 1)" "$bgloc" && [ -z "$silent" ] && notify-send -i "$bgloc" "Random Wallpaper chosen." ;;
*) [ -z "$silent" ] && notify-send "🖼️ Error" "Not a valid image or directory." ; exit 1;;
esac
# If pywal is installed, use it.

View File

@ -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<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(\"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<CR> \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\" }"

View File

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

View File

@ -19,11 +19,11 @@ case "$clock" in
esac
case $BLOCK_BUTTON in
1) notify-send "This Month" "$(cal --color=always | sed "s/..7m/<b><span color=\"red\">/;s|..27m|</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 ;;
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"

View File

@ -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}'

View File

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

View File

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

View File

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

View File

@ -7,7 +7,7 @@ url="${WTTRURL:-wttr.in}"
weatherreport="${XDG_CACHE_HOME:-$HOME/.cache}/weatherreport"
# Get a weather report from 'wttr.in' and save it locally.
getforecast() { curl -sf "$url/$LOCATION" > "$weatherreport" || exit 1; }
getforecast() { timeout --signal=1 2s curl -sf "$url/$LOCATION" > "$weatherreport" || exit 1; }
# Forecast should be updated only once a day.
checkforecast() {
@ -38,14 +38,14 @@ showweather() {
}
case $BLOCK_BUTTON in
1) setsid -f "$TERMINAL" -e less -Srf "$weatherreport" ;;
1) setsid -f "$TERMINAL" -e less -Sf "$weatherreport" ;;
2) getforecast && showweather ;;
3) notify-send "🌈 Weather module" "\- Left click for full forecast.
- Middle click to update forecast.
☔: Chance of rain/snow
🥶: Daily low
🌞: Daily high" ;;
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;;
esac
checkforecast || getforecast

View File

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

View File

@ -14,13 +14,20 @@ case $BLOCK_BUTTON in
🌐: ethernet working
🔒: vpn is active
" ;;
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;;
esac
if grep -xq 'up' /sys/class/net/w*/operstate 2>/dev/null ; then
# Wifi
if [ "$(cat /sys/class/net/w*/operstate 2>/dev/null)" = 'up' ] ; then
wifiicon="$(awk '/^\s*w/ { print "📶", int($3 * 100 / 70) "% " }' /proc/net/wireless)"
elif grep -xq 'down' /sys/class/net/w*/operstate 2>/dev/null ; then
grep -xq '0x1003' /sys/class/net/w*/flags && wifiicon="📡 " || wifiicon="❌ "
elif [ "$(cat /sys/class/net/w*/operstate 2>/dev/null)" = 'down' ] ; then
[ "$(cat /sys/class/net/w*/flags 2>/dev/null)" = '0x1003' ] && wifiicon="📡 " || wifiicon="❌ "
fi
printf "%s%s%s\n" "$wifiicon" "$(sed "s/down/❎/;s/up/🌐/" /sys/class/net/e*/operstate 2>/dev/null)" "$(sed "s/.*/🔒/" /sys/class/net/tun*/operstate 2>/dev/null)"
# Ethernet
[ "$(cat /sys/class/net/e*/operstate 2>/dev/null)" = 'up' ] && ethericon="🌐" || ethericon="❎"
# TUN
[ -n "$(cat /sys/class/net/tun*/operstate 2>/dev/null)" ] && tunicon=" 🔒"
printf "%s%s%s\n" "$wifiicon" "$ethericon" "$tunicon"

View File

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

View File

@ -4,13 +4,13 @@
# 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
- 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)"

View File

@ -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))}'

View File

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

View File

@ -1,6 +1,6 @@
#!/bin/sh
filter() { sed "/^volume:/d;s/\\&/&amp;/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 &
@ -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

View File

@ -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() {

View File

@ -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
<b>Note:</b> 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)"

View File

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

View File

@ -44,7 +44,7 @@ case $BLOCK_BUTTON in
- Shows 🔃 if updating prices.
- <b>Last updated:
$uptime</b>" ;;
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;;
esac
[ -n "$updateme" ] &&

View File

@ -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)" ] &&

View File

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

View File

@ -3,14 +3,14 @@
# Prints the current volume or 🔇 if muted.
case $BLOCK_BUTTON in
1) setsid -f "$TERMINAL" -e pulsemixer ;;
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%- ;;
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@)"

View File

@ -8,7 +8,7 @@ vidlist="
dwm (window manager) https://videos.lukesmith.xyz/videos/watch/f6b78db7-b368-4647-bc64-28c08fff1988
dwmblocks (status bar) https://videos.lukesmith.xyz/w/mmxHMbqZZEr5FManB57Yy1
pacman (installing/managing programs) https://videos.lukesmith.xyz/videos/watch/8e7cadb9-0fed-47ce-a2a8-6635fa48614b
sxiv (image viewer) https://videos.lukesmith.xyz/videos/watch/ad4c8d85-90c3-4f3d-a1f3-89129e64a3c2
sxiv/nsxiv (image viewer) https://videos.lukesmith.xyz/videos/watch/ad4c8d85-90c3-4f3d-a1f3-89129e64a3c2
st (terminal) https://videos.lukesmith.xyz/videos/watch/efddd39d-bac5-4599-b572-177beb4ce6e8
i3 (old window manager) https://videos.lukesmith.xyz/videos/watch/b861525c-7ada-40ee-a2bb-b5e1ffe0f48b
neomutt (email) https://videos.lukesmith.xyz/videos/watch/83122e83-52d9-4278-ae1a-7d1beeb50c8e

3
.local/bin/xdg-terminal-exec Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh
"$TERMINAL" -e "$@"

View File

@ -1,4 +1,4 @@
[Desktop Entry]
Type=Application
Name=Image viewer
Exec=/usr/bin/sxiv -a %f
Exec=/usr/bin/nsxiv -a %f

View File

@ -1,9 +1,8 @@
_
_____ _(_)_ __
/ __\ \/ / \ \ / /
\__ \> <| |\ V /
|___/_/\_\_| \_/
sxiv is the image viewer.
_ __ _____ _(_)_ __
| '_ \/ __\ \/ / \ \ / /
| | | \__ \> <| |\ V /
|_| |_|___/_/\_\_| \_/
nsxiv is the image viewer.
h/j/k/l - Pan image
-/+ - Zoom out/in
Enter - Toggle thumbnail mode
@ -12,4 +11,4 @@ sxiv is the image viewer.
r - Reload image if changed
m - Mark/unmark image
w - Zoom to fit window
ctrl-x - Run external command (see ~/.config/sxiv/exec/key-handler for options)
ctrl-x - Run external command (see ~/.config/nsxiv/exec/key-handler for options)

View File

@ -9,7 +9,7 @@ These are the dotfiles deployed by [LARBS](https://larbs.xyz) and as seen on
- zsh (shell)
- lf (file manager)
- mpd/ncmpcpp (music)
- sxiv (image/gif viewer)
- nsxiv (image/gif viewer)
- mpv (video player)
- other stuff like xdg default programs, inputrc and more, etc.
- I try to minimize what's directly in `~` so: