This commit is contained in:
tosu 2024-06-21 17:08:45 +02:00
parent 58e59d71dd
commit bfa8255451
3 changed files with 29 additions and 34 deletions

View File

@ -1,18 +1,6 @@
#! /bin/bash --
# 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
setxkbmap -layout us
@ -28,9 +16,6 @@ setxkbmap -layout us
# xargs -I pid xinput set-prop "$iid" pid 0;
# }
updatebar
######################### More or less shell specific ##########################
pathvarprepend () {
# prepending paths to pathvar denoted by the expansion of the PATHVAR parameter
# 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"
# shellcheck disable=SC1091
[ -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 &

12
.bashrc
View File

@ -1,3 +1,4 @@
#! /bin/bash --
# ex: set ts=4 sw=4 ft=sh
# 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.
_have_all () { while [ $# -gt 0 ] ; do [ -x "$(_path_lookup "$1")" ] || return 1 ; shift ; done; }
_have () { _have_all "$1"; }
_source_if () { [ -r "$1" ] && . "$1"; }
_source_if () { [ -f "$1" ] && [ -r "$1" ] && . "$1"; }
###################### 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 ; }
@ -263,6 +264,7 @@ alias ...='cd ../..'
alias ....='cd ../../..'
########################### general aliases (posix) ############################
alias svi='sudo vi'
alias open='xdg-open'
alias dp='declare -p'
alias wttr='curl -sfkSL wttr.in'
@ -273,6 +275,7 @@ alias paco='"${HOME-}"/francinette/tester.sh'
alias pcker='nvim "${HOME-}"/.config/nvim/lua/*'
alias francinette='"${HOME-}"/francinette/tester.sh'
alias q-dig='docker run --rm -it ghcr.io/natesales/q'
alias q='duck'
alias after='nvim "${HOME-}"/.config/nvim/after/plugin'
alias dotconf='git --git-dir="${HOME-}"/.dotfiles/ --work-tree="${HOME-}"'
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" | sudo xargs -r kill -9 || {
if [ $? -eq 1 ] ; then
printf '\033[41;30m%s\033[m\n' "These processes couldn't be killed with root:"
if [ $? -ne 1 ] ; then
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
else
info Cancelled
return 3;
fi
exit_status=1
}

View File

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