From a8cb2f204593ec816443de409c4b634220304e5f Mon Sep 17 00:00:00 2001 From: clint Date: Fri, 28 Feb 2025 08:25:30 -0600 Subject: [PATCH] hyprland but also bashrc rewrite loil --- bashrc/.bashrc | 163 +++++++------------------------ hypr/.config/hypr/hyprland.conf | 17 +++- hypr/.config/hypr/hyprlock.conf | 2 +- hypr/.config/hypr/hyprpaper.conf | 6 +- tmux/.config/tmux/tmux.conf | 3 +- 5 files changed, 55 insertions(+), 136 deletions(-) diff --git a/bashrc/.bashrc b/bashrc/.bashrc index b26c604..160a5fc 100644 --- a/bashrc/.bashrc +++ b/bashrc/.bashrc @@ -2,99 +2,32 @@ # ~/.bashrc # +# If not running interactively, don't do anything [[ $- != *i* ]] && return -colors() { - local fgc bgc vals seq0 +# that ain't vimlike +set -o vi +bind -m vi-command 'Control-l: clear-screen' +bind -m vi-insert 'Control-l: clear-screen' - printf "Color escapes are %s\n" '\e[${value};...;${value}m' - printf "Values 30..37 are \e[33mforeground colors\e[m\n" - printf "Values 40..47 are \e[43mbackground colors\e[m\n" - printf "Value 1 gives a \e[1mbold-faced look\e[m\n\n" +# prompt +PS1='\[\e[32m\]\u@\h\[\e[0m\]:\[\e[34m\]\w\[\e[0m\] \$ ' - # foreground colors - for fgc in {30..37}; do - # background colors - for bgc in {40..47}; do - fgc=${fgc#37} # white - bgc=${bgc#40} # black +# Source this file from git that expands PS1 stuff +GIT_PS1_SHOWUPSTREAM=git +GIT_PS1_SHOWDIRTYSTATE=true +GIT_PS1_SHOWUNTRACKEDFILES=true +source /etc/bash_completion.d/git-prompt.sh +PS1='\[\e[01;32m\]\u@\h\[\e[0m\]:\[\e[01;34m\]\w\[\e[0m\]$(__git_ps1 " (%s)")\[\e[0m\]\$ ' - vals="${fgc:+$fgc;}${bgc}" - vals=${vals%%;} - - seq0="${vals:+\e[${vals}m}" - printf " %-9s" "${seq0:-(default)}" - printf " ${seq0}TEXT\e[m" - printf " \e[${vals:+${vals+$vals;}}1mBOLD\e[m" - done - echo; echo - done -} - -[ -r /usr/share/bash-completion/bash_completion ] && . /usr/share/bash-completion/bash_completion - -# Change the window title of X terminals -case ${TERM} in - xterm*|rxvt*|Eterm*|aterm|kterm|gnome*|interix|konsole*) - PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/\~}\007"' - ;; - screen*) - PROMPT_COMMAND='echo -ne "\033_${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/\~}\033\\"' - ;; -esac - -use_color=true - -# Set colorful PS1 only on colorful terminals. -# dircolors --print-database uses its own built-in database -# instead of using /etc/DIR_COLORS. Try to use the external file -# first to take advantage of user additions. Use internal bash -# globbing instead of external grep binary. -safe_term=${TERM//[^[:alnum:]]/?} # sanitize TERM -match_lhs="" -[[ -f ~/.dir_colors ]] && match_lhs="${match_lhs}$(<~/.dir_colors)" -[[ -f /etc/DIR_COLORS ]] && match_lhs="${match_lhs}$(/dev/null \ - && match_lhs=$(dircolors --print-database) -[[ $'\n'${match_lhs} == *$'\n'"TERM "${safe_term}* ]] && use_color=true - -if ${use_color} ; then - # Enable colors for ls, etc. Prefer ~/.dir_colors #64489 - if type -P dircolors >/dev/null ; then - if [[ -f ~/.dir_colors ]] ; then - eval $(dircolors -b ~/.dir_colors) - elif [[ -f /etc/DIR_COLORS ]] ; then - eval $(dircolors -b /etc/DIR_COLORS) - fi - fi - - if [[ ${EUID} == 0 ]] ; then - PS1='\[\033[01;31m\][\h\[\033[01;36m\] \W\[\033[01;31m\]]\$\[\033[00m\] ' - else - PS1='\[\033[01;32m\][\u@\h\[\033[01;37m\] \W\[\033[01;32m\]]\$\[\033[00m\] ' - fi - - alias ls='eza -al --color=always --group-directories-first' - alias grep='grep --colour=auto' - alias egrep='egrep --colour=auto' - alias fgrep='fgrep --colour=auto' -else - if [[ ${EUID} == 0 ]] ; then - # show root@ when we don't have colors - PS1='\u@\h \W \$ ' - else - PS1='\u@\h \w \$ ' - fi -fi - -unset use_color safe_term match_lhs sh +# History settings: no duplicates, decent size +HISTSIZE=10000 +HISTFILESIZE=2000 +HISTCONTROL=ignoredups # aliases alias python="python3" alias cp="cp -i" # confirm before overwriting something -alias df='df -h' # human-readable sizes -alias free='free -m' # show sizes in MB alias np='nano -w PKGBUILD' alias more="less" alias rofi='rofi -m 1' @@ -104,52 +37,26 @@ alias ll="exa -lhga --group-directories-first" alias vim="nvim" alias docs="python ~/scripts/stock_price.py -s docs" alias stock="python ~/scripts/stock_price.py -s " -alias cls="clear & ls" alias r="ranger" +alias grep='grep --colour=auto' -xhost +local:root > /dev/null 2>&1 - -complete -cf sudo - -# Bash won't get SIGWINCH if another process is in the foreground. -# Enable checkwinsize so that bash will check the terminal size when -# it regains control. #65623 -# http://cnswww.cns.cwru.edu/~chet/bash/FAQ (E11) -shopt -s checkwinsize - -shopt -s expand_aliases - -# export QT_SELECT=4 - -# Enable history appending instead of overwriting. #139609 -shopt -s histappend - -# -# # ex - archive extractor -# # usage: ex -ex () -{ - if [ -f $1 ] ; then - case $1 in - *.tar.bz2) tar xjf $1 ;; - *.tar.gz) tar xzf $1 ;; - *.bz2) bunzip2 $1 ;; - *.rar) unrar x $1 ;; - *.gz) gunzip $1 ;; - *.tar) tar xf $1 ;; - *.tbz2) tar xjf $1 ;; - *.tgz) tar xzf $1 ;; - *.zip) unzip $1 ;; - *.Z) uncompress $1;; - *.7z) 7z x $1 ;; - *) echo "'$1' cannot be extracted via ex()" ;; - esac - else - echo "'$1' is not a valid file" - fi -} - +# expand path PATH=$PATH:/usr/local/bin -export EDITOR=/usr/bin/nvim +# exports +export EDITOR=/usr/bin/nvim +export BROWSER=firefox + +# fzf +export FZF_DEFAULT_OPTS='--layout=reverse --height=50% --preview-window=right:50%:border-sharp --border-label=" command preview " --border=double' + +# Set up fzf key bindings and fuzzy completion +# Ctrl+R override for bash history +# Alt-C overried to cd into selected directory +eval "$(fzf --bash)" + +# Quick file finder with preview and open with vim (Ctrl+T override) +bind '"\C-t": "fzf --preview \"cat {}\" < <(find . -type f) | xargs $EDITOR\n"' + +# kinda annoying tbh # pfetch || neofetch || fastfetch diff --git a/hypr/.config/hypr/hyprland.conf b/hypr/.config/hypr/hyprland.conf index 9c6f948..69d823d 100644 --- a/hypr/.config/hypr/hyprland.conf +++ b/hypr/.config/hypr/hyprland.conf @@ -73,9 +73,9 @@ decoration { # https://wiki.hyprland.org/Configuring/Variables/#blur blur { enabled = true - size = 3 - passes = 1 - vibrancy = 0.1696 + size = 8 + passes = 2 + #vibrancy = 0.1696 } } @@ -202,6 +202,17 @@ bind = $mainMod SHIFT, 8, movetoworkspace, 8 bind = $mainMod SHIFT, 9, movetoworkspace, 9 bind = $mainMod SHIFT, 0, movetoworkspace, 10 +# idk fixing workspace locations +workspace = 1,monitor:HDMI-A-1 +workspace = 3,monitor:HDMI-A-1 +workspace = 5,monitor:HDMI-A-1 +workspace = 7,monitor:HDMI-A-1 + +workspace = 2,monitor:DP-2 +workspace = 4,monitor:DP-2 +workspace = 6,monitor:DP-2 +workspace = 8,monitor:DP-2 + # Example special workspace (scratchpad) bind = $mainMod, S, togglespecialworkspace, magic bind = $mainMod SHIFT, S, movetoworkspace, special:magic diff --git a/hypr/.config/hypr/hyprlock.conf b/hypr/.config/hypr/hyprlock.conf index 4486769..6308095 100644 --- a/hypr/.config/hypr/hyprlock.conf +++ b/hypr/.config/hypr/hyprlock.conf @@ -1,7 +1,7 @@ # BACKGROUND background { monitor = - path = /home/clint/Pictures/wallpapers/green_hut.jpg + path = /home/clint/Pictures/wallpapers/castle2.jpg } diff --git a/hypr/.config/hypr/hyprpaper.conf b/hypr/.config/hypr/hyprpaper.conf index 45e008d..7e3e2da 100644 --- a/hypr/.config/hypr/hyprpaper.conf +++ b/hypr/.config/hypr/hyprpaper.conf @@ -1,6 +1,6 @@ -preload = /home/clint/Pictures/wallpapers/trees.jpg -wallpaper = HDMI-A-1, /home/clint/Pictures/wallpapers/trees.jpg -wallpaper = DP-2, /home/clint/Pictures/wallpapers/trees.jpg +preload = /home/clint/Pictures/wallpapers/castle_view.jpg +wallpaper = HDMI-A-1, /home/clint/Pictures/wallpapers/castle_view.jpg +wallpaper = DP-2, /home/clint/Pictures/wallpapers/castle_view.jpg #enable splash text rendering over the wallpaper splash = false diff --git a/tmux/.config/tmux/tmux.conf b/tmux/.config/tmux/tmux.conf index ac79bba..a34ca49 100644 --- a/tmux/.config/tmux/tmux.conf +++ b/tmux/.config/tmux/tmux.conf @@ -81,7 +81,8 @@ set -g @continuum-restore 'on' # testing this idk lol set -g pane-active-border-style bg=terminal set -g pane-border-style bg=terminal -set-window-option -g window-active-style bg=black +#set-window-option -g window-active-style bg=black +set-window-option -g window-active-style bg=terminal set-window-option -g window-style bg=terminal # adding ssh support