dotfiles

My personal configuration files.
Log | Files | Refs

commit e860d9a8f7ca586fa88ba2f0b1325377ebb14615
parent c295d8331ff5193cb97b1e3f6b15836654b010cc
Author: Benjamin Chausse <benjamin@chausse.xyz>
Date:   Thu,  8 Oct 2020 01:53:07 -0400

dwmblocks scripts

Diffstat:
M.config/aliasrc | 2+-
M.config/shortcutrc | 2+-
M.config/sxhkd/sxhkdrc | 5++++-
M.config/vifm/vifmrc | 11+++++++----
A.local/bin/dbshare | 14++++++++++++++
D.local/bin/dwmbar | 26--------------------------
D.local/bin/dwmbar-battery | 22----------------------
A.local/bin/dwmbar/dwmb-bat | 29+++++++++++++++++++++++++++++
R.local/bin/datetime -> .local/bin/dwmbar/dwmb-date | 0
A.local/bin/dwmbar/dwmb-dotfiles | 15+++++++++++++++
R.local/bin/kblayout -> .local/bin/dwmbar/dwmb-layout | 0
A.local/bin/dwmbar/dwmb-news | 3+++
A.local/bin/dwmbar/dwmb-test | 3+++
R.local/bin/vpnstatus -> .local/bin/dwmbar/dwmb-vpn | 0
A.local/bin/dwmbar/dwmbar | 26++++++++++++++++++++++++++
M.local/bin/newsup | 5++---
D.local/bin/yadms | 15---------------
M.profile | 2+-
18 files changed, 106 insertions(+), 74 deletions(-)

diff --git a/.config/aliasrc b/.config/aliasrc @@ -23,7 +23,7 @@ | dfa | yadm add | | dfc | yadm commit | | dfp | yadm pull | -| dfup | yadm commit -a && yadm push all master && dwmbar | +| dfup | yadm commit -a && yadm push all master && kill -39 $(pidof dwmblocks)| | e | $EDITOR | | ew | nvim ./main.rnw | | fetch | clear && printf '\n$(pfetch)\n$(bars)\n' | diff --git a/.config/shortcutrc b/.config/shortcutrc @@ -30,5 +30,5 @@ | Scripts | sc | $HOME/.local/bin | | Hotkeys | sx | $HOME/.config/sxhkd | | Images | img | $HOME/Dropbox/A/Personnal/Photos/unsorted | -| Compilation | cmp | $HOME/compilation | +| Compilation | cmp | $HOME/Compilation | |----------------+-----+--------------------------------------------------| diff --git a/.config/sxhkd/sxhkdrc b/.config/sxhkd/sxhkdrc @@ -140,7 +140,7 @@ super + n #-# Floating Apps/Utilities #-# ## Network Manager -super + shift + n +XF86WLAN killall nmtui || dropdowntoggle network nmtui ## TUI Audio Mixer (alsamixer) super + p @@ -258,3 +258,6 @@ super + shift + {bracketright, bracketleft} ## Toggle music playback super + backslash playerctl play-pause +# ## Network Manager +# super + shift + n +# killall nmtui || dropdowntoggle network nmtui diff --git a/.config/vifm/vifmrc b/.config/vifm/vifmrc @@ -137,7 +137,7 @@ set rulerformat= " CSV/Excel -filetype *.csv,*.xlsx libreoffice %c %i +filetype *.xlsx libreoffice %c %i fileviewer *.csv sed "s/,,,,/,,-,,/g;s/,,/ /g" %c | column -t | sed "s/ - / /g" | cut -c -%pw " HTMLs @@ -145,8 +145,8 @@ fileviewer *.html w3m -dump %c filextype *.html,*.htm firefox %f 2>/dev/null & " Text based files -filetype <text/*> nvim -fileviewer <text/*> env -uCOLORTERM bat --color always --theme base16 --wrap never --pager never %c -p +filetype <*.csv,text/*> nvim +fileviewer <*.csv,text/*> env -uCOLORTERM bat --color always --theme base16 --wrap never --pager never %c -p fileviewer *.[ch],*.[ch]pp,*.[ch]xx env -uCOLORTERM bat --color always --theme base16 --wrap never --pager never %c -p " PDFs @@ -260,7 +260,7 @@ nnoremap gb :file &<cr>l nnoremap yd :!echo %d | xclip -i -selection clipboard %i<cr> " Yank current file path into the clipboard -nnoremap yf :!echo %c:p | xclip -i -selection clipboard %i<cr> +nnoremap yf :!echo %c:p | xsel -b %i<cr> " Mappings for faster renaming nnoremap I cw<c-a> @@ -270,6 +270,9 @@ nnoremap A cw " Extract an archive nnoremap x :!/home/siddharth/bin/utils/extract %f &<cr> +" Share Files with dropbox + nnoremap s :!dbshare %d/%b &<cr> + " Make a new directory nnoremap mkd :mkdir<space> "}}} diff --git a/.local/bin/dbshare b/.local/bin/dbshare @@ -0,0 +1,14 @@ +#!/bin/bash + +output="$(dropbox-cli sharelink $1)" + +case "$output" in + https*) + echo "$output" | xsel -b + notify-send -a " Dropbox" "Your file $1 can now be shared. It's url is: +$output +It has been copied to your clipboard." ;; + *) + notify-send -a " Dropbox" "ERROR: +Your file could not be shared." ;; +esac diff --git a/.local/bin/dwmbar b/.local/bin/dwmbar @@ -1,26 +0,0 @@ -#!/bin/sh - -# Refreshes the dwm bar using the scripts in: -# $SCRIPTS/dwm/ - -# When given the echo option, echo to stdout instead -# of refreshing (useful for debugging) - -battery=$(battery) -datetime=$(datetime) -# dropbox=$(dropbox-status) -kblayout=$(kblayout) -# mailbox=$(mailbox) -news=$(news) -vpnstatus=$(vpnstatus) -# wifi=$(wifi) -yadms=$(yadms) - -bar="$yadms|$news|$datetime|$kblayout|$vpnstatus|$battery |" - -case "$1" in - echo) echo "$bar" ;; - *) xsetroot -name "$bar" ;; -esac - - diff --git a/.local/bin/dwmbar-battery b/.local/bin/dwmbar-battery @@ -1,22 +0,0 @@ -#!/bin/sh -# Better battery manager for polybar - -# Charging:  -# Discharching:  -# Full: underscore:  -# LOW BATTERY:  - -batstatus=$(acpi | tail -n 1) - -ico="" - -# Change the underscore color according to the charging state -case "$batstatus" in - *Charging*) ico=" ";; - *Discharging*) ico="  " ;; - *) ico="  " ;; -esac - -percentage=$( echo "$batstatus" | sed "s/.*\(\ [0-9]*\)\%.*$/\1/; s/\ //g; 1q") - -echo "$ico $percentage%" diff --git a/.local/bin/dwmbar/dwmb-bat b/.local/bin/dwmbar/dwmb-bat @@ -0,0 +1,29 @@ +#!/bin/sh + +case $BLOCK_BUTTON in + 1) notify-send hey ;; + 2) setsid -f "$TERMINAL" -e calcurse ;; + 3) notify-send " Time/date module" "\- Left click to show upcoming appointments for the next three days via \`calcurse -d3\` and show the month via \`cal\` +- Middle click opens calcurse if installed" ;; + 6) "$TERMINAL" -e "$EDITOR" "$0" ;; +esac + +# Charging:  # +# Discharching:  # +# Full: underscore:  # +# LOW BATTERY:  # + +batstatus=$(acpi | tail -n 1) + +ico="" + +# Change the underscore color according to the charging state +case "$batstatus" in + *Charging*) ico=" ";; + *Discharging*) ico="  " ;; + *) ico="  " ;; +esac + +percentage=$( echo "$batstatus" | sed "s/.*\(\ [0-9]*\)\%.*$/\1/; s/\ //g; 1q") + +echo "$ico$percentage% " diff --git a/.local/bin/datetime b/.local/bin/dwmbar/dwmb-date diff --git a/.local/bin/dwmbar/dwmb-dotfiles b/.local/bin/dwmbar/dwmb-dotfiles @@ -0,0 +1,15 @@ +#!/bin/bash + +dotfiles=$(yadm status | sed '1,3d; + 5,$d; + s/.$//g') + +if [[ ${dotfiles:0:1} == "n" ]]; then + warn="" +else + warn="  " +fi + + + +echo " $warn" diff --git a/.local/bin/kblayout b/.local/bin/dwmbar/dwmb-layout diff --git a/.local/bin/dwmbar/dwmb-news b/.local/bin/dwmbar/dwmb-news @@ -0,0 +1,3 @@ +#!/bin/sh + + cat /tmp/newsupdate 2>/dev/null || echo "$(newsboat -x print-unread | awk '{ if($1>0) print "  " $1}')$(cat "${XDG_CONFIG_HOME:-$HOME/.config}"/newsboat/.update 2>/dev/null) " diff --git a/.local/bin/dwmbar/dwmb-test b/.local/bin/dwmbar/dwmb-test @@ -0,0 +1,3 @@ +#!/bin/sh + +cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1 diff --git a/.local/bin/vpnstatus b/.local/bin/dwmbar/dwmb-vpn diff --git a/.local/bin/dwmbar/dwmbar b/.local/bin/dwmbar/dwmbar @@ -0,0 +1,26 @@ +#!/bin/sh + +# Refreshes the dwm bar using the scripts in: +# $SCRIPTS/dwm/ + +# When given the echo option, echo to stdout instead +# of refreshing (useful for debugging) + +battery=$(dwmb-bat) +datetime=$(dwmb-date) +# dropbox=$(dropbox-status) +kblayout=$(dwmb-layout) +# mailbox=$(mailbox) +news=$(dwmb-news) +vpnstatus=$(dwmb-vpn) +# wifi=$(wifi) +dotfiles=$(dwmb-dotfiles) + +bar="$dotfiles|$news|$datetime|$kblayout|$vpnstatus|$battery " + +case "$1" in + echo) echo "$bar" ;; + *) xsetroot -name "$bar" ;; +esac + + diff --git a/.local/bin/newsup b/.local/bin/newsup @@ -8,8 +8,7 @@ ping -q -c 1 1.1.1.1 > /dev/null || exit pgrep -x newsboat >/dev/null && /usr/bin/xdotool key --window "$(/usr/bin/xdotool search --name newsboat)" R && exit -echo "" > /tmp/newsupdate && dwmbar -pkill -RTMIN+6 i3blocks +echo "   " > /tmp/newsupdate && kill -37 $(pidof dwmblocks) /usr/bin/newsboat -x reload rm -f /tmp/newsupdate -/usr/bin/notify-send -t 1 -i "$HOME/.fonts/svg/rss.svg" -a RSS "RSS feed update complete." && dwmbar +/usr/bin/notify-send -t 1 -a " RSS" "RSS feed update complete." && kill -37 $(pidof dwmblocks) diff --git a/.local/bin/yadms b/.local/bin/yadms @@ -1,15 +0,0 @@ -#!/bin/bash - -dotfiles=$(yadm status | sed '1,3d; - 5,$d; - s/.$//g') - -if [[ ${dotfiles:0:1} == "n" ]]; then - warn="" -else - warn="  " -fi - - - -echo "  $warn" diff --git a/.profile b/.profile @@ -4,7 +4,7 @@ export PATH="$PATH:$(du "$HOME/.scripts/" | cut -f2 | tr '\n' ':')" export PATH=$PATH:/root/.local/bin export PATH=$PATH:$HOME/.local/bin export PATH=$PATH:$HOME/.cargo/bin -export PATH=$GOPATH/bin:$PATH +export PATH=$PATH$( find $HOME/.local/bin/ -type d -printf ":%p" ) export QT_QPA_PLATFORMTHEME="qt5ct" export EDITOR=/usr/bin/nvim export READER=/usr/bin/zathura