updated everything to be similar to luke smiths voidrice setup, going to clean things up quite a bit soon

This commit is contained in:
Solomon Laing 2022-05-20 23:04:23 +09:30
parent c3d67ccde5
commit 8b4105a830
14 changed files with 339 additions and 221 deletions

59
.config/shell/aliasrc Normal file
View File

@ -0,0 +1,59 @@
#!/bin/sh
# Use neovim for vim if present.
[ -x "$(command -v nvim)" ] && alias vim="nvim" vimdiff="nvim -d"
# Use $XINITRC variable if file exists.
[ -f "$XINITRC" ] && alias startx="startx $XINITRC"
# sudo not required for some system commands
for command in mount umount sv pacman updatedb su shutdown poweroff reboot ; do
alias $command="sudo $command"
done; unset command
# Verbosity and settings that you pretty much just always are going to want.
alias \
cp="cp -iv" \
mv="mv -iv" \
rm="rm -vI" \
bc="bc -ql" \
mkd="mkdir -pv" \
ffmpeg="ffmpeg -hide_banner"
# Colorize commands when possible.
alias \
ls="ls -hN --color=auto --group-directories-first" \
grep="grep --color=auto" \
diff="diff --color=auto" \
ccat="highlight --out-format=ansi" \
ip="ip -color=auto"
# These common commands are just too long! Abbreviate them.
alias \
ka="killall" \
g="git" \
e="$EDITOR" \
v="$EDITOR" \
z="zathura"
alias \
lf="lfub" \
magit="nvim -c MagitOnly" \
ref="shortcuts >/dev/null; source ${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc ; source ${XDG_CONFIG_HOME:-$HOME/.config}/shell/zshnameddirrc" \
weath="less -S ${XDG_DATA_HOME:-$HOME/.local/share}/weatherreport" \
# Everything above this comes from Luke Smiths voidrice.
# Alias dotfiles/config related commands
alias \
config="/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME" \
ccam="config commit -am" \
cpush="config push" \
cpull="config pull" \
cst="config status" \
# Alias some extra things for ease of use
alias \
myip="curl api.ipify.org" \
tmn="tmux new" \
tma="tmux attach"

14
.config/shell/bm-dirs Normal file
View File

@ -0,0 +1,14 @@
# You can add comments to these files with #
cac ${XDG_CACHE_HOME:-$HOME/.cache}
cf ${XDG_CONFIG_HOME:-$HOME/.config}
D ${XDG_DOWNLOAD_DIR:-$HOME/Downloads}
d ${XDG_DOCUMENTS_DIR:-$HOME/Documents}
dt ${XDG_DATA_HOME:-$HOME/.local/share}
rr $HOME/.local/src
h $HOME
m ${XDG_MUSIC_DIR:-$HOME/Music}
mn /mnt
pp ${XDG_PICTURES_DIR:-$HOME/Pictures}
sc $HOME/.local/bin
src $HOME/.local/src
vv ${XDG_VIDEOS_DIR:-$HOME/Videos}

23
.config/shell/bm-files Normal file
View File

@ -0,0 +1,23 @@
# These files automatically update when edited/saved in vim:
# keys filename description
bf ${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-files # This file, a list of bookmarked files
bd ${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-dirs # A list of bookmarked directories similar to this file
cfx ${XDG_CONFIG_HOME:-$HOME/.config}/x11/xresources # Colors, themes and variables for X11
cfb ~/.local/src/dwmblocks/config.h # dwmblocks: the status bar for dwm
# These do not update automatically, but on the next new instance of a program:
cfv ${XDG_CONFIG_HOME:-$HOME/.config}/nvim/init.vim # vim/neovim config
cfz $ZDOTDIR/.zshrc # zsh (shell) config
cfa ${XDG_CONFIG_HOME:-$HOME/.config}/shell/aliasrc # aliases used by zsh (and potentially other shells)
cfp ${XDG_CONFIG_HOME:-$HOME/.config}/shell/profile # profile file for login settings for zsh
cfm ${XDG_CONFIG_HOME:-$HOME/.config}/mutt/muttrc # mutt (email client) config
cfn ${XDG_CONFIG_HOME:-$HOME/.config}/newsboat/config # newsboat (RSS reader)
cfu ${XDG_CONFIG_HOME:-$HOME/.config}/newsboat/urls # RSS urls for newsboat
cfmb ${XDG_CONFIG_HOME:-$HOME/.config}/ncmpcpp/bindings # ncmpcpp (music player) keybinds file
cfmc ${XDG_CONFIG_HOME:-$HOME/.config}/ncmpcpp/config # ncmpcpp (music player) config
cfl ${XDG_CONFIG_HOME:-$HOME/.config}/lf/lfrc # lf (file browser) config
cfL ${XDG_CONFIG_HOME:-$HOME/.config}/lf/scope # lf's scope/preview file
cfX ${XDG_CONFIG_HOME:-$HOME/.config}/sxiv/exec/key-handler # sxiv (image viewer) key/script handler

19
.config/shell/inputrc Normal file
View File

@ -0,0 +1,19 @@
$include /etc/inputrc
set editing-mode vi
$if mode=vi
set show-mode-in-prompt on
set vi-ins-mode-string \1\e[6 q\2
set vi-cmd-mode-string \1\e[2 q\2
set keymap vi-command
# these are for vi-command mode
Control-l: clear-screen
Control-a: beginning-of-line
set keymap vi-insert
# these are for vi-insert mode
Control-l: clear-screen
Control-a: beginning-of-line
$endif

128
.config/shell/profile Normal file
View File

@ -0,0 +1,128 @@
#!/bin/zsh
# profile file. Runs on login. Environmental variables are set here.
# If you don't plan on reverting to bash, you can remove the link in ~/.profile
# to clean up.
# Adds `~/.local/bin` to $PATH
export PATH="$PATH:${$(find ~/.local/bin -type d -printf %p:)%%:}"
unsetopt PROMPT_SP
# Default programs:
export EDITOR="nvim"
export TERMINAL="st"
export BROWSER="firefox-bin"
# ~/ Clean-up:
export XDG_CONFIG_HOME="$HOME/.config"
export XDG_DATA_HOME="$HOME/.local/share"
export XDG_CACHE_HOME="$HOME/.cache"
export XINITRC="${XDG_CONFIG_HOME:-$HOME/.config}/x11/xinitrc"
export GTK2_RC_FILES="${XDG_CONFIG_HOME:-$HOME/.config}/gtk-2.0/gtkrc-2.0"
export LESSHISTFILE="-"
export INPUTRC="${XDG_CONFIG_HOME:-$HOME/.config}/shell/inputrc"
export ZDOTDIR="${XDG_CONFIG_HOME:-$HOME/.config}/zsh"
export TMUX_TMPDIR="$XDG_RUNTIME_DIR"
export HISTFILE="${XDG_DATA_HOME:-$HOME/.local/share}/history"
# Other program settings:
export DICS="/usr/share/stardict/dic/"
export LESS=-R
export LESS_TERMCAP_mb="$(printf '%b' '')"
export LESS_TERMCAP_md="$(printf '%b' '')"
export LESS_TERMCAP_me="$(printf '%b' '')"
export LESS_TERMCAP_so="$(printf '%b' '')"
export LESS_TERMCAP_se="$(printf '%b' '')"
export LESS_TERMCAP_us="$(printf '%b' '')"
export LESS_TERMCAP_ue="$(printf '%b' '')"
export LESSOPEN="| /usr/bin/highlight -O ansi %s 2>/dev/null"
export QT_QPA_PLATFORMTHEME="gtk2" # Have QT use gtk2 theme.
export MOZ_USE_XINPUT2="1" # Mozilla smooth scrolling/touchpads.
export AWT_TOOLKIT="MToolkit wmname LG3D" #May have to install wmname
export _JAVA_AWT_WM_NONREPARENTING=1 # Fix for Java applications in dwm
# This is the list for lf icons:
export LF_ICONS="di=📁:\
fi=📃:\
tw=🤝:\
ow=📂:\
ln=⛓:\
or=❌:\
ex=🎯:\
*.txt=✍:\
*.mom=✍:\
*.me=✍:\
*.ms=✍:\
*.png=🖼:\
*.webp=🖼:\
*.ico=🖼:\
*.jpg=📸:\
*.jpe=📸:\
*.jpeg=📸:\
*.gif=🖼:\
*.svg=🗺:\
*.tif=🖼:\
*.tiff=🖼:\
*.xcf=🖌:\
*.html=🌎:\
*.xml=📰:\
*.gpg=🔒:\
*.css=🎨:\
*.pdf=📚:\
*.djvu=📚:\
*.epub=📚:\
*.csv=📓:\
*.xlsx=📓:\
*.tex=📜:\
*.md=📘:\
*.r=📊:\
*.R=📊:\
*.rmd=📊:\
*.Rmd=📊:\
*.m=📊:\
*.mp3=🎵:\
*.opus=🎵:\
*.ogg=🎵:\
*.m4a=🎵:\
*.flac=🎼:\
*.wav=🎼:\
*.mkv=🎥:\
*.mp4=🎥:\
*.webm=🎥:\
*.mpeg=🎥:\
*.avi=🎥:\
*.mov=🎥:\
*.mpg=🎥:\
*.wmv=🎥:\
*.m4b=🎥:\
*.flv=🎥:\
*.zip=📦:\
*.rar=📦:\
*.7z=📦:\
*.tar.gz=📦:\
*.z64=🎮:\
*.v64=🎮:\
*.n64=🎮:\
*.gba=🎮:\
*.nes=🎮:\
*.gdi=🎮:\
*.1=:\
*.nfo=:\
*.info=:\
*.log=📙:\
*.iso=📀:\
*.img=📀:\
*.bib=🎓:\
*.ged=👪:\
*.part=💔:\
*.torrent=🔽:\
*.jar=♨:\
*.java=♨:\
"
[ ! -f ${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc ] && shortcuts >/dev/null 2>&1 &
# Start graphical server on user's current tty if not already running.
[ "$(tty)" = "/dev/tty1" ] && ! pidof -s Xorg >/dev/null 2>&1 && exec startx "$XINITRC"

23
.config/x11/xinitrc Executable file
View File

@ -0,0 +1,23 @@
#!/bin/sh
if [ -f "${XDG_CONFIG_HOME:-$HOME/.config}/x11/xprofile" ]; then
. "${XDG_CONFIG_HOME:-$HOME/.config}/x11/xprofile"
else
. "$HOME/.xprofile"
fi
HOST=$(cat /etc/hostname)
if [ "$HOST" == "archmetabox" ] ; then
# this is specifically for the laptop so check hostname
xrandr --setprovideroutputsource modesetting NVIDIA-G0
xrandr --auto
fi
HOST=$(hostname)
if [ "$HOST" == "holocene" ] ; then
dwmblocks &
exec dwm
fi

30
.config/x11/xprofile Executable file
View File

@ -0,0 +1,30 @@
#!/bin/sh
# keyboard layout
setxkbmap dvorak &
# wallpaper
~/.fehbg &
# compositor
picom &
# cursor
xsetroot -cursor_name left_ptr
# modmap because xinit won't do it
xmodmap -pke $HOME/.Xmodmap
# handle some nvidia stuff for archmetabox
HOST=$(cat /etc/hostname)
if [ "$HOST" == "archmetabox" ] ; then
# this is specifically for the laptop so check hostname
xrandr --setprovideroutputsource modesetting NVIDIA-G0
xrandr --auto
fi
autostart=""
for program in $autostart; do
pidof -s "$progam" || "$program" &
done >/dev/null 2>&1

View File

@ -4,37 +4,14 @@
# Path to your oh-my-zsh installation.
export ZSH="/home/solomon/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
#ZSH_THEME="microtech"
#ZSH_THEME="gnzh"
#ZSH_THEME="pmcgee"
ZSH_THEME="inkletblotsh"
# Set list of themes to pick from when loading at random
# Setting this variable when ZSH_THEME=random will cause zsh to load
# a theme from this variable instead of looking in $ZSH/themes/
# If set to an empty array, this variable will have no effect.
# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" )
# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"
# Uncomment the following line to use hyphen-insensitive completion.
# Case-sensitive completion must be off. _ and - will be interchangeable.
# HYPHEN_INSENSITIVE="true"
# Uncomment the following line to disable bi-weekly auto-update checks.
# DISABLE_AUTO_UPDATE="true"
# Uncomment the following line to automatically update without prompting.
# DISABLE_UPDATE_PROMPT="true"
# Uncomment the following line to change how often to auto-update (in days).
# export UPDATE_ZSH_DAYS=13
# Uncomment the following line if pasting URLs and other text is messed up.
# DISABLE_MAGIC_FUNCTIONS="true"
@ -45,17 +22,7 @@ ZSH_THEME="inkletblotsh"
# DISABLE_AUTO_TITLE="true"
# Uncomment the following line to enable command auto-correction.
ENABLE_CORRECTION="true"
# Uncomment the following line to display red dots whilst waiting for completion.
# Caution: this setting can cause issues with multiline prompts (zsh 5.7.1 and newer seem to work)
# See https://github.com/ohmyzsh/ohmyzsh/issues/5765
# COMPLETION_WAITING_DOTS="true"
# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"
# ENABLE_CORRECTION="true"
# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
@ -80,10 +47,6 @@ plugins=(git
source $ZSH/oh-my-zsh.sh
# User configuration
# export MANPATH="/usr/local/man:$MANPATH"
# You may need to manually set your language environment
export LANG=en_US.UTF-8
@ -94,32 +57,49 @@ source $ZSH/oh-my-zsh.sh
export EDITOR='nvim'
fi
# Compilation flags
# export ARCHFLAGS="-arch x86_64"
HISTSIZE=1000000
SAVEHIST=1000000
# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.
#
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"
# Load aliases and shortcuts if existent.
[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc" ] && source "${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc"
alias config='/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME'
alias ccma='config commit -am'
alias cpush='config push'
alias cpull='config pull'
alias cst='config status'
alias logout='/usr/bin/kill -9 -1'
alias ipaddr='curl api.ipify.org'
alias ls='ls -la --color=auto'
alias tmn='tmux new'
alias tma='tmux attach'
alias lf='lfub'
alias v='nvim'
[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/aliasrc" ] && source "${XDG_CONFIG_HOME:-$HOME/.config}/shell/aliasrc"
path+=('/home/solomon/.local/bin')
# vi mode
bindkey -v
export KEYTIMEOUT=1
# use vim keys in tab complete menu:
bindkey -M menuselect 'h' vi-backward-char
bindkey -M menuselect 'k' vi-up-line-or-history
bindkey -M menuselect 'l' vi-forward-char
bindkey -M menuselect 'j' vi-down-line-or-history
bindkey -v '^?' backward-delete-char
# use lf to switch directories and bind it to ctrl-l
lfcd() {
tmp="$(mktemp -uq)"
trap 'rm -f $tmp >/dev/null 2>&1' HUP INT QUIT TERM PWR EXIT
lf -last-dir-path="$tmp" "$@"
if [ -f "$tmp" ]; then
dir="$(cat "$tmp")"
[ -d "$dir" ] && [ "$dir" != "$(pwd)" ] && cd "$dir"
fi
}
bindkey -s '^l' '^ulfcd\n'
if [ -f /etc/hostname ]; then
HOST=$(cat /etc/hostname)
else
HOST=$(hostname)
fi
if [ "$HOST" = "holocene" ] ; then
source /usr/share/zsh/site-functions/zsh-syntax-highlighting.zsh
else
source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
fi
# Dracula Theme (for zsh-syntax-highlighting)
#
@ -211,15 +191,3 @@ ZSH_HIGHLIGHT_STYLES[redirection]='fg=#F8F8F2'
ZSH_HIGHLIGHT_STYLES[arg0]='fg=#F8F8F2'
ZSH_HIGHLIGHT_STYLES[default]='fg=#F8F8F2'
ZSH_HIGHLIGHT_STYLES[cursor]='standout'
if [ -f /etc/hostname ]; then
HOST=$(cat /etc/hostname)
else
HOST=$(hostname)
fi
if [ "$HOST" = "holocene" ] ; then
source /usr/share/zsh/site-functions/zsh-syntax-highlighting.zsh
else
source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
fi

View File

@ -1,29 +0,0 @@
#!/bin/bash
##
# Depends: zenity, bw (bitwarden-cli), notify-send
#
# Generates bw session key and saves it in tmp file where only current user has permissions
#
# By Solomon Laing (solomonlaing@pm.me)
# Date 2020-03-26
##
password=$(zenity --password)
if [ -z $password ]
then
exit 0;
fi
session=$(bw unlock "$password" | awk 'NF{last=$NF} END{print last}')
loc="/tmp/bw-session"
touch $loc -f
chmod 600 $loc
echo "$session" > /tmp/bw-session
notify-send "Your bitwarden vault has been unlocked until next reboot."

View File

@ -1,52 +0,0 @@
#!/bin/bash
##
# Depends bw (bitwarden-cli), bw-unlock (personal script), xclip, jq
#
# Processes bw to allow for searching of passwords by website (and if multple logins per website, by account).
#
# By Solomon Laing (solomonlaing@pm.me)
# Date 2020-03-26
##
# get bw-session, will only work if owned by current user
if ! session=$(cat /tmp/bw-session)
then
/home/solomon/.local/bin/bw-unlock
session=$(cat /tmp/bw-session)
fi
items=$(bw list items --session "$session")
options=$(echo "$items" | jq ".[].name" | sed 's/"//g')
entry=$(echo "$options" | dmenu -i -p "Which entry?" $1)
if [ -z $entry ]
then
exit 0
fi
if ! password=$(bw get password "$entry" --session "$session")
then
user_options=$(bw list items --search "$entry" --session "$session")
# does not return array, not sure why yet
# user_options=$(echo "$items" | jq '.[] | select(.name == "'"$entry"'") | .')
user=$(echo "$user_options" | jq '.[].login.username' | dmenu -i -p "Which account?" $1 | sed 's/"//g')
if [ -z $user ]
then
exit 0;
fi
pass=$(echo "$user_options" | jq '.[] | select(.login.username == "'"$user"'") | .login.password' | sed 's/"//g')
echo "$pass" | xclip -sel clip
else
echo "$password" | xclip -sel clip
fi
notify-send "password for $entry probably copied to clipbroad"

View File

@ -1,5 +0,0 @@
#!/bin/bash
if [ -f /usr/bin/Plexamp.AppImage ]; then
/usr/bin/Plexamp.AppImage
fi

View File

@ -1,62 +0,0 @@
#!/bin/sh
userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
sysresources=/etc/X11/xinit/.Xresources
sysmodmap=/etc/X11/xinit/.Xmodmap
# merge in defaults and keymaps
if [ -f $sysresources ]; then
xrdb -merge $sysresources
fi
if [ -f $sysmodmap ]; then
xmodmap $sysmodmap
fi
if [ -f "$userresources" ]; then
xrdb -merge "$userresources"
fi
if [ -f "$usermodmap" ]; then
xmodmap -pke "$usermodmap"
fi
# start some nice programs
if [ -d /etc/X11/xinit/xinitrc.d ] ; then
for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do
[ -x "$f" ] && . "$f"
done
unset f
fi
# nividia config, note that nvidia and nvidia-prime were needed
# it seems modules and xorg confs were not due to there being an intel
# integrated card, not sure how the desktop will react though
HOST=$(cat /etc/hostname)
if [ "$HOST" == "archmetabox" ] ; then
# this is specifically for the laptop so check hostname
xrandr --setprovideroutputsource modesetting NVIDIA-G0
xrandr --auto
fi
HOST=$(hostname)
if [ "$HOST" == "holocene" ] ; then
[ -f ~/.xprofile ] && . ~/.xprofile
dwmblocks &
while true; do
dwm >/dev/null 2>&1
done
exec dwm
fi

1
.xprofile Symbolic link
View File

@ -0,0 +1 @@
.config/x11/xprofile

1
.zprofile Symbolic link
View File

@ -0,0 +1 @@
.config/shell/profile