Ver código fonte

fish role

master
Markus Katharina Brechtel 7 anos atrás
commit
452923751e
3 arquivos alterados com 67 adições e 0 exclusões
  1. +25
    -0
      tasks/main.yml
  2. +26
    -0
      templates/fish_prompt.fish.j2
  3. +16
    -0
      templates/fish_title.fish.j2

+ 25
- 0
tasks/main.yml Ver arquivo

@@ -0,0 +1,25 @@
---

- name: fish package
package:
name: fish

- name: fish config directory
file:
path: /etc/fish/conf.d
state: directory

- name: fish config files
template:
src: "{{ item }}.fish.j2"
dest: /etc/fish/conf.d/{{ item }}.fish
with_items:
- fish_title
- fish_prompt

- file:
path: /etc/fish/conf.d/title.fish
state: absent
- file:
path: /etc/fish/conf.d/prompt.fish
state: absent

+ 26
- 0
templates/fish_prompt.fish.j2 Ver arquivo

@@ -0,0 +1,26 @@
# target format: user@host:~$
function fish_prompt --description 'prompt'
# Just calculate this once, to save a few cycles when displaying the prompt
if not set -q __fish_prompt_hostname
set -g __fish_prompt_hostname (hostname|cut -d . -f 1)
end

set -l color_cwd
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

set -g fish_prompt_pwd_dir_length 0

echo -n -s "$USER" @ "$__fish_prompt_hostname" : (set_color $color_cwd) (prompt_pwd) (set_color normal) " $suffix "
end

+ 16
- 0
templates/fish_title.fish.j2 Ver arquivo

@@ -0,0 +1,16 @@
function fish_title
# Just calculate this once, to save a few cycles when displaying the prompt
if not set -q __fish_prompt_hostname
set -g __fish_prompt_hostname (hostname|cut -d . -f 1)
end

set -l suffix
switch $USER
case root toor
set suffix '#'
case '*'
set suffix '>'
end

echo -n -s "$USER" @ "$__fish_prompt_hostname" : (prompt_pwd) " $suffix $_"
end

Carregando…
Cancelar
Salvar