From 394204d20c551cc428c24ded331ef812ef3e6653 Mon Sep 17 00:00:00 2001 From: Timmy Keller Date: Sat, 9 Sep 2023 08:51:32 -0500 Subject: script to change terminal window name to match prompt --- zsh/zscripts/terminalname.zsh | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 zsh/zscripts/terminalname.zsh (limited to 'zsh') diff --git a/zsh/zscripts/terminalname.zsh b/zsh/zscripts/terminalname.zsh new file mode 100644 index 0000000..8543896 --- /dev/null +++ b/zsh/zscripts/terminalname.zsh @@ -0,0 +1,8 @@ +function xtitle () { + builtin print -n -- "\e]0;$@\a" +} + +# Updates the window title whenever a command is run +function precmd () { + xtitle "$(print -P ${USER}@${HOST} %2~)" +} -- cgit v1.2.3 From ea3f4043c4895f51a519adca6c73d7b389007f8e Mon Sep 17 00:00:00 2001 From: Timmy Keller Date: Sat, 9 Sep 2023 09:09:08 -0500 Subject: change keybindings to work with zsh and clean up spacing --- zsh/zscripts/keybindrc.zsh | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) (limited to 'zsh') diff --git a/zsh/zscripts/keybindrc.zsh b/zsh/zscripts/keybindrc.zsh index 5e6ee83..2f2e664 100755 --- a/zsh/zscripts/keybindrc.zsh +++ b/zsh/zscripts/keybindrc.zsh @@ -6,24 +6,19 @@ KEYTIMEOUT=1 # Keybindings autoload edit-command-line; zle -N edit-command-line # Edit line in Vim buffer -bindkey '^E' edit-command-line # Ctrl-e - edit line in Vim buffer +bindkey '^E' edit-command-line # Ctrl-e - edit line in Vim buffer -bindkey '^[[P' delete-char # Delete Key -bindkey '^[[4~' end-of-line # End Key -bindkey '^[[H' beginning-of-line # Home Key -bindkey '^[[4h' overwrite-mode # Insert Key -bindkey '^D' kill-whole-line # Ctrl-d - delete line -bindkey '^X' clear-screen # Ctrl-x - clear screen -bindkey '^H' backward-delete-word # Ctrl-Backspace - delete entire word behind cursor -bindkey '^[[M' delete-word # Ctrl-Delete - delete currect word in front of the cursor +bindkey '^[[P' delete-char # Delete Key +bindkey '^[[F' end-of-line # End Key +bindkey '^[[H' beginning-of-line # Home Key +bindkey '^[[2~' overwrite-mode # Insert Key +bindkey '^D' kill-whole-line # Ctrl-d - delete line +bindkey '^X' clear-screen # Ctrl-x - clear screen +bindkey '^H' backward-delete-word # Ctrl-Backspace - delete entire word behind cursor +bindkey '^[[3;5~' delete-word # Ctrl-Delete - delete currect word in front of the cursor # History completion -bindkey '\e[A' history-search-backward # Up arrow - seach history backwards -bindkey '\e[B' history-search-forward # Down arrow - seach history forwards -# Ctrl-vi keys emulate arrow keys -#bindkey '^L' emacs-forward-word # Ctrl-H - go forward one word -#bindkey '^J' history-search-forward # Ctrl-J - seach history backwards -#bindkey '^K' history-search-backward # Ctrl-K - seach history forwards -#bindkey '^H' emacs-backward-word # Ctrl-L - go back one word +bindkey '\e[A' history-search-backward # Up arrow - seach history backwards +bindkey '\e[B' history-search-forward # Down arrow - seach history forwards # Ignore ctrl-d to exit shell setopt IGNORE_EOF -- cgit v1.2.3 From a78d9dd25c4c2d988b425ea0ed3dc190867cd7ca Mon Sep 17 00:00:00 2001 From: Timmy Keller Date: Sat, 9 Sep 2023 10:32:30 -0500 Subject: infinite length path in window title and make script executable --- zsh/zscripts/terminalname.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 zsh/zscripts/terminalname.zsh (limited to 'zsh') diff --git a/zsh/zscripts/terminalname.zsh b/zsh/zscripts/terminalname.zsh old mode 100644 new mode 100755 index 8543896..6e55d22 --- a/zsh/zscripts/terminalname.zsh +++ b/zsh/zscripts/terminalname.zsh @@ -4,5 +4,5 @@ function xtitle () { # Updates the window title whenever a command is run function precmd () { - xtitle "$(print -P ${USER}@${HOST} %2~)" + xtitle "$(print -P ${USER}@${HOST} %~)" } -- cgit v1.2.3 From a9e3e3057ddfae2ae2393868febe8dfa0c4fb58f Mon Sep 17 00:00:00 2001 From: Timmy Keller Date: Sat, 9 Sep 2023 10:37:34 -0500 Subject: reflect changing hostname fedora to desktop --- zsh/zscripts/hosts/aliasrc.desktop.zsh | 12 ++++++++++++ zsh/zscripts/hosts/aliasrc.fedora.zsh | 12 ------------ zsh/zscripts/hosts/colors.desktop.zsh | 9 +++++++++ zsh/zscripts/hosts/colors.fedora.zsh | 9 --------- 4 files changed, 21 insertions(+), 21 deletions(-) create mode 100755 zsh/zscripts/hosts/aliasrc.desktop.zsh delete mode 100755 zsh/zscripts/hosts/aliasrc.fedora.zsh create mode 100755 zsh/zscripts/hosts/colors.desktop.zsh delete mode 100755 zsh/zscripts/hosts/colors.fedora.zsh (limited to 'zsh') diff --git a/zsh/zscripts/hosts/aliasrc.desktop.zsh b/zsh/zscripts/hosts/aliasrc.desktop.zsh new file mode 100755 index 0000000..141212f --- /dev/null +++ b/zsh/zscripts/hosts/aliasrc.desktop.zsh @@ -0,0 +1,12 @@ +#!/bin/sh + +# Package Management +alias \ + d="sudo dnf" \ + dnf="sudo dnf" \ + +# Shorten program names +alias \ + systemctl="sudo systemctl" \ + sd="systemctl" \ + diff --git a/zsh/zscripts/hosts/aliasrc.fedora.zsh b/zsh/zscripts/hosts/aliasrc.fedora.zsh deleted file mode 100755 index 141212f..0000000 --- a/zsh/zscripts/hosts/aliasrc.fedora.zsh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -# Package Management -alias \ - d="sudo dnf" \ - dnf="sudo dnf" \ - -# Shorten program names -alias \ - systemctl="sudo systemctl" \ - sd="systemctl" \ - diff --git a/zsh/zscripts/hosts/colors.desktop.zsh b/zsh/zscripts/hosts/colors.desktop.zsh new file mode 100755 index 0000000..dee7ed3 --- /dev/null +++ b/zsh/zscripts/hosts/colors.desktop.zsh @@ -0,0 +1,9 @@ +#!/usr/bin/env zsh + +if [ -n "$DISPLAY" ]; then + declare col{br,at}=57 + declare col{name,host}=13 + coldir=129 +else + declare col{br,name,at,host,dir}=magenta +fi diff --git a/zsh/zscripts/hosts/colors.fedora.zsh b/zsh/zscripts/hosts/colors.fedora.zsh deleted file mode 100755 index dee7ed3..0000000 --- a/zsh/zscripts/hosts/colors.fedora.zsh +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env zsh - -if [ -n "$DISPLAY" ]; then - declare col{br,at}=57 - declare col{name,host}=13 - coldir=129 -else - declare col{br,name,at,host,dir}=magenta -fi -- cgit v1.2.3 From 39628ca7cf62383a39525f1945ebab7a6319465f Mon Sep 17 00:00:00 2001 From: Timmy Keller Date: Sat, 9 Sep 2023 19:52:48 -0500 Subject: change pythonuserbase to .local/bin/python and add bin to path --- zsh/zprofile | 2 ++ 1 file changed, 2 insertions(+) (limited to 'zsh') diff --git a/zsh/zprofile b/zsh/zprofile index 209e56a..2049165 100755 --- a/zsh/zprofile +++ b/zsh/zprofile @@ -26,6 +26,7 @@ export CARGO_HOME="$XDG_DATA_HOME/cargo" export GNUPGHOME="$XDG_DATA_HOME/gnupg" export GRADLE_USER_HOME="$XDG_DATA_HOME/gradle" export PASSWORD_STORE_DIR="$XDG_DATA_HOME/password-store" +export PYTHONUSERBASE="$XDG_DATA_HOME/python" export _JAVA_OPTIONS="-Djava.util.prefs.userRoot=$XDG_DATA_HOME/java" export XDG_STATE_HOME="$HOME/.local/state" @@ -36,6 +37,7 @@ export ZHISTFILE="$XDG_STATE_HOME/zsh/zhistory" # Used to set HISTFILE in zshrc for lbin in "$HOME/.local/bin"{/,/*/}; do export PATH="${lbin%/}:$PATH"; done 2>/dev/null # Add ~/.local/bin and all sub dirs export PATH="$HOME/.local/opt:$PATH" export PATH="$CARGO_HOME/bin:$PATH" +export PATH="$PYTHONUSERBASE/bin:$PATH" # Theming export QT_QPA_PLATFORMTHEME='qt5ct' -- cgit v1.2.3 From 866f16893ddd51c06f4b30211a6156d5f09453bb Mon Sep 17 00:00:00 2001 From: Timmy Keller Date: Sat, 9 Sep 2023 21:02:02 -0500 Subject: cdc cdw cds direct to docs/src now --- zsh/zscripts/aliasrc.zsh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'zsh') diff --git a/zsh/zscripts/aliasrc.zsh b/zsh/zscripts/aliasrc.zsh index 842d634..9c0e659 100755 --- a/zsh/zscripts/aliasrc.zsh +++ b/zsh/zscripts/aliasrc.zsh @@ -20,10 +20,9 @@ alias \ # Quick navigate to directories / open specific files alias \ - cdc="cd ~/.local/src/programs" \ - cds="cd ~/.local/bin" \ - cdw="cd ~/.local/src/sites" \ - hw="cd ~/docs/school" \ + cdc="cd ~/docs/src/programs" \ + cds="cd ~/docs/src/bin" \ + cdw="cd ~/docs/src/sites" \ vrc="vim ~/.config/nvim/init.vim" \ xrc="cd ~/.config/x11" \ zrc="cd ~/.config/zsh" \ -- cgit v1.2.3 From 503e1c3ad21a5367fe2d5c988afac30fa16f5f60 Mon Sep 17 00:00:00 2001 From: Timmy Keller Date: Sun, 10 Sep 2023 10:17:30 -0500 Subject: move ansible files from home dir --- zsh/zprofile | 3 +++ 1 file changed, 3 insertions(+) (limited to 'zsh') diff --git a/zsh/zprofile b/zsh/zprofile index 2049165..33e2e01 100755 --- a/zsh/zprofile +++ b/zsh/zprofile @@ -11,9 +11,12 @@ export SUDO='doas' # Make programs follow the XDG base directory specification export XDG_CACHE_HOME="$HOME/.cache" +export ANSIBLE_GALAXY_CACHE_DIR="${XDG_CACHE_HOME}/ansible/galaxy_cache" export XAUTHORITY="$XDG_CACHE_HOME/Xauthority" export XDG_CONFIG_HOME="$HOME/.config" +export ANSIBLE_HOME="${XDG_CONFIG_HOME}/ansible" +export ANSIBLE_CONFIG="${XDG_CONFIG_HOME}/ansible.cfg" export GTK2_RC_FILES="$XDG_CONFIG_HOME/gtk-2.0/gtkrc" export MBSYNCRC="$XDG_CONFIG_HOME/mbsync/config" export NOTMUCH_CONFIG="$XDG_CONFIG_HOME/notmuch/config" -- cgit v1.2.3 From 259d50a2a18daae577ff3c80bd0285a0357f0a53 Mon Sep 17 00:00:00 2001 From: Timmy Keller Date: Mon, 11 Sep 2023 12:05:45 -0500 Subject: move shortcut aliases to shortcuts.zsh --- zsh/zscripts/aliasrc.zsh | 9 --------- zsh/zscripts/shortcuts.zsh | 8 ++++---- 2 files changed, 4 insertions(+), 13 deletions(-) (limited to 'zsh') diff --git a/zsh/zscripts/aliasrc.zsh b/zsh/zscripts/aliasrc.zsh index 9c0e659..049c9c7 100755 --- a/zsh/zscripts/aliasrc.zsh +++ b/zsh/zscripts/aliasrc.zsh @@ -18,15 +18,6 @@ alias \ smi="sudo make install" \ su="sudo su -l" \ -# Quick navigate to directories / open specific files -alias \ - cdc="cd ~/docs/src/programs" \ - cds="cd ~/docs/src/bin" \ - cdw="cd ~/docs/src/sites" \ - vrc="vim ~/.config/nvim/init.vim" \ - xrc="cd ~/.config/x11" \ - zrc="cd ~/.config/zsh" \ - # Power scripts alias \ halt="launch shutdown" \ diff --git a/zsh/zscripts/shortcuts.zsh b/zsh/zscripts/shortcuts.zsh index fb34337..214b7f7 100755 --- a/zsh/zscripts/shortcuts.zsh +++ b/zsh/zscripts/shortcuts.zsh @@ -1,11 +1,11 @@ #!/usr/bin/env zsh +# TODO make this script more comprehensive to allow real aliases for directories # Quick navigate to directories / open specific files alias \ - cdc="cd ~/.local/src/programs" \ - cds="cd ~/.local/bin" \ - cdw="cd ~/.local/src/sites" \ - hw="cd ~/docs/school" \ + cdc="cd ~/docs/src/programs" \ + cds="cd ~/docs/src/scripts" \ + cdw="cd ~/docs/src/sites" \ vrc="vim ~/.config/nvim/init.vim" \ xrc="cd ~/.config/x11" \ zrc="cd ~/.config/zsh" \ -- cgit v1.2.3