diff --git a/Xclients b/Xclients deleted file mode 100755 index e9ea196..0000000 --- a/Xclients +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -# -# ~/.Xclients -# -# Executed by xdm/gdm/kdm at login -# - -/bin/bash --login -i ~/.xinitrc - diff --git a/config/pythonstartup.py b/config/pythonstartup.py index cc23251..4e8f34b 100644 --- a/config/pythonstartup.py +++ b/config/pythonstartup.py @@ -1,3 +1,49 @@ import rlcompleter import readline -readline.parse_and_bind("tab: complete") +import sys +import os + +print("HELLO") + +# From https://github.com/python/cpython/blob/v3.7.0b5/Lib/site.py#L436 +# Changing the history file +def register_readline(): + import atexit + try: + import readline + import rlcompleter + except ImportError: + return + + # Reading the initialization (config) file may not be enough to set a + # completion key, so we set one first and then read the file. + readline_doc = getattr(readline, '__doc__', '') + if readline_doc is not None and 'libedit' in readline_doc: + readline.parse_and_bind('bind ^I rl_complete') + else: + readline.parse_and_bind('tab: complete') + + try: + readline.read_init_file() + except OSError: + # An OSError here could have many causes, but the most likely one + # is that there's no .inputrc file (or .editrc file in the case of + # Mac OS X + libedit) in the expected location. In that case, we + # want to ignore the exception. + pass + + if readline.get_current_history_length() == 0: + # If no history was loaded, default to .python_history. + # The guard is necessary to avoid doubling history size at + # each interpreter exit when readline was already configured + # through a PYTHONSTARTUP hook, see: + # http://bugs.python.org/issue5845#msg198636 + history = os.path.join(os.path.expanduser('~'), + '.cache/python_history') + try: + readline.read_history_file(history) + except OSError: + pass + atexit.register(readline.write_history_file, history) + +sys.__interactivehook__ = register_readline diff --git a/screenrc b/config/screenrc similarity index 100% rename from screenrc rename to config/screenrc diff --git a/config/scripts/changeColors b/config/scripts/changeColors index 9abb14b..a6c326b 100755 --- a/config/scripts/changeColors +++ b/config/scripts/changeColors @@ -17,10 +17,10 @@ curl "https://raw.githubusercontent.com/chriskempson/base16-shell/master/scripts chmod +x ~/.local/bin/colorSchemeApply # Xressources (I'm not sure if this is really needed with shell overriding these but i3 load those resources) -curl "https://raw.githubusercontent.com/chriskempson/base16-xresources/master/xresources/base16-${scheme}-256.Xresources" > ~/.Xresources.d/theme +curl "https://raw.githubusercontent.com/chriskempson/base16-xresources/master/xresources/base16-${scheme}-256.Xresources" > ~/.config/Xresources/theme # Vim -echo -e "let base16colorspace=256\n\"set termguicolors\ncolorscheme base16-${scheme}" > ~/.vim/colorscheme.vim +echo -e "let base16colorspace=256\n\"set termguicolors\ncolorscheme base16-${scheme}" > ~/.cache/vim/colorscheme.vim # FZF curl "https://raw.githubusercontent.com/nicodebo/base16-fzf/master/bash/base16-${scheme}.config" > ~/.local/bin/colorSchemeApplyFzf @@ -44,6 +44,6 @@ curl "https://raw.githubusercontent.com/theova/base16-qutebrowser/master/themes/ ~/.local/bin/colorSchemeApply ~/.local/bin/colorSchemeApplyFzf # Error masking in case X not running -xrdb -load ~/.Xresources 2> /dev/null +xrdb -load ~/.config/Xresources/main 2> /dev/null i3-msg reload 2> /dev/null diff --git a/config/shell/commonrc b/config/shell/commonrc index ef0f6f5..2ec993a 100644 --- a/config/shell/commonrc +++ b/config/shell/commonrc @@ -19,6 +19,7 @@ alias dd='dd status=progress' alias rm='rm -Iv --one-file-system' alias free='free -m' alias dmesg='dmesg --ctime' +alias wget='wget --hsts-file $HOME/.cache/wget-hsts' # [ -f ~/.local/bin/colorSchemeApplyFzf ] && . ~/.local/bin/colorSchemeApplyFzf # Only applies RGB colors... POWERLINE_GO_DEFAULT_OPTS=(-colorize-hostname -max-width 25 -cwd-max-dir-size 10 -modules 'user,host,venv,cwd,perms,git' -modules-right 'jobs,exit,duration,load') # For reading by shell profiles diff --git a/config/shell/shenv b/config/shell/shenv index ae056f3..50c9870 100644 --- a/config/shell/shenv +++ b/config/shell/shenv @@ -25,20 +25,35 @@ export JAVA_FONTS=/usr/share/fonts/TTF # 2019-04-25 Attempt to remove .java/font # export ARDUINO_DIR=$ARDUINO # export ARDMK_VENDOR=archlinux-arduino +# Get out of my $HOME! direnv GOPATH "$HOME/.cache/go" direnv CARGOHOME "$HOME/.cache/cargo" # There are config in there that we can version if one want direnv CCACHE_BASEDIR "$HOME/.cache/ccache" export CCACHE_CONFIGPATH="$HOME/.config/ccache.conf" direnv GNUPGHOME "$HOME/.config/gnupg" +direnv GRADLE_USER_HOME "$HOME/.cache/gradle" export INPUTRC="$HOME/.config/inputrc" export LESSHISTFILE="$HOME/.cache/lesshst" direnv MONO_GAC_PREFIX "$HOME/.cache/mono" export NODE_REPL_HISTORY="$HOME/.cache/node_repl_history" direnv npm_config_cache "$HOME/.cache/npm" direnv PARALLEL_HOME "$HOME/.cache/parallel" +export PYTHONSTARTUP="$HOME/.config/pythonstartup.py" +export SCREENRC="$HOME/.config/screenrc" +export SQLITE_HISTFILE="$HOME/.cache/sqlite_history" +export TASKRC="$HOME/.config/taskrc" +direnv TASKDATA "$HOME/.config/task" +direnv TERMINFO "$HOME/.config/terminfo" +direnv TIMEWARRIORDB "$HOME/.config/timewarrior" +export RXVT_SOCKET="$HOME/.cache/urxvtd-$HOST" +export MYVIMRC="$HOME/.config/vim/vimrc" +export VIMINIT="source $MYVIMRC" +direnv WINEPREFIX "$HOME/.cache/wineprefix/default" +direnv YARN_CACHE_FOLDER "$HOME/.cache/yarn" +export YARN_DISABLE_SELF_UPDATE_CHECK=true # This also disable the creation of a ~/.yarnrc file +export XAUTHORITY="$HOME/.config/Xauthority" - -# For programs that think $HOME is a reasonable place to put their junk +# And for the rest, see aliases direnv JUNKHOME "$HOME/.cache/junkhome" # Path diff --git a/config/shell/shrc b/config/shell/shrc index 0f65deb..7fa3871 100644 --- a/config/shell/shrc +++ b/config/shell/shrc @@ -36,6 +36,7 @@ alias x='startx; logout' alias nx='nvidia-xrun; logout' # For programs that think $HOME is a reasonable place to put their junk +# and don't allow the user to change those questionable choices alias adb='HOME=$JUNKHOME adb' alias audacity='HOME=$JUNKHOME audacity' alias binwalk='HOME=$JUNKHOME binwalk' # Should use .config according to the GitHub code though @@ -44,12 +45,16 @@ alias cmake='HOME=$JUNKHOME cmake' alias ddd='HOME=$JUNKHOME ddd' alias ghidra='HOME=$JUNKHOME ghidra' alias itch='HOME=$JUNKHOME itch' +alias simplescreenrecorder='HOME=$JUNKHOME simplescreenrecorder' # Easy fix https://github.com/MaartenBaert/ssr/blob/1556ae456e833992fb6d39d40f7c7d7c337a4160/src/Main.cpp#L252 +alias vd='HOME=$JUNKHOME vd' +alias wpa_cli='HOME=$JUNKHOME wpa_cli' # TODO Maybe we can do something about node-gyp alias bower='bower --config.storage.packages=~/.cache/bower/packages --config.storage.registry=~/.cache/bower/registry --config.storage.links=~/.cache/bower/links' alias gdb='gdb -x $HOME/.config/gdbinit' alias iftop='iftop -c $HOME/.config/iftoprc' alias lmms='lmms --config $HOME/.config/lmmsrc.xml' +alias tmux='tmux -f $HOME/.config/tmux.conf' # TODO ruby's gem when I find a use for it diff --git a/terminfo/a/alacritty b/config/terminfo/a/alacritty similarity index 100% rename from terminfo/a/alacritty rename to config/terminfo/a/alacritty diff --git a/terminfo/a/alacritty-256color b/config/terminfo/a/alacritty-256color similarity index 100% rename from terminfo/a/alacritty-256color rename to config/terminfo/a/alacritty-256color diff --git a/terminfo/r/rxvt-unicode b/config/terminfo/r/rxvt-unicode similarity index 100% rename from terminfo/r/rxvt-unicode rename to config/terminfo/r/rxvt-unicode diff --git a/terminfo/r/rxvt-unicode-256color b/config/terminfo/r/rxvt-unicode-256color similarity index 100% rename from terminfo/r/rxvt-unicode-256color rename to config/terminfo/r/rxvt-unicode-256color diff --git a/tmux.conf b/config/tmux.conf similarity index 100% rename from tmux.conf rename to config/tmux.conf diff --git a/vimrc b/config/vim/vimrc similarity index 94% rename from vimrc rename to config/vim/vimrc index 3dec9a0..921811f 100644 --- a/vimrc +++ b/config/vim/vimrc @@ -4,6 +4,9 @@ set nocompatible filetype off +set runtimepath=~/.config/vim,~/.cache/vim +set viminfo+=n~/.cache/vim/viminfo + """ PLUGINS MANAGEMENT """ " NOTE 18-06-24 Got rid of Vundle in favor of vim-plug (why: more recent, supports @@ -11,14 +14,14 @@ filetype off " uncomment them again if you need to " Auto-install vim-plug -if empty(glob('~/.vim/autoload/plug.vim')) - silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs +if empty(glob('~/.cache/vim/autoload/plug.vim')) + silent !curl -fLo ~/.cache/vim/autoload/plug.vim --create-dirs \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim autocmd VimEnter * PlugInstall --sync | source $MYVIMRC endif " Plugin definition -call plug#begin() +call plug#begin('~/.cache/vim/plugged') " Plug 'L9' " Plug 'rstacruz/sparkup', {'rtp': 'vim/'} @@ -200,11 +203,11 @@ set wildmode=longest,list set showcmd " Put plugins and dictionaries in this dir (also on Windows) -let vimDir = '$HOME/.vim' +let vimDir = '$HOME/.cache/vim' let &runtimepath.=','.vimDir " theme -source $HOME/.vim/colorscheme.vim +source $HOME/.cache/vim/colorscheme.vim " Keep undo history across sessions by storing it in a file if has('persistent_undo') diff --git a/tern-config b/tern-config deleted file mode 100644 index 0967ef4..0000000 --- a/tern-config +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/xinitrc b/xinitrc index c636ffe..3a18a90 100755 --- a/xinitrc +++ b/xinitrc @@ -2,7 +2,9 @@ # # ~/.xinitrc # -# Executed by startx (run your window manager from here) +# Executed by xinit (startx) + +echo ~/.xinitrc if [ -d /etc/X11/xinit/xinitrc.d ]; then for f in /etc/X11/xinit/xinitrc.d/*; do @@ -14,3 +16,5 @@ fi [ -f /etc/xprofile ] && . /etc/xprofile [ -f ~/.xprofile ] && . ~/.xprofile +[ -f ~/.xsession ] && . ~/.xsession + diff --git a/xprofile b/xprofile deleted file mode 100755 index 4232742..0000000 --- a/xprofile +++ /dev/null @@ -1,60 +0,0 @@ -#!/bin/sh - -# -# ~/.xprofile -# -# sourced by your display manager -# - - -[ -f ~/.config/Xresources/main ] && xrdb -I"$HOME" ~/.config/Xresources/main -xset b off - -export GTK2_RC_FILES="$HOME/.gtkrc-2.0" - -found=0 -tryDM() { - if [ $found -eq 0 ]; then - parameters='' - case $1 in - awesome ) executable=awesome;; - bspwm ) executable=bspwm;; - catwm ) executable=catwm;; - cinnamon ) executable=cinnamon-session;; - dwm ) executable=dwm;; - enlightenment ) executable=enlightenment_start;; - ede ) executable=startede;; - fluxbox ) executable=startfluxbox;; - gnome ) executable=gnome-session;; - gnome-classic ) executable=gnome-session; parameters="--session=gnome-classic";; - i3|i3wm ) executable=i3;; - icewm ) executable=icewm-session;; - jwm ) executable=jwm;; - kde ) executable=startkde;; - mate ) executable=mate-session;; - monster|monsterwm ) executable=monsterwm;; - notion ) executable=notion;; - openbox ) executable=openbox-session;; - unity ) executable=unity;; - xfce|xfce4 ) executable=startxfce4;; - xmonad ) executable=xmonad;; - *) executable=$1;; - esac - if commannd -v "$executable" - then - found=1 - exec "$executable" $parameters - fi - fi -} - -if [ -n "$1" ] -then - tryDM "$1" -fi -tryDM i3 -tryDM xfce4 -tryDM mate -tryDM gnome -tryDM kde - diff --git a/xsession b/xsession index a16dc0b..c7950d6 100755 --- a/xsession +++ b/xsession @@ -3,8 +3,56 @@ # # ~/.xsession # -# Executed by xdm/gdm/kdm at login +# Might be sourced by DM when on custom +# TODO Test that on a DM I guess? # -/bin/bash --login -i ~/.xinitrc +[ -f ~/.config/Xresources/main ] && xrdb -I"$HOME" ~/.config/Xresources/main +xset b off + +found=0 +tryDM() { + if [ $found -eq 0 ]; then + parameters='' + case $1 in + awesome ) executable=awesome;; + bspwm ) executable=bspwm;; + catwm ) executable=catwm;; + cinnamon ) executable=cinnamon-session;; + dwm ) executable=dwm;; + enlightenment ) executable=enlightenment_start;; + ede ) executable=startede;; + fluxbox ) executable=startfluxbox;; + gnome ) executable=gnome-session;; + gnome-classic ) executable=gnome-session; parameters="--session=gnome-classic";; + i3|i3wm ) executable=i3;; + icewm ) executable=icewm-session;; + jwm ) executable=jwm;; + kde ) executable=startkde;; + mate ) executable=mate-session;; + monster|monsterwm ) executable=monsterwm;; + notion ) executable=notion;; + openbox ) executable=openbox-session;; + unity ) executable=unity;; + xfce|xfce4 ) executable=startxfce4;; + xmonad ) executable=xmonad;; + *) executable=$1;; + esac + if command -v "$executable" + then + found=1 + exec "$executable" $parameters + fi + fi +} + +if [ -n "$1" ] +then + tryDM "$1" +fi +tryDM i3 +tryDM xfce4 +tryDM mate +tryDM gnome +tryDM kde