update stuff, add relevant x scripts

This commit is contained in:
Bryson Steck 2022-12-11 01:03:47 -07:00
parent 173a51d4ae
commit c32ed90899
10 changed files with 124 additions and 31 deletions

View file

@ -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'

View file

@ -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 "***********************************************************"

View file

@ -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

2
dwm

@ -1 +1 @@
Subproject commit c5738de01d3c8adccaf87842cd6efceafd795d98
Subproject commit 54166726a7a266184041b04f3d9ad02ca0938b8a

View file

@ -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

View file

@ -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,6 +113,25 @@ function! s:check_back_space() abort
endfunction
" lightline config
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': {
@ -125,4 +148,5 @@ let g:lightline = {
\ }
let g:lightline.component = {
\ 'close': ' %n | X ', }
endif

View file

@ -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 &

View file

@ -1,3 +1,4 @@
#!/bin/sh
# executed by startx-not-docked
# for use when dingo is NOT docked
export DOCKED=false

48
x/battery.pl Executable file
View file

@ -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;
}

16
x/startdwm.sh Executable file
View file

@ -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