GithubHelp home page GithubHelp logo

jessebot / dot_files Goto Github PK

View Code? Open in Web Editor NEW
5.0 2.0 3.0 106.83 MB

Default dot files for onboardme including bash, neovim, powerline, neomutt, w3m, wezterm, and more :)

Home Page: https://jessebot.github.io/onboardme

License: GNU Affero General Public License v3.0

Shell 67.94% Python 2.66% Lua 28.75% Scheme 0.66%
bashrc dotfiles lua neomutt neovim nvim w3m powerline iterm2 ranger

dot_files's Introduction

Dot Files for onboardme

These are the chosen defaults for onboardme, but also the personal dot files of @cloudymax and @jessebot. The directories/files are installed to your home directory and follow the XDG Base Directory Spec as closely as possible. We update these pretty regularly.

Sections for each config directory/file

.cache

File: ~/.cache/wget/wget-hsts

File to auto-generate location for wget cache to match XDG Base Directory Spec

.config
asciinema

File: ~/.config/asciinema/config

Config file for asciinema, a lightweight, purely text-based approach to terminal recording. Currently it just sets the shell command to be /bin/bash --login, which loads your bash variables. This could be changed to a different shell and their equivilent.

bat

File: ~/.config/bat/config

Config file for batbat, a cat replacement with sytax highlighting and git support. Currently the config file:

  • sets a default theme
  • enable italic text
  • maps Chart.lock files to YAML syntax (this is for the helm charts for k8s)

The goal is to have a spacechalk.nvim-like theme soon :)

bash

Files

a config file to organize all our BASH aliases

enable tab completion for all common commands that support it.

  • sets history to be in ~/.local/state/bash/history
  • sets default history size
  • don't log duplicate history lines

sets neovim as default text editor, or vim if neovim is not present

kubernetes defaults:

  • set pathing for krew, a plugin manager for kubectl.
  • helpful aliases and functions such as:
    • k is aliased to kubecolor (kubectl with colors)
    • kg for kubecolor get
    • kgsdump and kgs to dump the contents of a given secret in plain text (supports tab completion)
    • kgall to get pods, PVCs, secrets, and configmaps in one go
  • fix how less handles non-text input files
  • change the default colors for less used in man pages
  • changes default pagers used when file is too long for catting
fastfetch

File: ~/.config/fastfetch/config.conf

Config file for fastfetch, is a neofetch-like tool for fetching system information and displaying them in a pretty way. It is written in pure c, with performance and customizability in mind. Currently, Linux, Android, FreeBSD, MacOS and Windows 7+ are supported.

Our current configuration default prints a dog on a computer using the iterm2 image protocol, but you could also change that to be sixel if you wanted.

We also provide a couple of basic presets in this dir: $XDG_DATA_HOME/.local/share/fastfetch/presets

You can also change the configuration to show more data or less on the right side.

gh

File: ~/.config/gh/config.yml

Config file for gh, the GitHub CLI. There's not a ton in there, but it uses rich-cli as a prettier pager, and firefox as a browser, and setting neovim as an editor. The rest is stock, and subject to change.

glab-cli

File: ~/.config/glab-cli/config.yml

Config file for glab, an open source GitLab CLI tool. There's not a ton in there, but it uses a dark theme, firefox as a browser, and neovim as an editor. The rest is stock, and subject to change.

git

File: ~/.config/git/config

Default git config file. We set the following parameters:

  • Default branch for new repos is main
  • Push up to remote automatically if it's a new branch
  • color is always on
  • set specific terminal colors for:
    • git branch
    • git status
    • git diff

We also include this block, which allows you to have a personal gitconfig file:

[includeIf "gitdit:~/"]
    path = ~/.config/git/personal

You can create a ~/.config/git/personal file and store info such as:

[user]
    email = [email protected]
    name = Fido Good-dog
    signingkey = gooddoggpgsigningkey
[commit]
    gpgsign = true
gitui

File: ~/.config/gitui/theme.ron

This just sets a basic colorscheme for gitui so it's readable with spacechalk.nvim-like colors :)

lsd

File: ~/.config/lsd/config.yaml

Config file for lsd, an ls alternative with icons and pretty colors. There's an intension to write and release a spacechalk.nvim-like theme for lsd eventually.

lsimg

File: ~/.config/lsimg/config.yaml

This is a local project that I'm working on to rewrite a bash script in python, to do basic checking of images in the terminal. I might remove it though, because after discovering ranger, it might not be really needed ๐Ÿคท

neomutt

Files:

Config files for NeoMutt, a terminal based email client. Config includes:

  • sets spacechalk theme, based on the neonwolf colorscheme and neomutt powerline
  • sets character set to be utf-8 (emojis ๐Ÿง‘โ€๐Ÿ’ป)
  • sets basic SMTP settings (but use [offlineimap] to pull the imap backup)
  • sets tls by default
  • sets header_cache and message_cachedir to be ~/.cache/mutt (must be a directory, NOT a file)
  • sets navigation keys similar to vim
  • set a key binding for V to be opening html attachments
  • removes the prompt of hitting enter after viewing an attachment

You'll still need to create ~/.config/neomutt/keys with the following info:

set my_user[email protected]
set my_name="Your Name"

# if you're using protonmail this is the password from protonmail-bridge,
# after you login, not your actual email password
set my_pass="areallycoolpasswordfordogs"

Config file for NeoMutt's MIME Support, which is how NeoMutt, a TUI email client, handles attachments e.g. html in an email body, PDFs, images...

We currently open these applications for these file types:

file type application
html w3m
PDFs macOS preview
images img2sixel
nvim

neovim is a hyperextensible Vim-based text editor, which is in some ways a sucessor to vim. It's a lot faster, for one, and there's more support for more languages, which means more plugins. Uses lazy.nvim to manage neovim plugins.

Each file explained below:

The main global configuration changes are:

  • turning off mouse scrolling (might re-enable this ๐Ÿค”)
  • enabling line numbers
  • adding a cursorline
  • enter folds the current code block
  • space is our leader key (a custom modifier key for neovim)
  • setting column 80 to be a different color for tidy code
  • searches are case insensitive
  • enabling gui colors so you aren't limited to like 16 colors
  • uses the spacechalk.nvim colorscheme
  • sources all the files in ~/.config/nvim/lua, including all our plugin configs.
  • adds a nice little terminal called [toggleterm.nvim] in toggleterm.lua

This is the configuration for [lazy.nvim], our plugin manager for neovim. It installs lazy, and then all of our plugins.

config for a starting screen dashboard for neovim. You should just check out the file to see what's being done. It's cute ascii art, and utilizes telescope to open your recent files or search your files.

config file to enable folding, which is just vim speak for collapsing blocks of code. Sets some defaults.

config file for nvim-tree, a neovim file explorer written in lua, with icons.

Opens on opening of any file, and auto-adjusts its window size.

config file for the nvim tree-sitter plugin, which helps with syntax highlighting of various languages.

currently installing syntax for: "lua", "yaml", "bash", "hcl"

offlineimap

File: ~/.config/offlineimap/config

This is to sync your email from whereever, but it's default configured for protonmail right now :) You will need to export the following env variables:

(if using protonmail bridge, these should be the credentials from there)

  • MAIL_SERVER - normally 127.0.0.1 for protonmail
  • MAIL_USER - normally [email protected] for protonmail
  • MAIL_PASS - normally generated from the protonmail bridge app
  • MAIL_PORT - typically 1143 for protonmail

Currently we import ALL folders except the "All Mail" folder, which is just all the mail from all the other folders (including inbox, sent, trash, etc)

onboardme

Files:

These are config files for [onboardme], a tool to install dot files, packages, and setup neovim.

powerline

Configuration files for powerline, a status line for BASH and tmux. We enable a spacechalk.nvim-like color theme as well as:

  • local IP address
  • hostname
  • current working directory
  • git status info
  • unread mail count
  • kubernetes info
  • laptop battery information
  • the time
  • status of last run command (only appears if exit code is not 0)

Currently working on getting mail notifications working.

Files for colors:

Files for configuring powerline for a login shell, and the console shell:

File for configuring tmux status line:

python

File:

This file sets the default history location to $XDG_STATE_HOME (~/.local/state/python/history) It requires the following in your bash config:

export PYTHONSTARTUP=$XDG_CONFIG_HOME/python/interactive_startup.py
ranger

Files:

ranger is a TUI file manager. Current configurations:

  • enable file previews using iterm2 image protocol
  • enable video previews using ffmpegthumbnailer
  • enable svg previews.
spotifyd

Files:

spotifyd is a spotify daemon used in combination with [spotify-tui] or other alternative spotify frontends.

Current settings are for Linux only. I will add a macOS file and appropriate aliases and docs soon :)

For Linux, this still requires a premium account, but then you can follow the potify-tui api connection instructions].

(You also need to change your cache in spotifyd.conf to be your username)

After that, just make sure you have your spotify credentials in bitwarden, and that you are logged into bitwarden via the bw cli. DON'T FORGET TO EXPORT YOUR SESSION ID! Then you HAVE TO RESTART SPOTIFYD!

brew services restart spotifyd

Linux Note: If you did a brew install spotifyd, then you might have to brew edit spotifyd, and then fix the hardcoded macOS backend to be alsa. Then you need to do a brew reinstall --build-from-source spotifyd.

After that, you can use commands such as spt (spotify-tui) to launch a lightweight terminal frontend. You can follow spotify-tui's instructions above, but the most important part is going to be creating your own little spotify app which you can do after logging into the developer spotify dashboard.

tmux

File: ~/.config/tmux/tmux.conf

Config file for tmux. Currently, it will:

  • Sets 256 colors
  • enable the powerline tmux status line
w3m

Files:

Files for the w3m terminal based web browser.

~/.config/w3m/config sets:

  • set default mailcap file for MIME types
  • always display images
  • set the default keymap file (for mapping keys)
  • quit without asking

~/.config/w3m/keymap sets vim key bindings.

~/.config/w3m/mailcap is supposed to set default MIMEtypes for w3m but does not ๐Ÿคท

wezterm

File: ~/.config/wezterm/wezterm.lua

This file is configuration for the terminal emulator [wezterm]:

  • disables bell noises
  • sets font face to mononoki
  • sets font size to 15
  • ignore warnings about missing glyphs
  • hides tab bar if only one tab
  • removes top title bar
  • set background opacity to 0.95
  • change colors to a softer spacechalk.nvim aligned colorscheme
  • maps alt+โฌ…๏ธ to go back a word on the command line
  • maps alt+โžก๏ธ to go forward a word on the command line
  • maps ctrl+s to open a split pane to the right
  • maps ctrl+S to open a split pane below the current pane
  • makes links clickable
.cron
local cron jobs for alarms, and package manager updates
.local

Directories:

bin

Files:

This is just where we throw a few really simple scripts like:

Command Description
utc for ease of use printing the time in UTC
w3m-splits open split in iterm2 and send a website or HTML file to w3m

w3m-splits is mostly useful for NeoMutt, but anything is possible ๐Ÿคท

Directories:

iterm2

Directory:

This is just for imgcat, for printing images in iterm2/wezterm.

share

Mostly READMEs to generate directory structure, but also some fastfetch preset configs.

state

This directory and the director[y/ies]/file(s) within it are specifically to auto-generate directory structure so that XDG spec is enforced with tools that only loosely enforce it.

.bash_profile, .bashrc

Configuration files for BASH. The .bash_profile just sources the .bashrc, since macOS default looks for .bash_profile instead of .bashrc.

The .bashrc sets the following defaults:

  • turns off bells
  • enables 256 colors
  • sources all the files in ~/.config/bash (see above under config > bash )
  • sources personal file in ~/.config/bash/personal/bashrc (this files is never checked in and is where you put sensitive host specific bash configs)
  • starts powerline daemon, which is used for our fancy status line for BASH
  • runs fastfetch when you source it
.gitignore

Git ignore file for all sorts of things in your home directory that should never get committed if this repo is used as your home directory dot files.

.hushlogin

This just silences the last login message of shells.

.zshrc

Recently started giving this some TLC, but still in it's infancy to be match the .bash configs. Currently we:

  • set some useful aliases
  • set the same powerline prompt as bash

Please feel free to fork this repo and make it your own. You can still use onboardme, but you'll want to pass in your git URL and branch.

Example via the CLI:

# this uses your personal git URL and makes sure to always pull from main
# if you want to overwrite your existing dot files, you can also add --overwrite to this command
onboardme --git_url https://github.com/your_username/dot_files --git_branch main

Example via the config file, ~/.config/onboardme/config.yaml:

# this uses your personal git URL and makes sure to always pull from main
dot_files:
  # your personal git repo URL for your dot files
  # defaults to https://github.com/jessebot/dot_files.git if not set
  git_url: "https://github.com/your_username/dot_files.git"
  # the branch to use for the git repo above, defaults to main
  git_branch: "main"
  # !!CAREFUL: runs a `git reset --hard`, which will overwrite/delete dot files in
  # $HOME that conflict with the above defined git repo url and branch.
  # Unless you know for sure you want to overwrite everytime you run onboardme, you
  # should run the following to get the files that would be overwritten before setting this:
  # onboardme -s dot_files
  # if set to true, then using onboardme -O will toggle it back to false
  overwrite: false

FAQ

Where are the config files for vim, iterm2, terminator, etc?

I've been moving all the configurations for apps I no longer use to jessebot/old_dotfiles.

RoadMap

  • Get screenshots
  • migrate some more of the themeing to the space-chalk org to unify it all
  • more in the GitHub Issues

dot_files's People

Contributors

cloudymax avatar jessebot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

dot_files's Issues

Folding in python doesn't work on functions

It only works on indented text, so if i used it in the doc string or any string below that, it would fold the doc string and/or function, but it doesn't collapse on the actual def somefunc(): line, and I want it to. I'm currently manually defining folds in a couple places, so it's probably also a good time to clear that up as well. Perhaps folding and indents should have their own config file?

Feature: Submodules for powerline Theme/ColorScheme

I really love my powerline, but maybe everyone else doesn't. I'd like this to be a sub module, and it would be cool if onboardme was able to maintain that, but by default submodules go into their own directory, so we'd need them present in the base directory, or purposefully cloned into their respective locations (e.g. powerline goes into ~/.config/powerline). Will update this ticket as I learn more/have time. Git was never meant to do this :-)

Follow up on why `:term` in vim doesn't use truecolor

for whatever reason, in vim, I get this:
Screenshot 2022-12-20 at 14 58 25

Instead of my normal terminal colors, which should be something like this:
Screenshot 2022-12-20 at 14 59 09

I opened a ticket with vim, but got too busy to follow up on it. Need to locate that and get back to it over the holiday break.

pip_packages location mismatch between Darwin/Linux

When installing on a fresh Xbuntu 22.04 or Debian12 host, python3.11 and pip3.11 are installed in ~/.local/ instead of ~/.local/python which causes the system to lose track all pip-installed packages.

To recreate:

  • install a fresh copy of Ubuntu22.04 or Debian12
  • run setup.sh from the onboardme repo
  • logout and back-in

Example of error:

testadmin@test:~$ echo $pip_packages
/home/testadmin/.local/share/python/lib/python3.11/site-packages

testadmin@test:~$ ls $pip_packages
lsd: /home/testadmin/.local/share/python/lib/python3.11/site-packages: No such file or directory (os error 2).

testadmin@test:~$ onboardme --help
Traceback (most recent call last):
  File "/home/testadmin/.local/bin/onboardme", line 5, in <module>
    from onboardme import main
ModuleNotFoundError: No module named 'onboardme'
testadmin@test:~$

Document iterm2 config

Also check into why the symlink happens in ~/.config/iterm2/* instead of just allowing me to store a file there. I'm sure I'm not the only one to complain of this.

Terminal Notifications: Starting with email notifications

I spend so much time in the terminal, that I could use some email notifications there. It would be nice to have it be part of some background daemon that is already checking my mail, like powerline, or maybe even the built in MAIL features of BASH.

Details about the MAIL features

From Interative Shell Behavior:

Bash will check for mail periodically, depending on the values of the MAIL, MAILPATH, and MAILCHECK shell variables (see Bash Variables).

These ENV vars are actually from the bourne shell:

  • MAIL
    If this parameter is set to a filename or directory name and the MAILPATH variable is not set, Bash informs the user of the arrival of mail in the specified file or Maildir-format directory.

  • MAILPATH
    A colon-separated list of filenames which the shell periodically checks for new mail. Each list entry can specify the message that is printed when new mail arrives in the mail file by separating the filename from the message with a โ€˜?โ€™. When used in the text of the message, $_ expands to the name of the current mail file.

  • MAILCHECK
    How often (in seconds) that the shell should check for mail in the files specified in the MAILPATH or MAIL variables. The default is 60 seconds. When it is time to check for mail, the shell does so before displaying the primary prompt. If this variable is unset, or set to a value that is not a number greater than or equal to zero, the shell disables mail checking.

Other interesting features:

  • shopt: mailwarn
    If set, and a file that Bash is checking for mail has been accessed since the last time it was checked, the message "The mail in mailfile has been read" is displayed.

  • _
    ($_, an underscore.) At shell startup, set to the pathname used to invoke the shell or shell script being executed as passed in the environment or argument list. Subsequently, expands to the last argument to the previous simple command executed in the foreground, after expansion. Also set to the full pathname used to invoke each command executed and placed in the environment exported to that command. When checking mail, this parameter holds the name of the mail file.

  • Source: gnu.org/software/bash/manual/bash.html#Bash-Builtins

Feature Request: default terminal multiplexer sessions, starting with a jukebox ๐ŸŽถ

Describe the feature you'd like, and why

In the config file, we should have an option for allowing automatic creation of named tmux(or other terminal multiplexers like zellij) sessions and what to run in them.

If the tmux session name doesn't exist already, we should create it by default. We should have this be off by default, and be an opt in feature, because a bunch of tmux sessions everywhere, sounds like pain to clean up, but here's an idea of how the feature would work:

Config File Update proposal [Draft1]

terminal_multiplexer: 
  # change this to true, to enable terminal multiplexer sessions
  enabled: false
  # this can be any program name, but we'll support tmux and zellij out of the box
  program_name: zellij
  # name of the session to create with: tmux new -s name
  # we will only create this if it doesn't already exist
  - session_name: spotify_tui
    command: spt

then we could generate a script to automatically create a session for them, or just do it for them by putting that script in a cronjob to make sure those sessions always exist.

tmux powerline is not consistent across platforms

the command will generate the correct source on the current platform, but its is not constant across linux/macos

echo "source \"$pip_packages/powerline/bindings/tmux/powerline.conf\"" >> ~/.config/tmux/tmux.conf

Example of issue:

MacOS:

source "/opt/homebrew/lib/python3.11/site-packages/powerline/bindings/tmux/powerline.conf" 

vs.

Debin12:

source "/home/friend/.local/share/python/lib/python3.11/site-packages/powerline/bindings/tmux/powerline.conf" 

Make vim respect XDG

The XDG specification is pretty good and helps get your dot files organized. Finding info on it, is a bit difficult. It's very old internet because it's freedesktop, but here's some links:

basically we want ~/.vim to move to ~/.config/ and we want ~/.vimrc to go into ~/.config/vim, to get config files into the config directory. What a battle this is with old software :)

Found this article called vim respect xdg that is pretty much exactly how to go about this, so I'll plan to do this soonish, because I really like the organization. It makes everything feel tidy.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.