From 511ff6e76141fbfec39b18c227c99068ca4f81d3 Mon Sep 17 00:00:00 2001 From: Hedy Li Date: Thu, 24 Dec 2020 13:33:42 +0000 Subject: [PATCH] Refactored fish functions, bin/ and add license --- .../functions/fish_prompt.1588078327.copy | 84 ------------------- .config/fish/functions/getpyjoke.fish | 4 - .config/fish/functions/hellofish.fish | 4 - .config/fish/functions/x.fish | 8 +- .config/fish/functions/xo.fish | 6 +- .config/fish/functions/y.fish | 4 - LICENSE | 21 +++++ bin/ccopy | 9 -- bin/cpaste | 10 --- 9 files changed, 23 insertions(+), 127 deletions(-) delete mode 100644 .config/fish/functions/fish_prompt.1588078327.copy delete mode 100644 .config/fish/functions/getpyjoke.fish delete mode 100644 .config/fish/functions/hellofish.fish delete mode 100644 .config/fish/functions/y.fish create mode 100644 LICENSE delete mode 100755 bin/ccopy delete mode 100755 bin/cpaste diff --git a/.config/fish/functions/fish_prompt.1588078327.copy b/.config/fish/functions/fish_prompt.1588078327.copy deleted file mode 100644 index c4caae0..0000000 --- a/.config/fish/functions/fish_prompt.1588078327.copy +++ /dev/null @@ -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 diff --git a/.config/fish/functions/getpyjoke.fish b/.config/fish/functions/getpyjoke.fish deleted file mode 100644 index 6908e43..0000000 --- a/.config/fish/functions/getpyjoke.fish +++ /dev/null @@ -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 diff --git a/.config/fish/functions/hellofish.fish b/.config/fish/functions/hellofish.fish deleted file mode 100644 index 5c860fa..0000000 --- a/.config/fish/functions/hellofish.fish +++ /dev/null @@ -1,4 +0,0 @@ -function hellofish - -end - diff --git a/.config/fish/functions/x.fish b/.config/fish/functions/x.fish index 51fa9a9..252fd3b 100644 --- a/.config/fish/functions/x.fish +++ b/.config/fish/functions/x.fish @@ -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 diff --git a/.config/fish/functions/xo.fish b/.config/fish/functions/xo.fish index 959e016..8039f0b 100644 --- a/.config/fish/functions/xo.fish +++ b/.config/fish/functions/xo.fish @@ -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 diff --git a/.config/fish/functions/y.fish b/.config/fish/functions/y.fish deleted file mode 100644 index 4753fc9..0000000 --- a/.config/fish/functions/y.fish +++ /dev/null @@ -1,4 +0,0 @@ -# Defined in - @ line 1 -function y --wraps=yadm --description 'alias y=yadm' - yadm $argv; -end diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..ed8d124 --- /dev/null +++ b/LICENSE @@ -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. diff --git a/bin/ccopy b/bin/ccopy deleted file mode 100755 index 1bd3b8b..0000000 --- a/bin/ccopy +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -# my own copy script - -echo '$1' > ~/clipped.txt -echo $1 | clip.exe - -exit 0 - diff --git a/bin/cpaste b/bin/cpaste deleted file mode 100755 index 4e6d29e..0000000 --- a/bin/cpaste +++ /dev/null @@ -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 -