Compare commits

...

2 Commits

Author SHA1 Message Date
tosu 03860b2b74 /usr/bin/bash -> /bin/bash 2024-06-21 17:10:53 +02:00
tosu bfa8255451 Update 2024-06-21 17:08:45 +02:00
5 changed files with 31 additions and 36 deletions

View File

@ -1,18 +1,6 @@
#! /bin/bash --
# ex: set ts=4 sw=4 ft=sh # ex: set ts=4 sw=4 ft=sh
# xrandr --setprovideroutputsource 1 0 --setprovideroutputsource 2 0
# Configure Displays
three-mon
# xrandr --newmode "1600x900_60.00" 119.00 1600 1696 1864 2128 900 901 904 932 -HSync +Vsync
# xrandr --addmode DVI-I-1-1 "1600x900_60.00"
# xrandr --above DP-1 --output DVI-I-1-1 --auto --mode "1600x900_60.00" --left-of DP-1
# Wallpaper Diashows
# wp-dia hor eDP-1 10m
# wp-dia wp-repo-1 HDMI-1 10m
# wp-dia wp-repo-1 DP-1 10m
# Keymap # Keymap
setxkbmap -layout us setxkbmap -layout us
@ -28,9 +16,6 @@ setxkbmap -layout us
# xargs -I pid xinput set-prop "$iid" pid 0; # xargs -I pid xinput set-prop "$iid" pid 0;
# } # }
updatebar
######################### More or less shell specific ##########################
pathvarprepend () { pathvarprepend () {
# prepending paths to pathvar denoted by the expansion of the PATHVAR parameter # prepending paths to pathvar denoted by the expansion of the PATHVAR parameter
# if it's already in the PATH, move it to the end # if it's already in the PATH, move it to the end
@ -214,7 +199,21 @@ export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
# shellcheck disable=SC1091 # shellcheck disable=SC1091
[ -s "$NVM_DIR/bash_completion" ] && . "$NVM_DIR/bash_completion" [ -s "$NVM_DIR/bash_completion" ] && . "$NVM_DIR/bash_completion"
####################### More or less shell specific END ########################
# xrandr --setprovideroutputsource 1 0 --setprovideroutputsource 2 0
# Configure Displays
three-mon
# xrandr --newmode "1600x900_60.00" 119.00 1600 1696 1864 2128 900 901 904 932 -HSync +Vsync
# xrandr --addmode DVI-I-1-1 "1600x900_60.00"
# xrandr --above DP-1 --output DVI-I-1-1 --auto --mode "1600x900_60.00" --left-of DP-1
# Wallpaper Diashows
# wp-dia hor eDP-1 10m
# wp-dia wp-repo-1 HDMI-1 10m
# wp-dia wp-repo-1 DP-1 10m
updatebar
picom & picom &

12
.bashrc
View File

@ -1,3 +1,4 @@
#! /bin/bash --
# ex: set ts=4 sw=4 ft=sh # ex: set ts=4 sw=4 ft=sh
# Exit when noninteractive. This is more portable than checking PS1. # Exit when noninteractive. This is more portable than checking PS1.
@ -26,7 +27,7 @@ good () { __log green "${@}" ; }
_path_lookup () { type -P "$1"; } # adapted for bash. _path_lookup () { type -P "$1"; } # adapted for bash.
_have_all () { while [ $# -gt 0 ] ; do [ -x "$(_path_lookup "$1")" ] || return 1 ; shift ; done; } _have_all () { while [ $# -gt 0 ] ; do [ -x "$(_path_lookup "$1")" ] || return 1 ; shift ; done; }
_have () { _have_all "$1"; } _have () { _have_all "$1"; }
_source_if () { [ -r "$1" ] && . "$1"; } _source_if () { [ -f "$1" ] && [ -r "$1" ] && . "$1"; }
###################### exit when already sourced (posix) ####################### ###################### exit when already sourced (posix) #######################
[ -n "${BASHRC_SOURCED}" ] && { __log red ".bashrc already sourced. Reset shell with 'exec bash [-l]' or start a new terminal." ; return 1 ; } [ -n "${BASHRC_SOURCED}" ] && { __log red ".bashrc already sourced. Reset shell with 'exec bash [-l]' or start a new terminal." ; return 1 ; }
@ -263,6 +264,7 @@ alias ...='cd ../..'
alias ....='cd ../../..' alias ....='cd ../../..'
########################### general aliases (posix) ############################ ########################### general aliases (posix) ############################
alias svi='sudo vi'
alias open='xdg-open' alias open='xdg-open'
alias dp='declare -p' alias dp='declare -p'
alias wttr='curl -sfkSL wttr.in' alias wttr='curl -sfkSL wttr.in'
@ -273,6 +275,7 @@ alias paco='"${HOME-}"/francinette/tester.sh'
alias pcker='nvim "${HOME-}"/.config/nvim/lua/*' alias pcker='nvim "${HOME-}"/.config/nvim/lua/*'
alias francinette='"${HOME-}"/francinette/tester.sh' alias francinette='"${HOME-}"/francinette/tester.sh'
alias q-dig='docker run --rm -it ghcr.io/natesales/q' alias q-dig='docker run --rm -it ghcr.io/natesales/q'
alias q='duck'
alias after='nvim "${HOME-}"/.config/nvim/after/plugin' alias after='nvim "${HOME-}"/.config/nvim/after/plugin'
alias dotconf='git --git-dir="${HOME-}"/.dotfiles/ --work-tree="${HOME-}"' alias dotconf='git --git-dir="${HOME-}"/.dotfiles/ --work-tree="${HOME-}"'
alias ll='\ls --width="${COLUMNS:-80}" --sort=time --time=mtime --color=auto --fu -bharZ1l' alias ll='\ls --width="${COLUMNS:-80}" --sort=time --time=mtime --color=auto --fu -bharZ1l'
@ -395,9 +398,12 @@ skill () {
pgrep -f "$1" | xargs ps -o user,ruser,pid,c,stime,tty,time,cmd pgrep -f "$1" | xargs ps -o user,ruser,pid,c,stime,tty,time,cmd
} }
pgrep -f -- "$1" | sudo xargs -r kill -9 || { pgrep -f -- "$1" | sudo xargs -r kill -9 || {
if [ $? -eq 1 ] ; then if [ $? -ne 1 ] ; then
printf '\033[41;30m%s\033[m\n' "These processes couldn't be killed with root:" printf '\033[41;30m%s\033[m\n' "These processes couldn't be killed with root (sudo):"
pgrep -f "$1" | xargs ps -o user,ruser,pid,c,stime,tty,time,cmd pgrep -f "$1" | xargs ps -o user,ruser,pid,c,stime,tty,time,cmd
else
info Cancelled
return 3;
fi fi
exit_status=1 exit_status=1
} }

View File

@ -1,18 +1,8 @@
#!/usr/bin/bash #! /bin/bash --
# This file ought to be sourced, above line for syntax highlighting purposes. # ex: set ts=4 sw=4 ft=sh
# shellcheck disable=SC2009 # shellcheck disable=SC2009
if ! ps aux|grep -v grep|grep startx 1>/dev/null; then 1>/dev/null pidof -q startx && 1>/home/tosuman/.startx.log 2>&1 startx
startx 1>/home/tosuman/.startx.log 2>&1
fi
# if running bash # if running bash
if [ -n "$BASH_VERSION" ] ; then [ -n "$BASH_VERSINFO" ] && if [ -f "$HOME/.bashrc" ] && [ -r "$HOME/.bashrc" ] && . "$HOME/.bashrc"
# include .bashrc if it exists
if [ -f "$HOME/.bashrc" ] && [ -r "$HOME/.bashrc" ]; then
# shellcheck disable=SC1091
. "$HOME/.bashrc"
fi
fi
# ex: set ts=4 sw=4 ft=sh

View File

@ -1,4 +1,4 @@
set -g default-command "/usr/bin/bash" set -g default-command "/bin/bash"
# Support mouse scrolling, system clipboard, etc. # Support mouse scrolling, system clipboard, etc.
set -g mouse on set -g mouse on

View File

@ -1,3 +1,3 @@
# ex: set ts=4 sw=4 ft=sh # ex: set ts=4 sw=4 ft=sh
exec /usr/bin/bash "${HOME}"/.bash_xinitrc exec /bin/bash "${HOME}"/.bash_xinitrc