Refactored fish functions, bin/ and add license

This commit is contained in:
Hedy Li 2020-12-24 13:33:42 +00:00
parent 702b9bd25e
commit 511ff6e761
9 changed files with 23 additions and 127 deletions

View File

@ -1,84 +0,0 @@
function fish_prompt --description 'Write out the prompt'
set -l last_pipestatus $pipestatus
if not set -q __fish_git_prompt_show_informative_status
set -g __fish_git_prompt_show_informative_status 1
end
if not set -q __fish_git_prompt_hide_untrackedfiles
set -g __fish_git_prompt_hide_untrackedfiles 1
end
if not set -q __fish_git_prompt_color_branch
set -g __fish_git_prompt_color_branch magenta --bold
end
if not set -q __fish_git_prompt_showupstream
set -g __fish_git_prompt_showupstream "informative"
end
if not set -q __fish_git_prompt_char_upstream_ahead
set -g __fish_git_prompt_char_upstream_ahead "↑"
end
if not set -q __fish_git_prompt_char_upstream_behind
set -g __fish_git_prompt_char_upstream_behind "↓"
end
if not set -q __fish_git_prompt_char_upstream_prefix
set -g __fish_git_prompt_char_upstream_prefix ""
end
if not set -q __fish_git_prompt_char_stagedstate
set -g __fish_git_prompt_char_stagedstate "●"
end
if not set -q __fish_git_prompt_char_dirtystate
set -g __fish_git_prompt_char_dirtystate "✚"
end
if not set -q __fish_git_prompt_char_untrackedfiles
set -g __fish_git_prompt_char_untrackedfiles "…"
end
if not set -q __fish_git_prompt_char_invalidstate
set -g __fish_git_prompt_char_invalidstate "✖"
end
if not set -q __fish_git_prompt_char_cleanstate
set -g __fish_git_prompt_char_cleanstate "✔"
end
if not set -q __fish_git_prompt_color_dirtystate
set -g __fish_git_prompt_color_dirtystate blue
end
if not set -q __fish_git_prompt_color_stagedstate
set -g __fish_git_prompt_color_stagedstate yellow
end
if not set -q __fish_git_prompt_color_invalidstate
set -g __fish_git_prompt_color_invalidstate red
end
if not set -q __fish_git_prompt_color_untrackedfiles
set -g __fish_git_prompt_color_untrackedfiles $fish_color_normal
end
if not set -q __fish_git_prompt_color_cleanstate
set -g __fish_git_prompt_color_cleanstate green --bold
end
set -l color_cwd
set -l prefix
set -l suffix
switch "$USER"
case root toor
if set -q fish_color_cwd_root
set color_cwd $fish_color_cwd_root
else
set color_cwd $fish_color_cwd
end
set suffix '#'
case '*'
set color_cwd $fish_color_cwd
set suffix '$'
end
# PWD
set_color $color_cwd
echo -n (prompt_pwd)
set_color normal
printf '%s ' (fish_vcs_prompt)
set -l pipestatus_string (__fish_print_pipestatus "[" "] " "|" (set_color $fish_color_status) (set_color --bold $fish_color_status) $last_pipestatus)
echo -n $pipestatus_string
set_color normal
echo -n "$suffix "
end

View File

@ -1,4 +0,0 @@
# Defined in - @ line 1
function getpyjoke --wraps=python3\ -c\ \'import\ pyjokes\;\ print\(pyjokes.get_joke\(\)\)\' --description alias\ getpyjoke=python3\ -c\ \'import\ pyjokes\;\ print\(pyjokes.get_joke\(\)\)\'
python3 -c 'import pyjokes; print(pyjokes.get_joke())' $argv;
end

View File

@ -1,4 +0,0 @@
function hellofish
end

View File

@ -1,9 +1,3 @@
# Defined in - @ line 1
function x
if test -e ~/.git_creds
if read_confirm 'gitlock?'
gitlock
end
end
function x
exit $argv;
end

View File

@ -1,7 +1,3 @@
# Defined in - @ line 1
function xo
if test -e ~/.git_creds && read_confirm 'gitlock?'
gitlock
end
function xo
exit 0 $argv;
end

View File

@ -1,4 +0,0 @@
# Defined in - @ line 1
function y --wraps=yadm --description 'alias y=yadm'
yadm $argv;
end

21
LICENSE Normal file
View File

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2020 Hedy Li
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.

View File

@ -1,9 +0,0 @@
#!/bin/bash
# my own copy script
echo '$1' > ~/clipped.txt
echo $1 | clip.exe
exit 0

View File

@ -1,10 +0,0 @@
#!/bin/bash
# my own paste from clipboard script
powershell.exe Get-Clipboard | sed 's/\r$//' | sed -z '$ s/\n$//' > ~/clipped.txt
cat ~/clipped.txt
exit 0