From d5e4d8ba3c427dcbbdc65f75c69c4a5231665ca2 Mon Sep 17 00:00:00 2001 From: Tucker Johnson Date: Thu, 22 May 2025 23:07:16 -0400 Subject: [PATCH] re-stage 1 --- .gitignore | 28 ++- newsboat/config | 54 +++++ newsboat/urls | 29 +++ qutebrowser/autoconfig.yml | 16 ++ qutebrowser/config.py | 400 +++++++++++++++++++++++++++++++++++++ qutebrowser/quickmarks | 0 shell/aliasrc | 49 +++++ shell/bm-dirs | 14 ++ shell/bm-files | 23 +++ shell/inputrc | 19 ++ shell/profile | 77 +++++++ shell/shortcutenvrc | 30 +++ shell/shortcutrc | 30 +++ shell/zshnameddirrc | 29 +++ zsh/.zshrc | 78 ++++++++ 15 files changed, 871 insertions(+), 5 deletions(-) create mode 100644 newsboat/config create mode 100644 newsboat/urls create mode 100644 qutebrowser/autoconfig.yml create mode 100644 qutebrowser/config.py create mode 100644 qutebrowser/quickmarks create mode 100644 shell/aliasrc create mode 100644 shell/bm-dirs create mode 100644 shell/bm-files create mode 100644 shell/inputrc create mode 100644 shell/profile create mode 100644 shell/shortcutenvrc create mode 100644 shell/shortcutrc create mode 100644 shell/zshnameddirrc create mode 100644 zsh/.zshrc diff --git a/.gitignore b/.gitignore index a07efcd..8e696cd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,13 +1,31 @@ -/* +* !.gitignore +!lf/ !lf/icons !lf/lfrc !lf/scope !lf/shortcutrc -!newsboat/* -!shell/* -!zsh/* -!zsh/.* + +!newsboat/ +!newsboat/config +!newsboat/urls + +!shell/ +!shell/aliasrc +!shell/bm-dirs +!shell/bm-files +!shell/inputrc +!shell/profile +!shell/shortcutenvrc +!shell/shortcutrc +!shell/zshnameddirrc + +!zsh/ +!zsh/.zshrc + +!qutebrowser/ !qutebrowser/config.py +!qutebrowser/autoconfig.yml +!qutebrowser/quickmarks diff --git a/newsboat/config b/newsboat/config new file mode 100644 index 0000000..a27ab0a --- /dev/null +++ b/newsboat/config @@ -0,0 +1,54 @@ +#show-read-feeds no +auto-reload yes + +external-url-viewer "urlscan -dc -r 'linkhandler {}'" + +bind-key j down +bind-key k up +bind-key j next articlelist +bind-key k prev articlelist +bind-key J next-feed articlelist +bind-key K prev-feed articlelist +bind-key G end +bind-key g home +bind-key d pagedown +bind-key u pageup +bind-key l open +bind-key h quit +bind-key a toggle-article-read +bind-key n next-unread +bind-key N prev-unread +bind-key D pb-download +bind-key U show-urls +bind-key x pb-delete + +color listnormal white default +color listfocus blue black standout bold +color listnormal_unread red default +color listfocus_unread magenta red standout bold +color info red black bold +color article white default bold + +browser linkhandler +macro , open-in-browser +macro t set browser "qndl" ; open-in-browser ; set browser linkhandler +macro a set browser "tsp yt-dlp --embed-metadata -xic -f bestaudio/best" ; open-in-browser ; set browser linkhandler +macro v set browser "setsid -f mpv" ; open-in-browser ; set browser linkhandler +macro w set browser "lynx" ; open-in-browser ; set browser linkhandler +macro d set browser "dmenuhandler" ; open-in-browser ; set browser linkhandler +macro c set browser "echo %u | xclip -r -sel c" ; open-in-browser ; set browser linkhandler +macro C set browser "youtube-viewer --comments=%u" ; open-in-browser ; set browser linkhandler +macro p set browser "mpv --vid=no --" ; one ; set browser linkhandler + +highlight all "---.*---" yellow +highlight feedlist ".*(0/0))" black +highlight article "(^Feed:.*|^Title:.*|^Author:.*)" cyan default bold +highlight article "(^Link:.*|^Date:.*)" default default +highlight article "https?://[^ ]+" green default +highlight article "^(Title):.*$" blue default +highlight article "\\[[0-9][0-9]*\\]" magenta default bold +highlight article "\\[image\\ [0-9]+\\]" green default bold +highlight article "\\[embedded flash: [0-9][0-9]*\\]" green default bold +highlight article ":.*\\(link\\)$" cyan default +highlight article ":.*\\(image\\)$" blue default +highlight article ":.*\\(embedded flash\\)$" magenta default diff --git a/newsboat/urls b/newsboat/urls new file mode 100644 index 0000000..28fd4bc --- /dev/null +++ b/newsboat/urls @@ -0,0 +1,29 @@ +https://gahlorddewald.com/rss2023a.xml "social" +https://restofworld.org/feed/latest "news" +https://www.democracynow.org/democracynow.rss "news" +https://therealnews.com/feed?partner-feed=the-real-news-network "news" +https://jacobin.com/feed/ "news" +https://newmusicusa.org/feed/ "news" +https://www.dissentmagazine.org/feed "news" +https://www.currentaffairs.org/feed "news" +https://feeds.feedburner.com/Posts-Jamhoor "news" +https://www.democracynow.org/podcast.xml "podcast" +https://nowandxen.libsyn.com/rss "podcast" +https://anchor.fm/s/e90b5574/podcast/rss "podcast +https://www.spreaker.com/show/5634537/episodes/feed "podcast" +https://feeds.transistor.fm/nymphet-alumni "podcast" +https://www.patreon.com/rss/cumtownRSS?auth=Sk3CTXwaTx0Aw_bT2PxSmYnN-st3sdxB "~CTown" "podcast" +https://pod.link/1097417804.rss "podcast" +https://feeds.soundcloud.com/users/soundcloud:users:55959949/sounds.rss "podcast" +https://anchor.fm/s/22c679fc/podcast/rss "podcast" +https://feeds.libsyn.com/102225/rss "podcast" +https://notrelated.xyz/rss "podcast" +https://videos.lukesmith.xyz/feeds/videos.xml?sort=-publishedAt&isLocal=true +https://based.cooking/index.xml "websites" +https://puredata.info/news/RSS "~pure data" "repos" +https://supercollider.github.io/feed.xml "~supercollider" "repos" +https://git.savannah.gnu.org/gitweb/?p=lilypond.git;a=rss "~lilypond" "repos" +https://git.iem.at/audioplugins/IEMPluginSuite.atom "~IEM" "repos" +https://artixlinux.org/feed.php "~artix linux" "repos" +https://www.archlinux.org/feeds/news/ "~arch linux" "repos" +https://www.patreon.com/rss/LooseLeafTransmissions?auth=rt2X-Q166sPLCoFu0oWBFCRIhH1V9DyU&show=866995 "podcast" diff --git a/qutebrowser/autoconfig.yml b/qutebrowser/autoconfig.yml new file mode 100644 index 0000000..e7f4f5c --- /dev/null +++ b/qutebrowser/autoconfig.yml @@ -0,0 +1,16 @@ +# If a config.py file exists, this file is ignored unless it's explicitly loaded +# via config.load_autoconfig(). For more information, see: +# https://github.com/qutebrowser/qutebrowser/blob/main/doc/help/configuring.asciidoc#loading-autoconfigyml +# DO NOT edit this file by hand, qutebrowser will overwrite it. +# Instead, create a config.py - see :help for details. + +config_version: 2 +settings: + bindings.commands: + global: + normal: + M: hint links spawn mpv {hint-url} + completion.cmd_history_max_items: + global: 0 + content.register_protocol_handler: + https://mail.google.com?extsrc=mailto&url=%25s: false diff --git a/qutebrowser/config.py b/qutebrowser/config.py new file mode 100644 index 0000000..da1b4d3 --- /dev/null +++ b/qutebrowser/config.py @@ -0,0 +1,400 @@ +# pylint: disable=C0111 +c = c # noqa: F821 pylint: disable=E0602,C0103 +config = config # noqa: F821 pylint: disable=E0602,C0103 +# pylint settings included to disable linting errors + +c.tabs.title.format = "{audio}{current_title}" +c.fonts.web.size.default = 15 +c.url.start_pages = ['https://newer.systems'] + +c.url.searchengines = { +# note - if you use duckduckgo, you can make use of its built in bangs, of which there are many! https://duckduckgo.com/bangs + 'DEFAULT': 'https://duckduckgo.com/?q={}', + '!aw': 'https://wiki.archlinux.org/?search={}', + '!apkg': 'https://archlinux.org/packages/?sort=&q={}&maintainer=&flagged=', + '!gh': 'https://github.com/search?o=desc&q={}&s=stars', + } + +c.completion.open_categories = ['searchengines', 'quickmarks', 'bookmarks', 'history', 'filesystem'] + +config.load_autoconfig() # load settings done via the gui + +c.auto_save.session = False # save tabs on quit/restart + +# c.content.user_stylesheets = ["~/.config/qutebrowser/styles/youtube-tweaks.css"] +c.tabs.indicator.width = 0 # no tab indicators +# c.window.transparent = True # apparently not needed +c.tabs.width = '7%' + +# privacy - adjust these settings based on your preference +# config.set("completion.cmd_history_max_items", 0) +# config.set("content.private_browsing", True) +config.set("content.webgl", False, "*") +config.set("content.canvas_reading", False) +config.set("content.geolocation", False) +config.set("content.webrtc_ip_handling_policy", "default-public-interface-only") +config.set("content.cookies.accept", "all") +config.set("content.cookies.store", True) +# config.set("content.javascript.enabled", False) # tsh keybind to toggle + +# Adblocking info --> +# For yt ads: place the greasemonkey script yt-ads.js in your greasemonkey folder (~/.config/qutebrowser/greasemonkey). +# The script skips through the entire ad, so all you have to do is click the skip button. +# Yeah it's not ublock origin, but if you want a minimal browser, this is a solution for the tradeoff. +# You can also watch yt vids directly in mpv, see qutebrowser FAQ for how to do that. +# If you want additional blocklists, you can get the python-adblock package, or you can uncomment the ublock lists here. +c.content.autoplay = True +c.content.blocking.enabled = False +c.content.blocking.method = 'adblock' # uncomment this if you install python-adblock +c.content.blocking.adblock.lists = [ + "https://github.com/ewpratten/youtube_ad_blocklist/blob/master/blocklist.txt", + "https://github.com/uBlockOrigin/uAssets/raw/master/filters/legacy.txt", + "https://github.com/uBlockOrigin/uAssets/raw/master/filters/filters.txt", + "https://github.com/uBlockOrigin/uAssets/raw/master/filters/filters-2020.txt", + "https://github.com/uBlockOrigin/uAssets/raw/master/filters/filters-2021.txt", + "https://github.com/uBlockOrigin/uAssets/raw/master/filters/filters-2022.txt", + "https://github.com/uBlockOrigin/uAssets/raw/master/filters/filters-2023.txt", + "https://github.com/uBlockOrigin/uAssets/raw/master/filters/filters-2024.txt", + "https://github.com/uBlockOrigin/uAssets/raw/master/filters/badware.txt", + "https://github.com/uBlockOrigin/uAssets/raw/master/filters/privacy.txt", + "https://github.com/uBlockOrigin/uAssets/raw/master/filters/badlists.txt", + "https://github.com/uBlockOrigin/uAssets/raw/master/filters/annoyances.txt", + "https://github.com/uBlockOrigin/uAssets/raw/master/filters/annoyances-cookies.txt", + "https://github.com/uBlockOrigin/uAssets/raw/master/filters/annoyances-others.txt", + "https://github.com/uBlockOrigin/uAssets/raw/master/filters/badlists.txt", + "https://github.com/uBlockOrigin/uAssets/raw/master/filters/quick-fixes.txt", + "https://github.com/uBlockOrigin/uAssets/raw/master/filters/resource-abuse.txt", + "https://github.com/uBlockOrigin/uAssets/raw/master/filters/unbreak.txt"] + +# gruvbox dark hard qutebrowser theme by Florian Bruhin +# +# Originally based on: +# base16-qutebrowser (https://github.com/theova/base16-qutebrowser) +# Base16 qutebrowser template by theova and Daniel Mulford +# Gruvbox dark, hard scheme by Dawid Kurek (dawikur@gmail.com), morhetz (https://github.com/morhetz/gruvbox) + +bg0_hard = "#1d2021" +bg0_soft = '#32302f' +bg0_normal = '#282828' + +bg0 = bg0_normal +bg1 = "#3c3836" +bg2 = "#504945" +bg3 = "#665c54" +bg4 = "#7c6f64" + +fg0 = "#fbf1c7" +fg1 = "#ebdbb2" +fg2 = "#d5c4a1" +fg3 = "#bdae93" +fg4 = "#a89984" + +bright_red = "#fb4934" +bright_green = "#b8bb26" +bright_yellow = "#fabd2f" +bright_blue = "#83a598" +bright_purple = "#d3869b" +bright_aqua = "#8ec07c" +bright_gray = "#928374" +bright_orange = "#fe8019" + +dark_red = "#cc241d" +dark_green = "#98971a" +dark_yellow = "#d79921" +dark_blue = "#458588" +dark_purple = "#b16286" +dark_aqua = "#689d6a" +dark_gray = "#a89984" +dark_orange = "#d65d0e" + +### Completion + +# Text color of the completion widget. May be a single color to use for +# all columns or a list of three colors, one for each column. +c.colors.completion.fg = [fg1, bright_aqua, bright_yellow] + +# Background color of the completion widget for odd rows. +c.colors.completion.odd.bg = bg0 + +# Background color of the completion widget for even rows. +c.colors.completion.even.bg = c.colors.completion.odd.bg + +# Foreground color of completion widget category headers. +c.colors.completion.category.fg = bright_blue + +# Background color of the completion widget category headers. +c.colors.completion.category.bg = bg1 + +# Top border color of the completion widget category headers. +c.colors.completion.category.border.top = c.colors.completion.category.bg + +# Bottom border color of the completion widget category headers. +c.colors.completion.category.border.bottom = c.colors.completion.category.bg + +# Foreground color of the selected completion item. +c.colors.completion.item.selected.fg = fg0 + +# Background color of the selected completion item. +c.colors.completion.item.selected.bg = bg4 + +# Top border color of the selected completion item. +c.colors.completion.item.selected.border.top = bg2 + +# Bottom border color of the selected completion item. +c.colors.completion.item.selected.border.bottom = c.colors.completion.item.selected.border.top + +# Foreground color of the matched text in the selected completion item. +c.colors.completion.item.selected.match.fg = bright_orange + +# Foreground color of the matched text in the completion. +c.colors.completion.match.fg = c.colors.completion.item.selected.match.fg + +# Color of the scrollbar handle in the completion view. +c.colors.completion.scrollbar.fg = c.colors.completion.item.selected.fg + +# Color of the scrollbar in the completion view. +c.colors.completion.scrollbar.bg = c.colors.completion.category.bg + +### Context menu + +# Background color of disabled items in the context menu. +c.colors.contextmenu.disabled.bg = bg3 + +# Foreground color of disabled items in the context menu. +c.colors.contextmenu.disabled.fg = fg3 + +# Background color of the context menu. If set to null, the Qt default is used. +c.colors.contextmenu.menu.bg = bg0 + +# Foreground color of the context menu. If set to null, the Qt default is used. +c.colors.contextmenu.menu.fg = fg2 + +# Background color of the context menu’s selected item. If set to null, the Qt default is used. +c.colors.contextmenu.selected.bg = bg2 + +#Foreground color of the context menu’s selected item. If set to null, the Qt default is used. +c.colors.contextmenu.selected.fg = c.colors.contextmenu.menu.fg + +### Downloads + +# Background color for the download bar. +c.colors.downloads.bar.bg = bg0 + +# Color gradient start for download text. +c.colors.downloads.start.fg = bg0 + +# Color gradient start for download backgrounds. +c.colors.downloads.start.bg = bright_blue + +# Color gradient end for download text. +c.colors.downloads.stop.fg = c.colors.downloads.start.fg + +# Color gradient stop for download backgrounds. +c.colors.downloads.stop.bg = bright_aqua + +# Foreground color for downloads with errors. +c.colors.downloads.error.fg = bright_red + +### Hints + +# Font color for hints. +c.colors.hints.fg = bg0 + +# Background color for hints. +c.colors.hints.bg = 'rgba(250, 191, 47, 200)' # bright_yellow + +# Font color for the matched part of hints. +c.colors.hints.match.fg = bg4 + +### Keyhint widget + +# Text color for the keyhint widget. +c.colors.keyhint.fg = fg4 + +# Highlight color for keys to complete the current keychain. +c.colors.keyhint.suffix.fg = fg0 + +# Background color of the keyhint widget. +c.colors.keyhint.bg = bg0 + +### Messages + +# Foreground color of an error message. +c.colors.messages.error.fg = bg0 + +# Background color of an error message. +c.colors.messages.error.bg = bright_red + +# Border color of an error message. +c.colors.messages.error.border = c.colors.messages.error.bg + +# Foreground color of a warning message. +c.colors.messages.warning.fg = bg0 + +# Background color of a warning message. +c.colors.messages.warning.bg = bright_purple + +# Border color of a warning message. +c.colors.messages.warning.border = c.colors.messages.warning.bg + +# Foreground color of an info message. +c.colors.messages.info.fg = fg2 + +# Background color of an info message. +c.colors.messages.info.bg = bg0 + +# Border color of an info message. +c.colors.messages.info.border = c.colors.messages.info.bg + +### Prompts + +# Foreground color for prompts. +c.colors.prompts.fg = fg2 + +# Border used around UI elements in prompts. +c.colors.prompts.border = f'1px solid {bg1}' + +# Background color for prompts. +c.colors.prompts.bg = bg3 + +# Background color for the selected item in filename prompts. +c.colors.prompts.selected.bg = bg2 + +### Statusbar + +# Foreground color of the statusbar. +c.colors.statusbar.normal.fg = fg2 + +# Background color of the statusbar. +c.colors.statusbar.normal.bg = bg0 + +# Foreground color of the statusbar in insert mode. +c.colors.statusbar.insert.fg = bg0 + +# Background color of the statusbar in insert mode. +c.colors.statusbar.insert.bg = dark_aqua + +# Foreground color of the statusbar in passthrough mode. +c.colors.statusbar.passthrough.fg = bg0 + +# Background color of the statusbar in passthrough mode. +c.colors.statusbar.passthrough.bg = dark_blue + +# Foreground color of the statusbar in private browsing mode. +c.colors.statusbar.private.fg = bright_purple + +# Background color of the statusbar in private browsing mode. +c.colors.statusbar.private.bg = bg0 + +# Foreground color of the statusbar in command mode. +c.colors.statusbar.command.fg = fg3 + +# Background color of the statusbar in command mode. +c.colors.statusbar.command.bg = bg1 + +# Foreground color of the statusbar in private browsing + command mode. +c.colors.statusbar.command.private.fg = c.colors.statusbar.private.fg + +# Background color of the statusbar in private browsing + command mode. +c.colors.statusbar.command.private.bg = c.colors.statusbar.command.bg + +# Foreground color of the statusbar in caret mode. +c.colors.statusbar.caret.fg = bg0 + +# Background color of the statusbar in caret mode. +c.colors.statusbar.caret.bg = dark_purple + +# Foreground color of the statusbar in caret mode with a selection. +c.colors.statusbar.caret.selection.fg = c.colors.statusbar.caret.fg + +# Background color of the statusbar in caret mode with a selection. +c.colors.statusbar.caret.selection.bg = bright_purple + +# Background color of the progress bar. +c.colors.statusbar.progress.bg = bright_blue + +# Default foreground color of the URL in the statusbar. +c.colors.statusbar.url.fg = fg4 + +# Foreground color of the URL in the statusbar on error. +c.colors.statusbar.url.error.fg = dark_red + +# Foreground color of the URL in the statusbar for hovered links. +c.colors.statusbar.url.hover.fg = bright_orange + +# Foreground color of the URL in the statusbar on successful load +# (http). +c.colors.statusbar.url.success.http.fg = bright_red + +# Foreground color of the URL in the statusbar on successful load +# (https). +c.colors.statusbar.url.success.https.fg = fg0 + +# Foreground color of the URL in the statusbar when there's a warning. +c.colors.statusbar.url.warn.fg = bright_purple + +### tabs + +# Background color of the tab bar. +c.colors.tabs.bar.bg = bg0 + +# Color gradient start for the tab indicator. +c.colors.tabs.indicator.start = bright_blue + +# Color gradient end for the tab indicator. +c.colors.tabs.indicator.stop = bright_aqua + +# Color for the tab indicator on errors. +c.colors.tabs.indicator.error = bright_red + +# Foreground color of unselected odd tabs. +c.colors.tabs.odd.fg = fg2 + +# Background color of unselected odd tabs. +c.colors.tabs.odd.bg = bg2 + +# Foreground color of unselected even tabs. +c.colors.tabs.even.fg = c.colors.tabs.odd.fg + +# Background color of unselected even tabs. +c.colors.tabs.even.bg = bg3 + +# Foreground color of selected odd tabs. +c.colors.tabs.selected.odd.fg = fg2 + +# Background color of selected odd tabs. +c.colors.tabs.selected.odd.bg = bg0 + +# Foreground color of selected even tabs. +c.colors.tabs.selected.even.fg = c.colors.tabs.selected.odd.fg + +# Background color of selected even tabs. +c.colors.tabs.selected.even.bg = bg0 + +# Background color of pinned unselected even tabs. +c.colors.tabs.pinned.even.bg = bright_green + +# Foreground color of pinned unselected even tabs. +c.colors.tabs.pinned.even.fg = bg2 + +# Background color of pinned unselected odd tabs. +c.colors.tabs.pinned.odd.bg = bright_green + +# Foreground color of pinned unselected odd tabs. +c.colors.tabs.pinned.odd.fg = c.colors.tabs.pinned.even.fg + +# Background color of pinned selected even tabs. +c.colors.tabs.pinned.selected.even.bg = bg0 + +# Foreground color of pinned selected even tabs. +c.colors.tabs.pinned.selected.even.fg = c.colors.tabs.selected.odd.fg + +# Background color of pinned selected odd tabs. +c.colors.tabs.pinned.selected.odd.bg = c.colors.tabs.pinned.selected.even.bg + +# Foreground color of pinned selected odd tabs. +c.colors.tabs.pinned.selected.odd.fg = c.colors.tabs.selected.odd.fg + +# Background color for webpages if unset (or empty to use the theme's +# color). +# c.colors.webpage.bg = bg4 diff --git a/qutebrowser/quickmarks b/qutebrowser/quickmarks new file mode 100644 index 0000000..e69de29 diff --git a/shell/aliasrc b/shell/aliasrc new file mode 100644 index 0000000..463e74b --- /dev/null +++ b/shell/aliasrc @@ -0,0 +1,49 @@ +#!/bin/sh + +# Use neovim for vim if present. +[ -x "$(command -v nvim)" ] && alias vim="nvim" vimdiff="nvim -d" + +# Use $XINITRC variable if file exists. +[ -f "$XINITRC" ] && alias startx="startx $XINITRC" + +[ -f "$MBSYNCRC" ] && alias mbsync="mbsync -c $MBSYNCRC" + +# sudo not required for some system commands +for command in mount umount sv pacman updatedb su shutdown poweroff reboot ; do + alias $command="sudo $command" +done; unset command + +se() { + choice="$(find ~/.local/bin -mindepth 1 -printf '%P\n' | fzf)" + [ -f "$HOME/.local/bin/$choice" ] && $EDITOR "$HOME/.local/bin/$choice" + } + +# Verbosity and settings that you pretty much just always are going to want. +alias \ + cp="cp -iv" \ + mv="mv -iv" \ + rm="rm -vI" \ + bc="bc -ql" \ + rsync="rsync -vrPlu" \ + mkd="mkdir -pv" \ + yt="yt-dlp --embed-metadata -i" \ + yta="yt -x -f bestaudio/best" \ + ytt="yt --skip-download --write-thumbnail" \ + ffmpeg="ffmpeg -hide_banner" + +# Colorize commands when possible. +alias \ + ls="ls -hN --color=auto --group-directories-first" \ + grep="grep --color=auto" \ + diff="diff --color=auto" \ + ccat="highlight --out-format=ansi" \ + ip="ip -color=auto" + +# These common commands are just too long! Abbreviate them. +alias \ + z="zathura" + +alias \ + magit="nvim -c MagitOnly" \ + ref="shortcuts >/dev/null; source ${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc ; source ${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutenvrc ; source ${XDG_CONFIG_HOME:-$HOME/.config}/shell/zshnameddirrc" \ + calendar="remind -c6wtm $CALENDAR | less" diff --git a/shell/bm-dirs b/shell/bm-dirs new file mode 100644 index 0000000..9d212ec --- /dev/null +++ b/shell/bm-dirs @@ -0,0 +1,14 @@ +# You can add comments to these files with # +cac ${XDG_CACHE_HOME:-$HOME/.cache} +cf ${XDG_CONFIG_HOME:-$HOME/.config} +D ${XDG_DOWNLOAD_DIR:-$HOME/Downloads} +d ${XDG_DOCUMENTS_DIR:-$HOME/Documents} +dt ${XDG_DATA_HOME:-$HOME/.local/share} +rr $HOME/.local/src +h $HOME +m ${XDG_MUSIC_DIR:-$HOME/Music} +mn /mnt +pp ${XDG_PICTURES_DIR:-$HOME/Pictures} +sc $HOME/.local/bin +src $HOME/.local/src +vv ${XDG_VIDEOS_DIR:-$HOME/Videos} diff --git a/shell/bm-files b/shell/bm-files new file mode 100644 index 0000000..2e8864b --- /dev/null +++ b/shell/bm-files @@ -0,0 +1,23 @@ +# These files automatically update when edited/saved in vim: + +# keys filename description +bf ${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-files # This file, a list of bookmarked files +bd ${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-dirs # A list of bookmarked directories similar to this file +cfx ${XDG_CONFIG_HOME:-$HOME/.config}/x11/xresources # Colors, themes and variables for X11 +cfb ~/.local/src/dwmblocks/config.h # dwmblocks: the status bar for dwm + + +# These do not update automatically, but on the next new instance of a program: + +cfv ${XDG_CONFIG_HOME:-$HOME/.config}/nvim/init.vim # vim/neovim config +cfz $ZDOTDIR/.zshrc # zsh (shell) config +cfa ${XDG_CONFIG_HOME:-$HOME/.config}/shell/aliasrc # aliases used by zsh (and potentially other shells) +cfp ${XDG_CONFIG_HOME:-$HOME/.config}/shell/profile # profile file for login settings for zsh +cfm ${XDG_CONFIG_HOME:-$HOME/.config}/mutt/muttrc # mutt (email client) config +cfn ${XDG_CONFIG_HOME:-$HOME/.config}/newsboat/config # newsboat (RSS reader) +cfu ${XDG_CONFIG_HOME:-$HOME/.config}/newsboat/urls # RSS urls for newsboat +cfmb ${XDG_CONFIG_HOME:-$HOME/.config}/ncmpcpp/bindings # ncmpcpp (music player) keybinds file +cfmc ${XDG_CONFIG_HOME:-$HOME/.config}/ncmpcpp/config # ncmpcpp (music player) config +cfl ${XDG_CONFIG_HOME:-$HOME/.config}/lf/lfrc # lf (file browser) config +cfL ${XDG_CONFIG_HOME:-$HOME/.config}/lf/scope # lf's scope/preview file +cfX ${XDG_CONFIG_HOME:-$HOME/.config}/nsxiv/exec/key-handler # nsxiv (image viewer) key/script handler diff --git a/shell/inputrc b/shell/inputrc new file mode 100644 index 0000000..f9b94dd --- /dev/null +++ b/shell/inputrc @@ -0,0 +1,19 @@ +$include /etc/inputrc +set editing-mode vi +$if mode=vi + +set show-mode-in-prompt on +set vi-ins-mode-string \1\e[6 q\2 +set vi-cmd-mode-string \1\e[2 q\2 + +set keymap vi-command +# these are for vi-command mode +Control-l: clear-screen +Control-a: beginning-of-line + +set keymap vi-insert +# these are for vi-insert mode +Control-l: clear-screen +Control-a: beginning-of-line + +$endif diff --git a/shell/profile b/shell/profile new file mode 100644 index 0000000..3dce588 --- /dev/null +++ b/shell/profile @@ -0,0 +1,77 @@ +#!/bin/sh +# shellcheck disable=SC2155 + +# Profile file, runs on login. Environmental variables are set here. + +# Add all directories in `~/.local/bin` to $PATH +export PATH="$PATH:$(find ~/.local/bin -type d | paste -sd ':' -)" + +unsetopt PROMPT_SP 2>/dev/null + +# Default programs: +export EDITOR="nvim" +export TERMINAL="st" +export TERMINAL_PROG="st" +export BROWSER="qutebrowser" + +# General +export CALENDAR="$HOME/Notes/calendar.rem" +export TODO="$HOME/Notes/todo.md" + +# Change the default crypto/weather monitor sites. +# export CRYPTOURL="rate.sx" +# export WTTRURL="wttr.in" + +# ~/ Clean-up: +export XDG_CONFIG_HOME="$HOME/.config" +export XDG_DATA_HOME="$HOME/.local/share" +export XDG_CACHE_HOME="$HOME/.cache" +export XINITRC="$XDG_CONFIG_HOME/x11/xinitrc" +#export XAUTHORITY="$XDG_RUNTIME_DIR/Xauthority" # This line will break some DMs. +export NOTMUCH_CONFIG="$XDG_CONFIG_HOME/notmuch-config" +export GTK2_RC_FILES="$XDG_CONFIG_HOME/gtk-2.0/gtkrc-2.0" +export WGETRC="$XDG_CONFIG_HOME/wget/wgetrc" +export INPUTRC="$XDG_CONFIG_HOME/shell/inputrc" +export ZDOTDIR="$XDG_CONFIG_HOME/zsh" +#export GNUPGHOME="$XDG_DATA_HOME/gnupg" +export WINEPREFIX="$XDG_DATA_HOME/wineprefixes/default" +export KODI_DATA="$XDG_DATA_HOME/kodi" +export PASSWORD_STORE_DIR="$XDG_DATA_HOME/password-store" +export TMUX_TMPDIR="$XDG_RUNTIME_DIR" +export ANDROID_SDK_HOME="$XDG_CONFIG_HOME/android" +export CARGO_HOME="$XDG_DATA_HOME/cargo" +export GOPATH="$XDG_DATA_HOME/go" +export GOMODCACHE="$XDG_CACHE_HOME/go/mod" +export ANSIBLE_CONFIG="$XDG_CONFIG_HOME/ansible/ansible.cfg" +export UNISON="$XDG_DATA_HOME/unison" +export HISTFILE="$XDG_DATA_HOME/history" +export MBSYNCRC="$XDG_CONFIG_HOME/mbsync/config" +export ELECTRUMDIR="$XDG_DATA_HOME/electrum" +export PYTHONSTARTUP="$XDG_CONFIG_HOME/python/pythonrc" +export SQLITE_HISTORY="$XDG_DATA_HOME/sqlite_history" + +# Other program settings: +export DICS="/usr/share/stardict/dic/" +export SUDO_ASKPASS="$HOME/.local/bin/dmenupass" +export FZF_DEFAULT_OPTS="--layout=reverse --height 40%" +export LESS="R" +export LESS_TERMCAP_mb="$(printf '%b' '')" +export LESS_TERMCAP_md="$(printf '%b' '')" +export LESS_TERMCAP_me="$(printf '%b' '')" +export LESS_TERMCAP_so="$(printf '%b' '')" +export LESS_TERMCAP_se="$(printf '%b' '')" +export LESS_TERMCAP_us="$(printf '%b' '')" +export LESS_TERMCAP_ue="$(printf '%b' '')" +export LESSOPEN="| /usr/bin/highlight -O ansi %s 2>/dev/null" +export QT_QPA_PLATFORMTHEME="gtk2" # Have QT use gtk2 theme. +export MOZ_USE_XINPUT2=1 # Mozilla smooth scrolling/touchpads. +export AWT_TOOLKIT="MToolkit wmname LG3D" # May have to install wmname +export _JAVA_AWT_WM_NONREPARENTING=1 # Fix for Java applications in dwm + +[ ! -f "$XDG_CONFIG_HOME/shell/shortcutrc" ] && setsid -f shortcuts >/dev/null 2>&1 + +# Start graphical server on user's current tty if not already running. +[ "$(tty)" = "/dev/tty1" ] && ! pidof -s Xorg >/dev/null 2>&1 && exec startx "$XINITRC" + +# Switch escape and caps if tty and no passwd required: +sudo -n loadkeys "$XDG_DATA_HOME/larbs/ttymaps.kmap" 2>/dev/null diff --git a/shell/shortcutenvrc b/shell/shortcutenvrc new file mode 100644 index 0000000..07d003c --- /dev/null +++ b/shell/shortcutenvrc @@ -0,0 +1,30 @@ +# vim: filetype=sh +[ -n "cac" ] && export cac="/home/tuckerj/.cache" +[ -n "cf" ] && export cf="/home/tuckerj/.config" +[ -n "D" ] && export D="/home/tuckerj/Downloads" +[ -n "d" ] && export d="/home/tuckerj/Documents" +[ -n "dt" ] && export dt="/home/tuckerj/.local/share" +[ -n "rr" ] && export rr="/home/tuckerj/.local/src" +[ -n "h" ] && export h="/home/tuckerj" +[ -n "m" ] && export m="/home/tuckerj/Music" +[ -n "mn" ] && export mn="/mnt" +[ -n "pp" ] && export pp="/home/tuckerj/Pictures" +[ -n "sc" ] && export sc="/home/tuckerj/.local/bin" +[ -n "src" ] && export src="/home/tuckerj/.local/src" +[ -n "vv" ] && export vv="/home/tuckerj/Videos" +[ -n "bf" ] && export bf="/home/tuckerj/.config/shell/bm-files" +[ -n "bd" ] && export bd="/home/tuckerj/.config/shell/bm-dirs" +[ -n "cfx" ] && export cfx="/home/tuckerj/.config/x11/xresources" +[ -n "cfb" ] && export cfb="~/.local/src/dwmblocks/config.h" +[ -n "cfv" ] && export cfv="/home/tuckerj/.config/nvim/init.vim" +[ -n "cfz" ] && export cfz="/home/tuckerj/.config/zsh/.zshrc" +[ -n "cfa" ] && export cfa="/home/tuckerj/.config/shell/aliasrc" +[ -n "cfp" ] && export cfp="/home/tuckerj/.config/shell/profile" +[ -n "cfm" ] && export cfm="/home/tuckerj/.config/mutt/muttrc" +[ -n "cfn" ] && export cfn="/home/tuckerj/.config/newsboat/config" +[ -n "cfu" ] && export cfu="/home/tuckerj/.config/newsboat/urls" +[ -n "cfmb" ] && export cfmb="/home/tuckerj/.config/ncmpcpp/bindings" +[ -n "cfmc" ] && export cfmc="/home/tuckerj/.config/ncmpcpp/config" +[ -n "cfl" ] && export cfl="/home/tuckerj/.config/lf/lfrc" +[ -n "cfL" ] && export cfL="/home/tuckerj/.config/lf/scope" +[ -n "cfX" ] && export cfX="/home/tuckerj/.config/nsxiv/exec/key-handler" diff --git a/shell/shortcutrc b/shell/shortcutrc new file mode 100644 index 0000000..a2cb240 --- /dev/null +++ b/shell/shortcutrc @@ -0,0 +1,30 @@ +# vim: filetype=sh +alias cac="cd /home/tuckerj/.cache && ls -A" \ +cf="cd /home/tuckerj/.config && ls -A" \ +D="cd /home/tuckerj/Downloads && ls -A" \ +d="cd /home/tuckerj/Documents && ls -A" \ +dt="cd /home/tuckerj/.local/share && ls -A" \ +rr="cd /home/tuckerj/.local/src && ls -A" \ +h="cd /home/tuckerj && ls -A" \ +m="cd /home/tuckerj/Music && ls -A" \ +mn="cd /mnt && ls -A" \ +pp="cd /home/tuckerj/Pictures && ls -A" \ +sc="cd /home/tuckerj/.local/bin && ls -A" \ +src="cd /home/tuckerj/.local/src && ls -A" \ +vv="cd /home/tuckerj/Videos && ls -A" \ +bf="$EDITOR /home/tuckerj/.config/shell/bm-files" \ +bd="$EDITOR /home/tuckerj/.config/shell/bm-dirs" \ +cfx="$EDITOR /home/tuckerj/.config/x11/xresources" \ +cfb="$EDITOR ~/.local/src/dwmblocks/config.h" \ +cfv="$EDITOR /home/tuckerj/.config/nvim/init.vim" \ +cfz="$EDITOR /home/tuckerj/.config/zsh/.zshrc" \ +cfa="$EDITOR /home/tuckerj/.config/shell/aliasrc" \ +cfp="$EDITOR /home/tuckerj/.config/shell/profile" \ +cfm="$EDITOR /home/tuckerj/.config/mutt/muttrc" \ +cfn="$EDITOR /home/tuckerj/.config/newsboat/config" \ +cfu="$EDITOR /home/tuckerj/.config/newsboat/urls" \ +cfmb="$EDITOR /home/tuckerj/.config/ncmpcpp/bindings" \ +cfmc="$EDITOR /home/tuckerj/.config/ncmpcpp/config" \ +cfl="$EDITOR /home/tuckerj/.config/lf/lfrc" \ +cfL="$EDITOR /home/tuckerj/.config/lf/scope" \ +cfX="$EDITOR /home/tuckerj/.config/nsxiv/exec/key-handler" \ diff --git a/shell/zshnameddirrc b/shell/zshnameddirrc new file mode 100644 index 0000000..84b38fc --- /dev/null +++ b/shell/zshnameddirrc @@ -0,0 +1,29 @@ +hash -d cac=/home/tuckerj/.cache +hash -d cf=/home/tuckerj/.config +hash -d D=/home/tuckerj/Downloads +hash -d d=/home/tuckerj/Documents +hash -d dt=/home/tuckerj/.local/share +hash -d rr=/home/tuckerj/.local/src +hash -d h=/home/tuckerj +hash -d m=/home/tuckerj/Music +hash -d mn=/mnt +hash -d pp=/home/tuckerj/Pictures +hash -d sc=/home/tuckerj/.local/bin +hash -d src=/home/tuckerj/.local/src +hash -d vv=/home/tuckerj/Videos +hash -d bf=/home/tuckerj/.config/shell/bm-files +hash -d bd=/home/tuckerj/.config/shell/bm-dirs +hash -d cfx=/home/tuckerj/.config/x11/xresources +hash -d cfb=~/.local/src/dwmblocks/config.h +hash -d cfv=/home/tuckerj/.config/nvim/init.vim +hash -d cfz=/home/tuckerj/.config/zsh/.zshrc +hash -d cfa=/home/tuckerj/.config/shell/aliasrc +hash -d cfp=/home/tuckerj/.config/shell/profile +hash -d cfm=/home/tuckerj/.config/mutt/muttrc +hash -d cfn=/home/tuckerj/.config/newsboat/config +hash -d cfu=/home/tuckerj/.config/newsboat/urls +hash -d cfmb=/home/tuckerj/.config/ncmpcpp/bindings +hash -d cfmc=/home/tuckerj/.config/ncmpcpp/config +hash -d cfl=/home/tuckerj/.config/lf/lfrc +hash -d cfL=/home/tuckerj/.config/lf/scope +hash -d cfX=/home/tuckerj/.config/nsxiv/exec/key-handler diff --git a/zsh/.zshrc b/zsh/.zshrc new file mode 100644 index 0000000..d299916 --- /dev/null +++ b/zsh/.zshrc @@ -0,0 +1,78 @@ +# Enable colors and change prompt: +autoload -U colors && colors # Load colors +PS1="%B%{$fg[grey]%}[%{$fg[yellow]%}%n%{$fg[green]%}@%{$fg[blue]%}%M %{$fg[magenta]%}%~%{$fg[grey]%}]%{$reset_color%}$%b " +setopt autocd # Automatically cd into typed directory. +stty stop undef # Disable ctrl-s to freeze terminal. +setopt interactive_comments + +# History in cache directory: +HISTSIZE=10000000 +SAVEHIST=10000000 +HISTFILE="${XDG_CACHE_HOME:-$HOME/.cache}/zsh/history" + +# Load aliases and shortcuts if existent. +[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc" ] && source "${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc" +[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/aliasrc" ] && source "${XDG_CONFIG_HOME:-$HOME/.config}/shell/aliasrc" +[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/zshnameddirrc" ] && source "${XDG_CONFIG_HOME:-$HOME/.config}/shell/zshnameddirrc" + +# Basic auto/tab complete: +autoload -U compinit +zstyle ':completion:*' menu select +zmodload zsh/complist +compinit +_comp_options+=(globdots) # Include hidden files. + +# vi mode +bindkey -v +export KEYTIMEOUT=1 + +# Use vim keys in tab complete menu: +bindkey -M menuselect 'h' vi-backward-char +bindkey -M menuselect 'k' vi-up-line-or-history +bindkey -M menuselect 'l' vi-forward-char +bindkey -M menuselect 'j' vi-down-line-or-history +bindkey -v '^?' backward-delete-char + +# Change cursor shape for different vi modes. +function zle-keymap-select () { + case $KEYMAP in + vicmd) echo -ne '\e[1 q';; # block + viins|main) echo -ne '\e[5 q';; # beam + esac +} +zle -N zle-keymap-select +zle-line-init() { + zle -K viins # initiate `vi insert` as keymap (can be removed if `bindkey -V` has been set elsewhere) + echo -ne "\e[5 q" +} +zle -N zle-line-init +echo -ne '\e[5 q' # Use beam shape cursor on startup. +preexec() { echo -ne '\e[5 q' ;} # Use beam shape cursor for each new prompt. + +# Use lf to switch directories and bind it to ctrl-o +lfcd () { + tmp="$(mktemp -uq)" + trap 'rm -f $tmp >/dev/null 2>&1 && trap - HUP INT QUIT TERM PWR EXIT' HUP INT QUIT TERM PWR EXIT + lf -last-dir-path="$tmp" "$@" + if [ -f "$tmp" ]; then + dir="$(cat "$tmp")" + [ -d "$dir" ] && [ "$dir" != "$(pwd)" ] && cd "$dir" + fi +} +bindkey -s '^o' '^ulfcd\n' + +bindkey -s '^a' '^ubc -lq\n' + +bindkey -s '^f' '^ucd "$(dirname "$(fzf)")"\n' + +bindkey '^[[P' delete-char + +# Edit line in vim with ctrl-e: +autoload edit-command-line; zle -N edit-command-line +bindkey '^e' edit-command-line +bindkey -M vicmd '^[[P' vi-delete-char +bindkey -M vicmd '^e' edit-command-line +bindkey -M visual '^[[P' vi-delete + +# Load syntax highlighting; should be last. +source /usr/share/zsh/plugins/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh 2>/dev/null -- 2.39.5