From b22257c7da5ef9f54e20ac27ed6528bfb270a1d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yi=C4=9Fit=20=C3=87olako=C4=9Flu?= Date: Tue, 23 Mar 2021 15:49:01 +0300 Subject: [PATCH] Neomutt and vim clipboard --- install.sh | 1 + mail/mutt/keys.muttrc | 1 + mail/mutt/mailcap | 4 ++-- scripts/status-bar/battery | 3 ++- scripts/status-bar/date | 2 ++ scripts/status-bar/weather | 8 ++++---- vim/vimrc | 2 ++ xorg/xinitrc | 2 ++ 8 files changed, 16 insertions(+), 7 deletions(-) diff --git a/install.sh b/install.sh index b387b81d..9f629d90 100755 --- a/install.sh +++ b/install.sh @@ -153,6 +153,7 @@ if [ ! -f "/var/spool/cron$username" ]; then sudo chown yigit:yigit "/var/spool/cron/$username" sudo chmod 755 "/var/spool/cron/$username" fi +echo "COMMAND firefox-developer-edition" > ~/.urlview echo "*/8 * * * * /home/$username/.scripts/mailsync" >> /var/spool/cron/yigit echo "*/15 * * * * /home/$username/.scripts/nextcloud-sync" >> /var/spool/cron/yigit echo "*/30 * * * * calcurse-caldav" >> /var/spool/cron/yigit diff --git a/mail/mutt/keys.muttrc b/mail/mutt/keys.muttrc index b9dbd170..04023863 100644 --- a/mail/mutt/keys.muttrc +++ b/mail/mutt/keys.muttrc @@ -47,6 +47,7 @@ bind editor complete-query #set pgp_default_key = 'your@gpgemailaddre.ss' macro index,pager a "set my_pipe_decode=\$pipe_decode pipe_decodeabook --add-emailset pipe_decode=\$my_pipe_decode; unset my_pipe_decode" "add the sender address to abook" +macro index,pager U "set pipe_decode = yesurlviewset pipe_decode = no""view URLs" macro index \Cr "T~UN." "mark all messages as read" macro index O "mw -Y" "run mw -Y to sync all mail" macro index \Cf "unset wait_keyprintf 'Enter a search term to find with notmuch: '; read x; echo \$x >~/.cache/mutt_terms~i \"\`notmuch search --output=messages \$(cat ~/.cache/mutt_terms) | head -n 600 | perl -le '@a=<>;s/\^id:// for@a;$,=\"|\";print@a' | perl -le '@a=<>; chomp@a; s/\\+/\\\\+/ for@a;print@a' \`\"" "show only messages matching a notmuch pattern" diff --git a/mail/mutt/mailcap b/mail/mutt/mailcap index 88bbdce7..46e58d0f 100644 --- a/mail/mutt/mailcap +++ b/mail/mutt/mailcap @@ -1,7 +1,7 @@ text/plain; $EDITOR %s ; text/html; openfile %s ; nametemplate=%s.html -#text/html; lynx -assume_charset=%{charset} -display_charset=utf-8 -dump %s; nametemplate=%s.html; copiousoutput; -text/html; firefox-developer-edition %s; +text/html; lynx -assume_charset=%{charset} -display_charset=utf-8 -dump %s; nametemplate=%s.html; copiousoutput; +#text/html; firefox-developer-edition %s; image/*; openfile %s ; video/*; setsid mpv --quiet %s &; copiousoutput audio/*; mpv %s ; diff --git a/scripts/status-bar/battery b/scripts/status-bar/battery index e18bb60f..d9b09cc0 100755 --- a/scripts/status-bar/battery +++ b/scripts/status-bar/battery @@ -12,6 +12,7 @@ ramp70= ramp80= ramp90= ramp100= +ac_bat= ac=ﮣ if [ "$NO_BAT" = true ] ; then echo "^c#ebcb8b^$ac^d^" @@ -20,7 +21,7 @@ else export status=$(cat /sys/class/power_supply/BAT0/status) export plugged=$(cat /sys/class/power_supply/AC/online) if [[ $plugged == "1" ]]; then - echo "^c#ebcb8b^$ac^d^" + echo "^c#ebcb8b^$ac_bat^d^ $bat%" elif [[ $bat -lt 10 ]]; then echo "^c#ebcb8b^$ramp10^d^ $bat% " elif [[ $bat -lt 20 ]]; then diff --git a/scripts/status-bar/date b/scripts/status-bar/date index fc7fe9da..6e1909ac 100755 --- a/scripts/status-bar/date +++ b/scripts/status-bar/date @@ -4,6 +4,8 @@ icon= events=$(calcurse -a | grep -- '->' | wc -l) if [ ! "$events" = "0" ]; then events="($events) " +else + events="" fi cmd=$(date +"%h %e") diff --git a/scripts/status-bar/weather b/scripts/status-bar/weather index 8015d286..2cc2e770 100755 --- a/scripts/status-bar/weather +++ b/scripts/status-bar/weather @@ -15,7 +15,7 @@ WCODES=( ["179"]="^c#81a1c1^" ["182"]="^c#81a1c1^" ["185"]="^c#81a1c1^" - ["200"]="" + ["200"]="^c#81a1c1^ " ["227"]="" ["230"]="" ["248"]="" @@ -67,11 +67,11 @@ showweather() { data=$(echo -ne $(echo $data | cut -d' ' -f 1-4)" ${WCODES[$(echo $data | cut -d' ' -f 5)]}") echo $data | awk -F' ' '{ if ($4 > 30) - print "^c#ffffff^ ^d^" $4 "kh "$5 " ^d^ " $1 "°" + print "^c#ffffff^ ^d^" $4 "kh "$5 " ^d^" $1 "°C" else if ($2 < $3) - print "^c#ffffff^ ^d^" $3 "% "$5 " ^d^ " $1 "°" + print "^c#ffffff^ ^d^" $3 "% "$5 " ^d^" $1 "°C" else - print "^c#81a1c1^ ^d^" $2 "% " $5 " ^d^ " $1 "°"}' + print "^c#81a1c1^ ^d^" $2 "% " $5 " ^d^" $1 "°C"}' } case $BLOCK_BUTTON in diff --git a/vim/vimrc b/vim/vimrc index a1f55a21..428dfb88 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -21,6 +21,7 @@ map h :History " CtrlP use FZF (faster!) nnoremap :Files +noremap u :wsilent !urlview syntax on filetype plugin on @@ -151,4 +152,5 @@ if has('nvim') endif command! -complete=file -nargs=1 Rpdf :r !pdftotext -nopgbrk - |fmt -csw78 +autocmd VimLeave * call system("xsel -ib", getreg('+')) packadd termdebug diff --git a/xorg/xinitrc b/xorg/xinitrc index 72199da2..ea6bf37c 100755 --- a/xorg/xinitrc +++ b/xorg/xinitrc @@ -19,7 +19,9 @@ xrdb ~/.Xresources & if [ "$NEXTCLOUD" = true ] ; then nextcloud --background & fi +mkdir -p ~/Downloads/neomutt if [ "$MCONNECT" = true ] ; then + mkdir -p ~/Downloads/mconnect (cd ~/Downloads/mconnect; mconnect -d > /tmp/mconnect 2> /tmp/mconnect.err &) fi if [ "$ACTIVITYWATCHER" = true ] ; then