summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam <56338480+adastx@users.noreply.github.com>2022-07-05 21:22:16 +0100
committerAdam <56338480+adastx@users.noreply.github.com>2022-07-18 16:44:00 +0200
commit73511892b43fb58aa81914a3a580288f846977af (patch)
treed18dcafa6157979686db945186e00862e0a348e0
parent9b20486a2956e2c21ed8b9509b6619cdde79135a (diff)
xdg: python_history
-rw-r--r--.config/python/pythonrc17
-rw-r--r--.config/zsh/.zprofile1
2 files changed, 18 insertions, 0 deletions
diff --git a/.config/python/pythonrc b/.config/python/pythonrc
new file mode 100644
index 0000000..f3f86a5
--- /dev/null
+++ b/.config/python/pythonrc
@@ -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)
diff --git a/.config/zsh/.zprofile b/.config/zsh/.zprofile
index 9ec11f6..a6f0db5 100644
--- a/.config/zsh/.zprofile
+++ b/.config/zsh/.zprofile
@@ -19,6 +19,7 @@ export _JAVA_OPTIONS="-Dawt.useSystemAAFontSettings=on -Dswing.aatext=true -Dswi
export SSB_HOME="$XDG_DATA_HOME"/zoom
export WGETRC="$XDG_CONFIG_HOME/wgetrc"
export WINEPREFIX="$XDG_DATA_HOME"/wineprefixes/default
+export PYTHONSTARTUP="${XDG_CONFIG_HOME}/python/pythonrc"
export CM_LAUNCHER=rofi
export CM_SELECTIONS=clipboard
export CM_DIR=/tmp