commit ba6296a2ec7fdbdea8d9676e6423d326b4c3a4d0 Author: eric o meehan Date: Thu Aug 8 11:17:26 2024 -0400 v0.0.1 diff --git a/README.md b/README.md new file mode 100644 index 0000000..5144952 --- /dev/null +++ b/README.md @@ -0,0 +1,39 @@ +ericomeehan +========= + +Ansible role to install user environment for ericomeehan. + +Requirements +------------ + +A radical attitude. + +Role Variables +-------------- + +None. + +Dependencies +------------ + +None. + +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: ericomeehan.ericomeehan } + +License +------- + +BSD + +Author Information +------------------ + +Eric O'Neill Meehan +https://www.eom.dev/ diff --git a/defaults/main.yml b/defaults/main.yml new file mode 100644 index 0000000..9368625 --- /dev/null +++ b/defaults/main.yml @@ -0,0 +1,2 @@ +--- +# defaults file for ericomeehan.ericomeehan diff --git a/files/gitconfig b/files/gitconfig new file mode 100644 index 0000000..3e50819 --- /dev/null +++ b/files/gitconfig @@ -0,0 +1,5 @@ +[user] + email = eric@eom.dev + name = eric o meehan +[init] + defaultBranch = main diff --git a/files/init.lua b/files/init.lua new file mode 100644 index 0000000..0ca93f1 --- /dev/null +++ b/files/init.lua @@ -0,0 +1,13 @@ +vim.cmd([[ + set nowrap + set number + set scrolloff=5 + set colorcolumn=128 + colorscheme elflord + hi ColorColumn ctermbg=lightgrey guibg=lightgrey + ]]) + +vim.keymap.set('n', '', '', { silent = true }) +vim.keymap.set('n', '', '', { silent = true }) +vim.keymap.set('n', '', '', { silent = true }) +vim.keymap.set('n', '', '', { silent = true }) diff --git a/files/prompt_eric_setup b/files/prompt_eric_setup new file mode 100644 index 0000000..35655a6 --- /dev/null +++ b/files/prompt_eric_setup @@ -0,0 +1,50 @@ +# Generic large colour fade-bar prompt theme from bashprompt +# Created by James Manning +# Changed by Spidey 08/06 +# Converted to zsh prompt theme by + +prompt_bigfade_help () { + cat < [ [ []]]] + +where the parameters are the colors for the fade-bar, user@host text, +date text, and current working directory respectively. The default +colors are blue, white, white, and yellow. This theme works best with +a dark background. + + +Recommended fonts for this theme: either UTF-8, or nexus or vga or similar. +If you don't have any of these, the 8-bit characters will probably look +stupid. +EOH +} + +prompt_bigfade_setup () { + local fadebar=${1:-'cyan'} + local userhost=${2:-'white'} + local date=${3:-'white'} + local cwd=${4:-'cyan'} + + local -A schars + autoload -Uz prompt_special_chars + prompt_special_chars + + PS1="%B%F{$fadebar}$schars[333]$schars[262]$schars[261]$schars[260]%B%F{$userhost}%K{$fadebar}%n@%m%b%k%f%F{$fadebar}%K{black}$schars[260]$schars[261]$schars[262]$schars[333]%b%f%k%F{$fadebar}%K{black}$schars[333]$schars[262]$schars[261]$schars[260]%B%F{$date}%b%f%k %D{%a %b %d} %D{%I:%M:%S%P} %B%F{$cwd}%d$prompt_newline> " + PS2="%B%F{$fadebar}>%b%f%k " + + prompt_opts=(cr subst percent) +} + +prompt_bigfade_preview () { + if (( ! $#* )); then + prompt_preview_theme bigfade + print + prompt_preview_theme bigfade red white grey white + else + prompt_preview_theme bigfade "$@" + fi +} + +prompt_bigfade_setup "$@" diff --git a/files/tmux.conf b/files/tmux.conf new file mode 100644 index 0000000..1250279 --- /dev/null +++ b/files/tmux.conf @@ -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 diff --git a/files/zshrc b/files/zshrc new file mode 100644 index 0000000..fab027c --- /dev/null +++ b/files/zshrc @@ -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 diff --git a/handlers/main.yml b/handlers/main.yml new file mode 100644 index 0000000..677d5f4 --- /dev/null +++ b/handlers/main.yml @@ -0,0 +1,2 @@ +--- +# handlers file for ericomeehan.ericomeehan diff --git a/meta/main.yml b/meta/main.yml new file mode 100644 index 0000000..c572acc --- /dev/null +++ b/meta/main.yml @@ -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. diff --git a/tasks/main.yml b/tasks/main.yml new file mode 100644 index 0000000..ae7ca7f --- /dev/null +++ b/tasks/main.yml @@ -0,0 +1,43 @@ +--- +# 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: zshrc + dest: /home/eric/.zshrc + +- name: Install custom zsh prompt + copy: + src: prompt_eric_setup + dest: /usr/share/zsh/functions/Prompts/prompt_eric_setup + +- name: Copy tmux configuration + copy: + src: tmux.conf + dest: /home/eric/.tmux.conf + +- name: Copy git configuration + copy: + src: gitconfig + dest: /home/eric/.gitconfig + +- name: Create local configuration directory + file: + path: /home/eric/.config/nvim + state: directory + +- name: Copy neovim configuration + copy: + src: init.lua + dest: /home/eric/.config/nvim/init.lua diff --git a/tasks/mobile-command.yml b/tasks/mobile-command.yml new file mode 100644 index 0000000..239f75b --- /dev/null +++ b/tasks/mobile-command.yml @@ -0,0 +1,2 @@ +--- +# tasks file for mobile-command.yml diff --git a/tests/inventory b/tests/inventory new file mode 100644 index 0000000..878877b --- /dev/null +++ b/tests/inventory @@ -0,0 +1,2 @@ +localhost + diff --git a/tests/test.yml b/tests/test.yml new file mode 100644 index 0000000..e42bc80 --- /dev/null +++ b/tests/test.yml @@ -0,0 +1,5 @@ +--- +- hosts: localhost + remote_user: root + roles: + - ericomeehan.ericomeehan diff --git a/vars/main.yml b/vars/main.yml new file mode 100644 index 0000000..6a2236c --- /dev/null +++ b/vars/main.yml @@ -0,0 +1,2 @@ +--- +# vars file for ericomeehan.ericomeehan