Compare commits
6 Commits
f755edaa08
...
master
Author | SHA1 | Date | |
---|---|---|---|
4e68eff17d
|
|||
0c131fdbfa
|
|||
d4d4663876
|
|||
076ff6fbe5
|
|||
082824261b
|
|||
851e88be15
|
4
bin/.bin/0x0
Executable file
4
bin/.bin/0x0
Executable file
@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
|
||||
curl -F"file=@$@" https://0x0.st | tee >(xclip -sel clip)
|
||||
|
8
bin/.bin/disc
Executable file
8
bin/.bin/disc
Executable file
@ -0,0 +1,8 @@
|
||||
#!/bin/sh
|
||||
|
||||
tmux ls -F \#S | grep disc && \
|
||||
tmux attach -t disc \
|
||||
|| \
|
||||
tmux new-session -s disc 'scli --save-history' \; \
|
||||
split-window -h -l 75% 'aerc' \; \
|
||||
split-window -v 'weechat' \; \
|
141
bin/.bin/emailbook
Executable file
141
bin/.bin/emailbook
Executable file
@ -0,0 +1,141 @@
|
||||
#!/bin/sh
|
||||
VERSION="0.2.1"
|
||||
usage() {
|
||||
echo "emailbook $VERSION"'
|
||||
A minimalistic address book for e-mails only.
|
||||
|
||||
Usage: emailbook FILE [OPTIONS]
|
||||
|
||||
Prints all values in FILE if no option is given.
|
||||
|
||||
Options:
|
||||
-a, --add [KEY] VALUE Add KEY/VALUE pair to FILE. If KEY is omitted,
|
||||
VALUE is used as key, too.
|
||||
[-s, --search] QUERY Search FILE for entries with keys or values containing QUERY.
|
||||
-k, --key QUERY Like `--search` but limit search to keys/aliases.
|
||||
-v, --value QUERY Like `--search` but limit search to values.
|
||||
-p, --parse SOURCE Parse stdin for e-mail addresses in header and add them to FILE.
|
||||
SOURCE might be either --from, --to , --cc, --bcc, or --all.
|
||||
-h, --help Show this help.
|
||||
-V, --version Print version.
|
||||
'
|
||||
}
|
||||
|
||||
checkfilename() {
|
||||
[ $QUIET ] || [ -e "$filename" ] \
|
||||
|| echo "File $filename not found. Creating it." 1>&2
|
||||
}
|
||||
|
||||
keyexists() {
|
||||
escaped=$(echo "$*" | sed 's/[][\.|$(){}?+*^]/\\&/g')
|
||||
# also check display name with/without double quotes
|
||||
quotestoggled=$(echo "$*" | sed -E 's/^"([^"]+)"( +<[^>]+>)/\1\2/;t;s/^([^"]+?)( +<[^>]+>)/"\1"\2/')
|
||||
quotestoggledescaped=$(echo "$quotestoggled" | sed 's/[][\.|$(){}?+*^]/\\&/g')
|
||||
grep -q -E "^$escaped( :|\$)" "$filename" 2> /dev/null \
|
||||
|| grep -q -E "^$quotestoggledescaped( :|\$)" "$filename" 2> /dev/null
|
||||
}
|
||||
|
||||
addentry() {
|
||||
if keyexists "$1"; then
|
||||
[ $QUIET ] || echo "! $1 (skipped)"
|
||||
else
|
||||
[ "$2" ] && line="$1 : $2" || line="$1"
|
||||
[ $QUIET ] || echo "+ $line"
|
||||
echo "$line" >> "$filename"
|
||||
fi
|
||||
}
|
||||
|
||||
add() {
|
||||
checkfilename
|
||||
case $# in
|
||||
1|2) addentry "$@" ;;
|
||||
*) echo "Expected one or two arguments after -a!"; exit 1 ;;
|
||||
esac
|
||||
}
|
||||
|
||||
addfromstdin() {
|
||||
# Skip lines without "@", skip lines containing no-reply (or similar),
|
||||
# strip \r, strip leading spaces, do the following replacements:
|
||||
# "'John Doe'" <xxx> → "John Doe" <xxx>
|
||||
# 'John Doe' <xxx> → John Doe <xxx>
|
||||
# "john.doe@example.com" <john.doe@example.com> → <john.doe@example.com>
|
||||
# "<john.doe@example.com>" <john.doe@example.com> → <john.doe@example.com>
|
||||
# john.doe@example.com → <john.doe@example.com>
|
||||
grep '@' \
|
||||
| grep -v -i -E '\bnot?[_-]?reply' \
|
||||
| sed 's/\r$//' \
|
||||
| sed -E 's/^ +//g' \
|
||||
| sed -E "s/(\"?)'([^'\"]+)'(\"?)/\1\2\3/" \
|
||||
| sed -E 's/^"<?([^">]*)>?" +<\1>/<\1>/' \
|
||||
| sed -E 's/^[^<>@ ]*@[^<>@ ]+$/<\0>/' \
|
||||
| sort -u \
|
||||
| while read -r line; do addentry "$line"; done
|
||||
}
|
||||
|
||||
searchall() {
|
||||
# show entries with matching alias first
|
||||
searchbyalias "$*"
|
||||
searchbyvalueonly "$*"
|
||||
}
|
||||
|
||||
searchbyalias() {
|
||||
grep -i -E "$* :" "$filename" | sed -E 's/^[^:]+:\s*//'
|
||||
}
|
||||
|
||||
searchbyvalue() {
|
||||
sed -E 's/^[^:]+:\s*//' "$filename" | grep -i -E "$*"
|
||||
}
|
||||
|
||||
searchbyvalueonly() {
|
||||
# exclude matches found by searchbyalias
|
||||
grep -i -E -v "$* :" "$filename" | sed -E 's/^[^:]+:\s*//' | grep -i -E "$*"
|
||||
}
|
||||
|
||||
parsefields() {
|
||||
# Find header fields starting with $1 (p.e. 'To:') plus following lines
|
||||
# starting with a space. Split entries at commas except when quoted. Skip
|
||||
# empty lines. Decode encoded strings. Squeeze double spaces.
|
||||
sed -E '/^\r?$/Q' - \
|
||||
| sed -E -n "/^$1:/{:a ; \$!N ; s/\n\s+/ / ; ta ; P ; D}" \
|
||||
| sed -E "s/^$1:\\s*//" \
|
||||
| grep -v -P '[\x80-\xFF]' \
|
||||
| awk -vFPAT='([^,"]*)("[^"]+")?([^,]*)?' -vOFS='\n' \
|
||||
'{for(i=1;i<=NF;i++) printf("%s\n",$i)}' \
|
||||
| sed -E -e '/^ *$/d' \
|
||||
| perl -CS -MEncode -ne 'print decode("MIME-Header", $_)' \
|
||||
| sed -E -e 's/ +/ /g' \
|
||||
| addfromstdin
|
||||
}
|
||||
|
||||
parse() {
|
||||
checkfilename
|
||||
case "$1" in
|
||||
--all) parsefields '(From|To|Cc|CC|Bcc)' ;;
|
||||
# TODO: Include References, In-Reply-To, Reply-To, Return-Path?
|
||||
--from) parsefields 'From' ;;
|
||||
--to) parsefields 'To' ;;
|
||||
--cc) parsefields '(Cc|CC)' ;;
|
||||
--bcc) parsefields 'Bcc' ;;
|
||||
esac
|
||||
}
|
||||
|
||||
|
||||
case "$1" in
|
||||
-h|--help|'') usage; exit ;;
|
||||
-V|--version) echo "$VERSION"; exit ;;
|
||||
esac
|
||||
|
||||
filename="$1"; shift
|
||||
|
||||
case "$1" in
|
||||
-q|--quiet) shift; QUIET=1 ;;
|
||||
esac
|
||||
|
||||
case "$1" in
|
||||
-a|--add) shift; add "$@" ;;
|
||||
-s|--search) shift; searchall "$*" ;;
|
||||
-k|--key) shift; searchbyalias "$*" ;;
|
||||
-v|--value) shift; searchbyvalue "$*" ;;
|
||||
-p|--parse) shift; parse "$@" ;;
|
||||
*) searchall "$*" ;;
|
||||
esac
|
@ -1355,6 +1355,7 @@
|
||||
🈺 Japanese “open for business” button; U+1F23A
|
||||
🈵 Japanese “no vacancy” button; U+1F235
|
||||
🔴 red circle; U+1F534
|
||||
🟢 green circle; U+1F7E2
|
||||
🔵 blue circle; U+1F535
|
||||
⚪ white circle; U+26AA
|
||||
⚫ black circle; U+26AB
|
||||
|
@ -98,6 +98,8 @@ bspc rule -a Zathura state=tiled
|
||||
bspc rule -a arduino state=pseudo_tiled
|
||||
bspc rule -a Spotify desktop=VII follow=off focus=off
|
||||
bspc rule -a discord desktop=VII follow=off focus=off
|
||||
bspc rule -a steam_app_2666510 state=pseudo_tiled split_dir=south split_ratio 340 locked private layer=above rectangle=1920x340+0+740
|
||||
#bspc rule -a steam_app_2666510 state=pseudo_tiling locked=on private=on split_dir=south split_ratio 296 layer=above rectangle=1920x296+0+784
|
||||
|
||||
## Autogap adjusts windowgap automatically according to the number of
|
||||
## windows on the desktop. Using it disables negative window gap.
|
||||
|
@ -1,6 +1,6 @@
|
||||
[user]
|
||||
email = debucquoy.anthony@gmail.com
|
||||
name = Anthony Debucquoy
|
||||
email = tonitch@herisson.ovh
|
||||
name = tonitch
|
||||
signingkey = 3D06B2E67463D272D769DF59A78D6421F083D42E
|
||||
[init]
|
||||
defaultBranch = master
|
||||
@ -17,3 +17,10 @@
|
||||
fap = fetch --all --prune
|
||||
[push]
|
||||
autoSetupRemote = true
|
||||
[sendemail]
|
||||
smtpServer = mail.herisson.ovh
|
||||
smtpEncryption = tls
|
||||
smtpServerPort = 587
|
||||
smtpUser = tonitch
|
||||
smtpPass = bateaux
|
||||
annotate = yes
|
||||
|
@ -21,4 +21,7 @@ do
|
||||
vim.keymap.set('i', '<C-S>', function()
|
||||
vim.lsp.buf.signature_help()
|
||||
end, { desc = 'vim.lsp.buf.signature_help()' })
|
||||
|
||||
vim.keymap.set('n', ']g', vim.diagnostic.goto_next)
|
||||
vim.keymap.set('n', '[g', vim.diagnostic.goto_prev)
|
||||
end
|
||||
|
@ -192,7 +192,8 @@ super + shift + {comma,period}
|
||||
# Change window gap
|
||||
|
||||
super + g
|
||||
bspc config -d focused window_gap {$gap,$(($gap+$cgap)),$(($gap+$cgap+$gap))}
|
||||
{bspc config window_gap 0 && bspc config top_padding 0 && bspc config bottom_padding 0 && bspc config right_padding 0 && bspc config left_padding 0,\
|
||||
bspc config window_gap $(($gap+$cgap)) && bspc config top_padding $(($PANEL_HEIGHT-($gap-$cgap))) && bspc config bottom_padding -$gap && bspc config right_padding -$gap && bspc config left_padding -$gap}
|
||||
|
||||
super + button{4,5}
|
||||
bspc config -d focused window_gap $((`bspc config -d focused window_gap` {+,-} 2 ))
|
||||
|
@ -1,5 +1,6 @@
|
||||
set -g mouse
|
||||
set -g set-clipboard on
|
||||
set -g focus-events on
|
||||
|
||||
bind h selectp -L
|
||||
bind j selectp -D
|
||||
|
@ -20,10 +20,14 @@ $0
|
||||
clean:
|
||||
rm -f *.o
|
||||
rm -f $1
|
||||
rm -f tags compile_commands.json
|
||||
|
||||
bear: clean
|
||||
bear -- make
|
||||
|
||||
tags:
|
||||
ctags **.{c,h}
|
||||
|
||||
run: $1
|
||||
./$<
|
||||
|
||||
|
@ -1,3 +1,2 @@
|
||||
set keywordprg=go\ doc
|
||||
unmap K
|
||||
set makeprg=go\ run\ .
|
||||
|
@ -72,6 +72,7 @@ alias open="xdg-open"
|
||||
alias sxiv=nsxiv
|
||||
alias :q=exit
|
||||
alias vim=nvim
|
||||
alias radio="mpv https://radio.freenode.net/radio.ogg --volume=30"
|
||||
|
||||
# Theming section
|
||||
autoload -U compinit colors zcalc
|
||||
|
Reference in New Issue
Block a user