dotfiles

<-- duh.
Log | Files | Refs | LICENSE

commit 31ef980e3a1b4598ceba20a2613d713749136dfa
parent e5a0dc5279fc6035a099925a4499881dd1371050
Author: Hayden Hamilton <hayden@haydenvh.com>
Date:   Mon, 20 Apr 2020 17:16:15 +0100

stuffs

Diffstat:
M.config/alias | 1+
M.config/neomutt/colours | 1+
M.config/neomutt/neomuttrc | 11++++++-----
M.config/nvim/init.vim | 6++++++
M.config/nvim/modules/filetype.vim | 2++
M.config/sxhkd/sxhkdrc | 4++--
M.config/zsh/alias.zsh | 1+
M.scripts/bin/dmenu/dinput | 2+-
M.scripts/bin/misc/mkmailbox | 13++++++++++++-
M.scripts/bin/misc/rmpv | 2+-
A.scripts/custom/xstuff | 7+++++++
M.scripts/dwmblocks/cpu | 13+++++++++++--
M.scripts/dwmblocks/dwmbar | 11+++++------
M.scripts/dwmblocks/mpv | 7++++---
M.scripts/dwmblocks/net | 3++-
D.scripts/dwmblocks/weather | 12------------
D.scripts/dwmblocks/weather2 | 11-----------
M.xinitrc | 2+-
18 files changed, 63 insertions(+), 46 deletions(-)

diff --git a/.config/alias b/.config/alias @@ -59,6 +59,7 @@ tmux \tmux -f $HOME/.config/tmux/config ~sbi cd ~/.scripts/bin/i3; ls ~sbm cd ~/.scripts/bin/misc; ls ~vrc vim ~/.vimrc +~ cd .. cd .. ... cd ../.. .... cd ../../.. diff --git a/.config/neomutt/colours b/.config/neomutt/colours @@ -66,3 +66,4 @@ color body red default "([a-z][a-z0-9+-]*://(((([a-z0-9_.!~*'();:&=+$,-]|%[0-9a- # Set status bar color color status color5 default +color progress color5 default diff --git a/.config/neomutt/neomuttrc b/.config/neomutt/neomuttrc @@ -10,8 +10,8 @@ set spoolfile = "~/general/mail/inbox" set record = "~/general/mail/sent" set postponed = "~/general/mail/drafts" set trash = "~/general/mail/rubbish" -#mailboxes =inbox =sent =drafts =rubbish # These are probably what you want -mailboxes =inbox =sent =drafts =rubbish =exmouth =exmouthsent =exmouthrubbish # Configured by my mkmailbox script +# mailboxes =inbox =sent =drafts =rubbish # These are probably what you want +mailboxes =inbox =sent =drafts =rubbish ="===============" =exmouth =exmouthsent =exmouthrubbish# Configured by my mkmailbox script set mbox_type = Maildir @@ -19,8 +19,9 @@ source colours source sidebar bind index D purge-message +bind index,pager M compose-to-sender -set sort=reverse-date -set sort_aux=last-date-received +# set sort=reverse-date +# set sort_aux=last-date-received -#source ~/.config/neomutt/gpg.rc +# source ~/.config/neomutt/gpg.rc diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim @@ -170,6 +170,12 @@ ino <Down> <Nop> ino <Left> <Nop> ino <Right> <Nop> +"Navigate in insert mode +inoremap <C-j> <down> +inoremap <C-k> <up> +inoremap <C-l> <right> +inoremap <C-h> <left> + "Search nnoremap <leader>CS :let @/=''<CR> diff --git a/.config/nvim/modules/filetype.vim b/.config/nvim/modules/filetype.vim @@ -6,6 +6,8 @@ function Shconfig() nnoremap <buffer> <localleader>($ i$(())<esc>hi nnoremap <buffer> <localleader>$ca i$cache nnoremap <buffer> <localleader>$co i$config + nnoremap <buffer> <localleader><space> i[[:space:]]<esc> + nnoremap <buffer> <localleader><localleader><space> [[:space:]] iabbrev ccachedir ${XDG_CACHE_HOME:=$HOME/.cache}<CR>cache=$XDG_CACHE_HOME iabbrev cconfigdir ${XDG_CONFIG_HOME:=$HOME/.config}<CR>cache=$XDG_CONFIG_HOME endfunction diff --git a/.config/sxhkd/sxhkdrc b/.config/sxhkd/sxhkdrc @@ -1,5 +1,5 @@ -super + {,shift, ctrl, alt} + bracketright - dinput "Are you sure?" "{sudo zzz, sudo ZZZ, sudo halt, sudo reboot}" +super + {shift, ctrl, alt} + v + dinput "Are you sure?" "{sudo zzz, sudo halt, sudo reboot}" super + Return st diff --git a/.config/zsh/alias.zsh b/.config/zsh/alias.zsh @@ -72,6 +72,7 @@ alias ~sbdm=" cd ~/.scripts/bin/dmenu; ls" alias ~sbi=" cd ~/.scripts/bin/i3; ls" alias ~sbm=" cd ~/.scripts/bin/misc; ls" alias ~vrc=" vim ~/.vimrc" +alias ~=" cd" alias ..=" cd .." alias ...=" cd ../.." alias ....=" cd ../../.." diff --git a/.scripts/bin/dmenu/dinput b/.scripts/bin/dmenu/dinput @@ -1,3 +1,3 @@ #!/bin/sh -[ "$(printf "No\\nYes" | dmenu -i -p "$1")" = "Yes" ] && $2 +[ "$(printf "No\\nYes" | dmenu -i -p "$2: $1")" = "Yes" ] && $2 diff --git a/.scripts/bin/misc/mkmailbox b/.scripts/bin/misc/mkmailbox @@ -1,5 +1,16 @@ #!/bin/sh -mailboxes=$(find ~/general/mail -type d | sed "s~$HOME/~~g;/\/.*\/.*\//d;/mail\/main/d;s~general/mail/~~g;s~^~=~g" | tail -n +2 | tr '\n' ' ') +mailboxes="$(printf "=inbox =sent =drafts =rubbish =\"===============\" +$(find ~/general/mail -type d | sed "s~$HOME/~~g;/\/.*\/.*\//d;/mail\/main/d;s~general/mail/~~g;s~^~=~g;s/===============$//g;s/=inbox$//g;s/=sent$//g;s/=drafts$//g;s/=rubbish//g" | tail -n +2)" | tr '\n' ' ' | tr -s ' ' | sed 's/ =$//g')" + +for var in "inbox" "sent" "drafts" "rubbish" "===============" +do + [ ! -d ~/general/mail/$var ] && { + mkdir -p ~/general/mail/$var/cur \ + ~/general/mail/$var/tmp \ + ~/general/mail/$var/new + } +done + out=$(sed 's~^mailboxes.*$~mailboxes '"$mailboxes"'# Configured by my mkmailbox script~g' < $HOME/.config/neomutt/neomuttrc) echo "$out" > $HOME/.config/neomutt/neomuttrc diff --git a/.scripts/bin/misc/rmpv b/.scripts/bin/misc/rmpv @@ -35,4 +35,4 @@ randomize() { allfiles files=$(for i in `seq $count`; do randomize; done) -[ "$(echo "$2" | grep "music")" != "" ] && mpv --input-ipc-server=/tmp/mpv-socket $files --no-video || mpv --input-ipc-server=/tmp/mpv-socket $files +echo "$1" | grep "music" && mpv --input-ipc-server=/tmp/mpv-socket $files --no-video || mpv --input-ipc-server=/tmp/mpv-socket $files diff --git a/.scripts/custom/xstuff b/.scripts/custom/xstuff @@ -0,0 +1,7 @@ +#!/bin/sh + +sudo mount.nfs4 192.168.1.20:/srv/storage general/ +sh $HOME/.scripts/custom/dock +nohup redshift & +rm nohup.out +ssh root@haydenvh.com diff --git a/.scripts/dwmblocks/cpu b/.scripts/dwmblocks/cpu @@ -6,7 +6,16 @@ # haydenvh.com # Copyright (c) 2019 Hayden Hamilton. -cpu=$(ps -e -o %cpu | awk '{s+=$1} END {print s}') -echo "[C $cpu%]" +cpup=$(ps -e -o %cpu | awk '{s+=$1} END {print s}' | sed 's/\..*$//g') +cpuc=$(lscpu | awk '/^CPU\(s\):/{print $2}') +cpu=$(($cpup/$cpuc)) +tempt=$(acpi -t | awk '{s+=$4} END {print s}') +tempc=$(acpi -t | wc -l) +temp=$(($tempt/$tempc)) +temp=" $temp" +[ $temp -gt 60 ] && [ ! $temp -gt 70 ] && temp=" ^c#ffff00^^b#888800^$temp" +[ $temp -gt 70 ] && temp=" ^c#ff0000^^b#770000^$temp" +[ $temp -lt 40 ] && temp=" ^c#7777dd^^b#222277^$temp" +echo "[C $cpu%${temp}C]" echo echo \#7525C8 diff --git a/.scripts/dwmblocks/dwmbar b/.scripts/dwmblocks/dwmbar @@ -1,8 +1,8 @@ #!/bin/bash -mkdir -p ~/.cache/blocks +mkdir -p /tmp/blocks block(){ - $HOME/.scripts/dwmblocks/$1 > $HOME/.cache/blocks/$1 & + $HOME/.scripts/dwmblocks/$1 > /tmp/blocks/$1 & } block host @@ -27,16 +27,15 @@ while true do block net block news - block weather block disk block disk2 block time2 sleep 20 done & -cd ~/.cache/blocks +cd /tmp/blocks while true do - sleep 1 - xsetroot -name "$(for void in $(seq 150); do printf " "; done) $(cat bat cpu disk disk2 mem mpv net news vol weather time time2 host | sed '/^#/d;/^$/d' | sed '1~2s/^/\^c#aaaaff\^/;2~2s/^/\^c#ffaaaa\^/;s~\[~ ^b#1a3136^ ~g;s~\]~ ^d^~g' | tr '\n' ' ') " + sleep 0.1 + xsetroot -name "$(for void in $(seq 150); do printf " "; done) $(cat mpv bat cpu disk disk2 mem net news vol time time2 host | sed '/^#/d;/^$/d' | sed '1~2s/^/\^c#ffaaaa\^/;2~2s/^/\^c#aaaaff\^/;s~\[~ ^b#1a3136^ ~g;s~\]~ ^d^~g' | tr '\n' ' ') " done diff --git a/.scripts/dwmblocks/mpv b/.scripts/dwmblocks/mpv @@ -15,9 +15,10 @@ artist2=$(echo '{ "command": ["get_property", "metadata/artist"] }' | socat - /t [ "$artist" != "" ] && artist="$artist - " [ "$artist2" != "" ] && artist2="$artist2 - " convertsecs() { - ((h=${1}/3600)) - ((m=(${1}%3600)/60)) - ((s=${1}%60)) + h=$((${1}/3600)) + m=$((${1}%3600)) + m=$(($m/60)) + s=$((${1}%60)) printf "%02d:%02d:%02d\n" $h $m $s } time=$(convertsecs $(echo '{ "command": ["get_property", "playback-time"] }' | socat - /tmp/mpv-socket | tr '{":,}' ' ' | awk '// {print $2}' | sed 's/\./ /g' | awk '// {print $1}')) diff --git a/.scripts/dwmblocks/net b/.scripts/dwmblocks/net @@ -6,7 +6,8 @@ # haydenvh.com # Copyright (c) 2019 Hayden Hamilton. -ip=$(curl -s http://n0a110w.xyz/ip.sh | tail -n 1) +ip=$(curl -s http://n0a110w.xyz/ip.sh || echo "No network.") +ip=$(echo "$ip" | tail -n 1) echo "[$ip]" echo echo \#4Da0C6 diff --git a/.scripts/dwmblocks/weather b/.scripts/dwmblocks/weather @@ -1,12 +0,0 @@ -#!/bin/bash -# -# i3blocks/weather -# Created by Hayden Hamilton -# -# haydenvh.com -# Copyright (c) 2019 Hayden Hamilton. - -curl -Ss 'https://wttr.in?0TQ' | cut -c 16- > ~/.cache/weather -echo "[$(sed 2q ~/.cache/weather | sed 's/\.\./ /g' | xargs echo)]" -echo -echo \#249980 diff --git a/.scripts/dwmblocks/weather2 b/.scripts/dwmblocks/weather2 @@ -1,11 +0,0 @@ -#!/bin/bash -# -# i3blocks/weather2 -# Created by Hayden Hamilton -# -# haydenvh.com -# Copyright (c) 2019 Hayden Hamilton. - -echo "[RAIN $(sed 5q ~/.cache/weather | sed 's/‘//g' | sed 's/‚’//g' | tail -n 1 | sed 's/ //g')]" -echo -echo \#249980 diff --git a/.xinitrc b/.xinitrc @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh xrdb ~/.local/xres & setxkbmap haydenh &