More ping sites for network script, vimrc changes, remove .config/setup

This commit is contained in:
natemaia 2018-07-13 14:01:38 -07:00
parent b514f3ef29
commit 15aadd2112
7 changed files with 26 additions and 41 deletions

View File

@ -76,8 +76,8 @@ exec --no-startup-id /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1
exec --no-startup-id gnome-keyring-daemon --start --components=pkcs11
# pressing super key alone simulates pressing Alt-F1
exec --no-startup-id ksuperkey -e 'Super_L=Alt_L|F1' &
exec --no-startup-id ksuperkey -e 'Super_R=Alt_L|F1' &
exec --no-startup-id ksuperkey -e 'Super_L=Alt_L|F1'
exec --no-startup-id ksuperkey -e 'Super_R=Alt_L|F1'
###########################################################
############# Bindings ##################

View File

@ -1,8 +1,6 @@
# compton
al-compositor --start &
#$HOME/.config/setup &
# enable numlock, commented out for laptop users
# numlockx &
@ -32,4 +30,3 @@ xfsettingsd &
xdg-user-dirs-gtk-update &
$HOME/.config/keypack &
# al-hello

View File

@ -4,4 +4,4 @@
# To load session at startup use the following line
# sleep 1; al-polybar-session &
/home/liveuser/.config/polybar/config bspwm-bar
/home/liveuser/.config/polybar/config bspwm-bar

View File

@ -1,22 +0,0 @@
#!/usr/bin/env bash
# this script will setup configs for any user created from /etc/skel
# if this is not run immediately at startup, polybar WILL fail to load
files=(
"$HOME/.config/polybar/config"
"$HOME/.config/polybar/sessions/i3-sessionfile"
"$HOME/.config/polybar/sessions/bspwm-sessionfile"
"$HOME/.config/polybar/sessions/openbox-sessionfile"
"$HOME/.config/openbox/autostart"
"$HOME/.config/gtk-3.0/bookmarks"
"$HOME/.mozilla/firefox/archlabs.default/prefs.js"
"$HOME/.mozilla/firefox/archlabs.default/sessionstore.js"
)
for f in "${files[@]}"; do
sed -i "s/liveuser/${USER}/g" "$f"
done
sed -i '/setup/d' "$HOME/.config/openbox/autostart"
rm -f "$HOME/.config/setup"

View File

@ -70,6 +70,12 @@ nnoremap <leader>r :call <SID>ranger()<CR>
" paste while in insert mode
inoremap <silent><C-v> <Esc>:set paste<CR>a<C-r>+<Esc>:set nopaste<CR>a
" change windows with ctrl+(hjkl)
nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>
" alt defaults
nnoremap 0 ^
nnoremap Y y$
@ -81,10 +87,12 @@ nnoremap <Tab> ==j
vnoremap > >gv
vnoremap < <gv
" j = gj :: k = gk while preserving numbered jumps ie. 12j or 30k
" j = gj :: k = gk while preserving numbered jumps eg. 12j
nnoremap <buffer><silent><expr>j v:count ? 'j' : 'gj'
nnoremap <buffer><silent><expr>k v:count ? 'k' : 'gk'
" open a new tab in the current directory with netrw
nnoremap <silent> <Leader>- :tabedit <C-R>=expand("%:p:h")<CR><CR>
" ------ autocmd ------
@ -101,6 +109,12 @@ augroup save_cursor_position
autocmd BufReadPost * call setpos(".", getpos("'\""))
augroup END
" enable cursorline in the currently active window
augroup cursorline
autocmd!
autocmd VimEnter,WinEnter,BufWinEnter * setlocal cursorline
autocmd WinLeave * setlocal nocursorline
augroup END
" ------ adv maps ------
@ -177,25 +191,19 @@ nnoremap <Leader>fw
" open ranger as a file chooser
function! <SID>ranger()
let l:temp = tempname()
execute 'silent !st -e ranger --choosefiles='.shellescape(l:temp).' $PWD'
if !filereadable(temp)
redraw!
return
endif
let l:names = readfile(l:temp)
if empty(l:names)
redraw!
return
endif
execute 'edit '.fnameescape(l:names[0])
for l:name in l:names[1:]
execute 'argadd '.fnameescape(l:name)
endfor
redraw!
endfunction

View File

@ -14,4 +14,6 @@
# automatically run startx when logging in on tty1
# comment this out if using the above example
[[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && exec startx -- vt1 &>/dev/null

View File

@ -7,8 +7,12 @@ wireless_connected=""
ethernet_connected=""
while true; do
if ping -c1 archlabslinux.com &>/dev/null || ping -c1 bitbucket.org &>/dev/null || ping -c1 github.com &>/dev/null; then
if ! (ping -c 1 archlabslinux.com || ping -c 1 google.com || ping -c 1 bitbucket.org) &>/dev/null; then
if ! (ping -c 1 github.com || ping -c 1 sourceforge.net) &>/dev/null; then
echo "$disconnected" ; sleep 0.6
echo "$disconnected2" ; sleep 0.6
fi
else
# avoid checking what type of interface it is every loop
if (( count < 1 )); then
ID="$(ip link | awk '/state UP/ {print $2}')"
@ -20,9 +24,5 @@ while true; do
else
echo "$wireless_connected" ; sleep 20
fi
else
echo "$disconnected" ; sleep 0.6
echo "$disconnected2" ; sleep 0.6
fi
done