diff options
Diffstat (limited to 'zsh/zscripts')
-rwxr-xr-x | zsh/zscripts/!rootcolors.zsh | 3 | ||||
-rwxr-xr-x | zsh/zscripts/.lfub.zsh | 27 | ||||
-rwxr-xr-x | zsh/zscripts/aliasrc.zsh | 64 | ||||
-rwxr-xr-x | zsh/zscripts/hosts/aliasrc.G3N2.zsh | 6 | ||||
l--------- | zsh/zscripts/hosts/aliasrc.T495.zsh | 1 | ||||
-rwxr-xr-x | zsh/zscripts/hosts/aliasrc.desktop.zsh | 12 | ||||
-rwxr-xr-x | zsh/zscripts/hosts/aliasrc.libreX60.zsh | 11 | ||||
-rwxr-xr-x | zsh/zscripts/hosts/aliasrc.voidx250.zsh | 8 | ||||
-rwxr-xr-x | zsh/zscripts/hosts/colors.desktop.zsh | 9 | ||||
-rwxr-xr-x | zsh/zscripts/hosts/colors.voidx250.zsh | 9 | ||||
-rwxr-xr-x | zsh/zscripts/keybindrc.zsh | 24 | ||||
-rwxr-xr-x | zsh/zscripts/nicegit.zsh | 31 | ||||
-rwxr-xr-x | zsh/zscripts/shortcuts.zsh | 12 | ||||
-rwxr-xr-x | zsh/zscripts/terminalname.zsh | 8 | ||||
-rwxr-xr-x | zsh/zscripts/termuxprompt.zsh | 8 | ||||
-rwxr-xr-x | zsh/zscripts/vicursor.zsh | 21 | ||||
-rwxr-xr-x | zsh/zscripts/zplug.zsh | 136 | ||||
-rwxr-xr-x | zsh/zscripts/zshcompmenu.zsh | 18 |
18 files changed, 0 insertions, 408 deletions
diff --git a/zsh/zscripts/!rootcolors.zsh b/zsh/zscripts/!rootcolors.zsh deleted file mode 100755 index d146aa5..0000000 --- a/zsh/zscripts/!rootcolors.zsh +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env zsh - -[ $EUID = 0 ] && declare col{br,name,at,host,dir}=red && clear # Clear to get rid of last login message diff --git a/zsh/zscripts/.lfub.zsh b/zsh/zscripts/.lfub.zsh deleted file mode 100755 index 2e1f7f4..0000000 --- a/zsh/zscripts/.lfub.zsh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/sh -# This is a wrapper script for lf that allows it to create image previews with -# ueberzug. This works in concert with the lf configuration file and the -# lf-cleaner script. - -cleanuplf() { - exec 3>&- - \rm "$FIFO_UEBERZUG" -} - -lfub() { - dircache=/tmp/$USER-lflastdir - lfopt="--last-dir-path=$dircache" - if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then - lf "$lfopt" "$@" - else - export FIFO_UEBERZUG="/tmp/ueberzug-$$" - mkfifo "$FIFO_UEBERZUG" - ueberzug layer -s <"$FIFO_UEBERZUG" -p json & - exec 3>"$FIFO_UEBERZUG" - trap cleanuplf HUP INT QUIT TERM PWR EXIT - lf "$lfopt" "$@" 3>&- - fi - [ -f "$dircache" ] && dir="$(cat "$dircache")" && [ -d "$dir" ] && cd "$dir" -} - -alias lf="lfub" diff --git a/zsh/zscripts/aliasrc.zsh b/zsh/zscripts/aliasrc.zsh deleted file mode 100755 index f4e5035..0000000 --- a/zsh/zscripts/aliasrc.zsh +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/env zsh - -# Replacement programs -typeset -A repaliases=( - #alias replacement - htop htim - mutt neomutt - vim nvim - sudo "${SUDO:- }" - neofetch fastfetch -) -for alias rep in ${(kv)repaliases}; do - command -v $rep >/dev/null && alias $alias=$rep -done # Tests if replacement exists before creating alias - - -# Shorten program names -alias \ - open="xdg-open" \ - smci="sudo make clean install" \ - smi="sudo make install" \ - su="sudo su -l" \ - -# Power scripts -alias \ - halt="launch shutdown" \ - off="launch shutdown" \ - reboot="launch reboot" \ - zzz="launch suspend" \ - -# Colorize command output -alias \ - bat="bat --theme='Monokai Extended'" \ - diff="diff --color=auto" \ - exa="exa --icons -a --group-directories-first" \ - grep="grep --color=auto -I --ignore-case --line-number" \ - ip="ip --color=auto" \ - ls="ls -vAhN --color=auto --group-directories-first" \ - -# (Non)-Verbosity -alias \ - cp="cp -iv" \ - dd="sudo dd status=progress bs=4M" - ffmpeg="ffmpeg -hide_banner" \ - ffprobe="ffprobe -hide_banner" \ - mkd="mkdir -p" \ - mv="mv -iv" \ - rm="rm -v" \ - -# Miscellaneous -alias \ - yt-dlp-album="yt-dlp -x -o '%(uploader)s (%(upload_date>%Y)s) - %(playlist_title)s%%%(playlist_index)s - %(title)s.%(ext)s'" \ - yt-dlp="yt-dlp -o '%(uploader)s - %(title)s.%(ext)s'" \ - -# Clean home directory -alias \ - mbsync="mbsync --config $MBSYNCRC" \ - startx="startx $X11CONFIG/xinitrc" \ - -# Copy-pasting from internet -alias \ - \$="" \ - \#="${SUDO-sudo}" \ - diff --git a/zsh/zscripts/hosts/aliasrc.G3N2.zsh b/zsh/zscripts/hosts/aliasrc.G3N2.zsh deleted file mode 100755 index 8e8d2a5..0000000 --- a/zsh/zscripts/hosts/aliasrc.G3N2.zsh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Package Management -alias \ - e="sudo emerge" \ - diff --git a/zsh/zscripts/hosts/aliasrc.T495.zsh b/zsh/zscripts/hosts/aliasrc.T495.zsh deleted file mode 120000 index 6c84487..0000000 --- a/zsh/zscripts/hosts/aliasrc.T495.zsh +++ /dev/null @@ -1 +0,0 @@ -aliasrc.desktop.zsh
\ No newline at end of file diff --git a/zsh/zscripts/hosts/aliasrc.desktop.zsh b/zsh/zscripts/hosts/aliasrc.desktop.zsh deleted file mode 100755 index 141212f..0000000 --- a/zsh/zscripts/hosts/aliasrc.desktop.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/aliasrc.libreX60.zsh b/zsh/zscripts/hosts/aliasrc.libreX60.zsh deleted file mode 100755 index 1180171..0000000 --- a/zsh/zscripts/hosts/aliasrc.libreX60.zsh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh - -# Package Management -alias \ - apt="sudo apt" \ - -# Shorten program names -alias \ - systemctl="sudo systemctl" \ - sd="systemctl" \ - diff --git a/zsh/zscripts/hosts/aliasrc.voidx250.zsh b/zsh/zscripts/hosts/aliasrc.voidx250.zsh deleted file mode 100755 index 4bb85ea..0000000 --- a/zsh/zscripts/hosts/aliasrc.voidx250.zsh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -# Package Management -alias \ - xi="sudo xbps-install" \ - xq="xbps-query -R --search" \ - xr="sudo xbps-remove" \ - diff --git a/zsh/zscripts/hosts/colors.desktop.zsh b/zsh/zscripts/hosts/colors.desktop.zsh deleted file mode 100755 index dee7ed3..0000000 --- a/zsh/zscripts/hosts/colors.desktop.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 diff --git a/zsh/zscripts/hosts/colors.voidx250.zsh b/zsh/zscripts/hosts/colors.voidx250.zsh deleted file mode 100755 index 910f1f9..0000000 --- a/zsh/zscripts/hosts/colors.voidx250.zsh +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env zsh - -if [ -n "$DISPLAY" ]; then - declare col{br,at}=green - declare col{name,host}=76 - coldir=40 -else - declare col{br,name,at,host,dir}=green -fi diff --git a/zsh/zscripts/keybindrc.zsh b/zsh/zscripts/keybindrc.zsh deleted file mode 100755 index 2f2e664..0000000 --- a/zsh/zscripts/keybindrc.zsh +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env zsh - -# Vi mode + requirements for ALL keybindings to work correctly -bindkey -v # Select viins keymap -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 '^[[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 - -# Ignore ctrl-d to exit shell -setopt IGNORE_EOF diff --git a/zsh/zscripts/nicegit.zsh b/zsh/zscripts/nicegit.zsh deleted file mode 100755 index 276d98e..0000000 --- a/zsh/zscripts/nicegit.zsh +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env zsh - -alias \ - ga="git add" \ - gpl="git pull" \ - gph="git push" \ - gl="git log" \ - gldaily='git log --pretty="format:- %s" --after="00:00" --before="24:00"' \ - - -function gc() { - if ! __is_diff; then - echo "Nothing to commit, working tree clean" - return - fi - - if [[ "$@" != "" ]]; then - commit="$@" - else - echo "Enter commit message:" && read commit - fi - git commit -m "$commit" -} - -function __is_diff() { - ! git diff --quiet HEAD $REF -- $DIR -} - -function gdf() { - __is_diff && git diff HEAD $RED -- $DIR || echo "Repo is unchanged" -} diff --git a/zsh/zscripts/shortcuts.zsh b/zsh/zscripts/shortcuts.zsh deleted file mode 100755 index 214b7f7..0000000 --- a/zsh/zscripts/shortcuts.zsh +++ /dev/null @@ -1,12 +0,0 @@ -#!/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 ~/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" \ - diff --git a/zsh/zscripts/terminalname.zsh b/zsh/zscripts/terminalname.zsh deleted file mode 100755 index 6e55d22..0000000 --- a/zsh/zscripts/terminalname.zsh +++ /dev/null @@ -1,8 +0,0 @@ -function xtitle () { - builtin print -n -- "\e]0;$@\a" -} - -# Updates the window title whenever a command is run -function precmd () { - xtitle "$(print -P ${USER}@${HOST} %~)" -} diff --git a/zsh/zscripts/termuxprompt.zsh b/zsh/zscripts/termuxprompt.zsh deleted file mode 100755 index 1442cc8..0000000 --- a/zsh/zscripts/termuxprompt.zsh +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env zsh - -if [ -n "$TERMUX_VERSION" ]; then - PS1="%B%F{green}[%F{blue}%U%~%u%F{green}]%f%b%(!.#.$) " - PS1OVERRIDE=1 - export ZPLUGINSDIR=~/.local/share/zsh/zplugins - export ZPLUGNOROOT=1 -fi diff --git a/zsh/zscripts/vicursor.zsh b/zsh/zscripts/vicursor.zsh deleted file mode 100755 index 3e4320d..0000000 --- a/zsh/zscripts/vicursor.zsh +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env zsh - -# Change cursor shape for different vi modes -# Copied from LARBS -if [ -n "$DISPLAY" ]; then - function zle-keymap-select () { - case $KEYMAP in - vicmd) echo -n '\e[1 q';; # block - viins|main) echo -n '\e[5 q';; # beam - esac - } - zle -N zle-keymap-select - zle-line-init() { - #zle -K viins # initiate `vi insert` as keymap (can be removed if `bindkey -V` has been set elsewhere) - echo -n "\e[5 q" - } - zle -N zle-line-init - echo -n '\e[5 q' # Use beam shape cursor on startup - preexec() { echo -n '\e[5 q' ;} # Use beam shape cursor for each new prompt -fi - diff --git a/zsh/zscripts/zplug.zsh b/zsh/zscripts/zplug.zsh deleted file mode 100755 index 27dc70f..0000000 --- a/zsh/zscripts/zplug.zsh +++ /dev/null @@ -1,136 +0,0 @@ -#!/usr/bin/env zsh - -local home=~ -local zplugs="${ZDOTDIR:-$home/.}${ZDOTDIR:+/}zplugs" # Declare all variables using `local` to keep them away from the interactive shell -local zplugins="${ZPLUGINSDIR:-$home/.local/share/zsh/zplugins}" -#[[ $EUID != 0 ]] && [ -z "$ZPLUGNOROOT" ] && local sudo=${SUDO-sudo} - -function __zplugInstall() { - touch "$zplugs" - local pluglist=( `\grep -v '#' "$zplugs"` ) - local confirm plug - shift - for plug in "$@"; do; pluglist+=(${plug}); done - - $sudo mkdir -p "$zplugins" - - for plug in ${pluglist[@]}; do - [ -d "$zplugins/$(basename -s'.git' "$plug")" ] && continue - if ! `$sudo git -C "$zplugins" clone "$plug" "$(basename -s'.git' "$plug")"`; then - # Runs if git has an error - printf "Remove \"$plug\"? [y|n]: " - read confirm - case $confirm in - y|yes) pluglist=(${pluglist#$plug}) && echo "Repo Deleted" ;; - *) echo "Repo Kept" ;; - esac - fi - echo - done - for plug in ${pluglist[@]}; do echo "$plug"; done | sort -u > "$zplugs" - echo "All plugins installed and saved to $zplugs!\nDone" -} - -function __zplugUninstall() { - local pluglist=( `cat "$zplugs"` ) pluglistbn=() - local confirm i plug plugids plugig - - [ -z "$pluglist" ] && echo "No packages are installed!" && return - - $sudo mkdir -p "$zplugins" - echo "Listing all packages in $zplugins ..." - for i in {1..${#pluglist[@]}}; do - pluglistbn[$i]="$(basename -s'.git' "${pluglist[$i]}")" - printf '%3d) %s\n' $i "${pluglistbn[$i]}" - done - - echo - printf "Choose zsh plugin(s) to remove: " - read plugids - [ -z "$plugids" ] && echo "No plugins selected\nAborting" && return - - echo "\nListing selected plugins:" - for plugid in $=plugids; do - if [ -z ${pluglist[$plugid]} ]; then - echo "Error: input \"$plugid\" is not a valid plugin identifier" - return - fi - echo "\t${pluglistbn[$plugid]}" - done - - printf "\nReally remove all of these plugins? [y|n]: " - read confirm - case $confirm in - y|yes) ;; - n|no) echo "Aborted" && return ;; - *) echo "Input not understood\nAborted" && return ;; - esac - for plugid in $=plugids; do - printf '\t' - $sudo rm -vrf "$zplugins/${pluglistbn[$plugid]}" - pluglist[$plugid]="" - done - for plug in ${pluglist[@]}; do echo "$plug"; done | sort -u > "$zplugs" - echo "\nDone" -} - -function __zplugUpgrade() { - local plugdir - $sudo mkdir -p "$zplugins" - echo "Upgrading all packages...\n" - for plugdir in "$zplugins"/*; do; - basename "$plugdir" - $sudo git -C "$plugdir" pull; - echo - done - echo "Done" -} - -function __zplugList() { - mkdir -p "$zplugins" - echo "Listing all packages...\n" - ls "$zplugins" | nl -s') ' -w3 - echo "\nDone" -} - -function __zplugHelp() { - echo "Usage: zplug [install/add/i|uninstall/remove/r|upgrade/update/u|list/l|help/h] - install, add, i [packages] : Install plugins from config file & add any new plugins - uninstall, remove, r : Interactively remove plugins - upgrade, update, u : Update all installed plugins - list, l : List all installed plugins - help, h : Show this help menu - - All plugins are listed in $zplugs - All plugins are installed in $zplugins - - To install a plugin, just put it in the zplug file and run \"zplug install\" - or just run \"zplug install [plugin]\" where [plugin] is a link to download the - plugin using git - - For instance, \"https://github.com/zdharma-continuum/fast-syntax-highlighting\" is - a valid plugin link for the fast-syntax-highlighting plugin. - - To use your plugins, just put \"zplugInitialize\" as the last line of your zshrc!" -} - -function zplug() { - local cmd=${1:-h} - case $cmd in - install|add|i) __zplugInstall $@ ;; - uninstall|remove|r) __zplugUninstall ;; - upgrade|update|u) __zplugUpgrade ;; - list|l) __zplugList ;; - help|h) __zplugHelp ;; - *) echo "zplug: input \"$1\" not recognized!" && __zplugHelp ;; - esac -} - -function zplugInitialize() { - local plugin - if ! [ -d "$zplugins" ] && [ -f "$zplugs" ]; then - echo "zplug installing plugins..." - __zplugInstall 0 # Put in some value since there is a shift - fi - for plugin in "$zplugins"/*/*.zsh; do source "$plugin"; done 2>/dev/null -} diff --git a/zsh/zscripts/zshcompmenu.zsh b/zsh/zscripts/zshcompmenu.zsh deleted file mode 100755 index 0d471a5..0000000 --- a/zsh/zscripts/zshcompmenu.zsh +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env zsh - -# Basic auto/tab complete -autoload -U compinit -zstyle ':completion:*' menu select -zmodload zsh/complist -compinit -d "${XDG_CACHE_HOME:-$HOME/.config}/zcompdump" # Change where .zcompdump is stored -_comp_options+=(globdots) # Include hidden files. - -# Use ctrl-vi keys in tab complete menu -bindkey -M menuselect '^h' vi-backward-char -bindkey -M menuselect '^j' vi-down-line-or-history -bindkey -M menuselect '^k' vi-up-line-or-history -bindkey -M menuselect '^l' vi-forward-char -bindkey -v '^?' backward-delete-char - -# Options -setopt MENU_COMPLETE # Immediately insert first option from completion menu |