From 42a6d15193d5dc6d420664d0db741a7140cf2f09 Mon Sep 17 00:00:00 2001 From: ObserverOfTime Date: Sun, 24 Nov 2019 16:50:07 +0200 Subject: [PATCH] Move more files to XDG directories --- .bash_profile | 64 +++++++++++++------ .XCompose => .config/X11/XCompose | 0 .config/inputrc | 48 ++++++++++++++ .config/konsolerc | 29 --------- .config/mpv/mpv.conf | 2 +- .config/pythonrc.py | 16 +++++ .config/qutebrowser/config.py | 18 ++---- .config/yarn/global/package.json | 6 +- .gitattributes | 14 ++-- .local/arch/init.sh | 23 ++++++- .bash_aliases => .local/share/bash/aliases.sh | 7 +- .bashrc => .local/share/bash/bashrc.sh | 13 +--- .bash_funcs => .local/share/bash/functions.sh | 2 +- {.gnupg => .local/share/gnupg}/gpg.conf | 0 README.md | 19 ++++-- 15 files changed, 164 insertions(+), 97 deletions(-) rename .XCompose => .config/X11/XCompose (100%) create mode 100644 .config/inputrc delete mode 100644 .config/konsolerc create mode 100644 .config/pythonrc.py rename .bash_aliases => .local/share/bash/aliases.sh (94%) rename .bashrc => .local/share/bash/bashrc.sh (79%) rename .bash_funcs => .local/share/bash/functions.sh (99%) rename {.gnupg => .local/share/gnupg}/gpg.conf (100%) diff --git a/.bash_profile b/.bash_profile index 3823d29..b2fcf02 100644 --- a/.bash_profile +++ b/.bash_profile @@ -3,12 +3,6 @@ # Print date on login printf '\e[1m\e[91m%(%A, %B %e, %Y)T \e[90m- \e[36m%(%Z %z)T\e[m\n\n' -# Ctrl + Space to expand command -bind '\C-Space':magic-space - -# Case insensitive completion -bind 'set completion-ignore-case on' - # Include hidden files in glob shopt -s dotglob @@ -40,6 +34,10 @@ export XDG_CACHE_HOME="$HOME/.cache" # Set the paths used by python {{{ export PYTHONPYCACHEPREFIX="$XDG_CACHE_HOME/__pycache__" +export PYTHONSTARTUP="$XDG_CONFIG_HOME/pythonrc.py" +export PYTHON_EGG_CACHE="$XDG_CACHE_HOME/python-eggs" +export IPYTHONDIR="$XDG_CONFIG_HOME/jupyter" +export JUPYTER_CONFIG_DIR="$XDG_CONFIG_HOME/jupyter" # }}} # Set the paths used by go {{{ @@ -50,6 +48,10 @@ export GOPATH="$HOME/.local/go" export GEM_HOME="$HOME/.local/ruby" export GEM_SPEC_CACHE="$GEM_HOME/specs" export GEM_PATH="$GEM_HOME:/usr/lib/ruby/gems/2.6.0" +export BUNDLE_USER_CONFIG="$XDG_CONFIG_HOME/bundle" +export BUNDLE_USER_CACHE="$XDG_CACHE_HOME/bundle" +export BUNDLE_USER_PLUGIN="$XDG_DATA_HOME/bundle" +export TRAVIS_CONFIG_PATH="$XDG_CONFIG_HOME/travis" # }}} # Set the paths used by perl5 {{{ @@ -67,8 +69,33 @@ export NODE_REPL_HISTORY="$XDG_CACHE_HOME/.node_repl_history" export NPM_CONFIG_USERCONFIG="$XDG_CONFIG_HOME/npm/npmrc" # }}} -# Set the paths used by the android sdk {{{ -export ANDROID_HOME="$HOME/.local/android" +# Set the paths used by android {{{ +export ANDROID_SDK_HOME="$HOME/.local/android" +export ANDROID_SDK_ROOT="$ANDROID_SDK_HOME" +export ANDROID_EMULATOR_HOME="$ANDROID_SDK_HOME" +export GRADLE_USER_HOME="$XDG_DATA_HOME/gradle" +# }}} + +# Set the paths used by sqlite {{{ +export SQLITE_HISTORY="$XDG_CACHE_HOME/.sqlite_history" +# }}} + +# Set the paths used by gtk {{{ +export GTK2_RC_FILES="$XDG_CONFIG_HOME/gtkrc-2.0" +# }}} + +# Set the paths used by xorg {{{ +export XCOMPOSEFILE="$XDG_CONFIG_HOME/X11/XCompose" +export XCOMPOSECACHE="$XDG_CACHE_HOME/X11/XCompose" +# }}} + +# Set the paths used by ccache {{{ +export CCACHE_CONFIGPATH="$XDG_CONFIG_HOME/ccache.cfg" +export CCACHE_DIR="$XDG_CACHE_HOME/ccache" +# }}} + +# Set the paths used by gpg {{{ +export GNUPGHOME="$XDG_DATA_HOME/gnupg" # }}} # Set the search path for commands {{{ @@ -81,13 +108,8 @@ export PATH="$HOME/.local/bin:\ $HOME/.local/perl/bin:\ $GOPATH/bin:\ $GEM_HOME/bin:\ -$ANDROID_HOME/tools:\ -$ANDROID_HOME/platform-tools:" -# }}} - -# Set the paths used by ccache {{{ -export CCACHE_CONFIGPATH="$XDG_CONFIG_HOME/ccache.cfg" -export CCACHE_DIR="$XDG_CACHE_HOME/ccache" +$ANDROID_SDK_HOME/tools:\ +$ANDROID_SDK_HOME/platform-tools:" # }}} # Use a 256color terminal if one exists {{{ @@ -97,7 +119,13 @@ for t in {konsole,xterm,gnome}-256color; do done # }}} -# Source bashrc -test -f ~/.bashrc && source ~/.bashrc +# Specify inputrc +test -f "$XDG_CONFIG_HOME/inputrc" && export INPUTRC="$_" -# vim:set fdm=marker fdl=1: +# Specify xinitrc +test -f "$XDG_CONFIG_HOME/X11/xinitrc" && export XINITRC="$_" + +# Source bashrc +test -f "$XDG_DATA_HOME/bash/bashrc.sh" && . "$_" + +# vim:fdm=marker:fdl=1: diff --git a/.XCompose b/.config/X11/XCompose similarity index 100% rename from .XCompose rename to .config/X11/XCompose diff --git a/.config/inputrc b/.config/inputrc new file mode 100644 index 0000000..de2da00 --- /dev/null +++ b/.config/inputrc @@ -0,0 +1,48 @@ +# Bindings {{{ + +# Expand history with Ctrl + Space +Control-Space: magic-space + +# Complete items with Insert +"\e[2~": menu-complete + +# }}} + +# Settings {{{ + +# Disable the bell +set bell-style none + +# Enable file colors +set colored-stats on + +# Enable case-insensitive completion +set completion-ignore-case on + +# Don't ask to show all completions +set completion-query-items -1 + +# Set the maximum number of history entries +set history-size 500 + +# Disable completion pages +set page-completions off + +# Print completions horizontally +set print-completions-horizontally on + +# Show ambiguous completions immediately +set show-all-if-ambiguous on + +# Show full completions immediately +set show-all-if-unmodified on + +# Skip completed text after the cursor +set skip-completed-text on + +# Show file type characters +set visible-stats on + +# }}} + +# vim:fdm=marker:fdl=1: diff --git a/.config/konsolerc b/.config/konsolerc deleted file mode 100644 index 174ef3f..0000000 --- a/.config/konsolerc +++ /dev/null @@ -1,29 +0,0 @@ -[Desktop Entry] -DefaultProfile=Default.profile - -[DownloadDialog Settings] -Height 768=510 -Width 1366=700 - -[Favorite Profiles] -Favorites=Default.profile,NvimTerm.profile - -[FileDialogSize] -Height 768=619 -Width 1366=1004 - -[MainWindow] -Height 1080=619 -Height 720=370 -Height 768=590 -State=AAAA/wAAAAD9AAAAAAAABVYAAALHAAAABAAAAAQAAAAIAAAACPwAAAAA -ToolBarsMovable=Disabled -Width 1024=648 -Width 1280=640 -Width 1366=1004 -Width 1920=1004 -Window-Maximized 768x1024=true -Window-Maximized 768x1366=true - -[TabBar] -TabBarVisibility=ShowTabBarWhenNeeded diff --git a/.config/mpv/mpv.conf b/.config/mpv/mpv.conf index fffcf5c..bbbe1fa 100644 --- a/.config/mpv/mpv.conf +++ b/.config/mpv/mpv.conf @@ -114,7 +114,7 @@ sub-auto=all sub-file-paths=Subs # Specify the position of subtitles on the screen. -sub-pos=95 +sub-pos=97 # }}} diff --git a/.config/pythonrc.py b/.config/pythonrc.py new file mode 100644 index 0000000..e6adfba --- /dev/null +++ b/.config/pythonrc.py @@ -0,0 +1,16 @@ +import atexit +import os +import readline +import sys + +histfile = os.path.join(os.getenv( + 'XDG_CACHE_HOME', os.path.expanduser('~/.config') +), '.python_history') + +try: + readline.read_history_file(histfile) + readline.set_history_length(1000) +except FileNotFoundError: + pass + +atexit.register(readline.write_history_file, histfile) diff --git a/.config/qutebrowser/config.py b/.config/qutebrowser/config.py index 84ece81..ad493c5 100644 --- a/.config/qutebrowser/config.py +++ b/.config/qutebrowser/config.py @@ -10,9 +10,9 @@ c.content.headers.accept_language = 'en_GB,en' c.content.headers.user_agent = ' '.join(( 'Mozilla/5.0', '(X11; Linux x86_64)', - 'QtWebEngine/5.13.1', + 'QtWebEngine/5.13.2', 'Chromium/73.0.3683.105', - 'qutebrowser/1.8.1' + 'qutebrowser/1.8.2' )) # Allow JavaScript to read from or write to the clipboard. @@ -48,20 +48,10 @@ c.fonts.monospace = ','.join(( c.qt.process_model = 'process-per-site' # Languages to use for spell checking. -c.spellcheck.languages = [ - 'en-GB', - 'en-US', - 'el-GR' -] +c.spellcheck.languages = ['en-GB', 'en-US', 'el-GR'] # List of widgets displayed in the statusbar. -c.statusbar.widgets = [ - 'keypress', - 'url', - 'history', - 'tabs', - 'progress' -] +c.statusbar.widgets = ['keypress', 'url', 'history', 'tabs', 'progress'] # Page(s) to open at the start. c.url.start_pages = [ # {{{1 diff --git a/.config/yarn/global/package.json b/.config/yarn/global/package.json index fefdb7d..fa91285 100644 --- a/.config/yarn/global/package.json +++ b/.config/yarn/global/package.json @@ -3,15 +3,15 @@ "private": true, "dependencies": { "american-british-english-translator": "^0.1.2", - "eslint": "^6.6.0", + "eslint": "^6.7.0", "grunt-cli": "^1.3.2", "gulp-cli": "^2.2.0", "htmlhint": "^0.11.0", "neovim": "^4.5.0", "pug-cli": "^1.0.0-alpha6", "pug-lint": "^2.5.0", - "stylelint": "^11.1.1", - "stylelint-scss": "^3.12.1", + "stylelint": "^12.0.0", + "stylelint-scss": "^3.13.0", "svgo": "^1.3.0" } } diff --git a/.gitattributes b/.gitattributes index d79dc21..595544e 100644 --- a/.gitattributes +++ b/.gitattributes @@ -14,7 +14,6 @@ .config/aria2/aria2.conf linguist-language=INI .config/ccache.cfg linguist-language=INI .config/htop/htoprc linguist-language=INI -.config/konsolerc linguist-language=INI .config/mpv/input.conf linguist-language=INI .config/mpv/mpv.conf linguist-language=INI .config/newsboat/config linguist-language=INI @@ -22,20 +21,23 @@ .config/plasma-localerc linguist-language=INI .config/pycodestyle linguist-language=INI .config/youtube-dl/config linguist-language=INI -.gnupg/gpg.conf linguist-language=INI +.local/share/gnupg/gpg.conf linguist-language=INI .local/share/konsole/Default.profile linguist-language=INI .local/share/konsole/Gruvbox8.colorscheme linguist-language=INI .local/share/konsole/NvimTerm.profile linguist-language=INI +.config/pythonrc.py linguist-language=Python .config/qutebrowser/config.py linguist-language=Python -.bash_aliases linguist-language=Shell -.bash_funcs linguist-language=Shell +.config/inputrc linguist-language=Readline-Config + .bash_profile linguist-language=Shell -.bashrc linguist-language=Shell .config/aria2/notif.sh linguist-language=Shell .config/newsboat/notif.sh linguist-language=Shell .local/arch/init.sh linguist-language=Shell +.local/share/bash/aliases.sh linguist-language=Shell +.local/share/bash/bashrc.sh linguist-language=Shell +.local/share/bash/functions.sh linguist-language=Shell .local/arch/packages.aur.txt linguist-language=Text .local/arch/packages.repo.txt linguist-language=Text @@ -53,7 +55,7 @@ # .yarnrc linguist-language=YAML # skews the stats due to its size -.XCompose linguist-language=XCompose linguist-detectable=false +.config/X11/XCompose linguist-language=XCompose linguist-detectable=false # these aren't part of the dotfiles .gitattributes linguist-detectable=false diff --git a/.local/arch/init.sh b/.local/arch/init.sh index 0fa8694..35706d5 100755 --- a/.local/arch/init.sh +++ b/.local/arch/init.sh @@ -98,6 +98,7 @@ declare -A ALIASES=( [goapp]=go [godoc]=go [gradlew]=gradle + [bundler]=bundle ) mkdir -p "$DIRECTORY" raw() (printf 'https://raw.githubusercontent.com/%s' "$1/$2/master/$3") @@ -110,9 +111,18 @@ $(raw omakoto go-completion.bash go-completion.bash) out=go $(raw llvm-mirror clang utils/bash-autocomplete.sh) out=clang +$(raw mernen completion-ruby completion-ruby) + out=ruby +$(raw mernen completion-ruby completion-gem) + out=gem +$(raw mernen completion-ruby completion-bundle) + out=bundle +$(raw mernen completion-ruby completion-rake) + out=rake EOF printf 'complete -o default -F _ffmpeg ffprobe\n' >> "$DIRECTORY/ffmpeg" printf 'complete -o default -F _clang clang++\n' >> "$DIRECTORY/clang" +printf 'complete -o default -F __bundle bundler\n' >> "$DIRECTORY/bundle" for key in "${!ALIASES[@]}"; do ln -fvs "$DIRECTORY/${ALIASES[$key]}" "$DIRECTORY/$key" done @@ -120,6 +130,8 @@ grunt --completion=bash > "$DIRECTORY/grunt" gulp --completion=bash > "$DIRECTORY/gulp" pandoc --bash-completion > "$DIRECTORY/pandoc" poetry completions bash > "$DIRECTORY/poetry" +ln -fvs "$(gem contents travis | grep 'travis.sh$')" "$DIRECTORY/travis" +ln -fvs /usr/share/fzf/completion.bash "$DIRECTORY/fzf" unset -f DIRECTORY ALIASES raw # }}} @@ -167,12 +179,17 @@ sudo grub-mkconfig -o /boot/grub/grub.cfg unset -f URL THEME SWAP clone # }}} +# Make maven use XDG_CACHE_HOME {{{ +sudo sed -i /opt/maven/conf/settings.xml \ + -e "\%xsi:schema%a \\ + \\ + \${env.XDG_CACHE_HOME}/maven/repository\\ + " +# }}} + # Setup neovim {{{ nvim --headless +q >/dev/null nvim --headless +PlugInstall +qa >/dev/null -sudo update-alternatives --set editor /usr/bin/nvim -sudo tee --append /etc/sudoers <<< \ - 'Defaults env_keep += "EDITOR"' >/dev/null # }}} # Setup mozilla profiles {{{ diff --git a/.bash_aliases b/.local/share/bash/aliases.sh similarity index 94% rename from .bash_aliases rename to .local/share/bash/aliases.sh index c045187..176a331 100644 --- a/.bash_aliases +++ b/.local/share/bash/aliases.sh @@ -58,9 +58,6 @@ alert() { # Use like so: sleep 10; alert # }}} # Functions kept separately -test -f ~/.bash_funcs && . "$_" +test -f "$XDG_DATA_HOME/bash/functions.sh" && . "$_" -# Secret ssh aliases -test -f ~/.ssh/aliases && . "$_" - -# vim:set fdm=marker fdl=1: +# vim:fdm=marker:fdl=1: diff --git a/.bashrc b/.local/share/bash/bashrc.sh similarity index 79% rename from .bashrc rename to .local/share/bash/bashrc.sh index fd2fd19..dda86e2 100644 --- a/.bashrc +++ b/.local/share/bash/bashrc.sh @@ -1,9 +1,6 @@ # If not running interactively, don't do anything [[ $- =~ i ]] || return -# Make less more friendly for non-text input files -[ -x /usr/bin/lesspipe.sh ] && eval "$(SHELL=/bin/sh lesspipe.sh)" - # Define where cd looks for targets [ -d ~/Documents/Code/GitHub ] && CDPATH='.:~/Documents/Code/GitHub' @@ -34,17 +31,11 @@ FIGNORE='~:.o:.swp:.pyc' COMP_CONFIGURE_HINTS=1 # Alias definitions -test -f ~/.bash_aliases && . "$_" - -# Travis completion -test -f ~/.travis/travis.sh && . "$_" - -# FZF completion -test -f /usr/share/fzf/completion.bash && . "$_" +test -f "$XDG_DATA_HOME/bash/aliases.sh" && . "$_" # Uni configuration test -f ~/.unirc.sh && . "$_" : # ensure 0 exit code -# vim:set wrap lbr bri briopt=shift\:4: +# vim:wrap:lbr:bri:briopt=shift\:4: diff --git a/.bash_funcs b/.local/share/bash/functions.sh similarity index 99% rename from .bash_funcs rename to .local/share/bash/functions.sh index 5e2ad76..cb41d1f 100644 --- a/.bash_funcs +++ b/.local/share/bash/functions.sh @@ -157,4 +157,4 @@ pwned() { # Checks if a password has been compromised done } -# vim:set ft=sh fdm=syntax fdl=0: +# vim:fdm=syntax:fdl=0: diff --git a/.gnupg/gpg.conf b/.local/share/gnupg/gpg.conf similarity index 100% rename from .gnupg/gpg.conf rename to .local/share/gnupg/gpg.conf diff --git a/README.md b/README.md index 25cf8d6..cc382a8 100644 --- a/README.md +++ b/README.md @@ -17,10 +17,10 @@ Managed via [dotfiles.sh](https://github.com/eli-schwartz/dotfiles.sh) ## [Bash](https://www.gnu.org/software/bash/) -* [.bash_aliases](.bash_aliases): contains various aliases -* [.bash_funcs](.bash_funcs): contains various functions * [.bash_profile](.bash_profile): login shell configuration file -* [.bashrc](.bashrc): interactive shell configuration file +* [.local/share/bash/aliases.sh](.local/share/bash/aliases.sh): contains various aliases +* [.local/share/bash/bashrc.sh](.local/share/bash/bashrc.sh): interactive shell configuration file +* [.local/share/bash/functions.sh](.local/share/bash/functions.sh): contains various functions ## [Ccache](https://github.com/ccache/ccache) @@ -57,7 +57,7 @@ Managed via [dotfiles.sh](https://github.com/eli-schwartz/dotfiles.sh) ## [GnuPG](https://gnupg.org/) -* [.gnupg/gpg.conf](.gnupg/gpg.conf): configuration file +* [.local/share/gnupgp/gpg.conf](.local/share/gnupg/gpg.conf): configuration file ## [KDE Plasma](https://kde.org/plasma-desktop) @@ -65,7 +65,6 @@ Managed via [dotfiles.sh](https://github.com/eli-schwartz/dotfiles.sh) ## [Konsole](https://konsole.kde.org/) -* [.config/konsolerc](.config/konsolerc): configuration file * [.local/share/konsole/Default.profile](.local/share/konsole/Default.profile): default profile * [.local/share/konsole/NvimTerm.profile](.local/share/konsole/NvimTerm.profile): `nvim +term` profile * [.local/share/konsole/Gruvbox8.colorscheme](.local/share/konsole/Gruvbox8.colorscheme): `Gruvbox8` colorscheme @@ -96,6 +95,10 @@ Managed via [dotfiles.sh](https://github.com/eli-schwartz/dotfiles.sh) * [.config/pycodestyle](.config/pycodestyle): configuration file +## [Python](https://www.python.org/) + +* [.config/pythonrc.py](.config/pythonrc.py): startup file + ## [Qutebrowser](https://www.qutebrowser.org/) * [.config/qutebrowser/config.py](.config/qutebrowser/config.py): configuration file @@ -104,6 +107,10 @@ Managed via [dotfiles.sh](https://github.com/eli-schwartz/dotfiles.sh) * [.pug-lintrc.json](.pug-lintrc.json): configuration file +## [Readline](https://tiswww.case.edu/php/chet/readline/rltop.html) + +* [.config/inputrc](.config/inputrc): configuration file + ## [Stylelint](https://stylelint.io/) * [.stylelintrc.json](.stylelintrc.json): configuration file @@ -114,7 +121,7 @@ Managed via [dotfiles.sh](https://github.com/eli-schwartz/dotfiles.sh) ## [X.Org](https://www.x.org/wiki/) -* [.XCompose](.XCompose): X client character mappings +* [.config/X11/XCompose](.config/X11/XCompose): X client character mappings ## [Yarn](https://yarnpkg.com/lang/en/)