Skip to content

Commit

Permalink
Update .bash{rc,_profile} and .xinitrc, delete .Xresources
Browse files Browse the repository at this point in the history
  • Loading branch information
pngdeity committed Aug 1, 2022
1 parent 5b83cf4 commit 1fbb367
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 95 deletions.
30 changes: 0 additions & 30 deletions .Xresources

This file was deleted.

41 changes: 41 additions & 0 deletions .bash_profile
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#
# ~/.bash_profile
#
# This file is only sourced by login shells.
# See the Arch Wiki article on Bash, subheading Invocation.

# Implement user directories for the XDG Base Directory Specification
export XDG_CONFIG_HOME=$HOME/.config
export XDG_CACHE_HOME=$HOME/.cache
export XDG_DATA_HOME=$HOME/.local/share
export XDG_STATE_HOME=$HOME/.local/state

# Default programs
export EDITOR=/usr/bin/nvim
export BROWSER=/usr/bin/firefox-nightly

# Add system Golang path for user-level programs
export GOROOT=/usr/local/go
export GOPATH=$HOME/go
export PATH="$GOPATH/bin:$GOROOT/bin:$PATH"

# Manual application intervention for XDG Base Directory Specification compliance
# Source: Arch Wiki on XDG Base Directory
export XAUTHORITY="$XDG_RUNTIME_DIR"/Xauthority
export CARGO_HOME="$XDG_DATA_HOME"/cargo
export RUSTUP_HOME="$XDG_DATA_HOME"/rustup
export _JAVA_OPTIONS=-Djava.util.prefs.userRoot="$XDG_CONFIG_HOME"/java
export GTK2_RC_FILES="$XDG_CONFIG_HOME"/gtk-2.0/gtkrc
# export VIMINIT='let $MYVIMRC="$XDG_CONFIG_HOME/vim/vimrc" | source $MYVIMRC'

# Vim environment variables
export MYVIMRC="/home/nathan/.config/nvim/init.vim"

if [ -z "${DISPLAY}" ] && [ "${XDG_VTNR}" -eq 1 ]; then
exec startx
fi

# This silences startx messages on bootup, stopping pollution in the login tty
# [[ $(fgconsole 2>/dev/null) == 1 ]] && exec startx -- vt1 &> /dev/null

[[ -f ~/.bashrc ]] && . ~/.bashrc
49 changes: 12 additions & 37 deletions .bashrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# ~/.bashrc
#

Expand Down Expand Up @@ -90,25 +89,8 @@ fi

unset use_color safe_term match_lhs sh

# User set preferences
alias cp='cp -i' # prompt if files will be overwritten
alias df='df -h' # human-readable sizes
alias free='free -m' # show sizes in MB
alias np='nano -w PKGBUILD'
alias more=less # these are terminal pagers
alias spotify='spotify --force-device-scale-factor=2' # spotify hiDPI issue
alias e=exit # close the terminal
alias ls="ls -A --color=auto" # list all hidden files, in color
alias rm='rm -i' # Makes the remove command interactive, practically speaking, prompts for deletion
alias good-morning='sh ~/good-morning.sh'
alias lock='physlock -m -p abandon_all_hope_ye_who_enter_here' # locks the screen, silencing any kernel messages
alias clear-downloads='rm -rf ~/Downloads/*' # remove, without prompt, all files and directories in ~/Downloads
alias poly='sh ~/.config/polybar/launch.sh' # launch polybar more easily
alias brainworkshop='python3 ~/Documents/brainworkshop/brainworkshop/brainworkshop.pyw' # launch brainworkshop more easily
alias zoom='env QT_SCALE_FACTOR=2 zoom &' # adjust scaling of Zoom on external display

source "/home/nathan/.config/bash/user-aliases"
xhost +local:root > /dev/null 2>&1

complete -cf sudo

# Bash won't get SIGWINCH if another process is in the foreground.
Expand Down Expand Up @@ -155,23 +137,16 @@ ex ()
# Why are you setting environment variables in this file, rather than ~/.profile?
# See ArchWiki on Bash, subheading Shell and environment variables

# export NVM_DIR="$HOME/.nvm"
# [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
# [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion

# Implementing the XDG Base Directory Specification
export XDG_CONFIG_HOME=$HOME/.config
export XDG_CACHE_HOME=$HOME/.cache
export XDG_DATA_HOME=$HOME/.local/share

# Clean up related to the above
export LESSHISTFILE="-"

# Default Programs
export EDITOR=/usr/share/vim

# export XDG_CONFIG_HOME=$HOME/.config
# export XDG_CACHE_HOME=$HOME/.cache
# export XDG_DATA_HOME=$HOME/.local/share

# Clean up related to the above XDG BDS
# export LESSHISTFILE="-"
# export XAUTHORITY="$XDG_RUNTIME_DIR"/Xauthority
# export HISTFILE="$XDG_DATA_HOME"/bash/history
# Following line taken from tlvince.com/vim-respect-xdg
export VIMINIT='let $MYVIMRC="$XDG_CONFIG_HOME/vim/vimrc" | source $MYVIMRC'

export XAUTHORITY="$XDG_RUNTIME_DIR"/Xauthority
export HISTFILE="$XDG_DATA_HOME"/bash/history
# export VIMINIT='let $MYVIMRC="$XDG_CONFIG_HOME/vim/vimrc" | source $MYVIMRC'
#
eval "$(beet completion)"
8 changes: 0 additions & 8 deletions .profile

This file was deleted.

28 changes: 8 additions & 20 deletions .xinitrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
userresources=$HOME/.config/X11/xresources-default
usermodmap=$HOME/.config/X11/xmodmap
sysresources=/etc/X11/xinit/.Xresources
sysmodmap=/etc/X11/xinit/.Xmodmap

Expand Down Expand Up @@ -46,7 +46,7 @@ get_session(){
enlightenment) dbus_args+=(enlightenment_start) ;;
fluxbox) dbus_args+=(startfluxbox) ;;
gnome) dbus_args+=(gnome-session) ;;
i3|i3wm) dbus_args+=(i3 --shmlog-size 0) ;;
i3|i3wm) dbus_args+=(i3 --shmlog-size 26214400) ;;
jwm) dbus_args+=(jwm) ;;
kde) dbus_args+=(startkde) ;;
lxde) dbus_args+=(startlxde) ;;
Expand All @@ -61,26 +61,11 @@ get_session(){
}

# No keyboard beeping
exec xset -b
xset -b &

# The following line restores the previously used colorscheme
# but does not alter the background.
exec wal -n -R

# this file is not run with root privileges, just an FYI

# This checks whether I am in range of IllinoisNet wifi
# and then starts a systemd unit file to automatically
# connect to IllinoisNet
# it currently does not work, because netctl requires root privileges.
#exec nmcli dev wifi list > /home/nathan/Downloads/wifi.txt

#if grep -q "IllinoisNet" /home/nathan/Downloads/wifi.txt ; then
#exec netctl start IllinoisNet
#echo "Netctl profile IllinoisNet started" >> /home/nathan/Downloads/wifi.txt
#else
#echo "Netctl profile IllinoisNet NOT started" >> /home/nathan/Downloads/wifi.txt
#fi
wal -n -R &

# turn on Num Lock
numlockx &
Expand All @@ -90,4 +75,7 @@ USERXSESSIONRC="$XDG_CACHE_HOME/x11/xsessionrc"
ALTUSERXSESSION="$XDG_CACHE_HOME/x11/Xsession"
ERRFILE="$XDG_CACHE_HOME/x11/xsession-errors"

# This process is not run in the background to prevent race conditions with xrdb & i3
autorandr --force --change

exec $(get_session)

0 comments on commit 1fbb367

Please sign in to comment.