Let my HOME alone 2/2

Also I messed up my Vim syntax coloring and probably X with DM.
Oh well.
This commit is contained in:
Geoffrey Frogeye 2019-04-28 04:05:45 +02:00
parent a83e45df5e
commit 62120e4592
17 changed files with 136 additions and 85 deletions

View file

@ -1,10 +0,0 @@
#!/bin/sh
#
# ~/.Xclients
#
# Executed by xdm/gdm/kdm at login
#
/bin/bash --login -i ~/.xinitrc

View file

@ -1,3 +1,49 @@
import rlcompleter import rlcompleter
import readline 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

View file

@ -17,10 +17,10 @@ curl "https://raw.githubusercontent.com/chriskempson/base16-shell/master/scripts
chmod +x ~/.local/bin/colorSchemeApply chmod +x ~/.local/bin/colorSchemeApply
# Xressources (I'm not sure if this is really needed with shell overriding these but i3 load those resources) # 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 # 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 # FZF
curl "https://raw.githubusercontent.com/nicodebo/base16-fzf/master/bash/base16-${scheme}.config" > ~/.local/bin/colorSchemeApplyFzf 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/colorSchemeApply
~/.local/bin/colorSchemeApplyFzf ~/.local/bin/colorSchemeApplyFzf
# Error masking in case X not running # 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 i3-msg reload 2> /dev/null

View file

@ -19,6 +19,7 @@ alias dd='dd status=progress'
alias rm='rm -Iv --one-file-system' alias rm='rm -Iv --one-file-system'
alias free='free -m' alias free='free -m'
alias dmesg='dmesg --ctime' alias dmesg='dmesg --ctime'
alias wget='wget --hsts-file $HOME/.cache/wget-hsts'
# [ -f ~/.local/bin/colorSchemeApplyFzf ] && . ~/.local/bin/colorSchemeApplyFzf # Only applies RGB colors... # [ -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 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

View file

@ -25,20 +25,35 @@ export JAVA_FONTS=/usr/share/fonts/TTF # 2019-04-25 Attempt to remove .java/font
# export ARDUINO_DIR=$ARDUINO # export ARDUINO_DIR=$ARDUINO
# export ARDMK_VENDOR=archlinux-arduino # export ARDMK_VENDOR=archlinux-arduino
# Get out of my $HOME!
direnv GOPATH "$HOME/.cache/go" direnv GOPATH "$HOME/.cache/go"
direnv CARGOHOME "$HOME/.cache/cargo" # There are config in there that we can version if one want direnv CARGOHOME "$HOME/.cache/cargo" # There are config in there that we can version if one want
direnv CCACHE_BASEDIR "$HOME/.cache/ccache" direnv CCACHE_BASEDIR "$HOME/.cache/ccache"
export CCACHE_CONFIGPATH="$HOME/.config/ccache.conf" export CCACHE_CONFIGPATH="$HOME/.config/ccache.conf"
direnv GNUPGHOME "$HOME/.config/gnupg" direnv GNUPGHOME "$HOME/.config/gnupg"
direnv GRADLE_USER_HOME "$HOME/.cache/gradle"
export INPUTRC="$HOME/.config/inputrc" export INPUTRC="$HOME/.config/inputrc"
export LESSHISTFILE="$HOME/.cache/lesshst" export LESSHISTFILE="$HOME/.cache/lesshst"
direnv MONO_GAC_PREFIX "$HOME/.cache/mono" direnv MONO_GAC_PREFIX "$HOME/.cache/mono"
export NODE_REPL_HISTORY="$HOME/.cache/node_repl_history" export NODE_REPL_HISTORY="$HOME/.cache/node_repl_history"
direnv npm_config_cache "$HOME/.cache/npm" direnv npm_config_cache "$HOME/.cache/npm"
direnv PARALLEL_HOME "$HOME/.cache/parallel" 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"
# And for the rest, see aliases
# For programs that think $HOME is a reasonable place to put their junk
direnv JUNKHOME "$HOME/.cache/junkhome" direnv JUNKHOME "$HOME/.cache/junkhome"
# Path # Path

View file

@ -36,6 +36,7 @@ alias x='startx; logout'
alias nx='nvidia-xrun; logout' alias nx='nvidia-xrun; logout'
# For programs that think $HOME is a reasonable place to put their junk # 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 adb='HOME=$JUNKHOME adb'
alias audacity='HOME=$JUNKHOME audacity' alias audacity='HOME=$JUNKHOME audacity'
alias binwalk='HOME=$JUNKHOME binwalk' # Should use .config according to the GitHub code though 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 ddd='HOME=$JUNKHOME ddd'
alias ghidra='HOME=$JUNKHOME ghidra' alias ghidra='HOME=$JUNKHOME ghidra'
alias itch='HOME=$JUNKHOME itch' 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 # 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 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 gdb='gdb -x $HOME/.config/gdbinit'
alias iftop='iftop -c $HOME/.config/iftoprc' alias iftop='iftop -c $HOME/.config/iftoprc'
alias lmms='lmms --config $HOME/.config/lmmsrc.xml' 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 # TODO ruby's gem when I find a use for it

View file

@ -4,6 +4,9 @@
set nocompatible set nocompatible
filetype off filetype off
set runtimepath=~/.config/vim,~/.cache/vim
set viminfo+=n~/.cache/vim/viminfo
""" PLUGINS MANAGEMENT """ """ PLUGINS MANAGEMENT """
" NOTE 18-06-24 Got rid of Vundle in favor of vim-plug (why: more recent, supports " 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 " uncomment them again if you need to
" Auto-install vim-plug " Auto-install vim-plug
if empty(glob('~/.vim/autoload/plug.vim')) if empty(glob('~/.cache/vim/autoload/plug.vim'))
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs silent !curl -fLo ~/.cache/vim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif endif
" Plugin definition " Plugin definition
call plug#begin() call plug#begin('~/.cache/vim/plugged')
" Plug 'L9' " Plug 'L9'
" Plug 'rstacruz/sparkup', {'rtp': 'vim/'} " Plug 'rstacruz/sparkup', {'rtp': 'vim/'}
@ -200,11 +203,11 @@ set wildmode=longest,list
set showcmd set showcmd
" Put plugins and dictionaries in this dir (also on Windows) " Put plugins and dictionaries in this dir (also on Windows)
let vimDir = '$HOME/.vim' let vimDir = '$HOME/.cache/vim'
let &runtimepath.=','.vimDir let &runtimepath.=','.vimDir
" theme " theme
source $HOME/.vim/colorscheme.vim source $HOME/.cache/vim/colorscheme.vim
" Keep undo history across sessions by storing it in a file " Keep undo history across sessions by storing it in a file
if has('persistent_undo') if has('persistent_undo')

View file

@ -1 +0,0 @@
{}

View file

@ -2,7 +2,9 @@
# #
# ~/.xinitrc # ~/.xinitrc
# #
# Executed by startx (run your window manager from here) # Executed by xinit (startx)
echo ~/.xinitrc
if [ -d /etc/X11/xinit/xinitrc.d ]; then if [ -d /etc/X11/xinit/xinitrc.d ]; then
for f in /etc/X11/xinit/xinitrc.d/*; do for f in /etc/X11/xinit/xinitrc.d/*; do
@ -14,3 +16,5 @@ fi
[ -f /etc/xprofile ] && . /etc/xprofile [ -f /etc/xprofile ] && . /etc/xprofile
[ -f ~/.xprofile ] && . ~/.xprofile [ -f ~/.xprofile ] && . ~/.xprofile
[ -f ~/.xsession ] && . ~/.xsession

View file

@ -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

View file

@ -3,8 +3,56 @@
# #
# ~/.xsession # ~/.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