From afe917b512cd814d427b9d7b2da4d7045f05e8fa Mon Sep 17 00:00:00 2001 From: Colin Powell Date: Tue, 12 Nov 2019 11:41:01 -0500 Subject: [PATCH] Updating #fishshell --- fish/.config/fish/.fishfile.swp | Bin 0 -> 12288 bytes fish/.config/fish/conf.d/done.fish | 152 ---------------- fish/.config/fish/fishfile | 1 - fish/.config/fish/functions/3screens.fish | 3 - fish/.config/fish/functions/archey.sh | 167 ------------------ fish/.config/fish/functions/dbag.fish | 5 - fish/.config/fish/functions/dces.fish | 5 - fish/.config/fish/functions/dcesdj.fish | 5 - fish/.config/fish/functions/doomu.fish | 7 - fish/.config/fish/functions/fe.fish | 3 + .../fish/functions/humanize_duration.fish | 19 -- fish/.config/fish/functions/k.fish | 3 - fish/.config/fish/functions/nconn.fish | 3 - fish/.config/fish/functions/off.fish | 2 +- fish/.config/fish/functions/on.fish | 2 +- fish/.config/fish/functions/pe.fish | 3 + fish/.config/fish/functions/rechunk.fish | 3 - fish/.config/fish/functions/update.fish | 8 - fish/.config/fish/functions/zd.fish | 11 -- 19 files changed, 8 insertions(+), 394 deletions(-) create mode 100644 fish/.config/fish/.fishfile.swp delete mode 100644 fish/.config/fish/conf.d/done.fish delete mode 100644 fish/.config/fish/functions/3screens.fish delete mode 100644 fish/.config/fish/functions/archey.sh delete mode 100644 fish/.config/fish/functions/dbag.fish delete mode 100644 fish/.config/fish/functions/dces.fish delete mode 100644 fish/.config/fish/functions/dcesdj.fish delete mode 100644 fish/.config/fish/functions/doomu.fish create mode 100644 fish/.config/fish/functions/fe.fish delete mode 100644 fish/.config/fish/functions/humanize_duration.fish delete mode 100644 fish/.config/fish/functions/k.fish delete mode 100644 fish/.config/fish/functions/nconn.fish create mode 100644 fish/.config/fish/functions/pe.fish delete mode 100644 fish/.config/fish/functions/rechunk.fish delete mode 100644 fish/.config/fish/functions/update.fish delete mode 100644 fish/.config/fish/functions/zd.fish diff --git a/fish/.config/fish/.fishfile.swp b/fish/.config/fish/.fishfile.swp new file mode 100644 index 0000000000000000000000000000000000000000..c5e1f7664a08a44401e61ca9665c996db5eff82d GIT binary patch literal 12288 zcmeI&KTg9i6bA5D7E}od1Q#fO#OAs!ORvDt5jKX9*oj-m4zW#D2AH@5r{D@~oPi^7 z12%-yh6SNY9V>m7K3R^PC;7KUdAEb>%SmtCA5t6#MBTmjn{z7Y`;4fvbD?$G?5rJC zZA;+`5!~8i^w<{U{mgo)v~XN1SMYvnja2z+(L8DP)|bLA1R$`9K=6`{yL2%c4w~0a zPmX&>hgX|az*z`D00Izz00bZa0SG`~%LRPZp{ICf#Bli_ LNn|O%O`M}21a)CY literal 0 HcmV?d00001 diff --git a/fish/.config/fish/conf.d/done.fish b/fish/.config/fish/conf.d/done.fish deleted file mode 100644 index c5af877..0000000 --- a/fish/.config/fish/conf.d/done.fish +++ /dev/null @@ -1,152 +0,0 @@ -# MIT License - -# Copyright (c) 2016 Francisco Lourenço & Daniel Wehner - -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: - -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - -set -g __done_version 1.10.0 - -function __done_get_focused_window_id - if type -q lsappinfo - lsappinfo info -only bundleID (lsappinfo front) | cut -d '"' -f4 - else if test -n "$SWAYSOCK" - and type -q jq - swaymsg --type get_tree | jq '.. | objects | select(.focused == true) | .id' - else if type -q xprop - and test -n "$DISPLAY" - xprop -root 32x '\t$0' _NET_ACTIVE_WINDOW | cut -f 2 - end -end - -function __done_is_tmux_window_active - set -q fish_pid; or set -l fish_pid %self - - not tmux list-panes -a -F "#{session_attached} #{window_active} #{pane_pid}" | string match -q "1 0 $fish_pid" -end - -function __done_is_process_window_focused - # Return false if the window is not focused - if test $__done_initial_window_id != (__done_get_focused_window_id) - return 1 - end - # If inside a tmux session, check if the tmux window is focused - if type -q tmux - and test -n "$TMUX" - __done_is_tmux_window_active - return $status - end - - return 0 -end - - -# verify that the system has graphical capabilites before initializing -if test -z "$SSH_CLIENT" # not over ssh -and count (__done_get_focused_window_id) > /dev/null # is able to get window id - - set -g __done_initial_window_id '' - set -q __done_min_cmd_duration; or set -g __done_min_cmd_duration 5000 - set -q __done_exclude; or set -g __done_exclude 'git (?!push|pull)' - set -q __done_notify_sound; or set -g __done_notify_sound 0 - - function __done_started --on-event fish_preexec - set __done_initial_window_id (__done_get_focused_window_id) - end - - function __done_ended --on-event fish_prompt - set -l exit_status $status - - # backwards compatibilty for fish < v3.0 - set -q cmd_duration; or set -l cmd_duration $CMD_DURATION - - if test $cmd_duration - and test $cmd_duration -gt $__done_min_cmd_duration # longer than notify_duration - and not __done_is_process_window_focused # process pane or window not focused - and not string match -qr $__done_exclude $history[1] # don't notify on git commands which might wait external editor - - # Store duration of last command - set -l humanized_duration (echo "$cmd_duration" | humanize_duration) - - set -l title "Done in $humanized_duration" - set -l wd (pwd | sed "s,^$HOME,~,") - set -l message "$wd/ $history[1]" - set -l sender $__done_initial_window_id - - if test $exit_status -ne 0 - set title "Failed ($exit_status) after $humanized_duration" - end - - if set -q __done_notification_command - eval $__done_notification_command - if test "$__done_notify_sound" -eq 1 - echo -e "\a" # bell sound - end - else if type -q terminal-notifier # https://github.com/julienXX/terminal-notifier - if test "$__done_notify_sound" -eq 1 - terminal-notifier -message "$message" -title "$title" -sender "$__done_initial_window_id" -sound default - else - terminal-notifier -message "$message" -title "$title" -sender "$__done_initial_window_id" - end - - else if type -q osascript # AppleScript - osascript -e "display notification \"$message\" with title \"$title\"" - if test "$__done_notify_sound" -eq 1 - echo -e "\a" # bell sound - end - - else if type -q notify-send # Linux notify-send - set -l urgency - if test $exit_status -ne 0 - set urgency "--urgency=critical" - end - notify-send $urgency --icon=terminal --app-name=fish "$title" "$message" - if test "$__done_notify_sound" -eq 1 - echo -e "\a" # bell sound - end - - else if type -q notify-desktop # Linux notify-desktop - set -l urgency - if test $exit_status -ne 0 - set urgency "--urgency=critical" - end - notify-desktop $urgency --icon=terminal --app-name=fish "$title" "$message" - if test "$__done_notify_sound" -eq 1 - echo -e "\a" # bell sound - end - - else # anything else - echo -e "\a" # bell sound - end - - end - end -end - -function __done_uninstall -e done_uninstall - # Erase all __done_* functions - functions -e __done_ended - functions -e __done_started - functions -e __done_get_focused_window_id - functions -e __done_is_tmux_window_active - functions -e __done_is_process_window_focused - - # Erase __done variables - set -e __done_version -end - diff --git a/fish/.config/fish/fishfile b/fish/.config/fish/fishfile index 096832e..6deaccb 100644 --- a/fish/.config/fish/fishfile +++ b/fish/.config/fish/fishfile @@ -5,4 +5,3 @@ oh-my-fish/plugin-direnv joseluisq/gitnow fishpkg/fish-git-util rafaelrinaldi/pure -franciscolourenco/done diff --git a/fish/.config/fish/functions/3screens.fish b/fish/.config/fish/functions/3screens.fish deleted file mode 100644 index e10aa08..0000000 --- a/fish/.config/fish/functions/3screens.fish +++ /dev/null @@ -1,3 +0,0 @@ -function 3screens - ~/.screenlayout/three.sh -end diff --git a/fish/.config/fish/functions/archey.sh b/fish/.config/fish/functions/archey.sh deleted file mode 100644 index 8f0d4fd..0000000 --- a/fish/.config/fish/functions/archey.sh +++ /dev/null @@ -1,167 +0,0 @@ -#!/bin/bash - -# archey-osx 1.5.2 (https://github.com/obihann/archey-osx/) - -# test to see if bash supports arrays -arraytest[0]='test' || (echo 'Error: Arrays are not supported in this version of -bash.' && exit 2) - -# Detect the packager. -#if [ -x /usr/local/bin/brew ]; then - #detectedpackager=homebrew -#elif command -v port >/dev/null; then - #detectedpackager=macports -#else - #detectedpackager=none -#fi - -# Get the command line options -opt_nocolor=f -opt_force_color=f -opt_offline=f -for arg in "$@" -do - case "${arg}" in - -p|--packager) - packager=$detectedpackager - ;; - -m|--macports) - packager=macports - ;; - -b|--nocolor) - opt_nocolor=t - ;; - -c|--color) - opt_nocolor=f - opt_force_color=t - ;; - -o|--offline) - opt_offline=t - ;; - -h|--help) - echo "Archey OS X 1.5.2" - echo - echo "Usage: $0 [options]" - echo - echo " -p --packager Use auto detected package system (default packager: ${detectedpackager})." - echo " -m --macports Force use MacPorts as package system." - echo " -b --nocolor Turn color off." - echo " -c --color Force the color on (overrides --nocolor)." - echo " -o --offline Disable the IP address check." - exit 0 - ;; - *) - echo "Unknown argument: $1" 1>&2 - echo "For help, use: $0 --help" 1>&2 - exit 1 - ;; - esac -done - -# System Variables -user=$(whoami) -hostname=$(hostname | sed 's/.local//g') - -#if [[ "${opt_offline}" = f ]]; then - #ipfile="${HOME}/.archey-ip" - #if [ -a "$ipfile" ] && test `find "$ipfile" -mmin -360`; then - #while read -r line; do - #ip="$line" - #done < "$ipfile" - #else - #ip=$(dig +short myip.opendns.com @resolver1.opendns.com) - #echo $ip > "$ipfile" - #fi -#fi - -distro="OS X $(sw_vers -productVersion)" -kernel=$(uname) -uptime=$(uptime | sed 's/.*up \([^,]*\), .*/\1/') -shell="$SHELL" -terminal="$TERM ${TERM_PROGRAM//_/ }" -cpu=$(sysctl -n machdep.cpu.brand_string) -#battery=$(ioreg -c AppleSmartBattery -r | awk '$1~/Capacity/{c[$1]=$3} END{OFMT="%.2f%%"; max=c["\"MaxCapacity\""]; print (max>0? 100*c["\"CurrentCapacity\""]/max: "?")}') -battery=$(pmset -g batt | xargs | egrep "\d+%" -o) - -# removes (R) and (TM) from the CPU name so it fits in a standard 80 window -cpu=$(echo "$cpu" | awk '$1=$1' | sed 's/([A-Z]\{1,2\})//g') - -ram="$(( $(sysctl -n hw.memsize) / 1024 ** 3 )) GB" -disk=$(df | head -2 | tail -1 | awk '{print $5}') - - -# Set up colors if: -# * stdout is a tty -# * the user hasn't turned it off -# * or if we're forcing color -if [[ ( -t 1 && "${opt_nocolor}" = f) || "${opt_force_color}" = t ]] -then - RED=$(tput setaf 1 2>/dev/null) - GREEN=$(tput setaf 2 2>/dev/null) - YELLOW=$(tput setaf 3 2>/dev/null) - BLUE=$(tput setaf 4 2>/dev/null) - PURPLE=$(tput setaf 5 2>/dev/null) - textColor=$(tput setaf 6 2>/dev/null) - normal=$(tput sgr0 2>/dev/null) -fi - -case "${packager}" in - homebrew) - packagehandler=$(brew list -1 | wc -l | awk '{print $1 }') - ;; - macports) - packagehandler=$(port installed | wc -l | awk '{print $1 }') - ;; - *) - packagehandler=0 - ;; -esac - -fieldlist[${#fieldlist[@]}]="${textColor}User:${normal} ${user}${normal}" -fieldlist[${#fieldlist[@]}]="${textColor}Hostname:${normal} ${hostname}${normal}" -fieldlist[${#fieldlist[@]}]="${textColor}Distro:${normal} ${distro}${normal}" -fieldlist[${#fieldlist[@]}]="${textColor}Kernel:${normal} ${kernel}${normal}" -fieldlist[${#fieldlist[@]}]="${textColor}Uptime:${normal} ${uptime}${normal}" -fieldlist[${#fieldlist[@]}]="${textColor}Shell:${normal} ${shell}${normal}" -fieldlist[${#fieldlist[@]}]="${textColor}Terminal:${normal} ${terminal}${normal}" -fieldlist[${#fieldlist[@]}]="${textColor}Terminal Size:${normal} $(tput lines) x $(tput cols)" -#if [ ${packagehandler} -ne 0 ]; then - #fieldlist[${#fieldlist[@]}]="${textColor}Packages:${normal} ${packagehandler}${normal}" -#fi -fieldlist[${#fieldlist[@]}]="${textColor}CPU:${normal} ${cpu}${normal}" -fieldlist[${#fieldlist[@]}]="${textColor}Memory:${normal} ${ram}${normal}" -fieldlist[${#fieldlist[@]}]="${textColor}Disk:${normal} ${disk}${normal}" -#if [ ! -z $battery ]; then -#fi -fieldlist[${#fieldlist[@]}]="${textColor}Battery:${normal} ${battery}${normal}" - -#if [ "${opt_offline}" = f ]; then - #fieldlist[${#fieldlist[@]}]="${textColor}IP Address:${normal} ${ip}${normal}" -#fi - -fieldlist[${#fieldlist[@]}]="${textColor}Date:${normal} $(date)${normal}" - -logofile=${ARCHEY_LOGO_FILE:-"${HOME}/.config/archey-logo"} -if [ -a "$logofile" ] - then - source "$logofile" -else -# The ${foo# } is a cheat so that it lines up here as well -# as when run. - echo -e " -${GREEN# } ####### ${fieldlist[0]} -${GREEN# } ######## ${fieldlist[1]} -${GREEN# } ##### ${fieldlist[2]} -${GREEN# } ##### ${fieldlist[3]} -${YELLOW# } ###### ${fieldlist[4]} -${YELLOW# } ######## ${fieldlist[5]} -${RED# } ########### ${fieldlist[6]} -${RED# } ##### ##### ${fieldlist[7]} -${RED# } ##### ##### ${fieldlist[8]} -${PURPLE# } ##### ##### ${fieldlist[9]} -${PURPLE# } ##### ##### ## ${fieldlist[10]} -${BLUE# } ##### ########## ${fieldlist[11]} -${BLUE# } ##### ####### ${fieldlist[12]} -${normal} -" -fi diff --git a/fish/.config/fish/functions/dbag.fish b/fish/.config/fish/functions/dbag.fish deleted file mode 100644 index a8868d0..0000000 --- a/fish/.config/fish/functions/dbag.fish +++ /dev/null @@ -1,5 +0,0 @@ -function dbag - xinput set-prop "SynPS/2 Synaptics TouchPad" "Synaptics Tap Action" 0 - xinput set-prop "SynPS/2 Synaptics TouchPad" "Synaptics ClickPad" 0 - setxkbmap -option "caps:escape" -end diff --git a/fish/.config/fish/functions/dces.fish b/fish/.config/fish/functions/dces.fish deleted file mode 100644 index e94e21b..0000000 --- a/fish/.config/fish/functions/dces.fish +++ /dev/null @@ -1,5 +0,0 @@ -function dces - pushd ~/src/elation/hippo-sync - docker-compose $argv - popd -end diff --git a/fish/.config/fish/functions/dcesdj.fish b/fish/.config/fish/functions/dcesdj.fish deleted file mode 100644 index 05ca797..0000000 --- a/fish/.config/fish/functions/dcesdj.fish +++ /dev/null @@ -1,5 +0,0 @@ -function dcesdj - pushd ~/src/elation/hippo-sync - docker-compose exec hippo django-admin $argv - popd -end diff --git a/fish/.config/fish/functions/doomu.fish b/fish/.config/fish/functions/doomu.fish deleted file mode 100644 index d1aa9c4..0000000 --- a/fish/.config/fish/functions/doomu.fish +++ /dev/null @@ -1,7 +0,0 @@ -function doomu - cd ~/.emacs.d/ - ./bin/doom clean - ./bin/doom upgrade --no-ask - ./bin/doom update --no-ask - ./bin/doom compile :core lang/python --no-ask -end diff --git a/fish/.config/fish/functions/fe.fish b/fish/.config/fish/functions/fe.fish new file mode 100644 index 0000000..bfc6d22 --- /dev/null +++ b/fish/.config/fish/functions/fe.fish @@ -0,0 +1,3 @@ +function pe + ~/.screenlayout/prometheus-ext.sh +end diff --git a/fish/.config/fish/functions/humanize_duration.fish b/fish/.config/fish/functions/humanize_duration.fish deleted file mode 100644 index eeb999f..0000000 --- a/fish/.config/fish/functions/humanize_duration.fish +++ /dev/null @@ -1,19 +0,0 @@ -function humanize_duration -d "Make a time interval human readable" - command awk ' - function hmTime(time, stamp) { - split("h:m:s:ms", units, ":") - for (i = 2; i >= -1; i--) { - if (t = int( i < 0 ? time % 1000 : time / (60 ^ i * 1000) % 60 )) { - stamp = stamp t units[sqrt((i - 2) ^ 2) + 1] " " - } - } - if (stamp ~ /^ *$/) { - return "0ms" - } - return substr(stamp, 1, length(stamp) - 1) - } - { - print hmTime($0) - } - ' -end diff --git a/fish/.config/fish/functions/k.fish b/fish/.config/fish/functions/k.fish deleted file mode 100644 index 123e529..0000000 --- a/fish/.config/fish/functions/k.fish +++ /dev/null @@ -1,3 +0,0 @@ -function k - kubectl $argv -end diff --git a/fish/.config/fish/functions/nconn.fish b/fish/.config/fish/functions/nconn.fish deleted file mode 100644 index 7329535..0000000 --- a/fish/.config/fish/functions/nconn.fish +++ /dev/null @@ -1,3 +0,0 @@ -function nconn - nmcli device wifi connect $argv -end diff --git a/fish/.config/fish/functions/off.fish b/fish/.config/fish/functions/off.fish index 0162ae6..339afc7 100644 --- a/fish/.config/fish/functions/off.fish +++ b/fish/.config/fish/functions/off.fish @@ -1,4 +1,4 @@ function off set -x DISPLAY :0 -xset -dpms s on + xset -dpms s on end diff --git a/fish/.config/fish/functions/on.fish b/fish/.config/fish/functions/on.fish index 49ec868..90d7399 100644 --- a/fish/.config/fish/functions/on.fish +++ b/fish/.config/fish/functions/on.fish @@ -1,4 +1,4 @@ function on set -x DISPLAY :0 -xset -dpms s off + xset -dpms s off end diff --git a/fish/.config/fish/functions/pe.fish b/fish/.config/fish/functions/pe.fish new file mode 100644 index 0000000..bfc6d22 --- /dev/null +++ b/fish/.config/fish/functions/pe.fish @@ -0,0 +1,3 @@ +function pe + ~/.screenlayout/prometheus-ext.sh +end diff --git a/fish/.config/fish/functions/rechunk.fish b/fish/.config/fish/functions/rechunk.fish deleted file mode 100644 index b79eee2..0000000 --- a/fish/.config/fish/functions/rechunk.fish +++ /dev/null @@ -1,3 +0,0 @@ -function rechunk - brew services restart chunkwm -end diff --git a/fish/.config/fish/functions/update.fish b/fish/.config/fish/functions/update.fish deleted file mode 100644 index fefa630..0000000 --- a/fish/.config/fish/functions/update.fish +++ /dev/null @@ -1,8 +0,0 @@ -function update - pushd ~/dotfiles - git stash - git pull --rebase - fisher - git stash apply - popd -end diff --git a/fish/.config/fish/functions/zd.fish b/fish/.config/fish/functions/zd.fish deleted file mode 100644 index 6b8661b..0000000 --- a/fish/.config/fish/functions/zd.fish +++ /dev/null @@ -1,11 +0,0 @@ -# Function to filter through recently used directories -function zd --argument-names 'name' - set -l zd_command "command fasd -Rdl $name 2> /dev/null" - fish -c "$zd_command" | __fzfcmd -1 -0 --no-sort -m | read -la select - if test ! (count $select) -eq 0 - cd "$select" - end -end - -# Set above function to even shorter j alias -alias j "zd"