diff options
author | Bryson Steck <brysonsteck@protonmail.com> | 2022-12-11 01:03:47 -0700 |
---|---|---|
committer | Bryson Steck <brysonsteck@protonmail.com> | 2022-12-11 01:03:47 -0700 |
commit | c32ed90899dd1047bc8bab171a60d7de6f4af34f (patch) | |
tree | 5cfeb8677f468814eae9ca29fad2fe39a46098f5 | |
parent | 173a51d4ae7ebca7e9b7d175ba314ff35a60d5ab (diff) | |
download | dotfiles-c32ed90899dd1047bc8bab171a60d7de6f4af34f.tar dotfiles-c32ed90899dd1047bc8bab171a60d7de6f4af34f.tar.gz dotfiles-c32ed90899dd1047bc8bab171a60d7de6f4af34f.tar.bz2 |
update stuff, add relevant x scripts
-rw-r--r-- | bash/.bash/01-aliases.bash | 6 | ||||
-rw-r--r-- | bash/.bash/03-boot.bash | 2 | ||||
-rw-r--r-- | dunst/dunstrc | 8 | ||||
m--------- | dwm | 0 | ||||
-rw-r--r-- | htop/htoprc | 12 | ||||
-rw-r--r-- | vim/.vimrc | 58 | ||||
-rw-r--r-- | x/.xinitrc | 2 | ||||
-rw-r--r-- | x/.xinitrc-not-docked | 1 | ||||
-rwxr-xr-x | x/battery.pl | 48 | ||||
-rwxr-xr-x | x/startdwm.sh | 16 |
10 files changed, 123 insertions, 30 deletions
diff --git a/bash/.bash/01-aliases.bash b/bash/.bash/01-aliases.bash index cae8190..94734e2 100644 --- a/bash/.bash/01-aliases.bash +++ b/bash/.bash/01-aliases.bash @@ -21,6 +21,8 @@ alias la='ls -a' alias ll='ls -lh' alias cp='cp -iv' alias mv='mv -iv' +alias rm='rm -vI' +alias diff='diff --color=auto' alias g++='g++ --std=c++20' alias vim='vim -p' alias gs='gs -dNOSAFER' @@ -51,8 +53,10 @@ alias ed='fzf --height=15 --layout=reverse | sed "s/^/\"/g;s/$/\"/g" | xargs -ro alias dj='python manage.py' alias smci='sudo make clean install' alias smi='sudo make install' -alias lib='xrandr --output HDMI-A-0 --auto --output eDP --off && xset r rate 300 50' +alias lib='xrandr --output HDMI-A-0 --auto --output eDP --off && xset r rate 300 50 && feh --bg-fill ~/git/wallpapers-exorcist/gruvbox/volcano-landscape.jpg' alias nolib='xrandr --output HDMI-A-0 --off --output eDP --auto' +alias keys='xset r rate 300 50' +alias gits='git status' # bash navigation alias aa='vim ~/.bash/01-aliases.bash; . ~/.bash_profile' diff --git a/bash/.bash/03-boot.bash b/bash/.bash/03-boot.bash index c821a28..333aaed 100644 --- a/bash/.bash/03-boot.bash +++ b/bash/.bash/03-boot.bash @@ -4,7 +4,7 @@ # startup scripts for systems bat_check() { - TEST=$(acpi | grep "Dis") + TEST=$(acpi | grep "Discharging" | grep -v "rate information") if [[ $? -eq 0 ]]; then echo "***********************************************************" diff --git a/dunst/dunstrc b/dunst/dunstrc index 7956a71..013420d 100644 --- a/dunst/dunstrc +++ b/dunst/dunstrc @@ -1,4 +1,4 @@ -# See dunst(5) for all configuration options +#See dunst(5) for all configuration options [global] ### Display ### @@ -258,7 +258,7 @@ # Uncomment this if you want to let notications appear under fullscreen # applications (default: overlay) - # layer = top + #layer = top # Set this to true to use X11 output on Wayland. force_xwayland = false @@ -398,8 +398,8 @@ # If the notification is already drawn, it won't get undrawn. # pushback: same as delay, but when switching into fullscreen, the notification will get # withdrawn from screen again and will get delayed like a new notification -#[fullscreen_delay_everything] -# fullscreen = delay +[fullscreen_delay_everything] + fullscreen = show #[fullscreen_show_critical] # msg_urgency = critical # fullscreen = show diff --git a/dwm b/dwm -Subproject c5738de01d3c8adccaf87842cd6efceafd795d9 +Subproject 54166726a7a266184041b04f3d9ad02ca0938b8 diff --git a/htop/htoprc b/htop/htoprc index 1ed5711..1f03b22 100644 --- a/htop/htoprc +++ b/htop/htoprc @@ -8,7 +8,7 @@ hide_userland_threads=0 shadow_other_users=0 show_thread_names=0 show_program_path=1 -highlight_base_name=0 +highlight_base_name=1 highlight_deleted_exe=1 highlight_megabytes=1 highlight_threads=1 @@ -19,17 +19,17 @@ strip_exe_from_cmdline=1 show_merged_command=0 header_margin=1 screen_tabs=1 -detailed_cpu_time=0 +detailed_cpu_time=1 cpu_count_from_one=0 show_cpu_usage=1 -show_cpu_frequency=0 -show_cpu_temperature=0 +show_cpu_frequency=1 +show_cpu_temperature=1 degree_fahrenheit=0 update_process_names=0 account_guest_in_cpu_meter=0 color_scheme=0 enable_mouse=1 -delay=15 +delay=7 hide_function_bar=0 header_layout=two_50_50 column_meters_0=LeftCPUs Memory Swap @@ -51,7 +51,7 @@ screen:Main=PID USER PRIORITY NICE M_VIRT M_RESIDENT M_SHARE STATE PERCENT_CPU P .sort_direction=-1 .tree_sort_direction=1 .all_branches_collapsed=0 -screen:I/O=PID USER IO_PRIORITY IO_RATE IO_READ_RATE IO_WRITE_RATE +screen:I/O=PID USER COMM IO_PRIORITY IO_RATE IO_READ_RATE IO_WRITE_RATE .sort_key=IO_RATE .tree_sort_key=PID .tree_view=0 @@ -22,6 +22,7 @@ call plug#end() set nocompatible set ttymouse=sgr set number +set relativenumber set bg:dark set mouse=a set tabstop=2 softtabstop=2 shiftwidth=2 expandtab @@ -64,6 +65,9 @@ nnoremap <leader>q :q<CR> nnoremap <leader>! :q!<CR> nnoremap <leader>x :wq<CR> nnoremap <leader>b :e#<CR> +nnoremap <leader>e :e<CR> +nnoremap <leader>u :tabp<CR> +nnoremap <leader>o :tabn<CR> nnoremap <leader>h :wincmd h<CR> nnoremap <leader>j :wincmd j<CR> nnoremap <leader>k :wincmd k<CR> @@ -71,7 +75,7 @@ nnoremap <leader>l :wincmd l<CR> nnoremap <leader>n :NERDTreeFocus<CR> nnoremap <leader>t :NERDTreeToggle<CR> nnoremap <leader>p :wincmd p<CR> -nnoremap <leader>v :set paste! number!<CR> +nnoremap <leader>v :set paste! number! relativenumber!<CR> nnoremap <leader>i :CocCommand clangd.switchSourceHeader<CR> " nerdtree stuff @@ -109,20 +113,40 @@ function! s:check_back_space() abort endfunction " lightline config -let g:lightline = { - \ 'colorscheme': 'gruvbox', - \ 'active': { - \ 'left': [ [ 'mode', 'paste' ], - \ [ 'filename', 'readonly', 'modified' ], - \ [ 'gitbranch'] ], - \ 'right': [ [ 'lineinfo' ], - \ [ 'fileformat', 'filetype' ], - \ [ 'percent' ] ] - \ }, - \ 'component_function': { - \ 'gitbranch': 'gitbranch#name' - \ }, - \ } -let g:lightline.component = { - \ 'close': ' %n | X ', } +if expand('$UID') == 0 + let g:lightline = { + \ 'colorscheme': 'molokai', + \ 'active': { + \ 'left': [ [ 'root', 'mode', 'paste' ], + \ [ 'filename', 'readonly', 'modified' ], + \ [ 'gitbranch'] ], + \ 'right': [ [ 'lineinfo' ], + \ [ 'fileformat', 'filetype' ], + \ [ 'percent' ] ] + \ }, + \ 'component_function': { + \ 'gitbranch': 'gitbranch#name' + \ }, + \ } + let g:lightline.component = { + \ 'close': ' %n | X ', + \ 'root': '!!root!!', } +else + let g:lightline = { + \ 'colorscheme': 'gruvbox', + \ 'active': { + \ 'left': [ [ 'mode', 'paste' ], + \ [ 'filename', 'readonly', 'modified' ], + \ [ 'gitbranch'] ], + \ 'right': [ [ 'lineinfo' ], + \ [ 'fileformat', 'filetype' ], + \ [ 'percent' ] ] + \ }, + \ 'component_function': { + \ 'gitbranch': 'gitbranch#name' + \ }, + \ } + let g:lightline.component = { + \ 'close': ' %n | X ', } +endif @@ -46,7 +46,7 @@ fi #spotifyd & # set up monitors -sh ~/.screenlayout/screenlayout.sh & +sh ~/.config/screenlayout.sh & # set default audio device to be dock audio jack pulseaudio -k && pacmd set-default-sink alsa_output.usb-0c76_USB_PnP_Audio_Device-00.analog-stereo & diff --git a/x/.xinitrc-not-docked b/x/.xinitrc-not-docked index 51aa3ae..b18ab1c 100644 --- a/x/.xinitrc-not-docked +++ b/x/.xinitrc-not-docked @@ -1,3 +1,4 @@ +#!/bin/sh # executed by startx-not-docked # for use when dingo is NOT docked export DOCKED=false diff --git a/x/battery.pl b/x/battery.pl new file mode 100755 index 0000000..b98707a --- /dev/null +++ b/x/battery.pl @@ -0,0 +1,48 @@ +#!/usr/bin/env perl +$| = 1; + +my $CRITICAL = undef; +my $LOW = undef; +my $CHARGING = undef; +my $DEAD_LEVEL = 2; +my $CRITICAL_LEVEL = 5; +my $LOW_LEVEL = 10; + +while (1) { + my @acpi = split " ", `acpi | grep "Discharging" | grep -v "rate information"`; + my $battery_level = $acpi[3]; + my $status = $acpi[2]; + my $sent = undef; + $battery_level =~ s/%,//g; + $status =~ s/,//g; + + if ($status =~ "Discharging") { + $CHARGING = undef; + if (!$CRITICAL) { + if (int($battery_level) <= int($CRITICAL_LEVEL)) { + $CRITICAL = 'def'; + $sent = 'def'; + system "notify-send -i \"battery-empty\" -t 0 -u critical \"BATTERY CRITICAL\" \"Battery level is ${battery_level}%\n\nCharge the system NOW.\"" + } + } if (!$LOW && !$sent) { + if (int($battery_level) <= int($LOW_LEVEL)) { + $LOW = 'def'; + $sent = 'def'; + system "notify-send -i \"battery-caution\" -t 0 -u normal \"BATTERY LOW\" \"Battery level is ${battery_level}%\n\nCharge the system soon.\"" + } + } if (int($battery_level) <= int($DEAD_LEVEL)) { + system "notify-send -t 0 -u critical \"SHUTTING DOWN\" \"Battery level is too low. The system will shutdown in 2 minutes to prevent corruption.\n\nCharge the system NOW to cancel the shutdown.\""; + system "doas shutdown -Ph 2 &"; + } + } else { + if (!$CHARGING) { + $CHARGING = 'def'; + $CRITICAL = undef; + $LOW = undef; + system "doas shutdown -c"; + system "notify-send -t 3000 -i \"battery-good-charging\" \"System is now charging\""; + } + } + + sleep 30; +} diff --git a/x/startdwm.sh b/x/startdwm.sh new file mode 100755 index 0000000..4625951 --- /dev/null +++ b/x/startdwm.sh @@ -0,0 +1,16 @@ +# stolen from https://wiki.archlinux.org/title/Dwm#Restart_dwm +# relaunch DWM if the binary changes, otherwise bail +csum="" +new_csum=$(sha1sum $(which dwm)) +while true +do + if [ "$csum" != "$new_csum" ] + then + csum=$new_csum + dbus-launch dwm + else + exit 0 + fi + new_csum=$(sha1sum $(which dwm)) + sleep 0.5 +done |