diff options
author | Julian T <julian@jtle.dk> | 2023-01-17 11:34:30 +0100 |
---|---|---|
committer | Julian T <julian@jtle.dk> | 2023-01-17 11:34:30 +0100 |
commit | 804f57809b981649e79a0aea18b9c91749716561 (patch) | |
tree | 33c9a2fabbe5c45e253ecee7eb633d15df43079a | |
parent | 4839a8f401b482a9d2cb3478d04a00bc5b93e1d2 (diff) |
Treesitter, setwall changes, polybar time color, and better next in sxhkd
-rw-r--r-- | bspwm/.config/sxhkd/sxhkdrc | 2 | ||||
-rw-r--r-- | polybar/.config/polybar/config | 2 | ||||
-rwxr-xr-x | scripts/Scripts/setwall | 300 | ||||
-rw-r--r-- | vim-extra/.config/nvim/extra.vim | 20 |
4 files changed, 174 insertions, 150 deletions
diff --git a/bspwm/.config/sxhkd/sxhkdrc b/bspwm/.config/sxhkd/sxhkdrc index ddeecdd..c584513 100644 --- a/bspwm/.config/sxhkd/sxhkdrc +++ b/bspwm/.config/sxhkd/sxhkdrc @@ -83,7 +83,7 @@ super + {p,b,comma,period} # focus the next/previous node in the current desktop super + {_,shift + }c - bspc node -f {next,prev}.local + bspc node -f {next,prev}.local.leaf # focus the next/previous desktop in the current monitor super + bracket{left,right} diff --git a/polybar/.config/polybar/config b/polybar/.config/polybar/config index 2238489..a0accde 100644 --- a/polybar/.config/polybar/config +++ b/polybar/.config/polybar/config @@ -152,7 +152,7 @@ date = %H:%M date-alt = %Y-%m-%d %H:%M:%S label = %date% -label-foreground = ${colors.primary} +label-foreground = ${colors.foreground} [settings] screenchange-reload = true diff --git a/scripts/Scripts/setwall b/scripts/Scripts/setwall index 7516646..86214a6 100755 --- a/scripts/Scripts/setwall +++ b/scripts/Scripts/setwall @@ -5,188 +5,192 @@ WALLLINK="$HOME/Pictures/current_wall" BINNAME="setwall" function unsetwalls() { - for wall in $@; do - echo unsetting $wall - pat=$(echo $wall | sed 's/\//\\\//g') - sed -i.bak "/$pat/d" $WALLFILE - done + for wall in $@; do + echo unsetting $wall + pat=$(echo $wall | sed 's/\//\\\//g') + sed -i.bak "/$pat/d" $WALLFILE + done } function unsetcur() { - if [ -f "${WALLLINK}" ]; then - unsetwalls $(realpath --relative-to=$HOME $WALLLINK) - else - echo "could not resolve current wallpaper" - exit 1 - fi + if [ -f "${WALLLINK}" ]; then + unsetwalls $(realpath --relative-to=$HOME $WALLLINK) + else + echo "could not resolve current wallpaper" + exit 1 + fi } function delete() { - echo deleting wallfile - rm $WALLFILE + echo deleting wallfile + rm $WALLFILE } function unsetall() { - echo clearing wallfile - echo -n > $WALLFILE + echo clearing wallfile + echo -n > $WALLFILE } function setwalls() { - for wall in $@; do - if grep -q $wall "$WALLFILE"; then - echo $wall already set - else - echo setting $wall - echo $wall >> $WALLFILE - fi - done + for wall in $@; do + if grep -q $wall "$WALLFILE"; then + echo $wall already set + else + echo setting $wall + echo $wall >> $WALLFILE + fi + done } function runsetwall() { - feh --bg-tile $1 - # wal --saturate 0.9 -i $1 + feh --bg-tile $1 + # wal --saturate 0.9 -i $1 } function applywall() { - echo applying wallpaper $1 - rm $WALLLINK - ln -s $(pwd)/$1 $WALLLINK - runsetwall $1 + echo applying wallpaper $1 + rm $WALLLINK + ln -s $(pwd)/$1 $WALLLINK + runsetwall $1 } function reapply() { - echo reapplying linked wallpaper - # feh --bg-fill $WALLLINK - runsetwall $WALLLINK + echo reapplying linked wallpaper + # feh --bg-fill $WALLLINK + runsetwall $WALLLINK } function help() { - echo "Wallpaper mangement script" - echo - echo "Syntax: ${BINNAME} OPTIONS" - echo "options:" - echo " -A, --apply [OPTIONS] applies a random wallpaper" - echo " -S, --set FILES sets new wallpapers" - echo " -U, --unset [OPTIONS] [FILES] unsets new wallpapers" - echo " -P, --preview FILE temporarily sets a wallpaper" - echo " -h, --help this message" - echo - echo "unset options:" - echo " -a, --all clears wallconfig file" - echo " -d, --delete deleted wallconfig file" - echo " -c, --current unset currently applied wallpaper" - echo - echo "apply options:" - echo " -r, --reapply reapply last applied wallpaper" + echo "Wallpaper mangement script" + echo + echo "Syntax: ${BINNAME} OPTIONS" + echo "options:" + echo " -A, --apply [OPTIONS] applies a random wallpaper" + echo " -S, --set FILES sets new wallpapers" + echo " -U, --unset [OPTIONS] [FILES] unsets new wallpapers" + echo " -P, --preview FILE temporarily sets a wallpaper" + echo " -h, --help this message" + echo + echo "unset options:" + echo " -a, --all clears wallconfig file" + echo " -d, --delete deleted wallconfig file" + echo " -c, --current unset currently applied wallpaper" + echo + echo "apply options:" + echo " -r, --reapply reapply last applied wallpaper" } function unknown() { - echo "${BINNAME}: unknown option $1" 1>&2 - exit 1 + echo "${BINNAME}: unknown option $1" 1>&2 + exit 1 } if [[ $# -eq 0 ]]; then - echo "${BINNAME}: no arguments given" 1>&2 - help - exit 1 + echo "${BINNAME}: no arguments given" 1>&2 + help + exit 1 fi mode="N" pos="" +function apply_mode() { + case $mode in + U) + unsetwalls $pos + ;; + S) + setwalls $pos + ;; + A) + applywall $(shuf -n 1 $WALLFILE) + ;; + esac +} + while [[ $# -gt 0 ]]; do - keys="$1" - # If $1 does is single - argument - if [[ $1 == '-'* ]] && [[ ! $1 == '--'* ]] ; then - # Remove first - - keys=${keys#?} - # Place space between each character - keys=$(echo $keys | sed 's/./-& /g') - fi + keys="$1" + # If $1 does is single - argument + if [[ $1 == '-'* ]] && [[ ! $1 == '--'* ]] ; then + # Remove first - + keys=${keys#?} + # Place space between each character + keys=$(echo $keys | sed 's/./-& /g') + fi - for key in $keys; do - case $mode in - U) - case $key in - -a|--all) - unsetall - exit 0 - ;; - -d|--delete) - delete - exit 0 - ;; - -c|--current) - unsetcur - exit 0 - ;; - '-'*|'--'*) - unknown $key - ;; - *) - pos="$pos $key" - shift - ;; - esac - ;; - A) - case $key in - -r|--reapply) - reapply - exit 0 - ;; - '-'*|'--'*) - unknown $key - ;; - *) - echo Unexpected argument - help - exit 0 - ;; - esac - ;; - S) - pos="$pos $key" - shift - ;; + for key in $keys; do + case $mode in + U) + case $key in + -a|--all) + unsetall + mode="N" + ;; + -d|--delete) + delete + mode="N" + ;; + -c|--current) + unsetcur + mode="N" + ;; + '-'*|'--'*) + unknown $key + ;; + *) + pos="$pos $key" + shift + ;; + esac + ;; + A) + case $key in + -r|--reapply) + reapply + mode="N" + ;; + '-'*|'--'*) + unknown $key + ;; + *) + echo Unexpected argument + help + mode="N" + ;; + esac + ;; + S) + pos="$pos $key" + shift + ;; - *) - case $key in - -A|--apply) - mode="A" - shift - ;; - -U|--unset) - mode="U" - shift - ;; - -S|--set) - mode="S" - shift - ;; - -P|--preview) - applywall $2 - exit 0 - ;; - -h|--help) - help - shift - exit 0 - ;; - *) - unknown $key - ;; - esac - ;; - esac - done + *) + apply_mode + case $key in + -A|--apply) + mode="A" + shift + ;; + -U|--unset) + mode="U" + shift + ;; + -S|--set) + mode="S" + shift + ;; + -P|--preview) + applywall $2 + ;; + -h|--help) + help + shift + exit 0 + ;; + *) + unknown $key + ;; + esac + ;; + esac + done done -case $mode in - U) - unsetwalls $pos - ;; - S) - setwalls $pos - ;; - A) - applywall $(shuf -n 1 $WALLFILE) - ;; -esac +apply_mode diff --git a/vim-extra/.config/nvim/extra.vim b/vim-extra/.config/nvim/extra.vim index 432c8bf..13f34f4 100644 --- a/vim-extra/.config/nvim/extra.vim +++ b/vim-extra/.config/nvim/extra.vim @@ -3,6 +3,8 @@ Plug 'neovim/nvim-lspconfig' Plug 'Shougo/echodoc.vim' + Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} + Plug 'tpope/vim-surround' Plug 'tpope/vim-repeat' @@ -36,3 +38,21 @@ "}}} +" Tree sitter {{{ + +lua << EOF +require'nvim-treesitter.configs'.setup { + ensure_installed = { "c", "lua", "vim", "rust", "help" }, + + auto_install = true, + + highlight = { + enable = true, + }, + incremental_selection = { + enable = true, + }, +} +EOF + +" }}} |