Move .python_history to a new location
Signed-off-by: Severin Kaderli <severin.kaderli@gmail.com>
This commit is contained in:
parent
62b2829be4
commit
55306bd850
4 changed files with 27 additions and 2 deletions
|
@ -46,6 +46,7 @@ LINKED_FILES_HOME=(
|
||||||
".config/npm"
|
".config/npm"
|
||||||
".config/polybar"
|
".config/polybar"
|
||||||
".config/pulse"
|
".config/pulse"
|
||||||
|
".config/python"
|
||||||
".config/redshift"
|
".config/redshift"
|
||||||
".config/streamlink"
|
".config/streamlink"
|
||||||
".config/termite"
|
".config/termite"
|
||||||
|
|
|
@ -36,6 +36,10 @@ export GEM_SPEC_CACHE="${XDG_CACHE_HOME}/gem/specs"
|
||||||
mkdir -p "${XDG_DATA_HOME}/wine/prefixes"
|
mkdir -p "${XDG_DATA_HOME}/wine/prefixes"
|
||||||
export WINEPREFIX="${XDG_DATA_HOME}/wine/prefixes/default"
|
export WINEPREFIX="${XDG_DATA_HOME}/wine/prefixes/default"
|
||||||
|
|
||||||
|
# Python
|
||||||
|
mkdir -p "${XDG_DATA_HOME}/python"
|
||||||
|
export PYTHONSTARTUP="${XDG_CONFIG_HOME}/python/startup.py"
|
||||||
|
|
||||||
# zsh
|
# zsh
|
||||||
export ZDOTDIR="${XDG_CONFIG_HOME}/zsh"
|
export ZDOTDIR="${XDG_CONFIG_HOME}/zsh"
|
||||||
export HISTFILE="${XDG_DATA_HOME}/zsh/history"
|
export HISTFILE="${XDG_DATA_HOME}/zsh/history"
|
||||||
|
@ -47,7 +51,7 @@ compinit -d "${XDG_DATA_HOME}/zsh/zcompdump-${ZSH_VERSION}"
|
||||||
|
|
||||||
# Setting applications
|
# Setting applications
|
||||||
export VISUAL=vim
|
export VISUAL=vim
|
||||||
export EDITOR="$VISUAL"
|
export EDITOR="${VISUAL}"
|
||||||
export TERMINAL=termite
|
export TERMINAL=termite
|
||||||
|
|
||||||
# QT
|
# QT
|
||||||
|
|
20
system/.config/python/startup.py
Executable file
20
system/.config/python/startup.py
Executable file
|
@ -0,0 +1,20 @@
|
||||||
|
import atexit
|
||||||
|
import os
|
||||||
|
import readline
|
||||||
|
|
||||||
|
XDG_DATA_HOME = os.environ["XDG_DATA_HOME"]
|
||||||
|
|
||||||
|
if not XDG_DATA_HOME:
|
||||||
|
histfile = os.path.join(os.path.expanduser(
|
||||||
|
"~"), ".local", "share", "python", "history")
|
||||||
|
else:
|
||||||
|
histfile = os.path.join(XDG_DATA_HOME, "python", "history")
|
||||||
|
|
||||||
|
try:
|
||||||
|
readline.set_auto_history(False)
|
||||||
|
readline.read_history_file(histfile)
|
||||||
|
readline.set_history_length(1000)
|
||||||
|
except FileNotFoundError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
atexit.register(readline.write_history_file, histfile)
|
Loading…
Add table
Add a link
Reference in a new issue