diff options
| -rw-r--r-- | .gitignore | 2 | ||||
| -rw-r--r-- | beets/.config/beets/config.yaml | 21 | ||||
| -rw-r--r-- | git/.config/git/config | 3 | ||||
| -rw-r--r-- | mpd/.config/mpd/mpd.conf | 13 | ||||
| -rw-r--r-- | mpv/.config/mpv/mpv.conf | 3 | ||||
| -rw-r--r-- | ncmpcpp/.config/ncmpcpp/config | 2 | ||||
| -rw-r--r-- | nvim/.config/nvim/init.vim | 109 | ||||
| -rwxr-xr-x | scripts/.local/bin/pass-git-helper | 86 | ||||
| -rwxr-xr-x | scripts/.local/bin/startxautolock | 2 | ||||
| -rw-r--r-- | shell/.config/shell/aliasrc | 12 | ||||
| -rw-r--r-- | shell/.config/shell/profile | 19 | ||||
| -rw-r--r-- | x11/.Xresources | 3 | ||||
| -rw-r--r-- | x11/.config/x11/xinitrc | 28 | ||||
| -rw-r--r-- | x11/.config/x11/xprofile | 49 | ||||
| -rwxr-xr-x | x11/.xinitrc | 2 | ||||
| -rw-r--r--[l---------] | x11/.xprofile | 47 |
16 files changed, 221 insertions, 180 deletions
@@ -3,3 +3,5 @@ *.log *.selection *.zcompdump +gtk-2.0/.config/gtk-2.0/gtkfilechooser.ini +gtk-3.0/.config/gtk-3.0/bookmarks diff --git a/beets/.config/beets/config.yaml b/beets/.config/beets/config.yaml index 9e1b9f9..de2e336 100644 --- a/beets/.config/beets/config.yaml +++ b/beets/.config/beets/config.yaml @@ -5,28 +5,29 @@ import: move: yes copy: no write: yes - log: ~/.cache/beet/beets.log + log: ~/.cache/beets.log resume: ask -plugins: fetchart lastgenre ftintitle convert lyrics replaygain albumtypes embedart +plugins: fetchart lastgenre ftintitle convert lyrics replaygain albumtypes embedart mbsync missing edit ftintitle unimported VGMplug paths: - default: $albumartist/$album-$format/$disc-$track-$title + default: $albumartist/$album%aunique{}-$format/$disc-$track-$title singleton: singletons/$artist-$title comp: various-artists/$album%aunique{}-$format/$disc-$track-$title - albumtype:soundtrack: soundtracks/$album-$format/$disc-$track-$title + albumtype:soundtrack: soundtracks/$album%aunique{}-$format/$disc-$track-$title convert: - dest: ~/audio/music-phone + dest: /media/wdblue/audio/music-phone copy_album_art: yes - never_convert_lossy_files: yes + # never_convert_lossy_files: yes embed: no max_bitrate: 1 - format: flac + format: opus + quiet: true formats: - flac: - command: /home/ivan/audio/music-phone/convert-to-opus-if-not-blacklisted.sh $source $dest - extension: opus + opus: + command: /media/wdblue/audio/music-phone/convert-to-opus-if-not-blacklisted.sh "$source" "$dest" + #extension: opus replaygain: auto: no diff --git a/git/.config/git/config b/git/.config/git/config index 6214226..8b931fa 100644 --- a/git/.config/git/config +++ b/git/.config/git/config @@ -2,4 +2,5 @@ name = ivan-boikov email = ik.boikov.public@protonmail.com [credential] - helper = /home/ivan/.local/bin/pass-git-helper + helper = cache + helper = !type pass-git-helper >/dev/null && pass-git-helper $@ diff --git a/mpd/.config/mpd/mpd.conf b/mpd/.config/mpd/mpd.conf index 5929e26..b2cd95f 100644 --- a/mpd/.config/mpd/mpd.conf +++ b/mpd/.config/mpd/mpd.conf @@ -36,13 +36,13 @@ db_file "~/.local/share/mpd/mpd.db" # setting defaults to logging to syslog, or to journal if mpd was started as # a systemd service. # -#log_file "~/.cache/mpd/mpd.log" +log_file "syslog" # # This setting sets the location of the file which stores the process ID # for use of mpd --kill and some init scripts. This setting is disabled by # default and the pid file will not be stored. # -pid_file "/tmp/mpd.pid" +pid_file "~/.cache/mpd.pid" # # This setting sets the location of the file which contains information about # most variables to get MPD back into the same general shape it was in before @@ -97,7 +97,7 @@ bind_to_address "localhost" # argument is recommended for troubleshooting, though can quickly stretch # available resources on limited hardware storage. # -#log_level "default" +#log_level "verbose" # # Setting "restore_paused" to "yes" puts MPD into pause mode instead # of starting playback after startup. @@ -416,7 +416,7 @@ audio_output { # result in the volume of all playing audio to be adjusted so the output has # equal "loudness". This setting is disabled by default. # -#volume_normalization "no" +#volume_normalization "yes" # ############################################################################### @@ -428,3 +428,8 @@ audio_output { filesystem_charset "UTF-8" # ############################################################################### + +# overcoming "output buffer full" error on some tracks +# this caused ncmpcpp album listing to crash +# default is 8MiB, setting 4 times as much, just in case +max_output_buffer_size "65536" diff --git a/mpv/.config/mpv/mpv.conf b/mpv/.config/mpv/mpv.conf index 0e50219..29d2a3d 100644 --- a/mpv/.config/mpv/mpv.conf +++ b/mpv/.config/mpv/mpv.conf @@ -3,3 +3,6 @@ sub-auto=fuzzy --sub-file-paths=subtitles:subs:sub cache=auto cache-secs=30 +--hwdec=vdpau-copy +--loop=yes + diff --git a/ncmpcpp/.config/ncmpcpp/config b/ncmpcpp/.config/ncmpcpp/config index a12d33a..b834f12 100644 --- a/ncmpcpp/.config/ncmpcpp/config +++ b/ncmpcpp/.config/ncmpcpp/config @@ -2,7 +2,7 @@ ncmpcpp_directory = "~/.config/ncmpcpp" lyrics_directory = "~/.local/share/lyrics" -mpd_music_dir = "~/music/lib" +mpd_music_dir = "/media/wdblue/audio/music/" message_delay_time = "1" #visualizer_type = "spectrum" song_list_format = {$4%a - }{%t}|{$8%f$9}$R{$3(%l)$9} diff --git a/nvim/.config/nvim/init.vim b/nvim/.config/nvim/init.vim index 3877e43..66b40bf 100644 --- a/nvim/.config/nvim/init.vim +++ b/nvim/.config/nvim/init.vim @@ -74,14 +74,6 @@ endif -lua << EOF - require("which-key").setup { - -- your configuration comes here - -- or leave it empty to use the default settings - -- refer to the configuration section below - } -EOF - map <silent> <C-b> :call BufferList()<CR> @@ -93,15 +85,50 @@ let g:lightline = { \ } " Indenting -set expandtab -set shiftwidth=4 -set tabstop=4 -set smartindent +set tabstop=4 " The width of a TAB is set to 4. + " Still it is a \t. It is just that + " Vim will interpret it to be having + " a width of 4. +set shiftwidth=4 " Indents will have a width of 4 +set softtabstop=4 " Sets the number of columns for a TAB +set noexpandtab " Expand TABs to spaces +set shiftround " Round indent to multiple of 'shiftwidth' +set smartindent " Do smart indenting when starting a new line +set autoindent " Copy indent from current line, over to the new line + +" This is necessary for VimTeX to load properly. The "indent" is optional. +" Note that most plugin managers will do this automatically. +filetype plugin indent on +" This enables Vim's and neovim's syntax-related features. Without this, some +" VimTeX features will not work (see ":help vimtex-requirements" for more +" info). +syntax enable + +let g:sleuth_tex_defaults = 'tabstop=4' + +" search +set ignorecase " obligatory before smartcase +set smartcase + +set undofile +set undodir=~/.local/state/nvim " line numbers set number set relativenumber +" soft-wrap text (only visually) at the edge of the window: +" optional - will help to visually verify that it's working +set number +set textwidth=0 +set wrapmargin=0 +set wrap +" optional - breaks by word rather than character +set linebreak +set formatoptions-=t + + + nmap <M-Tab> :bnext<CR> nmap <M-w> :bd<CR> nmap <S-Tab> :bprev<CR> @@ -111,7 +138,7 @@ nmap <S-Tab> :bprev<CR> let g:latex_to_unicode_keymap = 1 "let g:latex_to_unicode_tab=1 -let g:latex_to_unicode_file_types = ".*" +let g:latex_to_unicode_file_types = ".jl" " runs a script that cleans out tex build files whenever I close out of a .tex file. autocmd VimLeave *.tex !texclear % @@ -200,7 +227,7 @@ require'nvim-treesitter.configs'.setup { -- A list of parser names, or "all" ensure_installed = {{ "c", "lua", "cpp", "bash", "python", - "git_rebase", "gitattributes", "gitcommit", --"gitignore", + "git_rebase", "gitattributes", "gitcommit", "gitignore", "git_config", "make", "regex", "vim", "html", "css", "javascript", "json", "yaml", "markdown"}}, @@ -228,19 +255,19 @@ require'nvim-treesitter.configs'.setup { disable = { "latex", "julia" }, -- Or use a function for more flexibility, e.g. to disable slow treesitter highlight for large files disable = function(lang, buf) - local max_filesize = 100 * 1024 -- 100 KB + local max_filesize = 16 * 1024 -- 16 KB local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf)) - if ok and stats and stats.size > max_filesize then - return true - end + if ok and stats and stats.size > max_filesize then + return true + end end, - -- Setting this to true will run `:h syntax` and tree-sitter at the same time. - -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). - -- Using this option may slow down your editor, and you may see some duplicate highlights. - -- Instead of true it can also be a list of languages - additional_vim_regex_highlighting = false, - }, + -- Setting this to true will run `:h syntax` and tree-sitter at the same time. + -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). + -- Using this option may slow down your editor, and you may see some duplicate highlights. + -- Instead of true it can also be a list of languages + additional_vim_regex_highlighting = false + }, } EOF @@ -254,13 +281,33 @@ nmap <leader>ll :lua vim.lsp.util.show_line_diagnostics()<CR> nmap <leader>lk :lua vim.lsp.buf.signature_help()<CR> nmap <leader>lr :lua vim.lsp.buf.references()<CR> -let g:latex_to_unicode_auto = 1 +"let g:latex_to_unicode_auto = 1 " just in case to avoid interference with tab-completion -let g:latex_to_unicode_tab = "off" +"let g:latex_to_unicode_tab = "off" let g:vimtex_view_method = "zathura" let g:vimtex_compiler_method = 'latexmk' +"let g:vimtex_compiler_latexmk = { +" \ 'hooks' : [], +" \ 'executable' : 'latexmk', +" \ 'callback' : 1, +" \ 'continuous' : 1, +" \ 'options' : [ +" \ '-shell-escape', +" \ 'interaction=nonstopmode', +" \ '-file-line-error' +" \ ], +" \ } + +let g:vimtex_compiler_latexmk = { + \ 'options' : [ + \ '-shell-escape', + \ '-synctex=1', + \ '-interaction=nonstopmode', + \ ], + \ } + let g:vimwiki_ext2syntax = { '.Rmd': 'markdown', '.rmd': 'markdown', '.md': 'markdown', '.markdown': 'markdown', '.mdown': 'markdown' } " require("custom.plugins.mappings").vimwiki() " local map = require("core.utils").map @@ -412,17 +459,9 @@ let g:julia_indent_align_import = 0 let g:julia_indent_align_brackets = 0 let g:julia_indent_align_funcargs = 0 let g:julia_set_indentation = 0 +let g:latex_to_unicode_file_types = ".jl" hi link juliaComma Comment hi link juliaParDelim Comment hi link juliaSemicolon Comment hi link juliaFunctionCall Function - - -lua << EOF -require("trouble").setup { - -- your configuration comes here - -- or leave it empty to use the default settings - -- refer to the configuration section below -} -EOF diff --git a/scripts/.local/bin/pass-git-helper b/scripts/.local/bin/pass-git-helper index 5fe8e71..db120e5 100755 --- a/scripts/.local/bin/pass-git-helper +++ b/scripts/.local/bin/pass-git-helper @@ -1,7 +1,6 @@ #!/usr/bin/env python3 -""" -Implementation of the pass-git-helper utility. +"""Implementation of the pass-git-helper utility. .. codeauthor:: Johannes Wienke """ @@ -14,6 +13,7 @@ import fnmatch import logging import os import os.path +from pathlib import Path import re import subprocess import sys @@ -24,14 +24,13 @@ import xdg.BaseDirectory LOGGER = logging.getLogger() CONFIG_FILE_NAME = "git-pass-mapping.ini" -DEFAULT_CONFIG_FILE = os.path.join( - xdg.BaseDirectory.save_config_path("pass-git-helper"), CONFIG_FILE_NAME +DEFAULT_CONFIG_FILE = ( + Path(xdg.BaseDirectory.save_config_path("pass-git-helper")) / CONFIG_FILE_NAME ) def parse_arguments(argv: Optional[Sequence[str]] = None) -> argparse.Namespace: - """ - Parse the command line arguments. + """Parse the command line arguments. Args: argv: @@ -62,7 +61,7 @@ def parse_arguments(argv: Optional[Sequence[str]] = None) -> argparse.Namespace: "--logging", action="store_true", default=False, - help="Print debug messages on stderr. " "Might include sensitive information", + help="Print debug messages on stderr. Might include sensitive information", ) parser.add_argument( "action", @@ -75,8 +74,7 @@ def parse_arguments(argv: Optional[Sequence[str]] = None) -> argparse.Namespace: def parse_mapping(mapping_file: Optional[IO]) -> configparser.ConfigParser: - """ - Parse the file containing the mappings from hosts to pass entries. + """Parse the file containing the mappings from hosts to pass entries. Args: mapping_file: @@ -102,15 +100,14 @@ def parse_mapping(mapping_file: Optional[IO]) -> configparser.ConfigParser: "No mapping configured so far at any XDG config location. " "Please create {config_file}".format(config_file=DEFAULT_CONFIG_FILE) ) - default_file = os.path.join(xdg_config_dir, CONFIG_FILE_NAME) + default_file = Path(xdg_config_dir) / CONFIG_FILE_NAME LOGGER.debug("Parsing mapping file %s", mapping_file) - with open(default_file, "r") as file_handle: + with default_file.open("r") as file_handle: return parse(file_handle) def parse_request() -> Dict[str, str]: - """ - Parse the request of the git credential API from stdin. + """Parse the request of the git credential API from stdin. Returns: A dictionary with all key-value pairs of the request @@ -135,8 +132,7 @@ class DataExtractor(abc.ABC): """Interface for classes that extract values from pass entries.""" def __init__(self, option_suffix: Text = "") -> None: - """ - Create a new instance. + """Create a new instance. Args: option_suffix: @@ -147,8 +143,7 @@ class DataExtractor(abc.ABC): @abc.abstractmethod def configure(self, config: configparser.SectionProxy) -> None: - """ - Configure the extractor from the mapping section. + """Configure the extractor from the mapping section. Args: config: @@ -159,8 +154,7 @@ class DataExtractor(abc.ABC): def get_value( self, entry_name: Text, entry_lines: Sequence[Text] ) -> Optional[Text]: - """ - Return the extracted value. + """Return the extracted value. Args: entry_name: @@ -175,19 +169,20 @@ class DataExtractor(abc.ABC): class SkippingDataExtractor(DataExtractor): - """ - Extracts data from a pass entry and optionally strips a prefix. + """Extracts data from a pass entry and optionally strips a prefix. The prefix is a fixed amount of characters. """ def __init__(self, prefix_length: int, option_suffix: Text = "") -> None: - """ - Create a new instance. + """Create a new instance. Args: prefix_length: Amount of characters to skip at the beginning of the entry + option_suffix: + Suffix to put behind names of configuration keys for this + instance. Subclasses must use this for their own options. """ super().__init__(option_suffix) self._prefix_length = prefix_length @@ -219,8 +214,7 @@ class SpecificLineExtractor(SkippingDataExtractor): """Extracts a specific line number from an entry.""" def __init__(self, line: int, prefix_length: int, option_suffix: Text = "") -> None: - """ - Create a new instance. + """Create a new instance. Args: line: @@ -240,7 +234,9 @@ class SpecificLineExtractor(SkippingDataExtractor): "line{suffix}".format(suffix=self._option_suffix), fallback=self._line ) - def _get_raw(self, entry_name: Text, entry_lines: Sequence[Text]) -> Optional[Text]: + def _get_raw( + self, entry_name: Text, entry_lines: Sequence[Text] # noqa: ARG002 + ) -> Optional[Text]: if len(entry_lines) > self._line: return entry_lines[self._line] else: @@ -251,8 +247,7 @@ class RegexSearchExtractor(DataExtractor): """Extracts data using a regular expression with capture group.""" def __init__(self, regex: str, option_suffix: str) -> None: - """ - Create a new instance. + """Create a new instance. Args: regex: @@ -286,7 +281,7 @@ class RegexSearchExtractor(DataExtractor): ) def get_value( - self, entry_name: Text, entry_lines: Sequence[Text] + self, entry_name: Text, entry_lines: Sequence[Text] # noqa: ARG002 ) -> Optional[Text]: """See base class method.""" # Search through all lines and return the first matching one @@ -305,7 +300,7 @@ class EntryNameExtractor(DataExtractor): """Configure nothing.""" def get_value( - self, entry_name: Text, entry_lines: Sequence[Text] + self, entry_name: Text, entry_lines: Sequence[Text] # noqa: ARG002 ) -> Optional[Text]: """See base class method.""" return os.path.split(entry_name)[1] @@ -325,7 +320,6 @@ def find_mapping_section( mapping: configparser.ConfigParser, request_header: str ) -> configparser.SectionProxy: """Select the mapping entry matching the request header.""" - LOGGER.debug('Searching mapping to match against header "%s"', request_header) for section in mapping.sections(): if fnmatch.fnmatch(request_header, section): @@ -341,7 +335,6 @@ def find_mapping_section( def get_request_section_header(request: Mapping[str, str]) -> str: """Return the canonical host + optional path for section header matching.""" - if "host" not in request: LOGGER.error("host= entry missing in request. Cannot query without a host") raise ValueError("Request lacks host entry") @@ -356,18 +349,27 @@ def define_pass_target( section: configparser.SectionProxy, request: Mapping[str, str] ) -> str: """Determine the pass target by filling in potentially used variables.""" - pass_target = section.get("target").replace("${host}", request["host"]) if "username" in request: pass_target = pass_target.replace("${username}", request["username"]) + if "protocol" in request: + pass_target = pass_target.replace("${protocol}", request["protocol"]) return pass_target +def compute_pass_environment(section: configparser.SectionProxy) -> Mapping[str, str]: + environment = os.environ.copy() + password_store_dir = section.get("password_store_dir") + if password_store_dir: + LOGGER.debug('Setting PASSWORD_STORE_DIR to "%s"', password_store_dir) + environment["PASSWORD_STORE_DIR"] = password_store_dir + return environment + + def get_password( request: Mapping[str, str], mapping: configparser.ConfigParser ) -> None: - """ - Resolve the given credential request in the provided mapping definition. + """Resolve the given credential request in the provided mapping definition. The result is printed automatically. @@ -377,7 +379,6 @@ def get_password( mapping: The mapping configuration as a ConfigParser instance. """ - LOGGER.debug('Received request "%s"', request) header = get_request_section_header(request) @@ -392,11 +393,13 @@ def get_password( ] username_extractor.configure(section) + environment = compute_pass_environment(section) + LOGGER.debug('Requesting entry "%s" from pass', pass_target) # silence the subprocess injection warnings as it is the user's # responsibility to provide a safe mapping and execution environment - output = subprocess.check_output( # noqa: S603, S607 - ["pass", "show", pass_target] + output = subprocess.check_output( + ["pass", "show", pass_target], env=environment ).decode(section.get("encoding", "UTF-8")) lines = output.splitlines() @@ -416,8 +419,7 @@ def handle_skip() -> None: def main(argv: Optional[Sequence[str]] = None) -> None: - """ - Start the pass-git-helper script. + """Start the pass-git-helper script. Args: argv: @@ -437,7 +439,7 @@ def main(argv: Optional[Sequence[str]] = None) -> None: try: mapping = parse_mapping(args.mapping) - except Exception as error: # noqa: PIE786 ok'ish for the main function + except Exception as error: # ok'ish for the main function LOGGER.critical("Unable to parse mapping file", exc_info=True) print( # noqa: T201 "Unable to parse mapping file: {error}".format(error=error), file=sys.stderr @@ -447,7 +449,7 @@ def main(argv: Optional[Sequence[str]] = None) -> None: if action == "get": try: get_password(request, mapping) - except Exception as error: # noqa: PIE786 ok'ish for the main function + except Exception as error: # ok'ish for the main function print( # noqa: T201 "Unable to retrieve entry: {error}".format(error=error), file=sys.stderr ) diff --git a/scripts/.local/bin/startxautolock b/scripts/.local/bin/startxautolock index d7e6e68..1803e9f 100755 --- a/scripts/.local/bin/startxautolock +++ b/scripts/.local/bin/startxautolock @@ -1,2 +1,2 @@ #!/bin/sh -xautolock -time 1 -notify 5 -locker ilock -notifier 'notify-send "Screen will lock in 5s"' -secure -corners "+-+-" -cornerdelay 5 -detectsleep & +xautolock -time 1 -notify 5 -locker ilock -notifier 'notify-send "Screen will lock in 5s"' -secure -corners "0-+0" -cornerdelay 5 -detectsleep & diff --git a/shell/.config/shell/aliasrc b/shell/.config/shell/aliasrc index af4e169..8b48a2f 100644 --- a/shell/.config/shell/aliasrc +++ b/shell/.config/shell/aliasrc @@ -24,7 +24,7 @@ alias \ yt='youtube-dl --add-metadata -i' \ yta='yt -x -f bestaudio/best' \ ffmpeg='ffmpeg -hide_banner' \ - nnn='nnn -de' + nnn='nnn -deARU' # Colorize commands when possible. alias \ @@ -48,7 +48,7 @@ alias \ z='zathura' # spawn detached terminal -alias dst='$TERMINAL\" </dev/null &>/dev/null & disown ;' +alias dst='"$TERMINAL" </dev/null &>/dev/null & disown ;' # run mpv with SVP, if SVP not active, works as usual mpv alias mpv60='if [ -n $(pidof SVPManager) ]; then $HOME/.local/bin/svpman & fi ; mpv --input-ipc-server=/tmp/mpvsocket --hwdec=auto-copy' @@ -73,11 +73,11 @@ alias nvidia-settings='nvidia-settings --config=$XDG_CONFIG_HOME/nvidia/settings alias wget='wget --hsts-file=$XDG_CACHE_HOME/wget-hsts' alias yarn='yarn --use-yarnrc $XDG_CONFIG_HOME/yarn/config' -alias monerod='monerod --data-dir $XDG_DATA_HOME/bitmonero' -alias monero-wallet-cli='monero-wallet-cli --wallet-file $XDG_DATA_HOME/bitmonero/monero-wallet' +#alias monerod='monerod --data-dir $XDG_DATA_HOME/bitmonero' +#alias monero-wallet-cli='monero-wallet-cli --wallet-file $XDG_DATA_HOME/bitmonero/monero-wallet' alias wttr='curl https://wttr.in/paris-france' -mkdir -p "$XDG_CONFIG_HOME/abook/" -mkdir -p "$XDG_DATA_HOME/abook/" +[ -d "$XDG_CONFIG_HOME/abook/" ] || mkdir -p "$XDG_CONFIG_HOME/abook/" +[ -d "$XDG_DATA_HOME/abook/" ] || mkdir -p "$XDG_DATA_HOME/abook/" alias abook='abook --config $XDG_CONFIG_HOME/abook/abookrc --datafile $XDG_DATA_HOME/abook/addressbook' diff --git a/shell/.config/shell/profile b/shell/.config/shell/profile index 502ce4b..1a066ba 100644 --- a/shell/.config/shell/profile +++ b/shell/.config/shell/profile @@ -25,7 +25,13 @@ export PATH="$PATH:$(du -L "$HOME/.local/bin" | cut -f2 | paste -sd ':')" export PAGER="less" export EDITOR="nvim" export TERMINAL="st" + export BROWSER="firefox" +if command -v firefox-bin &> /dev/null +then + export BROWSER="firefox-bin" +fi + export READER="zathura" #export XDG_CACHE_HOME="$HOME/.cache" @@ -69,6 +75,7 @@ export WGETRC="$XDG_CONFIG_HOME/wgetrc" export PASSWORD_STORE_DIR="${XDG_DATA_HOME:-$HOME/.local/share}/password-store" export SUDO_ASKPASS="$HOME/.local/bin/pass-askpass" export JULIA_DEPOT_PATH="$XDG_DATA_HOME/julia:$JULIA_DEPOT_PATH" +export W3M_DIR="$XDG_STATE_HOME/w3m" # xinit #export XINITRC="$XDG_CONFIG_HOME/x11/xinitrc" export XSERVERRC="$XDG_CONFIG_HOME/x11/xserverrc" @@ -83,6 +90,16 @@ export ERRFILE="$XDG_STATE_HOME/x11/xsession-errors" export XCOMPOSEFILE="$XDG_CONFIG_HOME/x11/xcompose" export XCOMPOSECACHE="$XDG_CACHE_HOME/x11/xcompose" +# POSIX standard says: send read local mail to ~/mbox, an mbox database +# gentoo uses maildir by default, it is also recommended over mbox +# setting $MBOX to maildir/cur will treat it as a file, which does not help +# so override standard to avoid a mess +export MAIL="$XDG_DATA_HOME/mail/$USER@localhost/INBOX" +# also override mailutils's mail as it will create it's own mail directory +alias mail='mutt -f $MAIL' +# bash will also detect new mail in $MAIL every $MAILCHECK seconds (60 by default) +export MAILCLIENT="mutts" + export NPM_CONFIG_USERCONFIG=$XDG_CONFIG_HOME/npm/npmrc export MBSYNCRC="${XDG_CONFIG_HOME:-$HOME/.config}/mbsync/config" export NOTMUCH_CONFIG="${XDG_CONFIG_HOME:-$HOME/.config}/notmuch-config" @@ -90,7 +107,7 @@ export TMUX_TMPDIR="$XDG_CACHE_DIR" export CARGO_HOME="${XDG_DATA_HOME:-$HOME/.local/share}/cargo" export GOPATH="${XDG_DATA_HOME:-$HOME/.local/share}/go" -# I don't need history from less +# who needs history from less? no one export LESSHISTFILE="-" # retain color (maybe useless, most commands remove color when outputting to pipe, which is reasonable) export LESS=-R diff --git a/x11/.Xresources b/x11/.Xresources index a2ef765..70cfb91 100644 --- a/x11/.Xresources +++ b/x11/.Xresources @@ -35,6 +35,9 @@ *.color7: #abb2bf *.color15: #ffffff +*.alpha: 0.9 +*.font: Liberation Mono:pixelsize=12:antialias=true:autohint=true; + Xft.autohint: 0 Xft.lcdfilter: lcddefault Xft.hinting: 1 diff --git a/x11/.config/x11/xinitrc b/x11/.config/x11/xinitrc deleted file mode 100644 index 5fa14ab..0000000 --- a/x11/.config/x11/xinitrc +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh - -# xinitrc runs automatically when you run startx. - -# There are some small but important commands that need to be run when we start -# the graphical environment. There is a link to this file in ~/.xprofile -# because that file is run automatically if someone uses a display manager -# (login screen) and so they are needed there. To prevent doubling up commands, -# I source them here with the line below. - -if [ -f "${XDG_CONFIG_HOME:-$HOME/.config}/x11/xprofile" ]; then - . "${XDG_CONFIG_HOME:-$HOME/.config}/x11/xprofile" -else - . "$HOME/.xprofile" -fi - -picom & -firefox & -# delay thunderbird to allow protonmail initialize and avoid thunderbirds' "no connection to 127.0.0.1" -protonmail-bridge --no-window & ( sleep 5 && thunderbird & ) -signal-desktop & -telegram-desktop & -redshift -l40:2 & -syncthing & -xfce4-power-manager & - - -/usr/bin/dwm diff --git a/x11/.config/x11/xprofile b/x11/.config/x11/xprofile deleted file mode 100644 index 320ee3d..0000000 --- a/x11/.config/x11/xprofile +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/bash - -# This file runs when a DM logs you into a graphical session. -# If you use startx/xinit like a Chad, this file will also be sourced. - - -xrdb $HOME/.Xresources -xrdbpid=$! - -# Ensure that xrdb has finished running -[ -n "$xrdbpid" ] && wait "$xrdbpid" - -if [ $(xdpyinfo | awk '/dimensions/ {print $2}') == '3840x2160' ]; then - xrdb -merge <<< "Xft.dpi: 192" - xrdb -merge <<< "*.font: monospace:size=12" -fi - -# generate zathura config with colors from .Xresources -mkdir -pv $HOME/.config/zathura && $HOME/.local/bin/genzathurarc > $HOME/.config/zathura/zathurarc - -# and dunst too -mkdir -pv $HOME/.config/dunst && $HOME/.local/bin/gendunstrc > $HOME/.config/dunst/dunstrc - -$HOME/.local/bin/setbg - -$HOME/.local/bin/remaps - -autostart=( - "xcompmgr" - "mpd" - "dunst" - "unclutter" - "gentoo-pipewire-launcher" - "syncthing --no-browser" - "redshift -l40:2" -) - -for program in "${autostart[@]}" ; do - pidof -s "${program%% *}" || setsid -f $program -done >$XDG_CACHE_HOME/xprofile.errors 2>&1 - -# not sure why it does not work reliably inside autostart -dwmblocks & - -$HOME/.local/bin/startxautolock - -if [ -x /usr/bin/gpg-agent ]; then - eval "$(/usr/bin/gpg-agent --daemon)" -fi diff --git a/x11/.xinitrc b/x11/.xinitrc index 57be318..32207ef 100755 --- a/x11/.xinitrc +++ b/x11/.xinitrc @@ -14,4 +14,4 @@ else . "$HOME/.xprofile" fi -ssh-agent "$(which dwm)" +exec ssh-agent "$(which dwm)" diff --git a/x11/.xprofile b/x11/.xprofile index 61f87a7..f00b576 120000..100644 --- a/x11/.xprofile +++ b/x11/.xprofile @@ -1 +1,46 @@ -.config/x11/xprofile
\ No newline at end of file +#!/bin/bash + +# This file runs when a DM logs you into a graphical session. +# If you use startx/xinit this file will also be sourced. + +xrdb $HOME/.Xresources +xrdbpid=$! + +# Ensure that xrdb has finished running +[ -n "$xrdbpid" ] && wait "$xrdbpid" + +# HiDPI scaling +if [ $(xdpyinfo | awk '/dimensions/ {print $2}') == '3840x2160' ]; then + xrdb -merge <<< "Xft.dpi: 192" + xrdb -merge <<< "*.font: monospace:size=12" +fi + +# generate configs with colors from .Xresources +mkdir -pv $HOME/.config/zathura && $HOME/.local/bin/genzathurarc > $HOME/.config/zathura/zathurarc +mkdir -pv $HOME/.config/dunst && $HOME/.local/bin/gendunstrc > $HOME/.config/dunst/dunstrc + +$HOME/.local/bin/setbg + +$HOME/.local/bin/remaps + +autostart=( + "xcompmgr" + "mpd" + "dunst" + "unclutter" + "syncthing --no-browser" + "redshift -l40:2" + "dwmblocks" +) + +for program in "${autostart[@]}" ; do + pidof -s "${program%% *}" || setsid -f $program +done >$XDG_CACHE_HOME/xprofile.errors 2>&1 + +$HOME/.local/bin/startxautolock + +gentoo-pipewire-launcher restart & + +if [ -x /usr/bin/gpg-agent ]; then + eval "$(/usr/bin/gpg-agent --daemon)" +fi |
