diff --git a/.config/nvim/after/ftplugin/groff.vim b/.config/nvim/after/ftplugin/groff.vim index cc88953..521849d 100644 --- a/.config/nvim/after/ftplugin/groff.vim +++ b/.config/nvim/after/ftplugin/groff.vim @@ -1,5 +1,5 @@ " groff filetype config -" Licence LGPL v3.0 +" Licence GPLv3 inoremap à \[`a] inoremap 'A \[`A] diff --git a/.config/nvim/after/ftplugin/python.vim b/.config/nvim/after/ftplugin/python.vim index d1679c9..7eb9738 100644 --- a/.config/nvim/after/ftplugin/python.vim +++ b/.config/nvim/after/ftplugin/python.vim @@ -1,5 +1,5 @@ " python filetype config -" LGPL v3.0 Licence +" Licence GPLv3 " proper PEP 8 indentation set tabstop=4 diff --git a/.config/nvim/after/ftplugin/tex.vim b/.config/nvim/after/ftplugin/tex.vim index e9b9d71..7cea6e5 100644 --- a/.config/nvim/after/ftplugin/tex.vim +++ b/.config/nvim/after/ftplugin/tex.vim @@ -1,5 +1,5 @@ " tex filetype config -" Licence LGPL v3.0 +" Licence GPL3 " spellcheck enabled setlocal spell spelllang=fr diff --git a/.config/nvim/after/ftplugin/text.vim b/.config/nvim/after/ftplugin/text.vim index a367610..01e5570 100644 --- a/.config/nvim/after/ftplugin/text.vim +++ b/.config/nvim/after/ftplugin/text.vim @@ -1,4 +1,4 @@ " vim filetype config -" Licence LGPL v3.0 +" Licence GPL3 setlocal spell spelllang=fr,en_us diff --git a/.config/nvim/after/ftplugin/verilog.vim b/.config/nvim/after/ftplugin/verilog.vim index 0ef6127..9fa0c4d 100644 --- a/.config/nvim/after/ftplugin/verilog.vim +++ b/.config/nvim/after/ftplugin/verilog.vim @@ -1,4 +1,4 @@ " verilog indent removal -" Licence LGPL v3.0 +" Licence GPLv3 noremap :w! \| :CoqRunToCursor diff --git a/.config/nvim/after/ftplugin/vim.vim b/.config/nvim/after/ftplugin/vim.vim deleted file mode 100644 index 3c4811f..0000000 --- a/.config/nvim/after/ftplugin/vim.vim +++ /dev/null @@ -1,4 +0,0 @@ -" vim filetype config -" Licence LGPL v3.0 - -let b:coc_pairs_disabled = ['"'] diff --git a/.config/nvim/colors/polyjuice.vim b/.config/nvim/colors/polyjuice.vim index 39252f6..7af334a 100644 --- a/.config/nvim/colors/polyjuice.vim +++ b/.config/nvim/colors/polyjuice.vim @@ -4,7 +4,7 @@ " Maintainer: David JULIEN " Website: https://github.com/vim/vim/blob/master/src/syntax.c " License: Vim License (see `:help license`) -" Last Updated: Sun 10 May 2020 12:25:20 PM CEST +" Last Updated: Fri 15 May 2020 03:37:00 PM CEST " Generated by Colortemplate v2.0.0 @@ -275,21 +275,21 @@ if s:t_Co >= 8 finish endif -" Color: black #1d2021 0 Black +" Color: black #1d2021 0 Black " Color: darkred #b73935 160 DarkRed -" Color: darkgreen #5a8471 2 DarkGreen +" Color: darkgreen #5a8471 2 DarkGreen " Color: orange #f7a583 216 LightRed -" Color: darkblue #458588 24 DarkBlue +" Color: darkblue #458588 24 DarkBlue " Color: darkmagenta #b16286 138 DarkMagenta -" Color: darkcyan #7cafa3 30 DarkCyan +" Color: darkcyan #7cafa3 30 DarkCyan " Color: grey #7c6f64 243 Grey " Color: darkgrey #373737 243 Grey " Color: red #ea6962 203 Red -" Color: green #89b594 71 Green +" Color: green #89b594 71 Green " Color: yellow #ffeca3 230 White -" Color: blue #7daea3 24 DarkCyan +" Color: blue #7daea3 24 DarkCyan " Color: magenta #d3869b 181 Magenta -" Color: cyan #ace5d7 81 LightBlue +" Color: cyan #ace5d7 81 LightBlue " Color: white #ebdbb2 229 LightYellow " Term Colors: black darkred darkgreen orange darkblue darkmagenta darkcyan darkgrey " Term Colors: grey red green yellow blue magenta cyan white diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index 420545e..0150913 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -119,11 +119,11 @@ set smarttab " 1 tab = 4 spaces set tabstop=4 -set shiftwidth=4 "for indent operations +set shiftwidth=4 " Indent and wrap rules set autoindent -set wrap "wrap lines +set wrap " Stop auto-commenting new line autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o @@ -163,7 +163,7 @@ noremap s :source ~/.config/nvim/init.vim " Circle through buffers noremap n :bn -noremap p :bp +noremap b :bp " Clear the search highlight noremap q :nohl diff --git a/.config/nvim/polyjuice.colortemplate b/.config/nvim/polyjuice.colortemplate index 5d34f3c..e7fe425 100644 --- a/.config/nvim/polyjuice.colortemplate +++ b/.config/nvim/polyjuice.colortemplate @@ -11,21 +11,21 @@ Description: A simple yet customizable pastel colorscheme # Color palette {{{ # Color name GUI Base256 Base16 -Color: black #1d2021 0 Black +Color: black #1d2021 0 Black Color: darkred #b73935 160 DarkRed -Color: darkgreen #5a8471 2 DarkGreen +Color: darkgreen #5a8471 2 DarkGreen Color: orange #f7a583 216 LightRed -Color: darkblue #458588 24 DarkBlue +Color: darkblue #458588 24 DarkBlue Color: darkmagenta #b16286 138 DarkMagenta -Color: darkcyan #7cafa3 30 DarkCyan +Color: darkcyan #7cafa3 30 DarkCyan Color: grey #7c6f64 243 Grey Color: darkgrey #373737 243 Grey Color: red #ea6962 203 Red -Color: green #89b594 71 Green +Color: green #89b594 71 Green Color: yellow #ffeca3 230 White -Color: blue #7daea3 24 DarkCyan +Color: blue #7daea3 24 DarkCyan Color: magenta #d3869b 181 Magenta -Color: cyan #ace5d7 81 LightBlue +Color: cyan #ace5d7 81 LightBlue Color: white #ebdbb2 229 LightYellow # }}} diff --git a/.config/nvim/statusline.vim b/.config/nvim/statusline.vim index 4ae88fd..47c8cf4 100644 --- a/.config/nvim/statusline.vim +++ b/.config/nvim/statusline.vim @@ -14,7 +14,6 @@ function! CurrentMode() endfunction function! ModeColor() - let g:modecolor={ \ 'n' : '%#NormalMode#', \ 'v' : '%#VisualMode#', @@ -41,7 +40,6 @@ function! FileName() endfunction function! StatusLine() - let l:statusline='' " Buffer number @@ -56,6 +54,7 @@ function! StatusLine() let l:statusline.='%#File#' let l:statusline.=FileName() + " File status let l:statusline .= "%{&readonly?' [RO]':''}" let l:statusline .= "%{&modified?' [MO]':''}" @@ -76,10 +75,7 @@ function! StatusLine() let l:statusline.='%#WarningMsg#' let l:statusline.="%{&fileencoding!='utf-8'?'['.&fileencoding.'] ':''}%*" - - "setlocal statusline.=%#FileFormat# - "setlocal statusline.=\ %-7([%{&fileformat}]%) - + " Depth let l:statusline.='%#Percent#' let l:statusline.='%03.p%%%* ' @@ -88,16 +84,15 @@ function! StatusLine() let l:statusline.='-%c-' return l:statusline - endfunction function! StatusLineNC() - let l:statusline='' + " Buffer number let l:statusline.='[%n]' - " File name + " File name and status let l:statusline.=' %t' let l:statusline .= "%{&readonly?' [MO]':''}" @@ -109,11 +104,11 @@ function! StatusLineNC() " Separation point between left and right aligned items. let l:statusline.='%=' + " Depth let l:statusline.='%#Percent#' let l:statusline.='%03.p%%' return l:statusline - endfunction function! UpdateInactiveWindows() diff --git a/.config/root/etc_pacman.conf b/.config/root/etc_pacman.conf index 527421f..ecc5ebc 100644 --- a/.config/root/etc_pacman.conf +++ b/.config/root/etc_pacman.conf @@ -14,7 +14,7 @@ #CacheDir = /var/cache/pacman/pkg/ #LogFile = /var/log/pacman.log #GPGDir = /etc/pacman.d/gnupg/ -HookDir = /config/pacman/hooks +HookDir = /home/swytch/.config/pacman/hooks HoldPkg = pacman glibc #XferCommand = /usr/bin/curl -L -C - -f -o %o %u #XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u diff --git a/.config/sxhkd/sxhkdrc b/.config/sxhkd/sxhkdrc index 4bc03dc..fc1e706 100644 --- a/.config/sxhkd/sxhkdrc +++ b/.config/sxhkd/sxhkdrc @@ -40,7 +40,7 @@ super + shift + {w,z} $BROWSER super + shift + p - $BROWSER --incognito + $BROWSER --private-window super + shift + b script="$(printf "bibinput\nbibshow" | dmenu -i -p "which script?")" && $script diff --git a/.local/bin/README.md b/.local/bin/README.md index 87b8d4d..405ce01 100644 --- a/.local/bin/README.md +++ b/.local/bin/README.md @@ -39,9 +39,7 @@ This is the shell script I run just after I installed Arch. It does few things: -### What it does: - -* Install the apps I use -* Download my personnal repos -* Compile my WM (`dwm`), my binary launcher (`dmenu`) and my terminal emulator (`st`), which are part of the [suckless](https://suckless.org/) project. +- Install the apps I use +- Download my personnal repos +- Compile my WM (`dwm`), my binary launcher (`dmenu`) and my terminal emulator (`st`), which are part of the [suckless](https://suckless.org/) project. diff --git a/.local/bin/bibinput b/.local/bin/bibinput index dcfc838..d774779 100755 --- a/.local/bin/bibinput +++ b/.local/bin/bibinput @@ -33,15 +33,13 @@ refinput(){ } doctypes="article book online techreport" -base="$(basename "$(find $HOME/documents/bibliographies/ -type f -not -path '*/\.*' | dmenu -l 20 -p "[bibinput] which bibliography?")")" # the -not -path allows find to ignore hidden files +file="$(find $HOME/documents/bibliographies/ -type f -not -path '*/\.*' | dmenu -l 20 -p "[bibinput] which bibliography?")" # the -not -path allows find to ignore hidden files -[ -z "$base" ] && exit 1 - -file="$HOME/documents/bibliographies/"$base +[ -z "$file" ] && exit 1 refs="$(cat "$file" | grep "@" | sed "s/,$//g" | awk -F '{' '{print $2}' | tr '\n' ' ')" -# if the file does not exist, creates it +# if the file does not exist, create it if [ ! -e "$file" ]; then mkfile="$(printf "No\\nYes" | dmenu -i -p "$file does not exist. Create it?")" [ "$mkfile" = "Yes" ] && (touch "$file") diff --git a/.local/bin/bibshow b/.local/bin/bibshow index 944f6ac..c6ac2c5 100755 --- a/.local/bin/bibshow +++ b/.local/bin/bibshow @@ -4,7 +4,6 @@ # User inputs informations, this will show the content of an entry through dmenu - file="$(find $HOME/documents/bibliographies/ -type f -not -path '*/\.*' | dmenu -l 20 -p "[bibshow] which bibliography?")" # the -not -path allows find to ignore hidden files refs_list="$(cat "$file" | sed 's/\t//g' | tr '\n' ' ' | sed 's/}\ /}\n/g')" @@ -15,5 +14,5 @@ ref="$(echo "$refs_list" | dmenu -i -p 'infos?' -l 10)" output="$(echo "$ref" | sed 's/author/\n author/g' | sed 's/",/",\n/g')" -echo "$output" | dmenu -i -p "infos" -l 20 +echo "$output" | dmenu -i -p "infos" -l 10 echo "$ref" | awk -F '{' '{print $2}' | awk -F ',' '{print $1}' | xclip -selection clipboard diff --git a/.local/bin/compiler b/.local/bin/compiler index c44bd5a..dac8469 100755 --- a/.local/bin/compiler +++ b/.local/bin/compiler @@ -10,9 +10,12 @@ file=$(readlink -f "$1") dir=$(dirname "$file") +dirname=$(basename "$dir") base="$(echo "${file%.*}" | awk -F '/' '{printf $NF}')" shebang=$(sed -n 1p "$file") +sucklesstools="$(ls $XDG_CONFIG_HOME/suckless)" + cd "$dir" || exit shebangtest() @@ -22,7 +25,7 @@ shebangtest() esac } -textype() { \ +texcompile() { \ bibliography="$(cat "$file" | grep '\bibliography')" if [ -n "$bibliography" ]; then pdflatex --output-directory="$dir" "$base" && @@ -33,16 +36,27 @@ textype() { \ pdflatex --output-directory="$dir" "$base" && pdflatex --output-directory="$dir" "$base" fi - texclear "$file" } +s_build(){ + case "$file" in + *config.def.h) sudo make clean install && rm -f config.h ;; + *config.h) echo "" && echo "You should build from config.def.h !" ;; + esac + + exit 0 +} + +for tool in $sucklesstools; do + if [ "$tool" = "$dirname" ]; then + s_build + fi +done + case "$file" in - *config.def.h) sudo make clean install && rm -f config.h ;; - *config.h) echo "" && echo "You should build from config.def.h !" ;; - *\.c*) make && ./main ;; - *\.h*) make && ./main ;; - *\.mom) refer -PS -e "$file" | pdfmom > "$base.pdf" ;; - *\.tex) textype "$base" ;; - *\.py) python "$file" ;; + *.c*|.h*) make && ./main ;; + *.mom) refer -PS -e "$file" | pdfmom > "$base.pdf" ;; + *.tex) texcompile "$base" ; texclear "$file" ;; + *.py) python "$file" ;; *) shebangtest ;; esac diff --git a/.local/bin/displayselect b/.local/bin/displayselect index 8e45a19..29cff50 100755 --- a/.local/bin/displayselect +++ b/.local/bin/displayselect @@ -7,7 +7,6 @@ # selection" which opens arandr. twoscreen() { # If multi-monitor is selected and there are two screens. - mirror=$(printf "no\\nyes" | dmenu -i -p "Mirror displays?") # Mirror displays using native resolution of external display and a scaled # version for the internal display diff --git a/.local/bin/dot b/.local/bin/dot index b866c29..454c59e 100755 --- a/.local/bin/dot +++ b/.local/bin/dot @@ -3,9 +3,9 @@ ## Wrapper for my dotfiles git="/usr/bin/git --git-dir=$HOME/.dotfiles --work-tree=$HOME" -cmd="$git status" ## by default, give the status +cmd="$git status" # by default, give the status -[ "$1" = "-g" ] && shift && cmd="$git $@" ## make the wrapper transparent +[ "$1" = "-g" ] && shift && cmd="$git $@" # make the wrapper transparent [ "$1" = "-l" ] && shift && cmd="$git log" [ "$1" = "-c" ] && shift && cmd="$git commit $@" diff --git a/.local/bin/dwmbar b/.local/bin/dwmbar index 4f50a96..0ae069a 100755 --- a/.local/bin/dwmbar +++ b/.local/bin/dwmbar @@ -8,13 +8,10 @@ # Handle SIGTRAP signals sent by refbar to update the status bar immediately. trap 'update' 5 -# Set the deliminter character. -delim="|" +delim="|" # Set the delimiter character. status() { \ - - # Gets the volume of ALSA's master volume output. - + # Get the volume of ALSA's master volume output. volume="$(pamixer --get-volume)" muted="$(pamixer --get-mute)" @@ -38,7 +35,6 @@ status() { \ # Will show all batteries with approximate icon for remaining power. # Or show that the computer is plugged to a power source # In any case, show the remaining battery percentage - AC_ON="$(cat /sys/class/power_supply/AC/online)" for x in /sys/class/power_supply/BAT?/capacity; do @@ -57,7 +53,6 @@ status() { \ done && echo "$delim" # Date and time. - date '+%b. %d - %I:%M%p' } diff --git a/.local/bin/kbacklight b/.local/bin/kbacklight index 2b805f5..68c81bf 100755 --- a/.local/bin/kbacklight +++ b/.local/bin/kbacklight @@ -2,7 +2,7 @@ ## Control keyboard brightness ## level goes up at each call - ## goes back to 0 after meeting maximum brightness + ## goes back to 0 after reaching maximum brightness ## You need `upower` package to make it work diff --git a/.local/bin/maker b/.local/bin/maker index 8dcba95..f36b7cf 100755 --- a/.local/bin/maker +++ b/.local/bin/maker @@ -9,43 +9,37 @@ headers_list="$(ls | grep '.h$')" sources_list="$(ls | grep '.cp*$')" modules_list="$(echo "$sources_list" | sed 's/\.cp*//g' | tr '\n' ' ')" targets_list="$(echo "$sources_list" | sed 's/\.cp*/\.o/g' | tr '\n' ' ')" -bool=false -comp=gcc get_compiler(){ for source_ in "$sources_list"; do case "$source_" in - *.cpp) comp="g++" && return;; - *.c) ;; + *.cpp) echo "g++" && return;; + *.c) echo "gcc";; esac done } is_c_project(){ - if [ -n "$sources_list" ]; then - bool=true - fi + [ -n "$sources_list" ] } make_rule(){ if [ "$comp" = "gcc" ]; then - echo "$1.o : $1.c" >> makefile + echo "$1.o : $1.c $1.h" >> makefile echo -e "\t\$(CC) -c $1.c \$(FLAGS)" >> makefile else - echo "$1.o : $1.cpp" >> makefile + echo "$1.o : $1.cpp $1.h" >> makefile echo -e "\t\$(CC) -c $1.cpp \$(FLAGS)" >> makefile fi echo "" >> makefile } -is_c_project - -if [ "$bool" = false ]; then +if ! is_c_project; then echo "No C/C++ project in directory. Exiting..." exit 1 fi -get_compiler +comp=get_compiler touch makefile @@ -69,4 +63,9 @@ echo "clean :" >> makefile echo -e "\trm \$(BIN) *.o vgcore.*" >> makefile sed -i 's/\s$//' makefile -nvim makefile + +if type "nvim" &> /dev/null; then + nvim makefile +else + vim makefile +fi diff --git a/.local/bin/mommerge b/.local/bin/mommerge index bdf0eff..1dc83be 100755 --- a/.local/bin/mommerge +++ b/.local/bin/mommerge @@ -3,15 +3,13 @@ # /!\ files must be names 0_file0, 1_file1... in order to be processed correctly # if the file already exists, delete it -if [ -e rendu.mom ]; then - rm rendu.mom -fi +[ -e rendu.mom ] && rm rendu.mom -pdf_list=$(ls *.mom) +list=$(ls *.mom) touch rendu.mom -for doc in "$pdf_list"; do +for doc in "$list"; do cat "$doc" >> rendu.mom echo ".COLLATE" >> rendu.mom done diff --git a/.local/bin/texclear b/.local/bin/texclear index b6b4eb2..b87abdb 100755 --- a/.local/bin/texclear +++ b/.local/bin/texclear @@ -10,6 +10,6 @@ case "$1" in file=$(readlink -f "$1") dir=$(dirname "$file") base="${file%.*}" - find "$dir" -maxdepth 1 -type f -regextype gnu-awk -regex "^$base\\.(4tc|xref|tmp|pyc|pyo|fls|vrb|fdb_latexmk|bak|swp|aux|log|synctex\\(busy\\)|lof|lot|maf|idx|mtc|mtc0|nav|out|snm|toc|bcf|run\\.xml|synctex\\.gz|blg|bbl)" -delete ;; + find "$dir" -maxdepth 1 -type f -regextype gnu-awk -regex "^$base\\.(4tc|xref|tmp|pyc|pyo|fls|vrb|fdb_latexmk|bak|swp|aux|tns|log|synctex\\(busy\\)|lof|lot|maf|idx|mtc|mtc0|nav|out|snm|toc|bcf|run\\.xml|synctex\\.gz|blg|bbl)" -delete ;; *) printf "Give .tex file as argument.\\n" ;; esac diff --git a/.local/bin/texer b/.local/bin/texer index c4993d3..4cd9f2f 100755 --- a/.local/bin/texer +++ b/.local/bin/texer @@ -1,6 +1,6 @@ #! /bin/sh -# Create a LaTeX document with genereic metadata, then opens it with neovim (or vim as a fallback) +# Create a LaTeX document with genereic metadata, then open it with neovim (or vim as a fallback) if [ -z "$1" ]; then echo "Please provide a name for your file" diff --git a/.profile b/.profile index 518567d..b32f89a 100644 --- a/.profile +++ b/.profile @@ -19,8 +19,7 @@ export SUDO_ASKPASS="$HOME/.local/bin/dmenupass" export EDITOR="nvim" export TERMINAL="st" export READER="zathura" -export BROWSER="brave" -export INCOGNITO="brave --incognito" +export BROWSER="firefox" ## program settings export LESS_TERMCAP_md="$(printf '%b' '\e[01;32m')"