pythonrc and other dotfiles

This commit is contained in:
Danilo Reyes 2023-11-28 21:04:15 -06:00
parent b30073b7b8
commit 66b4ce43d2
2 changed files with 20 additions and 0 deletions

17
dotfiles/pythonrc Normal file
View File

@ -0,0 +1,17 @@
import os
import atexit
import readline
history = os.path.join(os.environ['XDG_CACHE_HOME'], 'python_history')
try:
readline.read_history_file(history)
except OSError:
pass
def write_history():
try:
readline.write_history_file(history)
except OSError:
pass
atexit.register(write_history)

View File

@ -827,6 +827,7 @@ xdg = {
"npm/npmrc".source = ../dotfiles/npm/npmrc;
"gallery-dl/config.json".source = ../dotfiles/gallery-dl/config.json;
"htop/htoprc".source = ../dotfiles/htop/htoprc;
"python/pythonrc".source = ../dotfiles/pythonrc;
};
};
#+end_src
@ -944,6 +945,8 @@ environment = {
PSQL_HISTORY="${XDG_DATA_HOME}/psql_history";
REDISCLI_HISTFILE="${XDG_DATA_HOME}/redis/rediscli_history";
WINEPREFIX="${XDG_DATA_HOME}/wine";
PYTHONSTARTUP="${XDG_CONFIG_HOME}/python/pythonrc";
STACK_ROOT="${XDG_DATA_HOME}/stack";
# OPTIONS
HISTFILE = "${XDG_STATE_HOME}/bash/history";