1
0
Fork 0
This commit is contained in:
Luca Bilke 2023-04-11 10:30:27 +02:00 committed by Luca Bilke
parent 01773469be
commit 5c32b08875
8 changed files with 34 additions and 28 deletions

View file

@ -45,7 +45,6 @@ def draw_tab(
else:
return screen.cursor.x
except FileNotFoundError:
print(f"KITTY TAB BAR ERROR: Can't find /tmp/current_venv for {active_pid}")
return screen.cursor.x
screen.cursor.x = screen.columns - len(str(env)) - 5

View file

@ -4,11 +4,13 @@ source $ZDOTDIR/configs/setup
source $ZDOTDIR/configs/widgets
source $ZDOTDIR/configs/bindings
source $ZDOTDIR/configs/aliases
source $ZDOTDIR/configs/host-setup
source $ZDOTDIR/plugins/fzf/bindings.zsh
source $ZDOTDIR/plugins/autopyenv/autopyenv.zsh
source $ZDOTDIR/plugins/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh
for f in $ZDOTDIR/configs/autogenerated/*; do
source $f
done
source $ZDOTDIR/plugins/fzf/bindings.zsh
source $ZDOTDIR/plugins/autopyenv/autopyenv.zsh
source $ZDOTDIR/plugins/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh

View file

@ -1,11 +1,11 @@
# vim:set ft=zsh
PYENV_DIR="${PYENVS_HOME:-$XDG_DATA_HOME}/virtualenv"
pydirs="${PYENVS_DIR:-$XDG_DATA_HOME/virtualenv}"
function chpwd_activate(){
[[ "$(pwd)" == "/" ]] && return 0
for pydir in $(ls $PYENV_DIR); do
if [[ "$(pwd | sed -e 's|/|~|g' | cut -c2-)" =~ "^${pydir}$" ]] || [[ "r-$(pwd | sed -e 's|/|~|g' | cut -c2-)" =~ "^${pydir}(_.+)?$" ]]; then
if [ "x$VIRTUAL_ENV" != "x$PYENV_DIR/$pydir" ]; then
source "$PYENV_DIR/$pydir/bin/activate"
for pydir in $(ls $pydirs); do
if [[ "$(pwd | sed -e 's|/|~|g' | cut -c2-)" =~ "^${pydir}$" ]] || [[ "r-$(pwd | sed -e 's|/|~|g' | cut -c2-)" =~ "^${pydir}(~.+)?$" ]]; then
if [ "x$VIRTUAL_ENV" != "x$pydirs/$pydir" ]; then
source "$pydirs/$pydir/bin/activate"
fi
return
fi
@ -19,12 +19,12 @@ function venv(){
[[ "$(pwd)" == "/" ]] && echo "Cannot create venv at root" && return 1
[[ "$(pwd)" != "/" ]] && envdir=$(pwd | sed -e 's|/|~|g' | cut -c2-)
[[ "$1" == "-r" ]] && envdir="r-$envdir" # create a venv that will be activated for all subdirectories as well
if [ ! -e "$PYENV_DIR/${envdir}" ]; then
if [ ! -e "$pydirs/${envdir}" ]; then
echo "Creating python venv for ${envdir}.."
mkdir "$PYENV_DIR" -p
python3 -m venv "$PYENV_DIR/${envdir}"
mkdir "$pydirs" -p
python3 -m venv "$pydirs/${envdir}"
echo "Activating virtual env ${envdir}"
source "$PYENV_DIR/${envdir}/bin/activate"
source "$pydirs/${envdir}/bin/activate"
else
echo "A venv for this path already exists"
fi

View file

@ -5,6 +5,10 @@ export EDITOR="nvim"
export TERMINAL="kitty"
export BROWSER="librewolf"
# Settings
export VIRTUAL_ENV_DISABLE_PROMPT=1
# Home Dir Cleanup
export XDG_DESKTOP_DIR="$HOME/Desktop"
export XDG_DOCUMENTS_DIR="$HOME/Documents"
export XDG_DOWNLOAD_DIR="$HOME/Downloads"
@ -17,7 +21,6 @@ export XDG_VIDEOS_DIR="$HOME/Videos"
export XDG_CONFIG_HOME="$HOME/.config"
export XDG_DATA_HOME="$HOME/.local/share"
export XDG_CACHE_HOME="$HOME/.cache"
export PYENVS_DIR="$XDG_DATA_HOME/virtualenv"
export KEYMAPS_DIR="$HOME/.local/bin/keymaps"
export ZSH_COMPDUMP="$XDG_CACHE_HOME/zcompdump"
export NOTMUCH_CONFIG="$XDG_CONFIG_HOME/notmuch-config"
@ -38,11 +41,11 @@ export UNISON="$XDG_DATA_HOME/unison"
export HISTFILE="$XDG_DATA_HOME/history"
export GRADLE_USER_HOME="$XDG_DATA_HOME/gradle"
export XAUTHORITY="$XDG_RUNTIME_DIR/Xauthority" # WARN: This line can break some display managers
export NPM_CONFIG_USERCONFIG="$XDG_CONFIG_HOME"/npm/npmrc
export NODE_REPL_HISTORY="$XDG_DATA_HOME"/node_repl_history
export CUDA_CACHE_PATH="$XDG_CACHE_HOME"/nv
export _JAVA_OPTIONS=-Djava.util.prefs.userRoot="$XDG_CONFIG_HOME"/java
export VIRTUAL_ENV_DISABLE_PROMPT=1
export NPM_CONFIG_USERCONFIG="$XDG_CONFIG_HOME/npm/npmrc"
export NODE_REPL_HISTORY="$XDG_DATA_HOME/node_repl_history"
export CUDA_CACHE_PATH="$XDG_CACHE_HOME/nv"
export _JAVA_OPTIONS=-Djava.util.prefs.userRoot="$XDG_CONFIG_HOME/java"
export MOZBUILD_STATE_PATH="$XDG_DATA_HOME/mozbuild"
export FZF_DEFAULT_OPTS="--layout=reverse --height 40%"
export LESS=-R
@ -58,7 +61,6 @@ export ANSIBLE_NOCOWS=1 # Stop those fucking cows in Ansible
localpath="$(find -L ~/.local/bin -type d -printf %p: | sed 's/.$//')"
export PATH="$PATH:$HOME/.local/share/npm-global/bin:$localpath"
export FPATH="$FPATH:$ZDOTDIR/functions:$ZDOTDIR/completions"
# Start X Server if logging in on TTY1 and no other server is running
[ -z "${DISPLAY}" ] && [ "${XDG_VTNR}" -eq 1 ] && ! pidof -s Xorg >/dev/null 2>&1 && exec startgraphical

View file

@ -1,3 +1,3 @@
#!/bin/sh
cd $HOME/.dotfiles/.librewolf || exit
# cd $HOME/.dotfiles/.librewolf || exit
librewolf --no-remote --CreateProfile "librewolf $HOME/.local/share/librewolf"

View file

@ -13,6 +13,6 @@ chosen=$(cut -d ';' -f1 ~/.local/share/chars/* | dmenu -i -l 30 | sed "s/ .*//")
if [ -n "$1" ]; then
xdotool type "$chosen"
else
printf "$chosen" | xclip -selection clipboard
printf "%s" "$chosen" | xclip -selection clipboard
notify-send "'$chosen' copied to clipboard." &
fi

View file

@ -1,15 +1,18 @@
#!/bin/sh
icon="\033[11m\033[10m"
if command -v pacman 1>/dev/null 2>&1; then
echo -n "$(pacman -Qu | grep -Fcv "[ignored]" | sed "s/^/ /;s/^ 0$//g")"
printf "%b" "$(pacman -Qu | grep -Fcv "[ignored]" | sed "s/^/$icon /;s/^$icon 0$//g")"
fi
if command -v apt 1>/dev/null 2>&1; then
vals=$(apt upgrade -sy 2>/dev/null | grep -m1 '^[0-9]\+ upgraded,' | tr -cd '0-9 ' | tr ' ' '\n' | grep '[0-9]\+' | xargs echo)
vals=$(apt upgrade -sy 2>/dev/null | grep -m1 '^[0-9]\+ upgraded,' | tr -cd '0-9 ' | tr ' ' '\n' | grep '[0-9]\+' | xargs)
for i in $vals; do
[ $i != 0 ] && icon="\033[11m\033[10m"
print="$print$i/"
[ "$i" != 0 ] && updates_available=yes
out="$out$i/"
done
[ -n "$icon" ] && printf "$icon " && echo " $print" | sed 's/\/$//'
[ -n "$updates_available" ] && printf "%b %s" "$icon" "$(echo "$out" | sed 's/\/$//')"
fi

@ -1 +1 @@
Subproject commit 92b413b056a08484fda28c31607671665755f96d
Subproject commit f943e5510c6f57b381bb723882d944e554b6c40f