dotfiles

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

commit a121c00e0de9f61678815b9689e7945b10cd5d75
parent 6cac815a0cac5a555dd5a75eac9efb46fa224688
Author: Hayden Hamilton <hayden@haydenvh.com>
Date:   Thu, 19 Mar 2020 13:29:55 +0000

stuff

Diffstat:
M.config/nvim/colors/haydenh.vim | 27+++++++++++++++++----------
M.config/nvim/init.vim | 4++--
M.config/nvim/modules/message.vim | 12+++---------
M.config/nvim/modules/netrw.vim | 2+-
M.config/nvim/modules/splits.vim | 4++--
M.config/nvim/modules/statusline.vim | 2++
M.config/zsh/.zshrc | 9+++++++++
M.config/zsh/functions | 3+++
M.profile | 2+-
A.scripts/bin/display/rwall | 53+++++++++++++++++++++++++++++++++++++++++++++++++++++
M.scripts/bin/display/wallblur | 33+++++----------------------------
M.scripts/bin/dmenu/dfm | 258+++++++++++++++++++++++++++++++++++++++++++------------------------------------
A.scripts/bin/misc/open | 7+++++++
M.xinitrc | 1+
14 files changed, 246 insertions(+), 171 deletions(-)

diff --git a/.config/nvim/colors/haydenh.vim b/.config/nvim/colors/haydenh.vim @@ -1,7 +1,7 @@ " Vim color file " Firstcreated by: Ron Aaron <ron@ronware.org> " Modified by: Hayden Hamilton <hayden@haydenvh.com> -" Last Change: 14th March 2020 +" Last Change: 17 March 2020 set background=dark hi clear @@ -18,6 +18,7 @@ hi identifier ctermfg=14 guifg=#434343 gui=NONE hi statement ctermfg=11 guifg=#a1a1d9 gui=NONE hi preproc ctermfg=44 guifg=#00d7d7 gui=none hi type ctermfg=85 guifg=#5fffaf gui=none +"hi type ctermfg=243 guifg=#767676 gui=none hi special ctermfg=255 guifg=#eeeeee gui=none hi link ErrorMsg Error hi link WarningMsg Error @@ -28,6 +29,7 @@ hi title ctermfg=225 guifg=#ffd7ff gui=none " hi ShowMarksHL ctermfg=cyan ctermbg=lightblue cterm=bold guifg=yellow guibg=black gui=bold hi label ctermfg=255 guifg=#eeeeee gui=none hi operator ctermfg=240 guifg=#585858 gui=none +hi link Operator operator hi clear Visual hi Visual cterm=reverse gui=reverse " hi DiffChange guibg=darkgreen @@ -40,16 +42,21 @@ hi FoldColumn cterm=none ctermfg=249 ctermbg=1 guifg=#b2b2b2 gui=none " hi diffOnly guifg=red gui=bold " Following section entirely created by Hayden Hamilton -hi Error ctermbg=10 ctermfg=0 guifg=#892b2b guibg=#141726 gui=none +hi Error ctermfg=10 ctermbg=0 guifg=#892b2b guibg=#141726 gui=none +hi NvimInternalError ctermfg=10 ctermbg=0 guifg=#892b2b guibg=#141726 gui=none +hi ErrorMsg ctermfg=0 ctermbg=10 guibg=#892b2b guifg=#141726 gui=none +hi WarningMsg ctermfg=0 ctermbg=10 guibg=#590b0b guifg=#141726 gui=none +hi MsgArea ctermbg=0 guibg=#141726 gui=none +hi MsgSeparator ctermbg=1 guibg=#24283c gui=none hi Todo cterm=bold ctermbg=3 ctermfg=255 guibg=#31364b guifg=#eeeeee gui=none,bold -hi link NvimInternalError Error -hi Float ctermfg=13 cterm=bold guifg=#a84b8d gui=none,bold -hi LineNr ctermfg=11 guifg=#a1a1d9 gui=none -hi link CursorLineNr LineNr -hi CursorLineNr gui=bold cterm=bold guifg=#a1a1d9 -hi SpellBad ctermbg=1 ctermfg=10 guifg=#24283c guibg=#24283c gui=none +hi Number ctermfg=13 guifg=#a84b8d +hi link Float Number +hi link Constant Number +hi LineNr ctermfg=11 guifg=#616199 gui=none +hi CursorLineNr ctermfg=11 gui=bold cterm=bold guifg=#a1a1d9 +hi SpellBad ctermbg=1 ctermfg=10 guifg=#892b2b guibg=#24283c gui=none hi SpellCap ctermbg=1 ctermfg=13 guifg=#a84b8d guibg=#24283c gui=none hi SpellRare ctermbg=1 ctermfg=none cterm=underline guifg=none guibg=#24283c gui=none,underline hi SpellLocal ctermbg=1 ctermfg=255 cterm=bold guifg=#eeeeee gui=none,bold -hi MsgArea ctermbg=0 guibg=#141726 gui=none -hi MsgSeparator ctermbg=1 guibg=#24283c gui=none +hi MatchParen ctermfg=30 cterm=reverse guifg=#003740 gui=reverse +hi Underlined cterm=underline ctermfg=23 gui=underline guifg=#005f5f diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim @@ -142,14 +142,14 @@ noremap <leader>li :call ToggleIPA()<CR> inoremap <leader>li <esc>:call ToggleIPA()<CR>a "An erotic file-browser -noremap <leader>eh :Sex \| set linebreak<CR> -noremap <leader>ev :Vex \| set linebreak<CR> +noremap <leader>ev :Lexplore \| set linebreak<CR> noremap <leader>ee :Explore noremap <leader>eo :browse oldfiles \| set linebreak<CR> noremap <leader>eb 100j let g:netrw_liststyle=3 let g:netrw_banner=0 let g:netrw_altv=1 +let g:netrw_winsize=20 "Remove arrow keys no <Up> <Nop> diff --git a/.config/nvim/modules/message.vim b/.config/nvim/modules/message.vim @@ -19,12 +19,6 @@ function! SpawnLauncher() call Winset() endfunction -function! FzfLauncher() - call Winmsg() - " fzf - call Winset() -endfunction - function! LauncherRecent() rshada! let olist=v:oldfiles @@ -34,7 +28,7 @@ function! LauncherRecent() redir! >/tmp/vim-recent.1 | silent! echo '' | silent! echo '' | silent! echo 'Config files:' | redir END redir! >/tmp/vim-recent.2 | silent! echo '' | silent! echo '' | silent! echo 'Recent files (cwd):' | redir END redir! >/tmp/vim-recent.3 | silent! echo '' | silent! echo '' | silent! echo 'General:' | redir END - redir! >/tmp/vim-recentcmd.vim | silent! echo ':silent! unmap <buffer> <c-k>' | silent! echo ':silent! unmap <buffer> q' | silent! echo 'nnoremap <buffer> q :q<CR>:new<CR>:only<CR>' | silent! echo ':silent! unmap <buffer>Q' | silent! echo ':no <buffer> Q :qa!<CR>' | silent! echo ':nnoremap <buffer>: <CR>' | redir END + redir! >/tmp/vim-recentcmd.vim | silent! echo ':silent! unmap <buffer> <c-k>' | silent! echo ':silent! unmap <buffer> q' | silent! echo 'nnoremap <buffer> q :q<CR>:new<CR>:only<CR>:let g:netrw_winsize=20<CR>:Lexplore<CR><c-w>l' | silent! echo ':silent! unmap <buffer>Q' | silent! echo ':nnoremap <buffer> Q :qa!<CR>' | silent! echo ':nnoremap <buffer>: <CR>' | redir END for string in olist let string=substitute(string, $HOME, "~", "") if i=='10' @@ -49,10 +43,10 @@ function! LauncherRecent() endfor let i=10 for string in olist - let string=substitute(string, $HOME, "~", "") if i=='20' break - elseif stridx(string, "~") != '-1' && stridx(string, "NetrwTreeListing") == '-1' && stridx(string, "/tmp/vim-recent") == '-1' && stridx(string, expand("~/.config/nvim/startup.greet")) == '-1' + elseif stridx(string, getcwd()) != '-1' && stridx(string, "NetrwTreeListing") == '-1' && stridx(string, "/tmp/vim-recent") == '-1' && stridx(string, "~/.config/nvim/startup.greet") == '-1' + let string=substitute(string, $HOME, "~", "") redir >>/tmp/vim-recent.2 | silent! echo '[' . i . '] ' . string | redir END redir >>/tmp/vim-recentcmd.vim | silent! echo ':silent! unmap <buffer> ' . i | silent! echo ':nnoremap <buffer> ' . i . ' :q<CR>:edit ' . string '<CR>' | redir END else diff --git a/.config/nvim/modules/netrw.vim b/.config/nvim/modules/netrw.vim @@ -1,4 +1,4 @@ function! Configurenetrw() - silent! nunmap! <buffer> <c-l> + silent! nunmap <buffer> <c-l> nnoremap <buffer> <c-l> <c-w>l endfunction diff --git a/.config/nvim/modules/splits.vim b/.config/nvim/modules/splits.vim @@ -14,7 +14,7 @@ noremap <A-l> <C-w>< function! Netrwmap(filetype) if a:filetype == 'netrw' - unmap! <c-l> + silent! unmap! <c-l> noremap! <C-l> <C-w>l endif @@ -27,6 +27,6 @@ augroup Netrwstop autocmd WinEnter,BufEnter * let _void=Netrwmap(_filetype) augroup END -set fillchars+=vert:\ +set fillchars+=vert:\| hi VertSplit ctermbg=1 ctermfg=1 guifg=#24283c guibg=#24283c hi link StatusLine VertSplit diff --git a/.config/nvim/modules/statusline.vim b/.config/nvim/modules/statusline.vim @@ -150,8 +150,10 @@ function! Choosestatus(active, filetype) "Overwrite if special let s="term" if a:filetype == 'netrw' && a:active == '1' + let g:s="" let statusline=NetrwAstatus() elseif a:filetype == 'netrw' + let g:s="" let statusline=NetrwIstatus() elseif stridx(expand('%:p'), s) == '0' && a:active == '1' let statusline=TermAstatus() diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc @@ -43,6 +43,15 @@ key[ShiftTab]="${terminfo[kcbt]}" # Functions . $HOME/.config/zsh/functions +# Highlighted man pages +export LESS_TERMCAP_mb=$'\e[1;32m' +export LESS_TERMCAP_md=$'\e[1;35m' +export LESS_TERMCAP_me=$'\e[0m' +export LESS_TERMCAP_se=$'\e[0m' +export LESS_TERMCAP_so=$'\e[01;33m' +export LESS_TERMCAP_ue=$'\e[0m' +export LESS_TERMCAP_us=$'\e[1;4;32m' + # Syntax highlighting typeset -A ZSH_HIGHLIGHT_STYLES . /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh diff --git a/.config/zsh/functions b/.config/zsh/functions @@ -39,6 +39,9 @@ make(){ } man(){ + cols=$(tput cols) + [ "$cols" -gt "120" ] && export MANWIDTH=120 + [ "$cols" -lt "120" ] && export MANWIDTH=$cols command man -c "$@" | centre } diff --git a/.profile b/.profile @@ -12,7 +12,7 @@ export LC_ALL="C" export SCRIPTS="$HOME/.scripts/bin" scripts=$(ls -d $SCRIPTS/*/ | tr '\n' ':') export PATH="$PATH:$scripts" -export EDITOR="vim" +export EDITOR="nvim" export TERMINAL="st" export BROWSER="vimb" export work="$HOME/work" diff --git a/.scripts/bin/display/rwall b/.scripts/bin/display/rwall @@ -0,0 +1,53 @@ +#!/bin/sh + +for arg in "$@" +do + case $arg in + --left) monitors="$monitors left" ;; + --right) monitors="$monitors right" ;; + --all) monitors="" ;; + --prev|--back) doprev=1 ;; + *) dir="$arg" ;; + esac +done + +setwall(){ + files=$(echo "$1" | sed 's/^[[:space:]]*//' | tr " " "\n" | sed "s~^~--output OUTPUT --zoom ~g" | tr "\n" " ") + for OUTPUT in $(xrandr --listactivemonitors | awk '$4 {print $4}') + do + files=$(echo "$files" | sed "s/OUTPUT/$OUTPUT/") + done + xwallpaper $files +} + +randomizer(){ + found=$(find $dir -type f \( -name "*.png" -o -name "*.jpg" \)) + fnum=$(echo "$found" | wc -l) + sran=$(od -vAn -N2 -tu2 < /dev/urandom) + nran=$((1+$sran%$fnum)) + echo "$found" | awk "NR==$nran {print"' $0}' +} + +randomizerM(){ + for void in $(seq $(xrandr --listactivemonitors | awk '/Monitors/ {print $2}')) + do + output="$output $(randomizer)" + done + echo "$output" +} + +[ "$doprev" == "1" ] && { + [ "$monitors" == "" ] && files=$(tail -2 < ~/.cache/rfeh/prev | head -1) && head -n -1 < ~/.cache/rfeh/prev | tee ~/.cache/rfeh/prev > /dev/null + [ "$(echo "$monitors" | grep "left")" != "" ] && files="$(tail -2 < ~/.cache/rfeh/left | head -1) $(tail -1 < ~/.cache/rfeh/right)" && head -n -1 < ~/.cache/rfeh/left | tee ~/.cache/rfeh/left > /dev/null + [ "$(echo "$monitors" | grep "right")" != "" ] && files="$(tail -1 < ~/.cache/rfeh/left) $(tail -2 < ~/.cache/rfeh/right | head -1)" && head -n -1 < ~/.cache/rfeh/right | tee ~/.cache/rfeh/right > /dev/null + echo "$files" + setwall "$files" +} || { + [ "$monitors" == "" ] && files=$(randomizerM) + [ "$(echo "$monitors" | grep "left")" != "" ] && files="$(randomizer) $(tail -1 < ~/.cache/rfeh/right)" + [ "$(echo "$monitors" | grep "right")" != "" ] && files="$(tail -1 < ~/.cache/rfeh/left) $(randomizer)" + echo "$files" | awk '{print $1}' >> ~/.cache/rfeh/left + echo "$files" | awk '{print $2}' >> ~/.cache/rfeh/right + echo "$files" >> ~/.cache/rfeh/prev + setwall "$files" +}; diff --git a/.scripts/bin/display/wallblur b/.scripts/bin/display/wallblur @@ -7,17 +7,12 @@ # Copyright (c) 2019 Hayden Hamilton. backend="xwallpaper" +args="$@" +echo "$args" -cachebool="$1" -if [ "$(echo $1 | awk '/help/ {print $0}')" != "" ] -then - echo 'wallblur ["true" for file caching] - -Written by Hayden Hamilton <hayden@haydenvh.com>' - exit 0 -fi +[ "$args" == "" ] && args=2 donorm(){ - convert $file -colors 2 $1 + convert $file -colors $args $1 files+="$1 " } input=$(cat ~/.cache/rfeh/prev) @@ -26,25 +21,7 @@ files="" for file in $input do count=$(($count+1)) - if [ "$cachebool" == "true" ] - then - file2=$(echo $file | sed "s~$HOME~$HOME/.cache/rfeh~g") - if [ -f $file2 ] - then - files+="$file2 " - else - file3=$(echo $file2 | sed 's~/~/ ~g' | awk 'sub(FS $NF,x)' | sed 's~/ ~/~g') - if [ -d $file3 ] - then - echo > /dev/null - else - mkdir -p $file3 - fi - donorm "$file2" - fi - else - donorm "/tmp/screen${count}.png" - fi + donorm "/tmp/screen${count}.png" done [ "$backend" = "xwallpaper" ] && { files=$(echo "$files" | tr " " "\n" | sed "s~^~--output OUTPUT --zoom ~g" | tr "\n" " ") diff --git a/.scripts/bin/dmenu/dfm b/.scripts/bin/dmenu/dfm @@ -10,7 +10,6 @@ if [ "$(echo $1 | awk '/help/ {print}')" != "" ] then echo "dfm [fm for standard mode/name of program for file-selection] [/path/to/dir - enter at start] - $(tput bold)CONFIG:$(tput sgr0) DFM_CONF_DIR=[insert /path/to/confdir] <-- Default: $HOME/.config/dfm DFM_DOT=[0/1 to show dotfiles] <-- Default: 1 @@ -19,18 +18,19 @@ DFM_DISABLE_ENQUEUE=[0/1 to never enqueue input] <-- Default: 0 DFM_SCREENSHOT_CMD=\"[insert program name]\" <-- Default: \"maim -s\" DFM_CLIPBOARD_TYPE=\"[PRIMARY/CLIPBOARD/CUSTOM]\" <-- Default: \"PRIMARY\" DFM_CLIPBOARD_CUSTOM=\"[insert program for clipboard]\" <-- Default: \"xclip\" - $(tput bold)CONFIGURING COMMANDS FOR FILE TYPES:$(tput sgr0) Syntax DFM_FILETYPE_[insert filetype in all caps]=\"[insert program name]\" ^ For example, .mkv is MKV ^ For example mpv When in standard file management mode, you will now get the option to automatically select a program to launch. - Written by Hayden Hamilton <haydenvh.com>" exit 0 fi forn1="$1" lsforce="$3" -[ "$1" == "" ] && export forn1="fm" +if [ "$1" == "" ] +then + export forn1="fm" +fi getconf(){ dmenu="dmenu" @@ -40,15 +40,23 @@ getconf(){ DFM_CLIPBOARD_TYPE="PRIMARY" . $HOME/.dmenurc . $HOME/.config/dfm/config - [ "$DFM_USE_HH_PATCH" == "1" ] && dmenu="$dmenu -c -w 1000" - - case "$DFM_CLIPBOARD_TYPE" in - PRIMARY) clipboard="xclip" ;; - CLIPBOARD) clipboard="xclip -selection clipboard" ;; - CUSTOM) clipboard="$DFM_CLIPBOARD_CUSTOM" ;; - esac - [ "$DFM_CLIPBOARD_TYPE" = "" ] && clipboard="xclip" - + if [ "$DFM_USE_HH_PATCH" == "1" ] + then + dmenu="$dmenu -c -w 1000" + fi + if [ "$DFM_CLIPBOARD_TYPE" == "PRIMARY" ] + then + clipboard="xclip" + elif [ "$DFM_CLIPBOARD_TYPE" == "CLIPBOARD" ] + then + clipboard="xclip -selection clipboard" + elif [ "$DFM_CLIPBOARD_TYPE" == "CUSTOM" ] + then + clipboard="$DFM_CLIPBOARD_CUSTOM" + else + clipboard="xclip" + fi + echo $clipboard confdir="$DFM_CONF_DIR" conffile="$confdir/config" } @@ -68,40 +76,46 @@ sendconf(){ } fmornorm(){ - [ "$forn1" == "fm" ] && { + if [ "$forn1" == "fm" ] + then output2=$(echo "$fmcmd2" | $dmenu -l 30 -i -p "Select command:") fmspecial - } || { + else dooutput - [ "$doarg" == "true" ] && { + if [ "$doarg" == "true" ] + then echo $forn1 $forn1 $argu argu="" - }; - }; + fi + fi } dooutput(){ [ "$DFM_DISABLE_ENQUEUE" != "1" ] && enqueue=$(echo "DO ENQUEUE" | tr " " "\n" | $dmenu -i -p "What do you want to do?") - [ "$enqueue" == "ENQUEUE" ] && { + if [ "$enqueue" == "ENQUEUE" ] + then argu+="$(pwd)/$output " doarg="false" - } || { + else argu+="$(pwd)/$output " doarg="true" - }; + fi } getdot(){ - [ "$lsforce" != "" ] && { + if [ "$lsforce" != "" ] + then lscommand="$lsforce" - } || [ "$DFM_DOT" == "1" ] && { + elif [ "$DFM_DOT" == "1" ] + then lscommand="ls -A" - } || [ "$DFM_DOT" == "0" ] && { + elif [ "$DFM_DOT" == "0" ] + then lscommand="ls" - } || { + else lscommand="ls -A" - }; + fi } getprog(){ @@ -122,35 +136,34 @@ sendscrn0x0(){ } fmspecial(){ - case "$output2" in - "AUTO - Check config for program to use") - getprog "$output" - [ "$commandout" != "" ] && $commandout $output $argu - [ "$commandout" == "" ] && echo "No program set..." - ;; - "RM - Remove file") - rm $output - ;; - "CMD - Specific command") - output3=$(dmenu_path | $dmenu -i -p "Select program") - $output3 $output $argu - argu="" - ;; - "MV - Move file") - output3=$(echo "" | $dmenu -i -p "Move to:") - mv $output $output3 - ;; - "EDIT - Open with $EDITOR") - $EDITOR $output $argu - argu="" - ;; - "QUE - Enqueue") - argu+="$output " - ;; - "SND - Send to 0x0.st") - send0x0 - ;; - esac + if [ "$output2" == "AUTO - Check config for program to use" ] + then + getprog "$output" + [ "$commandout" != "" ] && $commandout $output $argu + [ "$commandout" == "" ] && echo "No program set..." + elif [ "$output2" == "RM - Remove file" ] + then + rm $output + elif [ "$output2" == "CMD - Specific command" ] + then + output3=$(dmenu_path | $dmenu -i -p "Select program") + $output3 $output $argu + argu="" + elif [ "$output2" == "MV - Move file" ] + then + output3=$(echo "" | $dmenu -i -p "Move to:") + mv $output $output3 + elif [ "$output2" == "EDIT - Open with $EDITOR" ] + then + $EDITOR $output $argu + argu="" + elif [ "$output2" == "QUE - Enqueue" ] + then + argu+="$output " + elif [ "$output2" == "SND - Send to 0x0.st" ] + then + send0x0 + fi } cd $2 @@ -174,72 +187,81 @@ CMD - Specific command EDIT - Open with $EDITOR QUE - Enqueue SND - Send to 0x0.st" - [ "$output" == "FM" ] && { + if [ "$output" == "FM" ] + then output=$(echo "$fmcmd1" | $dmenu -l 30 -i -p "Select command:") - case "$output" in - "MD - Make dir") - output2=$(echo "" | $dmenu -i -p "Name dir:") - mkdir $output2 - ;; - "MF - Make file") - output2=$(echo "" | $dmenu -i -p "Name file:") - touch $output2 - ;; - "BM - Bookmarks") - touch ~/.config/dfm/bookmarks - output=$(echo "MK DEL $(cat ~/.config/dfm/bookmarks | awk '// {print $1}')" | tr "\n" " " | tr " " "\n" | $dmenu -l 30 -i -p "Select file/directory:") - [ "$output" == "MK" ] && { - output=$(echo "" | $dmenu -i -p "Choose bookmark name(no spaces):") - output2=$(echo "" | $dmenu -i -p "Choose bookmark path(absolute):") - echo "$output $output2" >> ~/.config/dfm/bookmarks - } || [ "$output" == "DEL" ] && { - output=$(echo "$(cat $confdir/bookmarks | awk '// {print $1}')" | $dmenu -l 30 -i -p "Select bookmark to delete:") - [ "$(cat $confdir/bookmarks | awk "/$output/ {print"' $1}')" == "$output" ] && sed -i "/$output/d" $confdir/bookmarks - } || { - output=$(cat ~/.config/dfm/bookmarks | awk "/$output/"' {print $2}') - output2=$(echo "$fmcmd2" | $dmenu -l 30 -i -p "Select command:") - fmspecial - }; - ;; - "FND - Find") - output=$(echo "" | $dmenu -i -p "Enter name of file:") - output2=$(printf "ROOT (Takes a while)\nLOCALLY" | $dmenu -i -p "Find option") - [ "$(echo $output2 | awk '/ROOT/')" != "" ] && { - echo "May take a while..." - output3="/" - } || { - output3="." - }; - output=$(echo "NONE $(find $output3 | grep -i "$output")" | tr " " "\n" | $dmenu -i -l 30 -p "Select file:") - [ "$output" == "NONE" ] && { - echo > /dev/null - } || { - fmornorm - }; - ;; - "HIDE - Toggle Dotfiles") - [ "$DFM_DOT" == "0" ] && { - export DFM_DOT="1" - sendconf "DFM_DOT" "1" - } || [ "$DFM_DOT" == "1" ] && { - export DFM_DOT="0" - sendconf "DFM_DOT" "0" - } || { - export DFM_DOT="0" - sendconf "DFM_DOT" "0" - }; - ;; - "SCRN - Host screenshot on 0x0.st") - sendscrn0x0 - ;; - esac - } || [ -d "$output" ] && { + if [ "$output" == "MD - Make dir" ] + then + output2=$(echo "" | $dmenu -i -p "Name dir:") + mkdir $output2 + elif [ "$output" == "MF - Make file" ] + then + output2=$(echo "" | $dmenu -i -p "Name file:") + touch $output2 + elif [ "$output" == "BM - Bookmarks" ] + then + touch ~/.config/dfm/bookmarks + output=$(echo "MK DEL $(cat ~/.config/dfm/bookmarks | awk '// {print $1}')" | tr "\n" " " | tr " " "\n" | $dmenu -l 30 -i -p "Select file/directory:") + if [ "$output" == "MK" ] + then + output=$(echo "" | $dmenu -i -p "Choose bookmark name(no spaces):") + output2=$(echo "" | $dmenu -i -p "Choose bookmark path(absolute):") + echo "$output $output2" >> ~/.config/dfm/bookmarks + elif [ "$output" == "DEL" ] + then + output=$(echo "$(cat $confdir/bookmarks | awk '// {print $1}')" | $dmenu -l 30 -i -p "Select bookmark to delete:") + [ "$(cat $confdir/bookmarks | awk "/$output/ {print"' $1}')" == "$output" ] && sed -i "/$output/d" $confdir/bookmarks + else + output=$(cat ~/.config/dfm/bookmarks | awk "/$output/"' {print $2}') + output2=$(echo "$fmcmd2" | $dmenu -l 30 -i -p "Select command:") + fmspecial + fi + elif [ "$output" == "FND - Find" ] + then + output=$(echo "" | $dmenu -i -p "Enter name of file:") + output2=$(printf "ROOT (Takes a while)\nLOCALLY" | $dmenu -i -p "Find option") + if [ "$(echo $output2 | awk '/ROOT/')" != "" ] + then + echo "May take a while..." + output3="/" + else + output3="." + fi + output=$(echo "NONE $(find $output3 | grep -i "$output")" | tr " " "\n" | $dmenu -i -l 30 -p "Select file:") + if [ "$output" == "NONE" ] + then + echo > /dev/null + else + fmornorm + fi + elif [ "$output" == "HIDE - Toggle Dotfiles" ] + then + if [ "$DFM_DOT" == "0" ] + then + export DFM_DOT="1" + sendconf "DFM_DOT" "1" + elif [ "$DFM_DOT" == "1" ] + then + export DFM_DOT="0" + sendconf "DFM_DOT" "0" + else + export DFM_DOT="0" + sendconf "DFM_DOT" "0" + fi + elif [ "$output" == "SCRN - Host screenshot on 0x0.st" ] + then + sendscrn0x0 + fi + elif [ -d "$output" ] + then cd $output - } || [ "$output" == "exit" ] && { + elif [ "$output" == "exit" ] + then exit 1 - } || [ "$output" == "" ] && { + elif [ "$output" == "" ] + then exit 1 - } || { + else fmornorm - }; + fi done diff --git a/.scripts/bin/misc/open b/.scripts/bin/misc/open @@ -0,0 +1,7 @@ +#!/bin/sh + +case $1 in + *.png|*.gif|*.jpg|*.jpeg) sxiv "$@" ;; + *.mp4|*.mkv|*.m4a|*.wav|*.flac|*.opus) mpv "$@" ;; + *) nvim "$@" ;; +esac diff --git a/.xinitrc b/.xinitrc @@ -2,6 +2,7 @@ xrdb ~/.Xresources setxkbmap haydenh +xsetroot -cursor_name sailboat while true; do dwm