diff --git a/functions/bluetooth b/functions/bluetooth new file mode 100755 index 0000000..449be4f --- /dev/null +++ b/functions/bluetooth @@ -0,0 +1,4 @@ +#!/bin/sh + +bssid="$(bluetoothctl devices | dmenu -p "Devices: " -l 20 | cut -d' ' -f2)" +bluetoothctl connect "$bssid" diff --git a/functions/killer b/functions/killer new file mode 100755 index 0000000..f647204 --- /dev/null +++ b/functions/killer @@ -0,0 +1,4 @@ +#!/bin/sh + +pidd="$(ps -u $USER -o pid,%mem,%cpu,comm | sort -b -k2 -r | sed -n '1!p' | dmenu -i -l 15 | awk '{print $1}')" +kill -15 "$pidd" diff --git a/functions/wifi b/functions/wifi new file mode 100644 index 0000000..13a3fa0 --- /dev/null +++ b/functions/wifi @@ -0,0 +1,5 @@ +#!/bin/sh + +bssid="$(nmcli -f BSSID,SSID,SIGNAL,RATE,BARS,SECURITY dev wifi list | sed -n '1!p' | dmenu -p "WiFi: " -l 20 | cut -d' ' -f1)" +pass="$(echo "" | dmenu -p "Password: ")" +nmcli device wifi connect "$bssid" "password" "$pass" diff --git a/sub/bash/functions b/sub/bash/functions index 1c4176c..2e1aa0b 100644 --- a/sub/bash/functions +++ b/sub/bash/functions @@ -152,7 +152,11 @@ docker_ips() { py() { - test -z "$@" && ipython -i -c "q = exit" || python3 $@ + if [ -z "$@" -a -n "$(which ipython)" ]; then + ipython -i -c "q = exit" + else + python3 $@ + fi } diff --git a/sub/bash/shopt b/sub/bash/shopt index 5b1d069..1d95db3 100644 --- a/sub/bash/shopt +++ b/sub/bash/shopt @@ -8,3 +8,5 @@ shopt -s checkwinsize ## Update col/lines after commands shopt -s cdspell ## Fixes minor spelling errors in cd paths shopt -s no_empty_cmd_completion ## Stops empty line tab comp shopt -s dirspell 2>/dev/null ## Tab comp can fix dir name typos + +bind '"\e."':yank-last-arg diff --git a/sub/zsh/completion b/sub/zsh/completion index 0b833bf..ae3c014 100644 --- a/sub/zsh/completion +++ b/sub/zsh/completion @@ -1,5 +1,6 @@ # enable completion features +fpath+=~/.zfunc autoload -Uz compinit compinit -d ~/.cache/zcompdump zstyle ':completion:*:*:*:*:*' menu select diff --git a/sub/zsh/options b/sub/zsh/options index 6a470aa..5c0783e 100644 --- a/sub/zsh/options +++ b/sub/zsh/options @@ -14,12 +14,11 @@ WORDCHARS=${WORDCHARS//\/} # Don't consider certain characters part of the word PROMPT_EOL_MARK="" # configure key keybindings -bindkey -e # emacs key bindings +bindkey -v +bindkey -M viins 'jk' vi-cmd-mode bindkey ' ' magic-space # do history expansion on space bindkey '^[[3;5~' kill-word # ctrl + Supr bindkey '^[[3~' delete-char # delete -bindkey '^[[1;5C' forward-word # ctrl + -> -bindkey '^[[1;5D' backward-word # ctrl + <- bindkey '^[[5~' beginning-of-buffer-or-history # page up bindkey '^[[6~' end-of-buffer-or-history # page down bindkey '^[[H' beginning-of-line # home @@ -27,5 +26,7 @@ bindkey '^[[F' end-of-line # end bindkey '^[[Z' undo # shift + tab undo last action bindkey '^K' up-line-or-history bindkey '^J' down-line-or-history -bindkey '^E' vi-forward-word -bindkey '^B' vi-backward-word +bindkey '^U' kill-whole-line +bindkey -M vicmd '^U' kill-whole-line +bindkey -M viins '^U' kill-whole-line +bindkey -M viins '\e.' insert-last-word diff --git a/sub/zsh/other b/sub/zsh/other index 2b35d0a..43ba5a1 100644 --- a/sub/zsh/other +++ b/sub/zsh/other @@ -25,6 +25,8 @@ if [ -f /usr/share/zsh-autosuggestions/zsh-autosuggestions.zsh ]; then fi -export PYENV_ROOT="$HOME/.pyenv" -command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH" -eval "$(pyenv init -)" +if [ -n "$(command -v pyenv >/dev/null)" ]; then + export PYENV_ROOT="$HOME/.pyenv" + export PATH="$PYENV_ROOT/bin:$PATH" + eval "$(pyenv init -)" +fi