moved salt from alias to functin, added username pillar

This commit is contained in:
Jonas Forsberg 2020-08-01 14:53:37 +02:00
parent f290d39b96
commit 7e580ef997
No known key found for this signature in database
GPG Key ID: F2E9818C70350CC9
5 changed files with 18 additions and 27 deletions

1
.alias
View File

@ -6,4 +6,3 @@ alias dotf='/usr/bin/git --git-dir=$HOME/.dotfiles --work-tree=$HOME'
alias ls_dotfiels='/usr/bin/git --git-dir=$HOME/.dotfiles ls-tree --full-tree -r --name-only HEAD' alias ls_dotfiels='/usr/bin/git --git-dir=$HOME/.dotfiles ls-tree --full-tree -r --name-only HEAD'
alias t="todo.sh" alias t="todo.sh"
alias gl='git log --graph --pretty=format:'\''%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'\'' --abbrev-commit --date=relative' alias gl='git log --graph --pretty=format:'\''%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'\'' --abbrev-commit --date=relative'
alias salt='sudo salt-call --local --file-root "$HOME/salt/states" --pillar-root "$HOME/salt/pillars" "$@"'

View File

@ -1,12 +1,5 @@
function gnomebindings(){ function salt() {
local KEY_PATH="/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings" sudo salt-call --local --file-root "$HOME/salt/states" --pillar-root "$HOME/salt/pillars" "$@" pillar="{username: $USER}"
local CMD="gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:$KEY_PATH"
gsettings set org.gnome.settings-daemon.plugins.media-keys custom-keybindings "['$KEY_PATH/custom0/']"
# Open Terminator
$CMD/custom0/ name "Open Terminator"
$CMD/custom0/ command "terminator"
$CMD/custom0/ binding "<Primary><Alt>Return"
} }
function pw(){ function pw(){

View File

@ -1,3 +1,5 @@
``` ```
alias salt='sudo salt-call --local --file-root "$HOME/salt/states" --pillar-root "$HOME/salt/pillars" "$@"' function salt(){
sudo salt-call --local --file-root "$HOME/salt/states" --pillar-root "$HOME/salt/pillars" "$@" pillar="{username: $USER}"
}
``` ```

View File

@ -3,15 +3,14 @@ packages:
vim: vim:
plugins: plugins:
jonas: calendar-vim:
calendar-vim: name: https://github.com/mattn/calendar-vim.git
name: https://github.com/mattn/calendar-vim.git vim-commentary:
vim-commentary: name: https://github.com/tpope/vim-commentary.git
name: https://github.com/tpope/vim-commentary.git vim-instant-markdown:
vim-instant-markdown: name: https://github.com/suan/vim-instant-markdown.git
name: https://github.com/suan/vim-instant-markdown.git vim-surround:
vim-surround: name: https://github.com/tpope/vim-surround.git
name: https://github.com/tpope/vim-surround.git vimwiki:
vimwiki: name: https://github.com/vimwiki/vimwiki.git
name: https://github.com/vimwiki/vimwiki.git

View File

@ -1,9 +1,7 @@
{% for user, plugins in pillar['vim']['plugins'].items() %} {% for plugin, args in pillar['vim']['plugins'].items() %}
{% for plugin, args in plugins.items() %}
{{ plugin }}: {{ plugin }}:
git.latest: git.latest:
- name: {{ args['name'] }} - name: {{ args['name'] }}
- target: {{ salt['user.info']( user ).home }}/.vim/bundle/{{ plugin }} - target: {{ salt['user.info']( pillar['username'] ).home }}/.vim/bundle/{{ plugin }}
- user: {{ user }} - user: {{ pillar['username'] }}
{% endfor %}
{% endfor %} {% endfor %}