diff --git a/.config/dwm/autostart.sh b/.config/dwm/autostart.sh index bc8c193..1ed9a63 100755 --- a/.config/dwm/autostart.sh +++ b/.config/dwm/autostart.sh @@ -1,5 +1,14 @@ #!/bin/sh +launch-dwmblocks & picom & nitrogen --restore & $HOME/.scripts/launch-conky_dwm.sh & + +#if [ x$(pidof dwmblocks) = "x" ] +#then +# dwmblocks & +# pkill -RTMIN+1 dwmblocks +#else +# echo 'dwmblocks is running, skipped.' +#fi diff --git a/.config/lf/lfrc b/.config/lf/lfrc index 16ce925..7f253ed 100644 --- a/.config/lf/lfrc +++ b/.config/lf/lfrc @@ -1,5 +1,7 @@ +set previewer ~/.config/lf/preview # Config set preview true +#set previewer ~/.config/lf/preview set previewer ~/.config/lf/scripts/previewer #set previewer ~/.config/lf/scripts/scope set icons true diff --git a/.config/polybar/config b/.config/polybar/config index efa3c5c..d711fe0 100755 --- a/.config/polybar/config +++ b/.config/polybar/config @@ -106,7 +106,7 @@ font-8 = "Iosevka Nerd Font:bold:style=solid:size=8;2" ; ---------------------------------------------------------------------------------------- modules-left = bspwm dividerS wirednetwork temp dividerS modules-center = date -modules-right = dividerS player-mpris-tail player-mpris mpd volume battery dividerS prompt +modules-right = dividerS disk player-mpris-tail player-mpris mpd volume battery dividerS prompt ; ---------------------------------------------------------------------------------------- tray-detached = false @@ -537,7 +537,7 @@ full-at = 99 ; Use the following command to list batteries and adapters: ; $ ls -1 /sys/class/power_supply/ -battery = BAT0 +battery = BAT* adapter = ADP1 poll-interval = 5 @@ -609,3 +609,15 @@ ramp-1 =  ramp-2 =  ramp-foreground = ${colors.secondary1L2} + +[module/disk] +type = custom/script +exec = ~/.config/polybar/scripts/disk.sh +tail = true +label-font = 3 +label-foreground = ${colors.foreground} +format-prefix = " " +format-prefix-font = "5" +format-foreground = ${colors.spotgreen} +format-background = ${colors.background} +format-padding = 1 diff --git a/.config/polybar/scripts/disk.sh b/.config/polybar/scripts/disk.sh new file mode 100755 index 0000000..6698d4c --- /dev/null +++ b/.config/polybar/scripts/disk.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +capacity=$(df -h --output=source,avail /home | grep -A1 '/' | sed "s/^.* //;s/[[:alpha:]]//") +warn="" +if [ $capacity -lt 71 ]; then warn='!'; fi + +printf "%s%s" "$warn " "$(echo $capacity | sed "s/$/G free/")" + diff --git a/.config/vim/vimrc b/.config/vim/vimrc index e36b59a..76c136f 100755 --- a/.config/vim/vimrc +++ b/.config/vim/vimrc @@ -31,7 +31,7 @@ autocmd FileType tex command! -nargs=0 Lw w !pdflatex % > /dev/null set number set ignorecase set smartcase -map :NERDTreeToggle +" map :NERDTreeToggle " Sw (sudo w) to save as root command! -nargs=0 W w !sudo tee % > /dev/null @@ -76,9 +76,19 @@ Plug 'preservim/nerdcommenter' Plug 'ycm-core/YouCompleteMe' Plug 'preservim/nerdtree' Plug 'ryanoasis/vim-devicons' +if !has('nvim') + Plug 'ptzz/lf.vim' +else + Plug 'ptzz/lf.vim' + Plug 'rbgrouleff/bclose.vim' +endif call plug#end() +" - Lf +let g:lf_map_keys = 0 +map :Lf + " - YouCompleteMe let g:ycm_autoclose_preview_window_after_completion = 1 diff --git a/.config/zsh/.zshenv b/.config/zsh/.zshenv index f6b6d2d..ce51a7f 100644 --- a/.config/zsh/.zshenv +++ b/.config/zsh/.zshenv @@ -1,7 +1,7 @@ #!/bin/zsh # Path -PATH="$HOME/.local/bin${PATH:+:${PATH}}" +PATH="$(du "$HOME/.local/bin/" | cut -f2 | paste -sd ':')${PATH:+:${PATH}}" # DEFAULT if [[ -n $SSH_CONNECTION ]]; then diff --git a/.scripts/rateUSD.sh b/.scripts/rateUSD.sh old mode 100644 new mode 100755 index 77f2741..06e0282 --- a/.scripts/rateUSD.sh +++ b/.scripts/rateUSD.sh @@ -1,12 +1,4 @@ -if [ ! -f /tmp/rate.html ]; then - curl -s "https://www.cnbcindonesia.com/market-data/currencies/IDR=/USD-IDR" > /tmp/rate.html -fi -if [ ! -f /tmp/rateUSD.txt ]; then - cat /tmp/rate.html | grep -A1 'class="mark_val"' | cut -d'"' -f2 | cut -d'<' -f2 | cut -d'>' -f2 > /tmp/rateUSD.txt - sed -i "s/mark_val/Kurs USD -> IDR:/g" /tmp/rateUSD.txt - cat /tmp/rateUSD.txt - echo "Sumber: CNBC Indonesia" -else - cat /tmp/rateUSD.txt - echo "Sumber: CNBC Indonesia" -fi +# get rate value from cnbcindonesia.com +curl -s "https://www.cnbcindonesia.com/market-data/currencies/IDR=/USD-IDR" | grep -A1 'class="mark_val"' | cut -d'"' -f2 | cut -d'<' -f2 | cut -d'>' -f2 > /tmp/rateUSD.txt +# if rateUSD.txt exist then display it while replace mark_val with Kurs USD -> IDR: +[ -f /tmp/rateUSD.txt ] && sed 's/mark_val/Kurs USD -> IDR:/' /tmp/rateUSD.txt; echo "Sumber: CNBC Indonesia"