Merge pull request #63 from RobDay/master

copy_prompts.fish created to integrate custom themes with fish_configs web portal.
This commit is contained in:
Bruno 2013-08-26 19:54:30 -07:00
commit d0dfd9bb2f
12 changed files with 22 additions and 0 deletions

View File

@ -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. 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 ## Switching to fish

8
copy_prompts.fish Executable file
View File

@ -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

View File

@ -1,3 +1,4 @@
# name: Agnoster
# agnoster's Theme - https://gist.github.com/3712874 # agnoster's Theme - https://gist.github.com/3712874
# A Powerline-inspired theme for FISH # A Powerline-inspired theme for FISH
# #

View File

@ -1,3 +1,4 @@
# name: CoffeeAndCode
# Theme colors # Theme colors
set fish_color_normal 5f5f5f set fish_color_normal 5f5f5f
set fish_color_command 5f87ff set fish_color_command 5f87ff

View File

@ -1,3 +1,4 @@
# name: Cor
# Display the following bits on the left: # Display the following bits on the left:
# * Virtualenv name (if applicable, see https://github.com/adambrenecki/virtualfish) # * Virtualenv name (if applicable, see https://github.com/adambrenecki/virtualfish)
# * Current user # * Current user

View File

@ -1,3 +1,4 @@
# name: idan
# Display the following bits on the left: # Display the following bits on the left:
# * Virtualenv name (if applicable, see https://github.com/adambrenecki/virtualfish) # * Virtualenv name (if applicable, see https://github.com/adambrenecki/virtualfish)
# * Current directory name # * Current directory name

View File

@ -1,3 +1,4 @@
# name: Jacaetevha
function tbytes -d 'calculates the total size of the files in the current directory' 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 }') set -l tBytes (ls -al | grep "^-" | awk 'BEGIN {i=0} { i += $5 } END { print i }')

View File

@ -1,3 +1,4 @@
# name: Krisleech
function _git_branch_name function _git_branch_name
echo (command git symbolic-ref HEAD ^/dev/null | sed -e 's|^refs/heads/||') echo (command git symbolic-ref HEAD ^/dev/null | sed -e 's|^refs/heads/||')
end end

View File

@ -1,3 +1,4 @@
# name: L
function _git_branch_name function _git_branch_name
echo (command git symbolic-ref HEAD ^/dev/null | sed -e 's|^refs/heads/||') echo (command git symbolic-ref HEAD ^/dev/null | sed -e 's|^refs/heads/||')
end end

View File

@ -1,3 +1,4 @@
# name: Numist
function fish_prompt function fish_prompt
set -l last_status $status set -l last_status $status

View File

@ -1,3 +1,4 @@
# name: RobbyRussel
function _git_branch_name function _git_branch_name
echo (command git symbolic-ref HEAD ^/dev/null | sed -e 's|^refs/heads/||') echo (command git symbolic-ref HEAD ^/dev/null | sed -e 's|^refs/heads/||')
end end

View File

@ -1,3 +1,4 @@
# name: Uggedal
function fish_prompt function fish_prompt
if test -n "$SSH_CONNECTION" if test -n "$SSH_CONNECTION"
printf '%s ' $HOSTNAME printf '%s ' $HOSTNAME