From 8a31e9024a5161833fd791962cc4fa35745e154f Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Tue, 28 May 2019 11:10:03 +0200 Subject: [PATCH 1/6] Add wallabag article quickadd to qutebrowser Adds :wallabag-add command to qutebrowser to add current page to it as an article. Can optionally use ra (read-add) for the same functionality. --- .config/qutebrowser/config.py | 5 +++++ .local/share/qutebrowser/userscripts/wallabag_add.sh | 12 ++++++++++++ 2 files changed, 17 insertions(+) create mode 100755 .local/share/qutebrowser/userscripts/wallabag_add.sh diff --git a/.config/qutebrowser/config.py b/.config/qutebrowser/config.py index 79ccd94..056948c 100644 --- a/.config/qutebrowser/config.py +++ b/.config/qutebrowser/config.py @@ -75,6 +75,11 @@ c.aliases["q"] = "tab-close" # if we save sessions with w, load sessions with e (again, mimicks vim) c.aliases["e"] = "session-load" +# bookmarklet aliases: +# wallabag add current page, either with walla command, or ra +c.aliases["wallabag-add"] = "spawn --userscript wallabag_add.sh" +config.bind(leader + 'ra', 'wallabag-add', mode='normal') + # set stylesheets for the browser to use # leader - ss to remove all applied stylesheets config.bind(leader + 'ss', 'set content.user_stylesheets ""') diff --git a/.local/share/qutebrowser/userscripts/wallabag_add.sh b/.local/share/qutebrowser/userscripts/wallabag_add.sh new file mode 100755 index 0000000..ab4c707 --- /dev/null +++ b/.local/share/qutebrowser/userscripts/wallabag_add.sh @@ -0,0 +1,12 @@ +#! /usr/bin/bash + +# from swalladge: +# https://github.com/swalladge/dotfiles/blob/master/local/share/qutebrowser/userscripts/wallabag_add.sh + +# for wallabag v1.* +# `-w 0` disables auto line wrapping in base64 +# echo "open -t https://www.framabag.org/u/swalladge/?action=add&url='`echo -n "$QUTE_URL" | base64 -w 0`'" >> "$QUTE_FIFO" + + +# v2.* +echo "open https://read.martyoeh.me/bookmarklet?url=$QUTE_URL" >> "$QUTE_FIFO" From 729bcf9660fa04e3b55f2252180df9a802868153 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Tue, 4 Jun 2019 11:30:45 +0200 Subject: [PATCH 2/6] Automatically start X when on display 1 Should start x after all the XDG folders have been set so that aliases etc should still work. If binds/aliases do not work (things like tm, tl, cl and so on) then this is presumably caused by a race condition and x should only be started *after* all directories have benn set. --- .config/shell/rc.d/autostartx.sh | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .config/shell/rc.d/autostartx.sh diff --git a/.config/shell/rc.d/autostartx.sh b/.config/shell/rc.d/autostartx.sh new file mode 100644 index 0000000..2296142 --- /dev/null +++ b/.config/shell/rc.d/autostartx.sh @@ -0,0 +1,3 @@ +# if [[ ! $DISPLAY && $XDG_VTNR -eq 1 ]]; then +# exec startx ~/.xinitrc +# fi From 9153315a091dc1e3f6ca01e5369441cd93b1cf60 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Tue, 4 Jun 2019 13:27:01 +0200 Subject: [PATCH 3/6] Clean section breaks in vimrc --- .config/nvim/init.vim | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index 8d5d1d6..e79f8df 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -11,7 +11,6 @@ " this config does not set nocompatible - neovim does this automatically " this config does not set filetype plugin - vim-sensible does this " }}} -" ================================================================================ " PLUGIN INSTALLATION - handled by VIM-PLUG {{{ " ================================================================================ " @@ -108,7 +107,6 @@ call plug#end() endif " }}} -" ================================================================================ " PLUGIN CONFIGURATION {{{ " ================================================================================ @@ -226,7 +224,6 @@ let g:tmuxline_preset = { let g:tmux_navigator_save_on_switch = 1 " }}} -" ================================================================================ " VIM SETTINGS {{{ " ================================================================================ " @@ -270,7 +267,6 @@ highlight ColorColumn ctermbg=magenta call matchadd('ColorColumn', '\%81v', 100) " }}} -" ================================================================================ " KEYBINDINGS {{{ " ================================================================================ " @@ -349,6 +345,5 @@ nnoremap Q vapJgqap noremap :Goyo " }}} -" ================================================================================ " END " ================================================================================ From eb57109565907211c042fb6df89096c9d9809700 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Tue, 4 Jun 2019 13:28:15 +0200 Subject: [PATCH 4/6] Add abbreviations and quote surround to vimrc --- .config/nvim/init.vim | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index e79f8df..3ee22fa 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -344,6 +344,29 @@ nnoremap Q vapJgqap " Enter distraction free prose mode with F11 noremap :Goyo +" surround stuff with quotes, from normal or visual mode +nnoremap " viwa"bi"lel +vnoremap " ``>la"l + +" stronger versions of left,right - move all the way +nnoremap H ^ +nnoremap L $ + +" }}} +" ABBREVIATIONS {{{ + +" Typos +iabbrev adn and +iabbrev waht what +iabbrev tehn then +iabbrev whit with +iabbrev whith with + +" Text expansion +iabbrev @@ marty.oehme@gmail.com +iabbrev ccopy Copyright 2019 Marty Oehme, all rights reserved. + +" " }}} " END " ================================================================================ From 79768266a153af37bf1931ea02ae410e746607fc Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Tue, 4 Jun 2019 13:28:44 +0200 Subject: [PATCH 5/6] Add open in webarchive to qutebrowser,unify keys --- .config/qutebrowser/config.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.config/qutebrowser/config.py b/.config/qutebrowser/config.py index 056948c..a37fbf7 100644 --- a/.config/qutebrowser/config.py +++ b/.config/qutebrowser/config.py @@ -76,9 +76,13 @@ c.aliases["q"] = "tab-close" c.aliases["e"] = "session-load" # bookmarklet aliases: -# wallabag add current page, either with walla command, or ra +# currently the idea is to prefix bookmarklets with b (as in open "bookmarklet") +# wallabag add current page, either with walla command, or bw c.aliases["wallabag-add"] = "spawn --userscript wallabag_add.sh" -config.bind(leader + 'ra', 'wallabag-add', mode='normal') +config.bind(leader + 'bw', 'wallabag-add', mode='normal') +# re-opens the current page on the web archive overview page +c.aliases["archive-open"] = "open https://web.archive.org/web/{url}" +config.bind(leader + 'ba', 'archive-open', mode='normal') # set stylesheets for the browser to use # leader - ss to remove all applied stylesheets From 6b7705409cf6a51f60fb9656c6557a917f5f4609 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Wed, 5 Jun 2019 16:44:15 +0200 Subject: [PATCH 6/6] Add fasd shell hook --- .config/shell/rc.d/enable-fasd-hook.sh | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .config/shell/rc.d/enable-fasd-hook.sh diff --git a/.config/shell/rc.d/enable-fasd-hook.sh b/.config/shell/rc.d/enable-fasd-hook.sh new file mode 100644 index 0000000..907fd96 --- /dev/null +++ b/.config/shell/rc.d/enable-fasd-hook.sh @@ -0,0 +1,3 @@ +#!/bin/sh +# more usage instructions at https://github.com/clvv/fasd +eval "$(fasd --init auto)"