dotfiles

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

commit cbd87e83a8da0f5031098dcbd61fceb664d35dce
parent 31ef980e3a1b4598ceba20a2613d713749136dfa
Author: Hayden Hamilton <hayden@haydenvh.com>
Date:   Sun, 10 May 2020 00:32:12 +0100

lotsa stuff

Diffstat:
M.config/alias | 11++---------
M.config/irssi/config | 32+++++++++++++++++++-------------
M.config/irssi/pipeline.theme | 1+
M.config/mpv/mpv.conf | 4++--
M.config/neomutt/colours | 5++++-
M.config/neomutt/neomuttrc | 5+++--
M.config/neomutt/sidebar | 4++++
M.config/nvim/init.vim | 1+
M.config/nvim/modules/filetype.vim | 6+++---
M.config/tmux/config | 6+++++-
M.config/vimb/scripts.js | 2+-
M.config/zsh/.zshrc | 3+++
M.config/zsh/alias.zsh | 11++---------
M.config/zsh/functions.zsh | 87+++++++++++++++++++++++++------------------------------------------------------
A.scripts/bin/display/sent-ascii | 1+
A.scripts/bin/dns/getdns | 17+++++++++++++++++
A.scripts/bin/dns/updatehosts | 6++++++
A.scripts/bin/misc/lsc | 15+++++++++++++++
A.scripts/bin/misc/remind | 72++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.scripts/bin/misc/schedule | 128+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
M.scripts/bin/misc/urlhand | 3++-
A.scripts/bin/misc/webmkv | 4++++
M.scripts/custom/dock | 3+--
M.scripts/custom/xstuff | 2++
M.scripts/dwmblocks/bat | 22+++++++++++++---------
M.scripts/dwmblocks/cpu | 4+---
M.scripts/dwmblocks/dwmbar | 12++++++++++--
A.scripts/dwmblocks/mail | 6++++++
M.scripts/dwmblocks/mem | 2+-
M.scripts/dwmblocks/mpv | 20+++++++++++++-------
M.scripts/dwmblocks/news | 4++--
A.scripts/dwmblocks/rem | 6++++++
A.scripts/random/example-args.sh | 21+++++++++++++++++++++
M.zprofile | 17++++++++++++++++-
34 files changed, 414 insertions(+), 129 deletions(-)

diff --git a/.config/alias b/.config/alias @@ -1,21 +1,13 @@ -ls nop l l \ls --color la \ls --color -A ll \ls --color -lh lla \ls --color -lAh r \rm rr \rm -rf -rm nop r m \mv -mv nop m -vim nop v -vi nop v v nvim -git nop g g \git c \cp -cp nop c -find nop f f \find xi sudo xbps-install xiu sudo xbps-install -S; sudo xbps-install -yu xbps; sudo xbps-install -yu @@ -40,10 +32,11 @@ cleancache sudo xbps-remove -Ooy; rm -rf ~/.cache ~/.mozilla ~/.local/share/web mkconfall mkmailpass; mkalias tmux tmux -f ~/.config/tmux/config nw newsboat -nm neomutt +nm neomutt ; rm /tmp/mail maic sudo make all install clean homesync rsync --port 222 --delete -azPe 'ssh -p 222' --exclude=general --exclude=.cache --exclude=.local/cache $HOME/ void@192.168.1.20:/home/void/homedir/ tmux \tmux -f $HOME/.config/tmux/config +notes vim ~/.local/notes ~d cd ~/general/downloads; ls ~do cd ~/general/documents; ls ~iw cd ~/images/wallpapers; ls diff --git a/.config/irssi/config b/.config/irssi/config @@ -26,12 +26,20 @@ channels = ( { name = "#GNU/matrix"; chatnet = "Rizon"; autojoin = "Yes"; }, { name = "#staw"; chatnet = "Freenode"; autojoin = "Yes"; }, { name = "#neomutt"; chatnet = "Freenode"; autojoin = "Yes"; }, - { name = "#cat-v"; chatnet = "Freenode"; autojoin = "Yes"; } - { name = "#archlinux-offtopic"; chatnet = "Freenode"; autojoin = "Yes"; }, - { name = "#vim"; chatnet = "Freenode"; autojoin = "Yes"; } - { name = "#neovim"; chatnet = "Freenode"; autojoin = "Yes"; } - { name = "#voidlinux-offtopic"; chatnet = "Freenode"; autojoin = "Yes"; }, - { name = "#i3"; chatnet = "Freenode"; autojoin = "Yes"; }, + { name = "#cat-v"; chatnet = "Freenode"; autojoin = "Yes"; }, + { + name = "#archlinux-offtopic"; + chatnet = "Freenode"; + autojoin = "Yes"; + }, + { name = "#vim"; chatnet = "Freenode"; autojoin = "Yes"; }, + { name = "#neovim"; chatnet = "Freenode"; autojoin = "Yes"; }, + { + name = "#voidlinux-offtopic"; + chatnet = "Freenode"; + autojoin = "Yes"; + }, + { name = "#i3"; chatnet = "Freenode"; autojoin = "Yes"; } ); aliases = { ATAG = "WINDOW SERVER"; @@ -192,13 +200,14 @@ aliases = { statusbar = { items = { barstart = "{sbstart}"; + ibarstart = "{isbstart}"; barend = "{sbend}"; user = "{sb {sbnickmode $cumode}$N{sbmode $usermode}{sbaway $A}}"; window = "{sb $winref:$tag/$itemname{sbmode $M}}"; window_empty = "{sb $winref{sbservertag $tag}}"; prompt = "{prompt $[.15]itemname}"; prompt_empty = "{prompt $winname}"; - topic = " $topic"; + topic = " {sb $winref/$itemname} TOPIC: $topic"; lag = "{sb Lag: $0-}"; act = "{sb Act: $0-}"; more = "-- more --"; @@ -223,7 +232,7 @@ statusbar = { position = "1"; visible = "inactive"; items = { - barstart = { priority = "100"; }; + ibarstart = { priority = "100"; }; window = { }; more = { priority = "-1"; alignment = "right"; }; barend = { priority = "100"; alignment = "right"; }; @@ -246,15 +255,12 @@ settings = { core = { real_name = "haydenh"; user_name = "haydenh"; - nick = "haydenh"; + nick = "haydenh_"; recode_transliterate = "no"; timestamp_format = "%H:%M:%S"; }; "fe-text" = { actlist_sort = "refnum"; }; - "fe-common/core" = { - theme = "pipeline"; - autolog = "yes"; - }; + "fe-common/core" = { theme = "pipeline"; autolog = "yes"; }; "perl/core/scripts" = { ascii_figlet_path = "/usr/bin/figlet"; nickcolor_colors = "4 8 9 10 11 12 13 14 15"; diff --git a/.config/irssi/pipeline.theme b/.config/irssi/pipeline.theme @@ -213,6 +213,7 @@ abstracts = { # background of statusbar sb_background = "%N"; + isbstart = "%0" # default statusbar item style diff --git a/.config/mpv/mpv.conf b/.config/mpv/mpv.conf @@ -1,3 +1,3 @@ -vo=gpu +vo=xv -ytdl-format="(bestvideo[height<=1080]+bestaudio)[ext=webm]/bestvideo[height<=1080]+bestaudio/best[height<=1080]/bestvideo+bestaudio/best" +ytdl-format="(bestvideo[height<=1080]+bestaudio)[ext=webm]/bestvideo[height<=1080]+bestaudio/best[height<=180]/bestvideo+bestaudio/best" diff --git a/.config/neomutt/colours b/.config/neomutt/colours @@ -7,8 +7,11 @@ color index_subject cyan default '.*' # For new mail: color index blue default "~N" -color index_author magenta default "~N" +color index_author color12 default "~N" color index_subject color12 default "~N" +color index blue default "~O" +color index_author color12 default "~O" +color index_subject color12 default "~O" # Header colors: color header blue default ".*" diff --git a/.config/neomutt/neomuttrc b/.config/neomutt/neomuttrc @@ -21,7 +21,8 @@ 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 new_mail_command="echo N:%n U:%u > /tmp/mail &" + +set sort=threads # source ~/.config/neomutt/gpg.rc diff --git a/.config/neomutt/sidebar b/.config/neomutt/sidebar @@ -5,11 +5,15 @@ set sidebar_width=15 set sidebar_format = "%B%?F? [%F]?%* %?N?%N/?%S" set mail_check_stats set sort_browser="unsorted" +set sidebar_short_path=yes bind index,pager \CK sidebar-prev bind index,pager \CO sidebar-open +bind index,pager \CL sidebar-open bind index,pager \CJ sidebar-next color sidebar_divider color2 default color sidebar_highlight color7 default +color sidebar_new color12 default +color sidebar_unread color12 default mono sidebar_indicator reverse diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim @@ -92,6 +92,7 @@ noremap <leader>u' ds' noremap <leader>sp o<esc>pi noremap <leader>Ee :edit noremap <leader>yv :reg<CR> +noremap <leader>8 :set tw=80<CR>:set fo+=t<CR> noremap <leader>nn :set number! relativenumber!<CR> noremap <leader><leader>nn :setlocal number! relativenumber!<CR> diff --git a/.config/nvim/modules/filetype.vim b/.config/nvim/modules/filetype.vim @@ -1,5 +1,5 @@ function Shconfig() - nnoremap <buffer> <localleader>s i#!/bin/sh<CR>#<CR># <++><CR># Created by Hayden Hamilton<CR>#<CR># haydenvh.com<CR># Copyright (c) <++> Hayden Hamilton<CR><CR>${XDG_CACHE_HOME:=$HOME/.cache}<CR>${XDG_CONFIG_HOME:=$HOME/.config}<CR>cache=$XDG_CACHE_HOME<CR>config=$XDG_CONFIG_HOME<esc> + nnoremap <buffer> <localleader>s i#!/bin/sh<CR>#<CR># <++><CR># Created by Hayden Hamilton<CR>#<CR># haydenvh.com<CR># Copyright (c) <++> Hayden Hamilton<CR><CR>cache=${XDG_CACHE_HOME:=$HOME/.cache}<CR>config=${XDG_CONFIG_HOME:=$HOME/.config}<esc> nnoremap <buffer> <localleader>x :!chmod +x %<CR> nnoremap <buffer> <localleader>f i(){<CR><CR>}<esc>kk0i nnoremap <buffer> <localleader>$ i$()<esc>i @@ -8,8 +8,8 @@ function Shconfig() 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 + iabbrev ccachedir cache=${XDG_CACHE_HOME:=$HOME/.cache} + iabbrev cconfigdir cache=${XDG_CONFIG_HOME:=$HOME/.config} endfunction augroup autocmd diff --git a/.config/tmux/config b/.config/tmux/config @@ -2,7 +2,8 @@ unbind C-b set-option -g prefix C-a bind-key C-a send-prefix -set-option -g default-terminal "xterm-256color" +# set-option -g default-terminal "xterm-256color" +set-option -g default-terminal "st-256color" bind z split-window -h bind Z split-window -v @@ -54,3 +55,6 @@ setw -g window-status-format ' #I#[fg=colour249]:#[fg=colour255]#W#[fg=colour249 # messages set -g message-style 'fg=colour232 bg=colour16 bold' + +#vi mode +set-window-option mode-keys vi diff --git a/.config/vimb/scripts.js b/.config/vimb/scripts.js @@ -17,7 +17,7 @@ var element = document.getElementsByTagName("tr"); element.outerHTML = element.outerHTML; addGlobalStyle("*{color:#1e5eb3 !important;}#js-tab-pipeline *{background-color:#0a0a10 !important}form *{background-color:#0a0a10 !important;}h1,h2,h3,h4,h5,h6{color:inherit !important;}.avatar-container *{ background-color:#141726 !important;}.top-bar{ background:#111111 !important;}aside{ background-color:#111111 !important;}.js-jobs-container{ background-color:#111111 !important;}.build-job *{ background-color:#222222 !important; border:0 !important;}body.ui-indigo .navbar-gitlab .navbar-sub-nav > li.active > button{ background-color:rgba(10,10,10,0.5) !important;}.content-block, .content-block *, .content-block * *{ background-color:#141726 !important;}.dropdown{ background-color:rgba(0,0,0,0) !important;}.file-holder *{ background-color:#141726 !important;}.banner-callout{ display:none !important;}.bg-light{ background-color:#141726 !important; border:none !important;}*{ color:#1e5eb3 !important; border-radius:0 !important;}.avatar-tile{ background-color:#141726 !important;}.avatar-container{ background-color:rgba(0,0,0,0) !important;}textarea{ border:0 !important; background-color:rgba(50,50,50,0.5) !important;}.input-group-prepend,.input-group-prepend div{ border:0 !important; background-color:rgba(25,25,25,0.5) !important;}gspan{color:#aaaaaa !important}.commit-sha-group div{ background-color:#141726 !important; border:0 !important; color:#ffffff !important;}.ci-status-link{ display:none !important;}.card, .card div{ background-color:#141726 !important;}.card{ border:0 !important;}.row-content-block{ background-color:#141726; border:0 !important;}.commit-header{ background-color:#141726 !important; border:0 !important;}body{font-family:monospace !important}.toggle-sidebar-button{ background-color:#141726; border:0 !important;}.dropdown-menu{ background-color:#141726;}input{ background:rgba(50,50,50,0.5) !important;}.cover-block{ background-color:#141726; color:#ffffff !important; padding-bottom:5vh !important;}.cover-block p,.cover-block .cover-title{ color:#ffffff !important;}.profile-link-holder{ color:#ffffff !important;}.cover-block .scrolling-tabs-container .nav-links{ border-bottom:0; position:relative; top:5vh;}.cover-block .scrolling-tabs-container .nav-links li{ border-top:#ffffff 1px solid !important;}.user-caller{display:none !important;}.avatar-container{border:0 !important;border-radius:0 !important;}article{border:0 !important;}article div{background-color:#141726 !important; border:0 !important; color:#ffffff !important;}article p{ color:#ffffff !important;}code{ background-color:rgba(15,15,15,0.5)}body{ background-color:#0a0a10; color:#1e5eb3 !important;}#content-body input,#content-body button,#content-body.dropdown,#content-body a{ border:none; background-color:rgba(0,0,0,0) !important; color:#1e5eb3 !important;font-weight:bold !important;}header{ background-color:#141726 !important;}.nav-sidebar{ background-color:#141726 !important;}.fly-out-list{ background-color:#141726 !important; border:0; border:#393982 1px solid !important; color:#ffffff !important;}a{ color:#ffffff !important;}.info-well{ background-color:rgba(0,0,0,0); border:0;}.bs-callout{ display:none !important;}.count-badge-count{ display:none !important;}table{ border:0 !important; background-color:rgba(0,0,0,0) !important; color:#ffffff !important;}.table-holder{ border:0 !important;}thead th{ background-color:#141726 !important; border:0 !important;}tr{ border-bottom-color:#141726 !important;}tr:hover{ border-bottom-color:#141726 !important; display:}"); } -if (hostname == "searx.win" || hostname == "searx.me") {addGlobalStyle("*{color:#1e5eb3 !important;border-color:#1e5e3 !important;}#categories label{ background-color:#141726; border:none !important; padding:1vw; cursor:pointer; border-bottom:#5555 5px solid !important;}.result{ background-color:rgba(0,0,0,0) !important;}.highlight{ background-color:#aaa !important;}.alert{ background-color:rgba(10,10,10,0.5) !important;}.panel div{ background-color:#0a0a10 !important; color:#1e5eb3 !important;}.panel img{ border:7.5px solid #141726}.searx-navbar{ background-color:#141726;}body{ background-color:#0a0a10; font-family:monospace !important;}input,button{ background-color:rgba(0,0,0,0) !important;}.footer{ display:none;}");} +if (hostname == "occusearch.de.win" || hostname == "searx.me") {addGlobalStyle("*{color:#1e5eb3 !important;border-color:#1e5e3 !important;}#categories label{ background-color:#141726; border:none !important; padding:1vw; cursor:pointer; border-bottom:#5555 5px solid !important;}.result{ background-color:rgba(0,0,0,0) !important;}.highlight{ background-color:#aaa !important;}.alert{ background-color:rgba(10,10,10,0.5) !important;}.panel div{ background-color:#0a0a10 !important; color:#1e5eb3 !important;}.panel img{ border:7.5px solid #141726}.searx-navbar{ background-color:#141726;}body{ background-color:#0a0a10; font-family:monospace !important;}input,button{ background-color:rgba(0,0,0,0) !important;}.footer{ display:none;}");} if (hostname == "neinchan.com") { addGlobalStyle(".greenText{color:#3ab475 !important;}a{color:#3ab475 !important;font-weight:bold !important;font-decoration:underline !important;}*{color:#1e5eb3 !important;}fieldset{ border:0 !important;}fieldset legend{ display:none !important;}.small{ display:none !important;g}*{border-radius:0 !important; background-color:#070911 !important;font-family:monospace !important;}nav{ padding-top:2vh !important; border-bottom:#aaaaaa 1px solid !important;}nav *,nav{ background-color:#141726 !important; color:#1e5eb3 !important;}hr{ border:0 !important; border-bottom:#aaaaaa 1px solid !important;}.postCell .innerPost{ border:#aaaaaa 1px solid !important;}.deletionCheckBox{ display:none !important;}th{ border:#aaaaaa 0.5px solid !important; padding-left:1vw !important; padding-right:1vw !important;}table input,table textarea,table .dropzone,button{ border:#aaaaaa 0.5px solid !important; padding:0.5vw !important; max-width:285px !important;}") document.getElementsByTagName("table")[0].setAttribute("cellspacing","0") diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc @@ -91,3 +91,6 @@ ZSH_HIGHLIGHT_STYLES[double-hyphen-option]='fg=7' ZSH_HIGHLIGHT_STYLES[path]='fg=7' . /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh + +# boot into X +[ "$(tty)" = "/dev/tty1" ] && startx diff --git a/.config/zsh/alias.zsh b/.config/zsh/alias.zsh @@ -11,24 +11,16 @@ alias -g ............=" ../../../../../../../../../../.." alias -g om=" origin master" alias -g gm=" github master" alias -g aic=" all install clean" -alias ls=" nop l" alias l=" \ls --color" alias la=" \ls --color -A" alias ll=" \ls --color -lh" alias lla=" \ls --color -lAh" alias r=" \rm" alias rr=" \rm -rf" -alias rm=" nop r" alias m=" \mv" -alias mv=" nop m" -alias vim=" nop v" -alias vi=" nop v" alias v=" nvim" -alias git=" nop g" alias g=" \git" alias c=" \cp" -alias cp=" nop c" -alias find=" nop f" alias f=" \find" alias xi=" sudo xbps-install" alias xiu=" sudo xbps-install -S; sudo xbps-install -yu xbps; sudo xbps-install -yu" @@ -53,10 +45,11 @@ alias cleancache=" sudo xbps-remove -Ooy; rm -rf ~/.cache ~/.mozilla ~/.local/sh alias mkconfall=" mkmailpass; mkalias" alias tmux=" tmux -f ~/.config/tmux/config" alias nw=" newsboat" -alias nm=" neomutt" +alias nm=" neomutt ; rm /tmp/mail" alias maic=" sudo make all install clean" alias homesync=" rsync --port 222 --delete -azPe 'ssh -p 222' --exclude=general --exclude=.cache --exclude=.local/cache $HOME/ void@192.168.1.20:/home/void/homedir/" alias tmux=" \tmux -f $HOME/.config/tmux/config" +alias notes=" vim ~/.local/notes" alias ~d=" cd ~/general/downloads; ls" alias ~do=" cd ~/general/documents; ls" alias ~iw=" cd ~/images/wallpapers; ls" diff --git a/.config/zsh/functions.zsh b/.config/zsh/functions.zsh @@ -1,50 +1,17 @@ -#!/bin/sh -killprog(){ - for prog in $(printf "$@") - do - pkill $prog - done -} - 0x0(){ - for file in $(printf "$@") - do - name=$(curl -n -F "file=@$file" http://0x0.st) - echo "$file : $name" - names="$names $name" done - echo $names | xclip + curl -n -F "file=<-" http://0x0.st < /dev/stdin | tee /dev/stderr | xclip } ix(){ - for file in $(printf "$@") - do - name=$(curl -n -F "f:1=<-" http://ix.io < $file) - echo "$file : $name" - names="$names $name" - done - echo $names | xclip -} - -pc(){ - "$@" | curl -n -F "f:1=<-" http://ix.io + curl -n -F "f:1=<-" http://ix.io < /dev/stdin | tee /dev/stderr | xclip } -make(){ - [ -f make.sh ] && { - sh make.sh "$@" - } || { - command make "$@" - } +me0w(){ + echo "gopher://me0w.net/0/pit/$(nc me0w.net 31415 < /dev/stdin)" | tee /dev/stderr |xclip } -colo(){ - for file in $(printf "$@") - do - name=$(curl -n -F "image=@$file" https://api.deepai.org/api/colorizer) - echo "$file : $name" - names="$names $name" - done - echo $names | xclip +hb(){ + nc haydenh.null 9999 < /dev/stdin | tee /dev/stderr | xclip } colotable(){ @@ -61,34 +28,34 @@ colotable(){ done } -filesort(){ - find $1 -type f | sort -} - -nop(){ - echo "This already has an alias... use $1 instead!" -} - encsign(){ [ "$1" = "--help" ] && echo '$1=recipient $2=file' && exit 1 gpg --encrypt --sign --armor -r $1 $2 } -h8(){ - for file in $(printf "$@") - do - name=$(curl -F 'file=<-' http://haydenvh.com:8080 < $file) - echo "$file : $name" - names="$names $name" - done - echo "$names" | xclip +cu(){ + sh $HOME/.scripts/custom/$1 } -p8(){ - name=$(curl -F 'file=<-' http://haydenvh.com:8080 < /dev/stdin) - echo "$name" | tee | xclip +radio(){ + mpv $1 --input-ipc-server=/tmp/mpv-socket3 } -cu(){ - sh $HOME/.scripts/custom/$1 +notebook(){ + nvim $HOME/.local/notes +} + +diary(){ + for o in "public" "private" + do + echo "===$o===" > ~/.local/${o}d + done + + phlog="$HOME/web/alcl/write" + mkdir -p $phlog/daily.accomplishments ~/.local/diary + vim -O ~/.local/publicd ~/.local/privated + date=$(date +%d%m%y) + printf '.txt or .gph?'; read ftype < /dev/tty + mv ~/.local/publicd $phlog/daily.accomplishments/Accomplishments.of.$date.$ftype + mv ~/.local/privated ~/.local/diary/$date } diff --git a/.scripts/bin/display/sent-ascii b/.scripts/bin/display/sent-ascii @@ -0,0 +1 @@ +#!/bin/sh diff --git a/.scripts/bin/dns/getdns b/.scripts/bin/dns/getdns @@ -0,0 +1,17 @@ +#!/bin/sh + +mkdir -p sources +sources="gnu.matrix 45.32.178.12" # each host is seperated by a space char, priority from left to right + +for s in $sources +do + curl -s gopher://$s/1/dns > sources/$s + touch sources/$s +done + +for s in $sources +do + sf="$sf sources/$s" +done + +cat $(echo "$sf" | sed 's/^ //g') | sort | uniq > hosts diff --git a/.scripts/bin/dns/updatehosts b/.scripts/bin/dns/updatehosts @@ -0,0 +1,6 @@ +#!/bin/sh + +[ -z $1 ] && echo "usage: script /path/to/dnsfile" && exit 1 + +[ ! -f /etc/hosts.old ] && cp /etc/hosts /etc/hosts.old && echo "Copying /etc/hosts to /etc/hosts.old - if you want to manually add to your hosts, please append /etc/hosts.old, and rerun this script, as anything added to /etc/hosts will be overwritten in next run of this script." +cat /etc/hosts.old hosts > newhosts && echo "new hosts file saved to 'newhosts'" diff --git a/.scripts/bin/misc/lsc b/.scripts/bin/misc/lsc @@ -0,0 +1,15 @@ +#!/bin/sh + +t=$(mktemp -d) + +for o in $(ls --color "$@") +do + o2=$(echo "$o" | perl -pe 's/\e\[?.*?[\@-~]//g') + [ -f $o2 ] && echo "$o" >> $t/file && fin="y" + [ -d $o2 ] && echo "$o" >> $t/dir && fin="y" + [ "$fin" != "y" ] && echo "$o" >> $t/other + unset fin +done + +pr -mtw "$(tput cols)" $t/* +rm -rf $t diff --git a/.scripts/bin/misc/remind b/.scripts/bin/misc/remind @@ -0,0 +1,72 @@ +#!/bin/sh +# +# remind +# Created by Hayden Hamilton +# +# haydenvh.com +# Copyright (c) 2020 Hayden Hamilton + +cache=${XDG_CACHE_HOME:=$HOME/.cache} + +usage(){ + echo "usage: remind $(tput bold)ARGS$(tput sgr0) + +ARGS: + -a DATE::STRING - add STRING as reminder for DATE (follows \`date +%d%%%m%%%y\` format) + -n - print number of reminders for today + -e - print reminders for today + -r - clear today's reminders + -d DATE - get reminders for DATE (follows \`date +%d%%%m%%%y\` format)" + exit 1 +} + +add(){ + fdate=$(echo "$1" | grep -o '.*::' | sed 's/::$//g') + string=$(echo "$1" | grep -o '::.*' | sed 's/^:://g') + + mkdir $cache/remind/$fdate -p + num=$(ls $cache/remind/$fdate | wc -l) + echo "$string" >> $cache/remind/$fdate/$num && echo 'reminder set' || echo 'failed to set reminder' +} + +num(){ + ls $cache/remind/$date 2>/dev/null | wc -l +} + +_echo(){ + cat $cache/remind/$date/* +} + +_clear(){ + rm -rf $cache/remind/$date +} + +_date(){ + cat $cache/remind/$1/* +} + +date=$(date +%d%%%m%%%y) +mkdir -p $cache/remind +[ -z $1 ] && usage +while [ "$#" != "0" ] +do + echo "$1" | grep "[a-zA-Z0-0]=" >/dev/null && { + arg_opt=$(echo "$1" | sed 's/=.*//g') + arg_opr=$(echo "$1" | sed 's/.*=//g') + } || { + arg_opt="$1" + echo "$arg_opt" | grep -E -- '-a|-d' >/dev/null && { + shift + arg_opr="$1" + } + } + case "$arg_opt" in + -a) add "$arg_opr" ;; + -n) num ;; + -e) _echo ;; + -r) _clear ;; + -d) _date "$arg_opr" ;; + *) echo "$arg_opt not recognized"; usage ;; + esac + shift +done diff --git a/.scripts/bin/misc/schedule b/.scripts/bin/misc/schedule @@ -0,0 +1,128 @@ +#!/bin/sh +# +# schedule +# Created by Hayden Hamilton +# +# haydenvh.com +# Copyright (c) 2020 Hayden Hamilton + +dir="${XDG_CACHE_HOME:=$HOME/.cache}/schedule" +current="${XDG_CACHE_HOME:=$HOME/.cache}/schedule-current" +config="${XDG_CONFIG_HOME:=$HOME/.config}" + +mkdir -p $config/schedule +touch $config/schedule/config +. $config/schedule/config + +usage(){ + echo "usage: schedule $(tput bold)ARGS$(tput sgr0) + +ARGS: + -n NAME - create a new schedule + -c NAME - choose from list of schedules + -t - interactively deal with today's schedule + -o - list number of started, yet uncomplete tasks + -l - list schedules + " +} + +new(){ + mkdir $dir/$1/ + for day in "mon" "tue" "wed" "thu" "fri" "sat" "sun" + do + printf "# everything preceded by a hash/sharp symbol is a comment\n#=== TIME\n# the above ^ signifies (commented) the start of an event, TIME being the hh:mm (\`date +%%H:%%M\`) at which it begins.\n\n" > $dir/$1/$day + done + printf "Schedule in $dir/$1. Edit files as you like.\n$dir/$1 set as main schedule.\n" + echo "export MAIN=\"$1\"" > $config/schedule/config + export MAIN="$1" +} + +choose(){ + echo "export MAIN=\"$1\"" > $config/schedule/config + export MAIN="$1" + echo "$1 set as main schedule." +} + +list(){ + find $dir/ -type d | tail -n +2 +} + +_day(){ + case "$(date +%u)" in + 1) day=mon ;; + 2) day=tue ;; + 3) day=wed ;; + 4) day=thu ;; + 5) day=fri ;; + 6) day=sat ;; + 7) day=sun ;; + *) echo "Could not determine day of the week... exiting."; exit 1 ;; + esac +} + +_copy(){ + _day + printf "#DATE: $(date +%d/%m/%y)\n#the above note is core to schedule(1)'s functionality\n#to 'complete' a task, delete it, then save this file.\n" | cat /dev/stdin $dir/$MAIN/$day > $current +} + +today(){ + # doing some checks + [ -f $current ] && { + date=$(grep -o '^#DATE: [0-9/]*' < $current | sed 's/^#DATE: //g') + rdate=$(date +%d/%m/%y) + echo "'$date' '$rdate'" + [ "$date" != "$rdate" ] && _copy + } || _copy + [ -z $EDITOR ] && { + print "Please set the \$EDITOR variable in the future.\nEDITOR: " + read EDITOR < /dev/tty + export $EDITOR + } + $EDITOR $current +} + +num(){ + # doing some checks + [ -f $current ] && { + date=$(grep -o '^#DATE: [0-9/]*' < $current | sed 's/^#DATE: //g') + rdate=$(date +%d/%m/%y) + echo "'$date' '$rdate'" + [ "$date" != "$rdate" ] && _copy + } || _copy + count=0 + for time in $(grep "^===" < $current | sed 's/^===//g;s/://g') + do + rtime=$(date +%H%M) + [ $rtime -ge $time ] && count=$(($count+1)) + done + echo $count +} + +echo(){ + printf '%s\n' "$@" +} + +mkdir -p $dir +[ -z $1 ] && usage +while [ "$#" != "0" ] +do + echo "$1" | grep "[a-zA-Z0-0]=" >/dev/null && { + arg_opt=$(echo "$1" | sed 's/=.*//g') + arg_opr=$(echo "$1" | sed 's/.*=//g') + } || { + arg_opt="$1" + echo "$arg_opt" | grep -E -- '-n|-c' >/dev/null && { + shift + arg_opr="$1" + } + } + case "$arg_opt" in + -n) new "$arg_opr" ;; + -c) choose "$arg_opr" ;; + -l) list ;; + -t) today ;; + -o) num ;; + *) echo "$arg_opt not recognized"; usage ;; + esac + shift +done diff --git a/.scripts/bin/misc/urlhand b/.scripts/bin/misc/urlhand @@ -1,6 +1,6 @@ #!/bin/bash -link=$(awk '/https*:\/\/|gopher:\/\//' < /dev/stdin | sed 's/.*http/http/g;s/.*gopher/gopher/g' | tr -d '<[]>' | awk '{print $1}' | sort | dmenu -i -p "Select a url:") +link=$(grep -Eo 'https://[A-Za-z0-9\.&%?\/\=_-+]*|http://[A-Za-z0-9\.&%?\/\=_-+]*|gopher://[A-Za-z0-9\.&%?\/\=_-+]*' < /dev/stdin 2>/dev/null| dmenu -i -p 'Select url') IFS=$'\n' @@ -11,6 +11,7 @@ youtube-dl --add-metadata -xic vimb --no-maximize xclip webimg +webkmv st -e curl" | dmenu -i -p "Select a handler:") pkill mpvlisten diff --git a/.scripts/bin/misc/webmkv b/.scripts/bin/misc/webmkv @@ -0,0 +1,4 @@ +#!/bin/sh + +curl "$1" > /tmp/webmkv +mpv /tmp/webmkv diff --git a/.scripts/custom/dock b/.scripts/custom/dock @@ -6,5 +6,4 @@ do done xrandr $ds --output VGA1 --mode 1920x1080 --primary --pos 0x0 -xrandr --output HDMI2 --mode 1920x1080 --pos 1920x0 - +xrandr --output HDMI2 --mode 1920x1080 --pos 1920x0 --rotate left diff --git a/.scripts/custom/xstuff b/.scripts/custom/xstuff @@ -3,5 +3,7 @@ sudo mount.nfs4 192.168.1.20:/srv/storage general/ sh $HOME/.scripts/custom/dock nohup redshift & +nohup wallblur & +xsetroot -cursor_name sailboat rm nohup.out ssh root@haydenvh.com diff --git a/.scripts/dwmblocks/bat b/.scripts/dwmblocks/bat @@ -6,27 +6,31 @@ # haydenvh.com # Copyright (c) 2019 Hayden Hamilton. -printf "[B " +setunfull(){ + [ "$full" != "y" ] && unfull="y" +} + +unset unfull for b in $(find /sys/class/power_supply -name "BAT*") do read charge < $b/capacity read stat < $b/status case "$stat" in - Charging) stat="^c#00ff00^+" ;; - Discharging) stat="^c#aa5555^-" ; dis="y" ;; - Full) stat="^c#00ff00^^r0,3,10,9^^f2^^c#00ff00^!^c#00ff00^^f8^" ; charge="" ;; + Charging) stat="^c#00ff00^+" && setunfull;; + Discharging) stat="^c#aa5555^-" && setunfull ;; + Full) stat="^c#00ff00^^r0,3,10,9^^f2^^c#00ff00^!^c#00ff00^^f8^" ; charge="" ; full="y" ;; *) stat="^c#aaaaaa^" ;; esac - [ "$charge" = "100" ] || [ "$charge" = "99" ] && stat="^c#00ff00^" && charge="$charge!" - [ $charge -le 10 ] && stat="^c#ff0000^!!!" + [ "$charge" = "100" ] || [ "$charge" = "99" ] && stat="^c#00ff00^^r0,3,10,9^^f2^^c#00ff00^!^c#00ff00^^f2^" && charge="" || setunfull + [ $charge -le 10 ] && stat="^c#ff0000^!!!" printf "%s:%s%s" "^c#aaaaaa^$(echo "$b" | grep -o "[0-9]*$")" "$stat" "$charge" - unset dis -done -printf "]" + unset full +done > /tmp/bat +[ "$unfull" = "y" ] && read output < /tmp/bat && printf "[B $output]" echo echo echo \#C625C8 diff --git a/.scripts/dwmblocks/cpu b/.scripts/dwmblocks/cpu @@ -6,9 +6,7 @@ # haydenvh.com # Copyright (c) 2019 Hayden Hamilton. -cpup=$(ps -e -o %cpu | awk '{s+=$1} END {print s}' | sed 's/\..*$//g') -cpuc=$(lscpu | awk '/^CPU\(s\):/{print $2}') -cpu=$(($cpup/$cpuc)) +cpu=$(ps -e -o %cpu | awk '{s+=$1} END {print s}' | sed 's/\..*$//g') tempt=$(acpi -t | awk '{s+=$4} END {print s}') tempc=$(acpi -t | wc -l) temp=$(($tempt/$tempc)) diff --git a/.scripts/dwmblocks/dwmbar b/.scripts/dwmblocks/dwmbar @@ -20,6 +20,7 @@ while true do block mpv block time + block time2 sleep 1 done & @@ -29,7 +30,8 @@ do block news block disk block disk2 - block time2 + block mail + block rem sleep 20 done & @@ -37,5 +39,11 @@ cd /tmp/blocks while true do 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' ' ') " + xsetroot -name "$(for void in $(seq 150); do printf " "; done) $(cat mpv bat cpu disk disk2 mem net news mail rem 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 & + +while true +do + sleep 200 + nohup cvrestart & done diff --git a/.scripts/dwmblocks/mail b/.scripts/dwmblocks/mail @@ -0,0 +1,6 @@ +#!/bin/sh +read LINE < /tmp/mail +[ "$LINE" = '' ] && exit 1 +echo "[$LINE]" +echo +echo \#000000 diff --git a/.scripts/dwmblocks/mem b/.scripts/dwmblocks/mem @@ -6,6 +6,6 @@ # haydenvh.com # Copyright (c) 2019 Hayden Hamilton. -echo "[M $(free -h | awk '/^Mem:/ {print $3 "/" $2}')]" +echo "[M $(free -h | awk '{print $3 "/" $2}' | head -n 2 | tail -n 1)]" echo echo \#007dc1 diff --git a/.scripts/dwmblocks/mpv b/.scripts/dwmblocks/mpv @@ -8,12 +8,16 @@ file2=$(echo '{command:["get_property", "media-title"]}' | socat - /tmp/mpv-socket | tr "." " " | sed 's/opus//g' | sed 's/mp3//g' | sed 's/mkv//g' | sed 's/flac//g' | sed 's/webm//g' | sed 's/part//g' | tr '"\{:,}[' ' ' | sed 's/data//g' | sed 's/request_id 0//g' | sed 's/error success//g' | sed 's/ //g' | tail -c +2 | sed 's/$//g' | tr "()'" " " | sed 's/ / /g' |sed 's/ / /g' | sed 's/ / /g' | sed 's/ / /g') vidtitle2=$(echo '{command:["get_property", "media-title"]}' | socat - /tmp/mpv-socket2 | tr '"{:,}\[' ' ' | sed 's/data//g' | sed 's/request_id 0//g' | sed 's/error success//g' | sed 's/ / /g' | sed 's/ / /g' | sed 's/ / /g' | sed 's/ / /g' | sed 's/^//g') +radtitle=$(echo '{command:["get_property", "metadata/icy-title"]}' | socat - /tmp/mpv-socket3 | tr '"{:,}\[' ' ' | sed 's/data//g' | sed 's/request_id 0//g' | sed 's/error success//g' | sed 's/ / /g' | sed 's/ / /g' | sed 's/ / /g' | sed 's/ / /g' | sed 's/^//g') state=$(echo '{ "command": ["get_property", "pause"] }' | socat - /tmp/mpv-socket | tr '{":0,}' ' ' | awk '// {print $2}') state2=$(echo '{ "command": ["get_property", "pause"] }' | socat - /tmp/mpv-socket2 | tr '{":0,}' ' ' | awk '// {print $2}') +state3=$(echo '{ "command": ["get_property", "pause"] }' | socat - /tmp/mpv-socket3 | tr '{":0,}' ' ' | awk '// {print $2}') artist=$(echo '{ "command": ["get_property", "metadata/artist"] }' | socat - /tmp/mpv-socket | tr '{":0,}' ' ' | sed 's/[[:space:]]*data[[:space:]]*//g;s/[[:space:]]*request_id.*$//g') artist2=$(echo '{ "command": ["get_property", "metadata/artist"] }' | socat - /tmp/mpv-socket2 | tr '{":0,}' ' ' | sed 's/[[:space:]]*data[[:space:]]*//g;s/[[:space:]]*request_id.*$//g') +artist3=$(echo '{ "command": ["get_property", "metadata/icy-artist"] }' | socat - /tmp/mpv-socket3 | tr '{":0,}' ' ' | sed 's/[[:space:]]*data[[:space:]]*//g;s/[[:space:]]*request_id.*$//g') [ "$artist" != "" ] && artist="$artist - " [ "$artist2" != "" ] && artist2="$artist2 - " +[ "$artist3" != "" ] && artist3="$artist3 - " convertsecs() { h=$((${1}/3600)) m=$((${1}%3600)) @@ -24,7 +28,11 @@ convertsecs() { time=$(convertsecs $(echo '{ "command": ["get_property", "playback-time"] }' | socat - /tmp/mpv-socket | tr '{":,}' ' ' | awk '// {print $2}' | sed 's/\./ /g' | awk '// {print $1}')) time2=$(convertsecs $(echo '{ "command": ["get_property", "playback-time"] }' | socat - /tmp/mpv-socket2 | tr '{":,}' ' ' | awk '// {print $2}' | sed 's/\./ /g' | awk '// {print $1}')) -if [ "$state" = "false" ] +if [ "$state3" = "false" ] +then + out="$(echo "PLAY - RADIO - $artist3$radtitle" | cut -zc-60)" + color="true" +elif [ "$state" = "false" ] then out="$(echo "PLAY - MUSIC - $artist$file2" | cut -zc-60) - $time" color="true" @@ -33,6 +41,9 @@ then if [ "$state2" = "false" ] then out="$(echo "PLAY - VIDEO - $artist2$vidtitle2" | cut -zc-60) - $time2" + elif [ "$state3" = "true" ] + then + out="$(echo "STOP - RADIO - $artist3$radtitle" | cut -zc-60)" else out="$(echo "STOP - MUSIC - $artist$file2" | cut -zc-60) - $time" fi @@ -46,8 +57,7 @@ then out="$(echo "STOP - VIDEO - $artist2$vidtitle2" | cut -zc-60) - $time2" color="true" else - out=" NONE" - color="true" + color="false" fi if [ "$color" = "true" ] then @@ -61,7 +71,3 @@ else echo "Nothing set?... Exiting" exit 1 fi -if [ "$BLOCK_BUTTON" = "1" ] -then - dunstify "Currently playing" "$file\n$vidtitle" -fi diff --git a/.scripts/dwmblocks/news b/.scripts/dwmblocks/news @@ -8,7 +8,7 @@ newsboat -x reload 2>/dev/null unread=$(newsboat -x print-unread | sed 's/ unread articles//g') - -echo "[NEWS $unread]" +[ "$unread" = "0" ] || [ "$unread" = "" ] && exit 1 +echo "[NWS $unread]" echo echo \#498364 diff --git a/.scripts/dwmblocks/rem b/.scripts/dwmblocks/rem @@ -0,0 +1,6 @@ +#!/bin/sh +rem=$(remind -n) +[ "$rem" = "0" ] && exit 1 +echo "[Reminders: ^c#892b2b^$rem!!]" +echo +echo \#000000 diff --git a/.scripts/random/example-args.sh b/.scripts/random/example-args.sh @@ -0,0 +1,21 @@ +#!/bin/sh +# not to be run + +while [ "$#" != "0" ] +do + echo "$1" | grep "[a-zA-Z0-0]=" >/dev/null && { + arg_opt=$(echo "$1" | sed 's/=.*//g') + arg_opr=$(echo "$1" | sed 's/.*=//g') + } || { + arg_opt="$1" + echo "$arg_opt" | grep -E -- '--blargh|-b' >/dev/null && { + shift + arg_opr="$1" + } + } + case "$arg_opt" in + --blargh|-b) do_blargh "$arg_opr" ;; + *) echo "$arg_opt not recognized"; usage ;; + esac + shift +done diff --git a/.zprofile b/.zprofile @@ -3,7 +3,7 @@ # Created by Hayden Hamilton # # haydenvh.com -# Copyright (c) 2019 Hayden Hamilton. LICENSE:GPLv2 ./licenses/gplv2.license +# Copyright (c) 2019 Hayden Hamilton. LICENSE:MIT # export LC_CTYPE="en_US.UTF-8" @@ -39,3 +39,18 @@ export XDG_DATA_DIRS=/usr/local/share:/usr/share:$HOME/.local/share export XAUTHORITY=$HOME/.local/.xauth export LESSHISTFILE=- export GNUPGHOME=$HOME/.local/gnupg + +export LANG=sv_SE.UTF-8 +export LC_CTYPE="sv_SE.UTF-8" +export LC_NUMERIC="sv_SE.UTF-8" +export LC_TIME=sv_SE.UTF-8 +export LC_COLLATE=sv_SE.UTF-8 +export LC_MONETARY="sv_SE.UTF-8" +export LC_MESSAGES="sv_SE.UTF-8" +export LC_PAPER="sv_SE.UTF-8" +export LC_NAME="sv_SE.UTF-8" +export LC_ADDRESS="sv_SE.UTF-8" +export LC_TELEPHONE="sv_SE.UTF-8" +export LC_MEASUREMENT="sv_SE.UTF-8" +export LC_IDENTIFICATION="sv_SE.UTF-8" +export LC_ALL=