updated uptime script to be fluent and replaced keybinds

nvim
Keegan 2 years ago
parent 034943ef7e
commit 24eee5670a

@ -1,4 +1,16 @@
#!/usr/bin/env bash
uptime=$(cat /proc/uptime | awk '{print $1 / 60; print $1 % 60}' | xargs printf '%d min %d sec' 2>/dev/null)
echo "$uptime"
ft_seconds=$(cat /proc/uptime | awk '{print $1}' | xargs printf '%d' 2>/dev/null) # floored int total
ft_minutes=$(($ft_seconds/60))
ft_hours=$(($ft_minutes/60))
echo $ft_hours $ft_minutes $ft_seconds
if [[ $ft_hours -gt 1 ]] ; then
# display with leading hours
rem_mins=$(($ft_minutes % 60)) # get remaining mins
printf '%dH %dM' $ft_hours $rem_mins
else
# display with leading minutes
rem_secs=$(($ft_seconds % 60)) # get remaining mins
printf '%dM %dS' $ft_minutes $rem_secs
fi

13
vimrc

@ -10,6 +10,7 @@ set backspace=indent,eol,start
" basics
set number
let mapleader=' '
" setting color theme stuff
set background=dark
@ -41,8 +42,8 @@ autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
" nerdtree binds
nnoremap <silent> <C-n> :NERDTree<CR>
nnoremap <silent> <C-t> :NERDTreeToggle<CR>
nnoremap <silent> <leader>n :NERDTree<CR>
nnoremap <silent> <leader>t :NERDTreeToggle<CR>
" nnoremap <C-f> :NERDTreeFocus<CR> going to conflict with fzf and I dont use
" this anyway
@ -79,10 +80,10 @@ endif
command! -bang -nargs=? -complete=dir Find
\ call fzf#vim#files(<q-args>, fzf#vim#with_preview({'options': ['--layout=reverse', '--info=inline']}), <bang>0)
nnoremap <silent> ff :Find<CR>
nnoremap <silent> fh :Find $HOME<CR>
nnoremap <silent> fg :GFiles<CR>
nnoremap <silent> fs :GFiles?<CR>
nnoremap <silent> <leader>f :Find<CR>
nnoremap <silent> <leader>h :Find $HOME<CR>
nnoremap <silent> <leader>g :GFiles<CR>
nnoremap <silent> <leader>s :GFiles?<CR>
" tweaking timeout to quit instatnly via esc
set ttimeout

Loading…
Cancel
Save