add modular bashrc

This commit is contained in:
Pim Kunis 2023-03-04 14:28:09 +01:00
parent 3391f67080
commit 04aba0d670
16 changed files with 49 additions and 21 deletions

View file

@ -13,7 +13,8 @@ My current setup is [Debian Bullseye](https://www.debian.org/releases/bullseye/)
- thunderbird config (pretty hard to do, should just capture steps taken somewhere) - thunderbird config (pretty hard to do, should just capture steps taken somewhere)
- firefox config? extensions? host own synchronizer? - firefox config? extensions? host own synchronizer?
- Smart script to manage screens: if external screen is connected, only show on that screen. Otherwise, show on laptop screen. - Smart script to manage screens: if external screen is connected, only show on that screen. Otherwise, show on laptop screen.
- drop-in includement of bashrc parts - fix suspend
- Better randr profiles using autorandr: https://github.com/phillipberndt/autorandr
#### Neovim #### Neovim

View file

@ -0,0 +1,2 @@
[ -f ~/.asdf/asdf.sh ] && source ~/.asdf/asdf.sh
[ -f ~/.asdf/completions/asdf.bash ] && source ~/.asdf/completions/asdf.bash

View file

@ -1,2 +1,3 @@
dependencies: dependencies:
- role: common - role: common
- role: bash

View file

@ -32,3 +32,7 @@
shell: shell:
cmd: "~/.asdf/bin/asdf plugin-add elixir https://github.com/asdf-vm/asdf-elixir.git" cmd: "~/.asdf/bin/asdf plugin-add elixir https://github.com/asdf-vm/asdf-elixir.git"
creates: ~/.asdf/plugins/elixir creates: ~/.asdf/plugins/elixir
- name: Copy asdf.bashrc
copy:
src: "{{ role_path }}/files/asdf.bashrc"
dest: ~/.bashrc.d/asdf.bashrc

1
roles/bash/files/bashrc Normal file
View file

@ -0,0 +1 @@
for f in ~/.bashrc.d/*; do source $f; done

View file

@ -6,10 +6,18 @@
- bat - bat
- fzf - fzf
- name: Install .bashrc - name: Install .bashrc
template:
src: "{{ role_path }}/templates/bashrc.j2"
dest: ~/.bashrc
- name: Install .fzf.bash
copy: copy:
src: "{{ role_path }}/files/fzf.bash" src: "{{ role_path }}/files/bashrc"
dest: ~/.fzf.bash dest: ~/.bashrc
- name: Create bashrc config directory
file:
path: ~/.bashrc.d
state: directory
- name: Copy base.bashrc
template:
src: "{{ role_path }}/templates/base.bashrc.j2"
dest: ~/.bashrc.d/base.bashrc
- name: Copy fzf.bash
copy:
src: "{{ role_path }}/files/fzf.bashrc"
dest: ~/.bashrc.d/fzf.bashrc

View file

@ -90,18 +90,5 @@ alias gb='git branch'
alias ga='git add' alias ga='git add'
alias gl='git log' alias gl='git log'
# For neovim
PATH=$PATH:/usr/local
alias vi='nvim'
alias vim='nvim'
[ -f ~/.fzf.bash ] && source ~/.fzf.bash
# asdf
[ -f ~/.asdf/asdf.sh ] && source ~/.asdf/asdf.sh
[ -f ~/.asdf/completions/asdf.bash ] && source ~/.asdf/completions/asdf.bash
# pip scripts # pip scripts
PATH=$PATH:~/.local/bin PATH=$PATH:~/.local/bin
export SSH_AUTH_SOCK="{{ ssh_agent_socket }}"

View file

@ -2,4 +2,4 @@
SCREEN_RESOLUTION="$(xdpyinfo | grep dimensions | cut -d' ' -f7)" SCREEN_RESOLUTION="$(xdpyinfo | grep dimensions | cut -d' ' -f7)"
BGCOLOR="000000" BGCOLOR="000000"
convert "/home/pim/Pictures/wallpapers/orphans.png" -gravity Center -background \#$BGCOLOR -resize "$SCREEN_RESOLUTION" RGB:- | i3lock --raw "$SCREEN_RESOLUTION":rgb -c $BGCOLOR -i /dev/stdin --nofork convert "/home/pim/Pictures/wallpapers/orphans.png" -gravity Center -background \#$BGCOLOR -resize "$SCREEN_RESOLUTION" RGB:- | i3lock --raw "$SCREEN_RESOLUTION":rgb -c $BGCOLOR -i /dev/stdin

View file

@ -8,6 +8,8 @@
- rofi - rofi
- nitrogen - nitrogen
- xss-lock - xss-lock
- arandr
- autorandr
- name: Create i3 config directory - name: Create i3 config directory
file: file:
path: ~/.config/i3 path: ~/.config/i3
@ -37,3 +39,11 @@
copy: copy:
src: "{{ role_path }}/files/bg-saved.cfg" src: "{{ role_path }}/files/bg-saved.cfg"
dest: ~/.config/nitrogen/bg-saved.cfg dest: ~/.config/nitrogen/bg-saved.cfg
- name: Handle lid close
become: true
ini_file:
path: /etc/systemd/logind.conf
section: Login
option: HandleLidSwitch
value: suspend
no_extra_spaces: true

View file

@ -0,0 +1 @@
export SSH_AUTH_SOCK="/tmp/ssh-agent.socket"

View file

@ -0,0 +1,2 @@
dependencies:
- role: bash

View file

@ -29,3 +29,6 @@
option: AuthSockOverride option: AuthSockOverride
value: "{{ ssh_agent_socket }}" value: "{{ ssh_agent_socket }}"
no_extra_spaces: true no_extra_spaces: true
- name: Copy keepassxc.bashrc
copy:
src: "{{ role_path }}/files/keepassxc.bashrc"

View file

@ -0,0 +1,3 @@
PATH=$PATH:/usr/local
alias vi='nvim'
alias vim='nvim'

View file

@ -1,2 +1,3 @@
dependencies: dependencies:
- role: common - role: common
- role: bash

View file

@ -64,3 +64,7 @@
option: "{{ item }}" option: "{{ item }}"
value: "nvim.desktop" value: "nvim.desktop"
loop: "{{ default_apps }}" loop: "{{ default_apps }}"
- name: Copy neovim.bashrc
copy:
src: "{{ role_path }}/files/neovim.bashrc"
dest: ~/.bashrc.d/neovim.bashrc