This commit is contained in:
2024-07-08 12:26:06 -04:00
parent b78e8e4242
commit 6948b9baa8
47 changed files with 1142 additions and 79 deletions

View File

@@ -0,0 +1,38 @@
Role Name
=========
A brief description of the role goes here.
Requirements
------------
Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required.
Role Variables
--------------
A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well.
Dependencies
------------
A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles.
Example Playbook
----------------
Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:
- hosts: servers
roles:
- { role: username.rolename, x: 42 }
License
-------
BSD
Author Information
------------------
An optional section for the role authors to include contact information, or a website (HTML is not allowed).

View File

@@ -0,0 +1,2 @@
---
# defaults file for ericomeehan.ericomeehan

View File

@@ -0,0 +1,5 @@
[user]
email = eric@eom.dev
name = eric o meehan
[init]
defaultBranch = main

View File

@@ -0,0 +1,12 @@
vim.cmd([[
set nowrap
set number
set scrolloff=5
colorscheme elflord
]])
vim.keymap.set('n', '<C-Up>', '<C-w><up>', { silent = true })
vim.keymap.set('n', '<C-Down>', '<C-w><down>', { silent = true })
vim.keymap.set('n', '<C-Left>', '<C-w><left>', { silent = true })
vim.keymap.set('n', '<C-Right>', '<C-w><right>', { silent = true })

View File

@@ -0,0 +1,119 @@
# eric prompt theme
prompt_eric_help () {
cat <<'EOF'
This prompt is color-scheme-able. You can invoke it thus:
prompt eric [ 8bit ] [<color1> [<color2> [<color3>] [<color4>]]
where the colors are for the hyphens, current directory, user@host,
and user input bits respectively. The default colors are cyan, green,
cyan, and white. This theme works best with a dark background.
If you have either UTF-8 or the `nexus' or `vga' console fonts or similar,
you can specify the `8bit' option to use 8-bit replacements for the
7-bit characters.
And you probably thought adam1 was overkill ...
EOF
}
prompt_eric_setup () {
# Some can't be local
setopt localoptions nowarncreateglobal
local prompt_gfx_tlc prompt_gfx_mlc prompt_gfx_blc
if [[ $1 == '8bit' ]]; then
shift
if [[ ${LC_ALL:-${LC_CTYPE:-$LANG}} = *UTF-8* ]]; then
prompt_gfx_tlc=$'\xe2\x94\x8c'
prompt_gfx_mlc=$'\xe2\x94\x9c'
prompt_gfx_blc=$'\xe2\x94\x94'
prompt_gfx_hyphen=$'\xe2\x94\x80'
else
prompt_gfx_tlc=$'\xda'
prompt_gfx_mlc=$'\xc3'
prompt_gfx_blc=$'\xc0'
prompt_gfx_hyphen=$'\xc4'
fi
else
prompt_gfx_tlc='.'
prompt_gfx_mlc='|'
prompt_gfx_blc='\`'
prompt_gfx_hyphen='-'
fi
# Colour scheme
prompt_eric_color1=${1:-'white'} # hyphens
prompt_eric_color2=${2:-'cyan'} # current directory
prompt_eric_color3=${3:-'cyan'} # user@host
prompt_eric_color4=${4:-'white'} # user input
local prompt_gfx_bbox
prompt_gfx_tbox="%B%F{$prompt_eric_color1}${prompt_gfx_tlc}%b%F{$prompt_eric_color1}${prompt_gfx_hyphen}"
prompt_gfx_bbox="%B%F{$prompt_eric_color1}${prompt_gfx_blc}${prompt_gfx_hyphen}%b%F{$prompt_eric_color1}"
# This is a cute hack. Well I like it, anyway.
prompt_gfx_bbox_to_mbox=$'%{\e[A\r'"%}%B%F{$prompt_eric_color1}${prompt_gfx_mlc}%b%F{$prompt_eric_color1}${prompt_gfx_hyphen}%{"$'\e[B%}'
prompt_l_paren="%B%F{black}("
prompt_r_paren="%B%F{black})"
prompt_user_host="%b%F{$prompt_eric_color3}%n%B%F{$prompt_eric_color3}@%b%F{$prompt_eric_color3}%m %{$fg[cyan]%}[%D{%f/%m/%y} %D{%L:%M:%S}]"
prompt_line_1a="$prompt_gfx_tbox$prompt_l_paren%B%F{$prompt_eric_color2}%~$prompt_r_paren%b%F{$prompt_eric_color1}"
prompt_line_1b="$prompt_l_paren$prompt_user_host$prompt_r_paren%b%F{$prompt_eric_color1}${prompt_gfx_hyphen}"
prompt_line_2="$prompt_gfx_bbox${prompt_gfx_hyphen}%B%F{white}"
prompt_char="%(!.#.>)"
prompt_opts=(cr subst percent)
add-zsh-hook precmd prompt_eric_precmd
}
prompt_eric_precmd() {
setopt localoptions extendedglob noxtrace nowarncreateglobal
local prompt_line_1
prompt_eric_choose_prompt
PS1="$prompt_line_1$prompt_newline$prompt_line_2%B%F{white}$prompt_char %b%f%k"
PS2="$prompt_line_2$prompt_gfx_bbox_to_mbox%B%F{white}-> %b%f%k"
PS3="$prompt_line_2$prompt_gfx_bbox_to_mbox%B%F{white}-> %b%f%k"
zle_highlight[(r)default:*]="default:fg=$prompt_eric_color4,bold"
}
prompt_eric_choose_prompt () {
local prompt_line_1a_width=${#${(S%%)prompt_line_1a//(\%([KF1]|)\{*\}|\%[Bbkf])}}
local prompt_line_1b_width=${#${(S%%)prompt_line_1b//(\%([KF1]|)\{*\}|\%[Bbkf])}}
local prompt_padding_size=$(( COLUMNS
- prompt_line_1a_width
- prompt_line_1b_width ))
# Try to fit in long path and user@host.
if (( prompt_padding_size > 0 )); then
local prompt_padding
eval "prompt_padding=\${(l:${prompt_padding_size}::${prompt_gfx_hyphen}:)_empty_zz}"
prompt_line_1="$prompt_line_1a$prompt_padding$prompt_line_1b"
return
fi
prompt_padding_size=$(( COLUMNS - prompt_line_1a_width ))
# Didn't fit; try to fit in just long path.
if (( prompt_padding_size > 0 )); then
local prompt_padding
eval "prompt_padding=\${(l:${prompt_padding_size}::${prompt_gfx_hyphen}:)_empty_zz}"
prompt_line_1="$prompt_line_1a$prompt_padding"
return
fi
# Still didn't fit; truncate
local prompt_pwd_size=$(( COLUMNS - 5 ))
prompt_line_1="$prompt_gfx_tbox$prompt_l_paren%B%F{$prompt_eric_color2}%$prompt_pwd_size<...<%~%<<$prompt_r_paren%b%F{$prompt_eric_color1}$prompt_gfx_hyphen"
}
prompt_eric_setup "$@"

View File

@@ -0,0 +1,6 @@
bind '"' split-window -c "#{pane_current_path}"
bind '%' split-window -h -c "#{pane_current_path}"
set-option -g pane-active-border-style fg=black,bg=cyan
set-option -g status-style fg=black,bg=cyan

View File

@@ -0,0 +1,43 @@
# Aliases
alias ls='ls --color=auto'
alias ll='ls -lah --color=auto'
alias grep='grep --color=auto'
export PS2='> '
# Keep 5000 lines of history within the shell and save it to ~/.zsh_history:
HISTSIZE=5000
SAVEHIST=5000
HISTFILE=~/.zsh_history
setopt histignorealldups sharehistory
# Set the prompt
autoload -Uz promptinit
promptinit
prompt eric
# Use modern completion system
autoload -Uz compinit
compinit
# zplug - manage plugins
source /usr/share/zplug/init.zsh
zplug "plugins/git", from:oh-my-zsh
zplug "plugins/sudo", from:oh-my-zsh
zplug "plugins/command-not-found", from:oh-my-zsh
zplug "zsh-users/zsh-syntax-highlighting"
zplug "zsh-users/zsh-autosuggestions"
zplug "zsh-users/zsh-history-substring-search"
zplug "zsh-users/zsh-completions"
# zplug - install/load new plugins when zsh is started or reloaded
if ! zplug check; then
printf "Install? [y/N]: "
if read -q; then
echo; zplug install
fi
fi
zplug load
if [ -x "$(command -v tmux)" ] && [ -n "${DISPLAY}" ] && [ -z "${TMUX}" ]; then
exec tmux new-session -A -s ${USER} >/dev/null 2>&1
fi

View File

@@ -0,0 +1,2 @@
---
# handlers file for ericomeehan.ericomeehan

View File

@@ -0,0 +1,52 @@
galaxy_info:
author: your name
description: your role description
company: your company (optional)
# If the issue tracker for your role is not on github, uncomment the
# next line and provide a value
# issue_tracker_url: http://example.com/issue/tracker
# Choose a valid license ID from https://spdx.org - some suggested licenses:
# - BSD-3-Clause (default)
# - MIT
# - GPL-2.0-or-later
# - GPL-3.0-only
# - Apache-2.0
# - CC-BY-4.0
license: license (GPL-2.0-or-later, MIT, etc)
min_ansible_version: 2.1
# If this a Container Enabled role, provide the minimum Ansible Container version.
# min_ansible_container_version:
#
# Provide a list of supported platforms, and for each platform a list of versions.
# If you don't wish to enumerate all versions for a particular platform, use 'all'.
# To view available platforms and versions (or releases), visit:
# https://galaxy.ansible.com/api/v1/platforms/
#
# platforms:
# - name: Fedora
# versions:
# - all
# - 25
# - name: SomePlatform
# versions:
# - all
# - 1.0
# - 7
# - 99.99
galaxy_tags: []
# List tags for your role here, one per line. A tag is a keyword that describes
# and categorizes the role. Users find roles by searching for tags. Be sure to
# remove the '[]' above, if you add tags to this list.
#
# NOTE: A tag is limited to a single word comprised of alphanumeric characters.
# Maximum 20 tags per role.
dependencies: []
# List your role dependencies here, one per line. Be sure to remove the '[]' above,
# if you add dependencies to this list.

View File

@@ -0,0 +1,27 @@
---
# tasks file for ericomeehan.ericomeehan
- name: Install user environment packages
apt:
name:
- zplug
- zsh
state: present
- name: Set default shell to zsh
user:
name: eric
shell: /bin/zsh
- name: Copy zsh configuration
copy:
src: files/zsrhc
dest: /home/eric/.zsrhc
- name: Install custom zsh prompt
copy:
src: files/prompt_eric_setup
dest: /usr/share/zsh/functions/Prompts/prompt_eric_setup
- name: Setup mobile command
include_tasks: mobile-command.yml
when: ansible_host == mobil_command

View File

@@ -0,0 +1,41 @@
---
# tasks file for mobile-command.yml
- name: Install additional user packages
apt:
name:
- git
- gimp
- gpsd
- neovim
- openscad
- passwordsafe
- tmux
state: present
- name: Append tmux text to zshrc
become: true
lineinfile:
path: "{{ ansible_user_dir }}/.zshrc"
line: "if [ -x \"$(command -v tmux)\" ] && [ -n \"\${DISPLAY}\" ] && [ -z \"\${TMUX}\" ]; then\n exec tmux new-session -A -s {{ ansible_user }} >/dev/null 2>&1\nfi"
create: true
- name: Copy tmux configuration
copy:
src: files/tmux.conf
dest: /home/eric/.tmux.conf
- name: Copy git configuration
copy:
src: files/gitconfig
dest: /home/eric/.gitconfig
- name: Create local configuration directory
file:
path: /home/eric/.config/nvim
state: directory
- name: Copy neovim configuration
copy:
src: files/init.lua
dest: /home/eric/.config/nvim/init.lua

View File

@@ -0,0 +1,2 @@
localhost

View File

@@ -0,0 +1,5 @@
---
- hosts: localhost
remote_user: root
roles:
- ericomeehan.ericomeehan

View File

@@ -0,0 +1,2 @@
---
# vars file for ericomeehan.ericomeehan