diff --git a/README.markdown b/README.markdown index fbdc7bd..c411ec9 100644 --- a/README.markdown +++ b/README.markdown @@ -44,6 +44,10 @@ just add a new file (ending in .load) into the `custom/` directory. I'm hoping to collect a bunch of themes for our command prompts. You can see existing ones in the [themes](themes/) directory. +## Integrating oh-my-fish themes with fish_config + +Fish provides fish_config, a web portal where you can modify some configurations, including changing your fish_prompt. By default, fish_config comes with a series of prepackaged themes. Running copy_prompts.fish installed with oh-my-fish will integrate oh-my-fish's provided themes with fish_config and allow you to choose a custom theme as your prompt. + ## Switching to fish diff --git a/copy_prompts.fish b/copy_prompts.fish new file mode 100755 index 0000000..ee1e442 --- /dev/null +++ b/copy_prompts.fish @@ -0,0 +1,8 @@ +#!/usr/local/bin/fish +# This script will create a symbolic link between all themes included in oh-my-fish to the sample prompts +# This will allow the user to choose an oh-my-fish theme while using the stock fish_config web application +for themePath in (ls $fish_path/themes/*/fish_prompt.fish) + set themeName (echo $themePath | sed "s/.*themes\///;s/\/fish_prompt.fish//") + echo "Adding $themeName to the sample prompts" + ln -sf $themePath $__fish_datadir/tools/web_config/sample_prompts/$themeName.fish +end diff --git a/themes/agnoster/fish_prompt.fish b/themes/agnoster/fish_prompt.fish index 190f929..e4ad3dc 100644 --- a/themes/agnoster/fish_prompt.fish +++ b/themes/agnoster/fish_prompt.fish @@ -1,3 +1,4 @@ +# name: Agnoster # agnoster's Theme - https://gist.github.com/3712874 # A Powerline-inspired theme for FISH # diff --git a/themes/coffeeandcode/fish_prompt.fish b/themes/coffeeandcode/fish_prompt.fish index 82e1649..454964f 100644 --- a/themes/coffeeandcode/fish_prompt.fish +++ b/themes/coffeeandcode/fish_prompt.fish @@ -1,3 +1,4 @@ +# name: CoffeeAndCode # Theme colors set fish_color_normal 5f5f5f set fish_color_command 5f87ff diff --git a/themes/cor/fish_prompt.fish b/themes/cor/fish_prompt.fish index 853ff82..225e61e 100644 --- a/themes/cor/fish_prompt.fish +++ b/themes/cor/fish_prompt.fish @@ -1,3 +1,4 @@ +# name: Cor # Display the following bits on the left: # * Virtualenv name (if applicable, see https://github.com/adambrenecki/virtualfish) # * Current user diff --git a/themes/idan/fish_prompt.fish b/themes/idan/fish_prompt.fish index 00ec450..a032766 100644 --- a/themes/idan/fish_prompt.fish +++ b/themes/idan/fish_prompt.fish @@ -1,3 +1,4 @@ +# name: idan # Display the following bits on the left: # * Virtualenv name (if applicable, see https://github.com/adambrenecki/virtualfish) # * Current directory name diff --git a/themes/jacaetevha/fish_prompt.fish b/themes/jacaetevha/fish_prompt.fish index af72a00..5777ece 100644 --- a/themes/jacaetevha/fish_prompt.fish +++ b/themes/jacaetevha/fish_prompt.fish @@ -1,3 +1,4 @@ +# name: Jacaetevha function tbytes -d 'calculates the total size of the files in the current directory' set -l tBytes (ls -al | grep "^-" | awk 'BEGIN {i=0} { i += $5 } END { print i }') diff --git a/themes/krisleech/fish_prompt.fish b/themes/krisleech/fish_prompt.fish index 2de7a7f..ef9a24e 100644 --- a/themes/krisleech/fish_prompt.fish +++ b/themes/krisleech/fish_prompt.fish @@ -1,3 +1,4 @@ +# name: Krisleech function _git_branch_name echo (command git symbolic-ref HEAD ^/dev/null | sed -e 's|^refs/heads/||') end diff --git a/themes/l/fish_prompt.fish b/themes/l/fish_prompt.fish index db5f1c6..31d01f1 100644 --- a/themes/l/fish_prompt.fish +++ b/themes/l/fish_prompt.fish @@ -1,3 +1,4 @@ +# name: L function _git_branch_name echo (command git symbolic-ref HEAD ^/dev/null | sed -e 's|^refs/heads/||') end diff --git a/themes/numist/fish_prompt.fish b/themes/numist/fish_prompt.fish index aa268ac..0bf99d2 100644 --- a/themes/numist/fish_prompt.fish +++ b/themes/numist/fish_prompt.fish @@ -1,3 +1,4 @@ +# name: Numist function fish_prompt set -l last_status $status diff --git a/themes/robbyrussell/fish_prompt.fish b/themes/robbyrussell/fish_prompt.fish index 0c659a0..c4769cb 100644 --- a/themes/robbyrussell/fish_prompt.fish +++ b/themes/robbyrussell/fish_prompt.fish @@ -1,3 +1,4 @@ +# name: RobbyRussel function _git_branch_name echo (command git symbolic-ref HEAD ^/dev/null | sed -e 's|^refs/heads/||') end diff --git a/themes/uggedal/fish_prompt.fish b/themes/uggedal/fish_prompt.fish index ec4bf59..52b2377 100644 --- a/themes/uggedal/fish_prompt.fish +++ b/themes/uggedal/fish_prompt.fish @@ -1,3 +1,4 @@ +# name: Uggedal function fish_prompt if test -n "$SSH_CONNECTION" printf '%s ' $HOSTNAME