From 4a73f6b7c560a53a7f6fe3bff54a06671fea6109 Mon Sep 17 00:00:00 2001 From: Benjamin Chausse Date: Thu, 7 Jan 2021 21:46:47 -0500 Subject: linkhandler uses mpv with the sponsorblock plugin --- .config/mimeapps.list | 31 ++++++++++++++++++++++++++----- .config/newsboat/urls | 1 + .config/nvim/init.vim | 33 +++++++++++++++------------------ .config/sxhkd/sxhkdrc | 5 +---- .config/vifm/vifmrc | 2 +- .local/bin/dmenuprint | 15 +++++++++++++++ .local/bin/dwmbar/dwmb-debarque | 29 +++++++++++++++++++++-------- .local/bin/linkhandler | 3 ++- 8 files changed, 82 insertions(+), 37 deletions(-) create mode 100755 .local/bin/dmenuprint diff --git a/.config/mimeapps.list b/.config/mimeapps.list index 6c7c2fe..487fece 100644 --- a/.config/mimeapps.list +++ b/.config/mimeapps.list @@ -1,8 +1,4 @@ [Default Applications] - -# xdg-open will use these settings to determine how to open filetypes. -# These .desktop entries can also be seen and changed in ~/.local/share/applications/ - text/x-shellscript=text.desktop; x-scheme-handler/magnet=torrent.desktop; application/x-bittorrent=torrent.desktop; @@ -17,6 +13,31 @@ application/rss+xml=rss.desktop video/x-matroska=video.desktop x-scheme-handler/lbry=lbry.desktop inode/directory=file.desktop -x-scheme-handler/kite=kite-copilot.desktop application/x-osptracker=tracker.desktop x-scheme-handler/msteams=teams.desktop +x-scheme-handler/http=firefox.desktop +x-scheme-handler/https=firefox.desktop +x-scheme-handler/ftp=firefox.desktop +x-scheme-handler/chrome=firefox.desktop +text/html=firefox.desktop +application/x-extension-htm=firefox.desktop +application/x-extension-html=firefox.desktop +application/x-extension-shtml=firefox.desktop +application/xhtml+xml=firefox.desktop +application/x-extension-xhtml=firefox.desktop +application/x-extension-xht=firefox.desktop +x-scheme-handler/kite=kite-copilot.desktop + +[Added Associations] +x-scheme-handler/http=firefox.desktop; +x-scheme-handler/https=firefox.desktop; +x-scheme-handler/ftp=firefox.desktop; +x-scheme-handler/chrome=firefox.desktop; +text/html=firefox.desktop; +application/x-extension-htm=firefox.desktop; +application/x-extension-html=firefox.desktop; +application/x-extension-shtml=firefox.desktop; +application/xhtml+xml=firefox.desktop; +application/x-extension-xhtml=firefox.desktop; +application/x-extension-xht=firefox.desktop; +text/plain=nvim.desktop; diff --git a/.config/newsboat/urls b/.config/newsboat/urls index d124fbb..e1ef743 100644 --- a/.config/newsboat/urls +++ b/.config/newsboat/urls @@ -44,6 +44,7 @@ https://www.archlinux.org/feeds/news/ "Website" "~Website: Arch https://chausse.xyz/rss.xml "Website" "~Website: My personal Blog" # https://www.ledevoir.com/rss/section/societe/science.xml "Website" "~Website: Le Devoir Sciences" # https://spacenews.com/feed/ "Website" "~Website: SpaceNews" +https://www.macleans.ca/feed/ "Website" "~Website: Macleans" # #---Facebook---# # https://rss-bridge.bb8.fun/?action=display&bridge=Facebook&context=User&u=LaDebarqueEscalade&media_type=all&limit=-1&format=Atom "Facebook" "~Facebook: La Debarque" diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index 2dc3db4..3df54ba 100755 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -125,10 +125,8 @@ set linebreak " #---Plugin Preferences---# " " Emmet Expansion let g:user_emmet_leader_key=',' -" Enable kite autocompletion -" let g:kite_auto_complete=1 " MarkdownPreview -" let g:mkdp_browser = 'surf' +let g:mkdp_browser = 'firefox' " Bracey let g:bracey_browser_command = "firefox" " Grammalecte path @@ -148,20 +146,22 @@ let g:Hexokinase_highlighters = ['virtual'] let g:vimtex_view_general_viewer = 'open' let g:vimtex_view_general_options = '-a zathura' let g:tex_flavor = 'latex' +" Vimtex TOC +nnoremap :VimtexTocToggle " #---Document Compilation/Visualisation---# " " Compile document, be it groff/LaTeX/markdown/etc. -map c :w! \| AsyncRun compiler % +nnoremap c :w! \| AsyncRun compiler % autocmd InsertLeave,TextChanged *.gd,*.ms,*.mom :w! | :execute 'silent AsyncRun compiler %' " autocmd InsertLeave *.rmd,*.rnw,*.tex :w! | :execute 'silent AsyncRun compiler %; todotable % TODO FIXME CHANGED XXX IDEA HACK NOTE REVIEW NB BUG QUESTION COMBAK' -map x :w! \| AsyncRun todotable % TODO FIXME CHANGED XXX IDEA HACK NOTE REVIEW NB BUG QUESTION COMBAK TEMP +nnoremap x :w! \| AsyncRun todotable % TODO FIXME CHANGED XXX IDEA HACK NOTE REVIEW NB BUG QUESTION COMBAK TEMP " Have dwmblocks automatically recompile and run when you edit this file in autocmd BufWritePost ~/Compilation/dwmblocks/config.h !cd ~/Compilation/dwmblocks/; make && sudo make install && { killall -q dwmblocks;setsid dwmblocks & } autocmd BufWritePost ~/.Xresources !xrdb -load % " Open corresponding .pdf/.html or preview - map p :! opout % + nnoremap p :! opout % " Open corresponding .pdf/.html or preview - map o :! tdout % + nnoremap o :! tdout % " Spaces are superior to tabs set tabstop=2 set shiftwidth=2 @@ -178,14 +178,11 @@ call matchadd('ColorColumn', '\%81v', 100) map :verticalresize+3 map :split map :vsplit -" Ninja python execution - map :Codi!! - map :QuickRun " Shortcutting split navigation, saving a keypress: - map h - map j - map k - map l + nnoremap h + nnoremap j + nnoremap k + nnoremap l " Easily escape terminal mode tnoremap " Space is my leader @@ -225,7 +222,7 @@ autocmd BufWritePre * %s/\s\+$//e " Soft Tabs filetype plugin indent on " Nvim-R send line -nmap l +" nmap l " Nvim-R match colorscheme let rout_follow_colorscheme = 0 " Nvim-R folding @@ -276,11 +273,11 @@ nnoremap >s :call QuickFixSpell(1) " Markdown Heading underline function! UnderlineHeading(level) if a:level == 1 - normal! yypVr= + execute "normal! yypVr=k$" elseif a:level == 2 - normal! yypVr- + execute "normal! yypVr-k$" else - normal! I### + execute "normal! I### \e$" endif endfunction diff --git a/.config/sxhkd/sxhkdrc b/.config/sxhkd/sxhkdrc index 0b917b5..ea9de01 100644 --- a/.config/sxhkd/sxhkdrc +++ b/.config/sxhkd/sxhkdrc @@ -131,9 +131,6 @@ super + w ## TUI Email Client (neomutt) super + e killall neomutt || $TERMINAL -e neomutt && mw -Y -## TUI Calendar (calcurse) -super + shift + e - killall calcurse || $TERMINAL -t dropdown_calendar -e calcurse ## TUI RSS Reader (newsboat) super + n killall newsboat || $TERMINAL -e newsboat ; kill -37 $(pidof dwmblocks) @@ -156,7 +153,7 @@ super + shift + a dropdowntoggle shell tmux-shell ## TUI Youtube (youtube-viewer) super + v - killall youtube-viewer || $TERMINAL -c youtube -t YouTube -e youtube-viewer + killall youtube-viewer || $TERMINAL -c youtube -t YouTube -e youtube-viewer -SV ## TUI Hacker News super + shift + v killall hacker-news || dropdowntoggle hacker-news tmux-hn diff --git a/.config/vifm/vifmrc b/.config/vifm/vifmrc index 10296bb..16ea457 100644 --- a/.config/vifm/vifmrc +++ b/.config/vifm/vifmrc @@ -228,7 +228,7 @@ fileviewer * file -b %c "{{{ Key mappings " Easily quit vifm by hitting q -nmap q ZQ +nmap q :q " Use comma to enter command mode nnoremap , : diff --git a/.local/bin/dmenuprint b/.local/bin/dmenuprint new file mode 100755 index 0000000..cfcd179 --- /dev/null +++ b/.local/bin/dmenuprint @@ -0,0 +1,15 @@ +#!/bin/sh + +choice="$(lpstat -p -d | sed 's/.*default.*//g; + s/[^ ]* //; + s/is\sidle.//g + s/.*disabled.*//g' | + dmenu -p "Which printer?" | + sed 's/\s.*//g' )" + +lpr -P $choice "$@" + +# printer Canon_iP110_series is idle. enabled since Tue 10 Nov 2020 04:22:34 PM +# printer HP_OfficeJet_Pro_9010 is idle. enabled since Wed 09 Dec 2020 01:57:06 AM +# printer HP_OfficeJet_Pro_9010_fax is idle. enabled since Tue 27 Oct 2020 08:40:56 PM +# system default destination: HP_OfficeJet_Pro_9010 diff --git a/.local/bin/dwmbar/dwmb-debarque b/.local/bin/dwmbar/dwmb-debarque index a5c0e21..79fc346 100755 --- a/.local/bin/dwmbar/dwmb-debarque +++ b/.local/bin/dwmbar/dwmb-debarque @@ -1,13 +1,26 @@ #!/bin/sh -count="$(curl https://www.ladebarque.com/achalandage | - grep -i 'il y a ' | - sed 's/.*il\sy\sa\sen\sce\smoment\s//; s/\([0-9]*\).*/\1/')" +# count="$(curl https://www.ladebarque.com/achalandage | + # grep 'il y a' | + # sed 's/.*il\sy\sa\sen\sce\smoment\s//; s/\sgrimpeurs.*//')" -echo "  $count " +count="$(curl -L ladebarque.com/achalandage | + grep -i 'moment' | + sed 's/\s//g; + s/Maximum.*//; + s/^.*moment//; + s/\([0-9]\+\).*/\1/')" -case $BLOCK_BUTTON in - 1) $BROWSER https://www.ladebarque.com/achalandage ;; - 2) notify-send -a " La Débarque" "Syncing..." && kill -51 $(pidof dwmblocks) && notify-send -a " La Débarque" "Done!" ;; - 3) notify-send -a "La Débarque" "This block shows the number of people currently climbing at my local gym." ;; +# curl https://www.ladebarque.com/achalandage > ~/asdf.html + +sep="," +date="$(TZ='America/Toronto' date +"%Y-%m-%d$sep%R")" +entry=""$date"$sep"$count"" + +case "$1" in + write) echo "$entry" >> $HOME/.cache/debarque.csv ;; + *) echo "  $count " ;; esac + + +# echo "$entry" diff --git a/.local/bin/linkhandler b/.local/bin/linkhandler index c7c5e75..0beb361 100755 --- a/.local/bin/linkhandler +++ b/.local/bin/linkhandler @@ -11,7 +11,8 @@ case "$1" in *mkv|*webm|*mp4|*youtube.com/watch*|*youtube.com/playlist*|*youtu.be*|*hooktube.com*|*bitchute.com*|*video.twimg.com*) - mpv --no-config "$1" ;; + mpv "$1" ;; + # mpv --no-config "$1" ;; # setsid -f mpv --no-config "$1" ;; *png|*jpg|*jpe|*jpeg|*gif|*.webp) curl -sL "$1" > "/tmp/$(echo "$1" | sed "s/.*\///")" && sxiv -a "/tmp/$(echo "$1" | sed "s/.*\///")" >/dev/null 2>&1 & ;; -- cgit v1.2.3