diff --git a/misc/neofetch/config b/misc/neofetch/config new file mode 100755 index 0000000..c08b471 --- /dev/null +++ b/misc/neofetch/config @@ -0,0 +1,415 @@ +#!/usr/bin/env bash +# vim:fdm=marker +# +# Neofetch config file +# https://github.com/dylanaraps/neofetch + +# Speed up script by not using unicode +export LC_ALL=C +export LANG=C + +# Info Options {{{ + + +# Info +# See this wiki page for more info: +# https://github.com/dylanaraps/neofetch/wiki/Customizing-Info +printinfo() { + info "OS" distro + info "Kernel" kernel + info "Shell" shell + info "Resolution" resolution + prin "WM" "bspwm" + info "Theme" theme + info "Icons" icons + info "Term" term + prin "Font" "lemon" + info "CPU" cpu + info "GPU" gpu + + # info "CPU Usage" cpu_usage + # info "Disk" disk + # info "Battery" battery + # info "Font" font + # info "Song" song + # info "Local IP" localip + # info "Public IP" publicip + # info "Users" users + # info "Birthday" birthday + + info linebreak + info cols + + wait +} + + +# Kernel + +# Show more kernel info +# --kernel_shorthand on, off +kernel_shorthand="on" + + +# Distro + +# Shorten the output of distro (tiny, on, off) +# NOTE: This is only possible on Linux, macOS, and Solaris +distro_shorthand="off" + +# Show 'x86_64' and 'x86' in 'Distro:' output. +# --os_arch on, off +os_arch="on" + + +# Uptime + +# Shorten the output of the uptime function +# --uptime_shorthand tiny, on, off +uptime_shorthand="off" + + +# Shell + +# Show the path to $SHELL +# --shell_path on, off +shell_path="off" + +# Show $SHELL's version +# --shell_version on, off +shell_version="on" + + +# CPU + +# CPU speed type +# Only works on Linux with cpufreq. +# --speed_type current, min, max, bios, +# scaling_current, scaling_min, scaling_max +speed_type="max" + +# CPU Shorthand +# Set shorthand setting +# --cpu_shorthand name, speed, tiny, on, off +cpu_shorthand="off" + +# CPU Usage display +# Set CPU usage display setting +# --cpu_display bar, infobar, barinfo, off +cpu_display="off" + +# CPU Speed +# Hide/Show CPU speed. +# --cpu_speed on, off +cpu_speed="on" + +# CPU Cores +# Display CPU cores in output +# Logical: All virtual cores +# Physical: All physical cores +# --cpu_cores logical, physical, off +# Note: 'physical' doesn't work on BSD. +cpu_cores="logical" + +# CPU Temperature +# Hide/Show CPU temperature. +# --cpu_temp on, off +# Note: Only works on Linux. +cpu_temp="off" + + +# GPU + +# Enable/Disable GPU Brand +# --gpu_brand on, off +gpu_brand="on" + + +# Resolution + +# Display refresh rate next to each monitor +# Unsupported on Windows +# --refresh_rate on, off +refresh_rate="off" + + +# Gtk Theme / Icons + +# Shorten output (Hide [GTK2] etc) +# --gtk_shorthand on, off +gtk_shorthand="off" + + +# Enable/Disable gtk2 theme/icons output +# --gtk2 on, off +gtk2="on" + +# Enable/Disable gtk3 theme/icons output +# --gtk3 on, off +gtk3="on" + + +# IP Address + +# Website to ping for the public IP +# --ip_host url +public_ip_host="http://ident.me" + + +# Song + +# Print the Artist and Title on seperate lines +# --song_shorthand on, off +song_shorthand="off" + + +# Birthday + +# Whether to show a long pretty output +# or a shortened one +# NOTE: Long pretty output doesn't work on OpenBSD or NetBSD. +# --birthday_shorthand on, off +birthday_shorthand="off" + +# Whether to show the time in the output +# --birthday_time on, off +birthday_time="on" + +# Date format to use when printing birthday +# --birthday_format "format" +birthday_format="+%a %d %b %Y %l:%M %p" + + +# }}} + +# Text Colors {{{ + + +# Text Colors +# Each number represents a different part of +# the text in this order: +# title, @, underline, subtitle, colon, info +# colors=(4 6 1 8 8 6) +# You can also specify: +# fg (foreground color) +colors=(distro) + + +# }}} + +# Text Options {{{ + + +# Toggle bold text +# --bold on, off +bold="on" + +# Enable/Disable Underline +# --underline on, off +underline_enabled="on" + +# Underline character +# --underline_char char +underline_char="-" + + +# }}} + +# Color Blocks {{{ + + +# Color block range +# --block_range start end +start=0 +end=7 + +# Toggle color blocks +# --color_blocks on, off +color_blocks="on" + +# Color block width in spaces +# --block_width num +block_width=3 + +# Color block height in lines +# --block_height num +block_height=1 + + +# }}} + +# Progress Bars {{{ + + +# Progress bar character +# --progress_char elapsed_char total_char +progress_char_elapsed="-" +progress_char_total="=" + +# Progress border +# --progress_border on, off +progress_border="on" + +# Progress bar length in spaces +# Number of chars long to make the progress bars. +# --progress_length num +progress_length="15" + +# Progress bar colors +# When set to distro, uses your distro's logo colors +# Takes: num, "distro" +# --progress_colors col col +progress_color_elapsed="distro" +progress_color_total="distro" + +# Customize how the info is displayed. +# bar: Only the progress bar is displayed. +# infobar: The bar is displayed after the info. +# barinfo: The bar is displayed before the info. +# off: Only the info is displayed. +# +# --memory_display bar, infobar, barinfo, off +# --battery_display bar, infobar, barinfo, off +# --disk_display bar, infobar, barinfo, off +memory_display="off" +battery_display="off" +disk_display="off" + + +# }}} + +# Image Options {{{ + + +# Image Source +# --image wall, ascii, /path/to/img, /path/to/dir/, off +image="w3m" + +# Thumbnail directory +thumbnail_dir="$HOME/.cache/thumbnails/neofetch" + +# W3m-img path +# Only works with the w3m backend. +# Some systems have this in another location +w3m_img_path="/usr/lib/w3m/w3mimgdisplay" + +# Crop mode +# --crop_mode normal, fit, fill +crop_mode="normal" + +# Crop offset +# Only affects normal mode. +# --crop_offset northwest, north, northeast, west, center +# east, southwest, south, southeast +crop_offset="center" + +# Image size +# The image is half the terminal width by default. +# --size auto, 00px, 00%, none +image_size="auto" + +# Right gap between image and text +# --gap num +gap=2 + +# Image offsets +# Only works with the w3m backend. +# --xoffset px +# --yoffset px +yoffset=0 +xoffset=0 + +# Image background color +# Only works with the w3m backend. +# Unset by default. +# --bg_color 'color', blue +background_color= + + +# }}} + +# Ascii Options {{{ + + +# Default ascii image to use +# When this is set to distro it will use your +# distro's logo as the ascii. +# --ascii 'distro', path/to/ascii +ascii="distro" + +# Ascii distro +# Which distro's ascii art to display. +# --ascii_distro 'auto', 'distro_name' +ascii_distro="auto" + +# Ascii colors +# When this is set to distro it will use your +# ditro's colors to color the ascii. +# NOTE: You can also set this to a range of colors +# which will allow you to custom color distro logos +# --ascii_colors distro +# --ascii_colors 2 4 5 6 +ascii_colors=(distro) + +# Logo size +# Arch, Crux and Gentoo have a smaller logo +# variant. Changing the value below to small +# will make neofetch use the small logo. +# --ascii_logo_size small, normal +ascii_logo_size="normal" + +# Bold ascii logo +# Whether or not to bold the ascii logo. +# --ascii_bold on, off +ascii_bold="on" + + +# }}} + +# Scrot Options {{{ + + +# Whether or not to always take a screenshot +# You can manually take a screenshot with "--scrot" or "-s" +scrot="off" + +# Screenshot program to launch +# --scrot_cmd +scrot_cmd="scrot -c -d 3" + +# Scrot dir +# Where to save the screenshots +# --scrot_dir /path/to/screenshot/folder +scrot_dir="$NICE_HOME/img/" + +# Scrot filename +# What to name the screenshots +# --scrot_name str +scrot_name="neofetch-$(date +%F-%I-%M-%S-${RANDOM}).png" + +# Image upload host +# Where to upload the image. +# Possible values: imgur, teknik +image_host="imgur" + +# Imgur api key +# This is an api key for neofetch, you can sign up for your own +# here: http://api.imgur.com/oauth2/addclient +imgur_client_id="0e8b44d15e9fc95" + + +# }}} + +# Config Options {{{ + + +# Enable/Disable config file +# --config off, none +config="on" + +# Path to custom config file location +# --config path/to/config +config_file="${XDG_CONFIG_HOME:-${HOME}/.config}/neofetch/config" + + +# }}} diff --git a/readme.md b/readme.md index d1bd16c..e920d82 100644 --- a/readme.md +++ b/readme.md @@ -6,6 +6,13 @@ who may not know either how to go about organizing such files or to learn how to achieve certain behavior in their software and to have quick and easy access for myself when setting up a new machine. +## Setup + +* Clone the repo into `~/.config/dotfiles` +* Run `~/.config/dotfiles/setup` +* Read the warning, obey it, backup your files, *then* agree +* Reboot once the script finishes. + ## Priorities I have specific needs and desires (as does any developer) and I will lay those diff --git a/setup b/setup index 191e218..7f65f4a 100755 --- a/setup +++ b/setup @@ -1,7 +1,7 @@ #!/usr/bin/env bash if [[ -z "$XDG_CONFIG_HOME" ]]; then - export XDG_CONFIG_HOME="$HOME/.config" + export XDG_CONFIG_HOME="$HOME/.config" fi dfp=$(cd "$(dirname "${BASH_SOURCE[0]}" )/" && pwd) @@ -12,77 +12,80 @@ ALERT_AGREEMENT_FILE="$dfp/.agreed-to-erasing-files.lock" # that they should read this script before running. We'll use a lock file so # the user only needs to agree once. if [ -f "$ALERT_AGREEMENT_FILE" ]; then - # User agreed already - do nothing - echo "Linking..." + # User agreed already - do nothing + echo "Linking..." else - echo "Running this script may delete existing personal configuration files." - echo "Please view this script's source, fully understand it, and backup any" - echo "files before continuing." - echo "Seriously. Like... entire directories. Just gone." - read -r -p "Are you sure you want to continue? [y/N] " response - response=${response,,} # to lower case - if [[ $response =~ ^(yes|y)$ ]]; then - echo "agreed" > "$ALERT_AGREEMENT_FILE" - else - exit 1 - fi + echo "Running this script may delete existing personal configuration files." + echo "Please view this script's source, fully understand it, and backup any" + echo "files before continuing." + echo "Seriously. Like... entire directories. Just gone." + read -r -p "Are you sure you want to continue? [y/N] " response + response=${response,,} # to lower case + if [[ $response =~ ^(yes|y)$ ]]; then + echo "agreed" > "$ALERT_AGREEMENT_FILE" + else + exit 1 + fi fi # TODO: make sure we have an even number, here links=( - # desktop environment files - "$dfp/de/bspwmrc" "$XDG_CONFIG_HOME/bspwm/bspwmrc" - "$dfp/de/sxhkdrc" "$XDG_CONFIG_HOME/sxhkd/sxhkdrc" - "$dfp/de/xresources" "$HOME/.Xresources" - "$dfp/de/xinitrc" "$HOME/.xinitrc" - "$dfp/de/xprofile" "$HOME/.xprofile" - "$dfp/common/colors/xresources" "$HOME/.Xresources.colors" + # desktop environment files + "$dfp/de/bspwmrc" "$XDG_CONFIG_HOME/bspwm/bspwmrc" + "$dfp/de/sxhkdrc" "$XDG_CONFIG_HOME/sxhkd/sxhkdrc" + "$dfp/de/xresources" "$HOME/.Xresources" + "$dfp/de/xinitrc" "$HOME/.xinitrc" + "$dfp/de/xprofile" "$HOME/.xprofile" + "$dfp/common/colors/xresources" "$HOME/.Xresources.colors" - # bar files - "$dfp/de/bar/polybar-config" "$XDG_CONFIG_HOME/polybar/config" + # bar files + "$dfp/de/bar/polybar-config" "$XDG_CONFIG_HOME/polybar/config" - # shell files - "$dfp/shell/bashrc" "$HOME/.bashrc" - "$dfp/shell/bash_profile" "$HOME/.bash_profile" - "$dfp/shell/tmux.conf" "$HOME/.tmux.conf" - "$dfp/shell/tmux-layouts" "$HOME/.tmux/layouts" + # shell files + "$dfp/shell/bashrc" "$HOME/.bashrc" + "$dfp/shell/bash_profile" "$HOME/.bash_profile" + "$dfp/shell/tmux.conf" "$HOME/.tmux.conf" + "$dfp/shell/tmux-layouts" "$HOME/.tmux/layouts" - # text editor files - "$dfp/text-editor/neovim/" "$XDG_CONFIG_HOME/nvim" - "$dfp/text-editor/neovim/" "$HOME/.vim" - "$dfp/text-editor/neovim/init.vim" "$HOME/.vimrc" - "$dfp/common/colors/vim" "$XDG_CONFIG_HOME/nvim/colors/base16-donokai.vim" + # text editor files + "$dfp/text-editor/neovim/" "$XDG_CONFIG_HOME/nvim" + "$dfp/text-editor/neovim/" "$HOME/.vim" + "$dfp/text-editor/neovim/init.vim" "$HOME/.vimrc" + "$dfp/common/colors/vim" "$XDG_CONFIG_HOME/nvim/colors/base16-donokai.vim" - # irc files - "$dfp/misc/irssi/" "$HOME/.irssi" - "$dfp/misc/weechat/" "$HOME/.weechat" + # irc files + "$dfp/misc/irssi/" "$HOME/.irssi" + "$dfp/misc/weechat/" "$HOME/.weechat" + + # neofetch config + "$dfp/misc/neofetch/config" "$HOME/.config/neofetch/config" ) source="" for i in "${links[@]}"; do - if [ -n "$source" ]; then - if [ -L "$i" ]; then # if symlink exists, delete it - rm -rf "$i" - fi - if [ -f "$i" ]; then # if file exists, delete it - rm -rf "$i" - fi - if [ -d "$i" ]; then # if directory exists, delete it - rm -rf "$i" - fi - # check if the directory that will contain the link exists - DIR_TO_LINK=$(dirname "$i") - if [ -d "$DIR_TO_LINK" ]; then - : - else - mkdir -p "$DIR_TO_LINK" - fi - ln -s "$source" "$i" - echo "Linked $(basename $source) to $i." - source="" - else - source="$i" - fi + if [ -n "$source" ]; then + if [ -L "$i" ]; then # if symlink exists, delete it + rm -rf "$i" + fi + if [ -f "$i" ]; then # if file exists, delete it + rm -rf "$i" + fi + if [ -d "$i" ]; then # if directory exists, delete it + rm -rf "$i" + fi + # check if the directory that will contain the link exists + DIR_TO_LINK=$(dirname "$i") + if [ -d "$DIR_TO_LINK" ]; then + : + else + mkdir -p "$DIR_TO_LINK" + fi + ln -s "$source" "$i" + echo "Linked $(basename $source) to $i." + source="" + else + source="$i" + fi done echo "Done." diff --git a/shell/shell_funcs b/shell/shell_funcs index ed5c902..173120b 100644 --- a/shell/shell_funcs +++ b/shell/shell_funcs @@ -7,7 +7,9 @@ calc() { export -f calc stopbar() { - # TODO: properly kill the polybar + # TODO: get the proper monitor! + bspc config -m "DVI-I-2" bottom_padding "0" + bspc config -m "DVI-I-2" top_padding "0" killall -q polybar while pgrep -x polybar >/dev/null; do sleep 1; done } diff --git a/text-editor/neovim/.gitignore b/text-editor/neovim/.gitignore new file mode 100644 index 0000000..1268564 --- /dev/null +++ b/text-editor/neovim/.gitignore @@ -0,0 +1,3 @@ +* +!.gitignore +!init.vim diff --git a/text-editor/neovim/init.vim b/text-editor/neovim/init.vim index 414d7b4..23d0f06 100644 --- a/text-editor/neovim/init.vim +++ b/text-editor/neovim/init.vim @@ -134,7 +134,7 @@ let python_space_errors = 1 autocmd FileType php setl tabstop=4 expandtab shiftwidth=4 softtabstop=4 " Markdown -" autocmd BufNewFile,BufReadPost *.md setl filetype=markdown spell textwidth=0 wrapmargin=0 +autocmd BufNewFile,BufReadPost *.md setl filetype=markdown spell " Text autocmd BufNewFile,BufReadPost *.txt setl spell textwidth=0 wrapmargin=0