dotfiles

My personal shell configs and stuff
git clone git://git.alex.balgavy.eu/dotfiles.git
Log | Files | Refs | Submodules | README | LICENSE

commit e8e6b34727300dd992bdbfe4ac032a333ff78473
parent a797a1a7beb56fe8ea89849a6ef4026cccf78f14
Author: Alex Balgavy <alex@balgavy.eu>
Date:   Tue, 19 Jan 2021 15:26:39 +0100

Unified mailcap, uninstalled tuir

tuir is now ttrv

Diffstat:
Mdot.map | 4+++-
Amailcap | 7+++++++
Dmutt/mailcap | 7-------
Mmutt/muttrc | 2+-
Mnewsboat/urls | 2+-
Mscripts/linkhandler | 2+-
Mshell/env | 1+
Mtmuxinator/dash.yml | 4++--
Attrv/ttrv.cfg | 186+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Dtuir/tuir.cfg | 186-------------------------------------------------------------------------------
Mvim/vimrc | 2+-
Mw3m/config | 2+-
Dw3m/mailcap | 2--
13 files changed, 204 insertions(+), 203 deletions(-)

diff --git a/dot.map b/dot.map @@ -4,6 +4,8 @@ bin: ~/.bin # My scripts scripts: ~/.scripts +mailcap: ~/.config/mailcap + # Config: utilities compton: ~/.config/compton ctags: ~/.config/ctags @@ -27,7 +29,7 @@ newsboat: - history.cmdline: ~/.local/share/newsboat/history.cmdline polybar: ~/.config/polybar ranger: ~/.config/ranger -tuir: ~/.config/tuir +ttrv: ~/.config/ttrv screen: - screenrc: ~/.screenrc tmux: diff --git a/mailcap b/mailcap @@ -0,0 +1,7 @@ +image/*; sh -c 'case "%s" in http*) name="/tmp/$(printf "%s" | sed "s/.*\///")"; curl -sL "%s" > "$name";; *) name="%s";; esac; sxiv -a "$name"' +video/*; mpvq %s +text/html; w3m -config /Users/alex/.config/w3m/config -T text/html %s +text/plain; less +application/pdf; open -a Skim %s +application/vnd.openxmlformats-officedocument.wordprocessingml.document; open -a 'Microsoft Word' %s +application/x-tar-gz; tar tzf %s | less -R diff --git a/mutt/mailcap b/mutt/mailcap @@ -1,7 +0,0 @@ -image/*; sxiv -a %s -video/*; mpvq %s -text/html; w3m -config /Users/alex/.config/w3m/config -T text/html %s -text/plain; less -application/pdf; open -a Skim %s -application/vnd.openxmlformats-officedocument.wordprocessingml.document; open -a 'Microsoft Word' %s -application/x-tar-gz; tar tzf %s | less -R diff --git a/mutt/muttrc b/mutt/muttrc @@ -5,7 +5,7 @@ source `{ [ -f ~/.config/dark-theme ] && printf "colors-dark"; } || printf "colo set mbox_type = Maildir set mail_check=0 # minimum time between scans unset mark_old # it's enough to see whats unread -set mailcap_path = ~/.config/mutt/mailcap +set mailcap_path = ~/.config/mailcap set pgp_default_key = 0x67A9DD9A68AE0B7C set crypt_autosign diff --git a/newsboat/urls b/newsboat/urls @@ -101,7 +101,7 @@ https://github.com/junegunn/fzf/releases.atom "softwa https://github.com/getzola/zola/releases.atom "software" "~Zola" https://www.freelists.org/feed/regolith-linux "software" "~Regolith Linux" https://github.com/laurent22/joplin/releases.atom "software" "~Joplin" -https://gitlab.com/ajak/tuir/-/tags?format=atom "software" "~Tuir" +https://pypi.org/rss/project/ttrv/releases.xml "software" "~TTRV" https://newsboat.org/news.atom "software" "~Newsboat" https://github.com/searx/searx/releases.atom "software" "~Searx" https://github.com/RSS-Bridge/rss-bridge/commits/master.atom "software" "~RSS Bridge commits" diff --git a/scripts/linkhandler b/scripts/linkhandler @@ -18,7 +18,7 @@ case "$1" in setsid -f mpv --volume=50 "$1" 1>/dev/null 2>&1 ;; *reddit.com*) - tuir "$1" + ttrv "$1" ;; *news.ycombinator.com*|*lean-forward.github.io*) # readability whitelist w3m -config ~/.config/w3m/config "$1" diff --git a/shell/env b/shell/env @@ -205,3 +205,4 @@ export GEM_HOME="$XDG_DATA_HOME/gems" export NOTMUCH_CONFIG="$XDG_CONFIG_HOME/notmuch/config" export GNUPGHOME="$XDG_CONFIG_HOME/gnupg" export R_PROFILE_USER="$XDG_CONFIG_HOME/R/Rprofile" +export MAILCAPS="$XDG_CONFIG_HOME/mailcap" diff --git a/tmuxinator/dash.yml b/tmuxinator/dash.yml @@ -44,7 +44,7 @@ windows: layout: 04ea,201x52,0,0[201x13,0,0,0,201x12,0,14,1,201x18,0,27,2,201x6,0,46,3] panes: - exec newsboat - - nocorrect exec tuir -s vim - - exec tuir -s rotmg + - nocorrect exec ttrv -s vim + - exec ttrv -s rotmg - df -h / /Volumes/HDD | exec less diff --git a/ttrv/ttrv.cfg b/ttrv/ttrv.cfg @@ -0,0 +1,186 @@ +; Terminal UI for Reddit Configuration File +; https://gitlab.com/ajak/ttrv +; +; This file should be placed in $XDG_CONFIG/ttrv/ttrv.cfg +; If $XDG_CONFIG is not set, use ~/.config/ttrv/ttrv.cfg + +[ttrv] +################## +# General Settings +################## + +; Turn on ascii-only mode to disable all unicode characters. +; This may be necessary for compatibility with some terminal browsers. +ascii = False + +; Turn on monochrome mode to disable color. +monochrome = False + +; Data being copied is piped into this command +;clipboard_cmd = xclip +;clipboard_cmd = xsel -b -i +;clipboard_cmd = wl-copy +;clipboard_cmd = pbcopy w + +; Flash when an invalid action is executed. +flash = True + +; Enable debugging by logging all HTTP requests and errors to the given file. +;log = /tmp/ttrv.log + +; Default subreddit that will be opened when the program launches. +subreddit = front +;subreddit = python +;subreddit = python+linux+programming +;subreddit = all + +; Allow ttrv to store reddit authentication credentials between sessions. +persistent = True + +; Automatically log in on startup, if credentials are available. +autologin = True + +; Clear any stored credentials when the program starts. +clear_auth = False + +; Maximum number of opened links that will be saved in the history file. +history_size = 200 + +; Open external links using programs defined in the mailcap config. +enable_media = True + +; Maximum number of columns for a comment +max_comment_cols = 120 + +; Maximum number of columns for pager +;max_pager_cols = 70 + +; Hide username if logged in, display "Logged in" instead +hide_username = True + +; Color theme, use "ttrv --list-themes" to view a list of valid options. +; This can be an absolute filepath, or the name of a theme file that has +; been installed into either the custom of default theme paths. +;theme = molokai + +; Open a new browser window instead of a new tab in existing instance +force_new_browser_window = False + +################ +# OAuth Settings +################ +; This sections defines the paramaters that will be used during the OAuth +; authentication process. ttrv is registered as an "installed app", +; see https://github.com/reddit/reddit/wiki/OAuth2 for more information. + +; These settings are defined at https://www.reddit.com/prefs/apps and should +; not be altered unless you are defining your own developer application. +oauth_client_id = zjyhNI7tK8ivzQ +oauth_client_secret = praw_gapfill +oauth_redirect_uri = http://127.0.0.1:65000/ + +; Port that the ttrv webserver will listen on. This should match the redirect +; uri defined above. +oauth_redirect_port = 65000 + +; Access permissions that will be requested. +oauth_scope = edit,history,identity,mysubreddits,privatemessages,read,report,save,submit,subscribe,vote + +; This is a separate token for the imgur api. It's used to extract images +; from imgur links and albums so they can be opened with mailcap. +; See https://imgur.com/account/settings/apps to generate your own key. +imgur_client_id = 93396265f59dec9 + +[bindings] +############## +# Key Bindings +############## +; If you would like to define custom bindings, copy this section into your +; config file with the [bindings] heading. All commands must be bound to at +; least one key for the config to be valid. +; +; 1.) Plain keys can be represented by either uppercase/lowercase characters +; or the hexadecimal numbers referring their ascii codes. For reference, see +; https://en.wikipedia.org/wiki/ASCII#ASCII_printable_code_chart +; e.g. Q, q, 1, ? +; e.g. 0x20 (space), 0x3c (less-than sign) +; +; 2.) Special ascii control codes should be surrounded with <>. For reference, +; see https://en.wikipedia.org/wiki/ASCII#ASCII_control_code_chart +; e.g. <LF> (enter), <ESC> (escape) +; +; 3.) Other special keys are defined by curses, they should be surrounded by <> +; and prefixed with KEY_. For reference, see +; https://docs.python.org/2/library/curses.html#constants +; e.g. <KEY_LEFT> (left arrow), <KEY_F5>, <KEY_NPAGE> (page down) +; +; Notes: +; - Curses <KEY_ENTER> is unreliable and should always be used in conjunction +; with <LF>. +; - Use 0x20 for the space key. +; - A subset of Ctrl modifiers are available through the ascii control codes. +; For example, Ctrl-D will trigger an <EOT> signal. See the table above for +; a complete reference. + +; Base page +EXIT = q +FORCE_EXIT = Q +HELP = ? +SORT_1 = 1 +SORT_2 = 2 +SORT_3 = 3 +SORT_4 = 4 +SORT_5 = 5 +SORT_6 = 6 +SORT_7 = 7 +MOVE_UP = k, <KEY_UP> +MOVE_DOWN = j, <KEY_DOWN> +PREVIOUS_THEME = <KEY_F2> +NEXT_THEME = <KEY_F3> +PAGE_UP = m, <KEY_PPAGE>, <NAK> +PAGE_DOWN = n, <KEY_NPAGE>, <EOT> +PAGE_TOP = gg +PAGE_BOTTOM = G +UPVOTE = a +DOWNVOTE = z +LOGIN = u +DELETE = d +EDIT = e +INBOX = i +REFRESH = r, <KEY_F5> +PROMPT = / +SAVE = w +COPY_PERMALINK = y +COPY_URL = Y +PRIVATE_MESSAGE = C +SUBSCRIPTIONS = s +MULTIREDDITS = S + +; Submission page +SUBMISSION_TOGGLE_COMMENT = 0x20 +SUBMISSION_OPEN_IN_BROWSER = o, <LF>, <KEY_ENTER> +SUBMISSION_POST = c +SUBMISSION_EXIT = h, <KEY_LEFT> +SUBMISSION_OPEN_IN_PAGER = l, <KEY_RIGHT> +SUBMISSION_OPEN_IN_URLVIEWER = U +SUBMISSION_GOTO_PARENT = K +SUBMISSION_GOTO_SIBLING = J + +; Subreddit page +SUBREDDIT_SEARCH = f +SUBREDDIT_POST = c +SUBREDDIT_OPEN = l, <KEY_RIGHT> +SUBREDDIT_OPEN_IN_BROWSER = o, <LF>, <KEY_ENTER> +SUBREDDIT_FRONTPAGE = p +SUBREDDIT_HIDE = 0x20 + +; Subscription page +SUBSCRIPTION_SELECT = l, <LF>, <KEY_ENTER>, <KEY_RIGHT> +SUBSCRIPTION_EXIT = h, s, S, <ESC>, <KEY_LEFT> + +; Inbox page +INBOX_VIEW_CONTEXT = l, <KEY_RIGHT> +INBOX_OPEN_SUBMISSION = o, <LF>, <KEY_ENTER> +INBOX_REPLY = c +INBOX_MARK_READ = w +INBOX_EXIT = h, <ESC>, <KEY_LEFT> diff --git a/tuir/tuir.cfg b/tuir/tuir.cfg @@ -1,186 +0,0 @@ -; Terminal UI for Reddit Configuration File -; https://gitlab.com/ajak/tuir -; -; This file should be placed in $XDG_CONFIG/tuir/tuir.cfg -; If $XDG_CONFIG is not set, use ~/.config/tuir/tuir.cfg - -[tuir] -################## -# General Settings -################## - -; Turn on ascii-only mode to disable all unicode characters. -; This may be necessary for compatibility with some terminal browsers. -ascii = False - -; Turn on monochrome mode to disable color. -monochrome = False - -; Data being copied is piped into this command -;clipboard_cmd = xclip -;clipboard_cmd = xsel -b -i -;clipboard_cmd = wl-copy -;clipboard_cmd = pbcopy w - -; Flash when an invalid action is executed. -flash = True - -; Enable debugging by logging all HTTP requests and errors to the given file. -;log = /tmp/tuir.log - -; Default subreddit that will be opened when the program launches. -subreddit = front -;subreddit = python -;subreddit = python+linux+programming -;subreddit = all - -; Allow tuir to store reddit authentication credentials between sessions. -persistent = True - -; Automatically log in on startup, if credentials are available. -autologin = True - -; Clear any stored credentials when the program starts. -clear_auth = False - -; Maximum number of opened links that will be saved in the history file. -history_size = 200 - -; Open external links using programs defined in the mailcap config. -enable_media = False - -; Maximum number of columns for a comment -max_comment_cols = 120 - -; Maximum number of columns for pager -;max_pager_cols = 70 - -; Hide username if logged in, display "Logged in" instead -hide_username = True - -; Color theme, use "tuir --list-themes" to view a list of valid options. -; This can be an absolute filepath, or the name of a theme file that has -; been installed into either the custom of default theme paths. -;theme = molokai - -; Open a new browser window instead of a new tab in existing instance -force_new_browser_window = False - -################ -# OAuth Settings -################ -; This sections defines the paramaters that will be used during the OAuth -; authentication process. tuir is registered as an "installed app", -; see https://github.com/reddit/reddit/wiki/OAuth2 for more information. - -; These settings are defined at https://www.reddit.com/prefs/apps and should -; not be altered unless you are defining your own developer application. -oauth_client_id = zjyhNI7tK8ivzQ -oauth_client_secret = praw_gapfill -oauth_redirect_uri = http://127.0.0.1:65000/ - -; Port that the tuir webserver will listen on. This should match the redirect -; uri defined above. -oauth_redirect_port = 65000 - -; Access permissions that will be requested. -oauth_scope = edit,history,identity,mysubreddits,privatemessages,read,report,save,submit,subscribe,vote - -; This is a separate token for the imgur api. It's used to extract images -; from imgur links and albums so they can be opened with mailcap. -; See https://imgur.com/account/settings/apps to generate your own key. -imgur_client_id = 93396265f59dec9 - -[bindings] -############## -# Key Bindings -############## -; If you would like to define custom bindings, copy this section into your -; config file with the [bindings] heading. All commands must be bound to at -; least one key for the config to be valid. -; -; 1.) Plain keys can be represented by either uppercase/lowercase characters -; or the hexadecimal numbers referring their ascii codes. For reference, see -; https://en.wikipedia.org/wiki/ASCII#ASCII_printable_code_chart -; e.g. Q, q, 1, ? -; e.g. 0x20 (space), 0x3c (less-than sign) -; -; 2.) Special ascii control codes should be surrounded with <>. For reference, -; see https://en.wikipedia.org/wiki/ASCII#ASCII_control_code_chart -; e.g. <LF> (enter), <ESC> (escape) -; -; 3.) Other special keys are defined by curses, they should be surrounded by <> -; and prefixed with KEY_. For reference, see -; https://docs.python.org/2/library/curses.html#constants -; e.g. <KEY_LEFT> (left arrow), <KEY_F5>, <KEY_NPAGE> (page down) -; -; Notes: -; - Curses <KEY_ENTER> is unreliable and should always be used in conjunction -; with <LF>. -; - Use 0x20 for the space key. -; - A subset of Ctrl modifiers are available through the ascii control codes. -; For example, Ctrl-D will trigger an <EOT> signal. See the table above for -; a complete reference. - -; Base page -EXIT = q -FORCE_EXIT = Q -HELP = ? -SORT_1 = 1 -SORT_2 = 2 -SORT_3 = 3 -SORT_4 = 4 -SORT_5 = 5 -SORT_6 = 6 -SORT_7 = 7 -MOVE_UP = k, <KEY_UP> -MOVE_DOWN = j, <KEY_DOWN> -PREVIOUS_THEME = <KEY_F2> -NEXT_THEME = <KEY_F3> -PAGE_UP = m, <KEY_PPAGE>, <NAK> -PAGE_DOWN = n, <KEY_NPAGE>, <EOT> -PAGE_TOP = gg -PAGE_BOTTOM = G -UPVOTE = a -DOWNVOTE = z -LOGIN = u -DELETE = d -EDIT = e -INBOX = i -REFRESH = r, <KEY_F5> -PROMPT = / -SAVE = w -COPY_PERMALINK = y -COPY_URL = Y -PRIVATE_MESSAGE = C -SUBSCRIPTIONS = s -MULTIREDDITS = S - -; Submission page -SUBMISSION_TOGGLE_COMMENT = 0x20 -SUBMISSION_OPEN_IN_BROWSER = o, <LF>, <KEY_ENTER> -SUBMISSION_POST = c -SUBMISSION_EXIT = h, <KEY_LEFT> -SUBMISSION_OPEN_IN_PAGER = l, <KEY_RIGHT> -SUBMISSION_OPEN_IN_URLVIEWER = U -SUBMISSION_GOTO_PARENT = K -SUBMISSION_GOTO_SIBLING = J - -; Subreddit page -SUBREDDIT_SEARCH = f -SUBREDDIT_POST = c -SUBREDDIT_OPEN = l, <KEY_RIGHT> -SUBREDDIT_OPEN_IN_BROWSER = o, <LF>, <KEY_ENTER> -SUBREDDIT_FRONTPAGE = p -SUBREDDIT_HIDE = 0x20 - -; Subscription page -SUBSCRIPTION_SELECT = l, <LF>, <KEY_ENTER>, <KEY_RIGHT> -SUBSCRIPTION_EXIT = h, s, S, <ESC>, <KEY_LEFT> - -; Inbox page -INBOX_VIEW_CONTEXT = l, <KEY_RIGHT> -INBOX_OPEN_SUBMISSION = o, <LF>, <KEY_ENTER> -INBOX_REPLY = c -INBOX_MARK_READ = w -INBOX_EXIT = h, <ESC>, <KEY_LEFT> diff --git a/vim/vimrc b/vim/vimrc @@ -713,7 +713,7 @@ if has('terminal') cnoreabbrev tm terminal ++close man cnoreabbrev tf terminal ++close lf cnoreabbrev tn terminal ++close joplin - command! Tuir tab terminal tuir + command! Reddit tab terminal ttrv endif " }}} " Digraphs {{{1 diff --git a/w3m/config b/w3m/config @@ -66,7 +66,7 @@ personal_document_root cgi_bin index_file mime_types ~/.mime.types, /usr/local/Cellar/w3m/0.5.3_6/etc/mime.types -mailcap ~/.config/w3m/mailcap, /usr/local/Cellar/w3m/0.5.3_6/etc/w3m/mailcap +mailcap ~/.config/mailcap, /usr/local/Cellar/w3m/0.5.3_6/etc/w3m/mailcap urimethodmap ~/.config/w3m/urimethodmap, /usr/local/Cellar/w3m/0.5.3_6/etc/w3m/urimethodmap editor /usr/local/bin/vim mailto_options 1 diff --git a/w3m/mailcap b/w3m/mailcap @@ -1,2 +0,0 @@ -image/*; sxiv -a '%s' -video/*; mpvq '%s'