diff --git a/.config/gnupg/gpg-agent.conf b/.config/gnupg/gpg-agent.conf index 858aa95..3cda906 100644 --- a/.config/gnupg/gpg-agent.conf +++ b/.config/gnupg/gpg-agent.conf @@ -1,5 +1,4 @@ -allow-preset-passphrase -default-cache-ttl 604800 -max-cache-ttl 604800 +default-cache-ttl 86400 +max-cache-ttl 86400 pinentry-program /usr/bin/pinentry-gnome3 diff --git a/.config/notmuch/tags/univ b/.config/notmuch/tags/univ new file mode 100644 index 0000000..b6d7884 --- /dev/null +++ b/.config/notmuch/tags/univ @@ -0,0 +1,18 @@ +# vim: filetype=none + +# !filters will be applied top to bottom + +# mailbox +#+univ -- path:univ/ + ++teaching/X11I020 -inbox subject:x11i020 ++teaching/X11I040 -inbox subject:x11i040 + ++publications -inbox subject:[hal] ++forge -inbox from:gitlab@univ-nantes.fr + ++velo -inbox subject:[ls2n-velo] ++login -inbox from:login@univ-nantes.fr + ++admin -inbox from:virginie.dupont or from alexiane.brard or from emmanuelle.sale ++thesis -inbox from:benoit.delahaye or from:guillaume.cantin or from:gilles.ardourel diff --git a/.config/nvim/lua/plugin/lsp/init.lua b/.config/nvim/lua/plugin/lsp/init.lua index 4a22120..274c9b6 100644 --- a/.config/nvim/lua/plugin/lsp/init.lua +++ b/.config/nvim/lua/plugin/lsp/init.lua @@ -5,7 +5,8 @@ local lspconfig = require("lspconfig") -local lsp_installer = require("nvim-lsp-installer") +local mason = require("mason") +local mason_lspconfig = require("mason-lspconfig") local globals = require("globals") local signs = { @@ -58,8 +59,8 @@ local capabilities = vim.lsp.protocol.make_client_capabilities() capabilities = require("cmp_nvim_lsp").default_capabilities(capabilities) local servers = { "clangd", "sumneko_lua", "texlab" } -lsp_installer.setup { - ensure_installed = servers, + +mason.setup({ ui = { icons = { server_installed = "✓", @@ -67,7 +68,12 @@ lsp_installer.setup { server_uninstalled = "" } } -} +}) + +mason_lspconfig.setup({ + ensure_installed = servers, +}) + for _, server in ipairs(servers) do local opts = { diff --git a/.config/nvim/lua/plugin/packer.lua b/.config/nvim/lua/plugin/packer.lua index 16cda69..b1afd3b 100644 --- a/.config/nvim/lua/plugin/packer.lua +++ b/.config/nvim/lua/plugin/packer.lua @@ -4,7 +4,6 @@ -- Description : neovim packer config file -local packer = require("packer") local install_path = vim.fn.stdpath("data") .. "/site/pack/packer/start/packer.nvim" if vim.fn.empty(vim.fn.glob(install_path)) > 0 then print("Cloning packer...") @@ -20,14 +19,16 @@ if vim.fn.empty(vim.fn.glob(install_path)) > 0 then print("Done.") end +local packer = require("packer") + packer.init({ display = { - working_sym = 'o', -- The symbol for a plugin being installed/updated - error_sym = '', -- The symbol for a plugin with an error in installation/updating - done_sym = '✓', -- The symbol for a plugin which has completed installation/updating - removed_sym = '-', -- The symbol for an unused plugin which was removed - moved_sym = '→', -- The symbol for a plugin which was moved (e.g. from opt to start) - header_sym = '━', -- The symbol for the header line in packer's display + working_sym = ' ', -- The symbol for a plugin being installed/updated + error_sym = ' ', -- The symbol for a plugin with an error in installation/updating + done_sym = ' ', -- The symbol for a plugin which has completed installation/updating + removed_sym = '- ', -- The symbol for an unused plugin which was removed + moved_sym = '→ ', -- The symbol for a plugin which was moved (e.g. from opt to start) + header_sym = '━ ', -- The symbol for the header line in packer's display }, }) @@ -68,7 +69,8 @@ return require("packer").startup(function() use { "neovim/nvim-lspconfig", requires = { - "williamboman/nvim-lsp-installer", + "williamboman/mason.nvim", + "williamboman/mason-lspconfig.nvim", }, config = function() require("plugin.lsp") end } diff --git a/.config/zsh/.zprofile b/.config/zsh/.zprofile index 7b839a0..a925f41 100644 --- a/.config/zsh/.zprofile +++ b/.config/zsh/.zprofile @@ -1,6 +1,8 @@ #!/bin/zsh # This file is sourced when launching a DM from startx/xinit +# path +export PATH="$(find $HOME/.local/bin -type d | tr '\n' ':' | sed 's/:$//'):$PATH" # environment variables ## path @@ -40,3 +42,10 @@ export MUSIC_CLIENT="ncmpcpp" ## misc export _JAVA_AWT_WM_NONREPARENTING=1 export _JAVA_OPTIONS=-Djava.util.prefs.userRoot="$XDG_CONFIG_HOME"/java +export LESS_TERMCAP_md="$(printf '%b' '\e[01;32m')" +export LESS_TERMCAP_me="$(printf '%b' '\e[0m')" +export LESS_TERMCAP_se="$(printf '%b' '\e[0m')" +export LESS_TERMCAP_so="$(printf '%b' '\e[01;44;33em')" +export LESS_TERMCAP_ue="$(printf '%b' '\e[0m')" +export LESS_TERMCAP_us="$(printf '%b' '\e[01;35m')" +export LS_COLORS='rs=0:di=01;34:ln=01;35:mh=00:pi=40;35:so=01;33:do=01;33:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=00;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;33:*.jpeg=01;33:*.mjpg=01;33:*.mjpeg=01;33:*.gif=01;33:*.bmp=01;33:*.pbm=01;33:*.pgm=01;33:*.ppm=01;33:*.tga=01;33:*.xbm=01;33:*.xpm=01;33:*.tif=01;33:*.tiff=01;33:*.png=01;33:*.svg=01;33:*.svgz=01;33:*.mng=01;33:*.pcx=01;33:*.mov=01;33:*.mpg=01;33:*.mpeg=01;33:*.m2v=01;33:*.mkv=01;33:*.webm=01;33:*.ogm=01;33:*.mp4=01;33:*.m4v=01;33:*.mp4v=01;33:*.vob=01;33:*.qt=01;33:*.nuv=01;33:*.wmv=01;33:*.asf=01;33:*.rm=01;33:*.rmvb=01;33:*.flc=01;33:*.avi=01;33:*.fli=01;33:*.flv=01;33:*.gl=01;33:*.dl=01;33:*.xcf=01;33:*.xwd=01;33:*.yuv=01;33:*.cgm=01;33:*.emf=01;33:*.ogv=01;33:*.ogx=01;33:*.aac=01;33:*.au=01;33:*.flac=01;33:*.m4a=01;33:*.mid=01;33:*.midi=01;33:*.mka=01;33:*.mp3=01;33:*.mpc=01;33:*.ogg=01;33:*.ra=01;33:*.wav=01;33:*.oga=01;33:*.opus=01;33:*.spx=01;33:*.xspf=01;33:'; diff --git a/.local/bin/fetch b/.local/bin/fetch index 6ee7f6c..7002b5e 100755 --- a/.local/bin/fetch +++ b/.local/bin/fetch @@ -15,7 +15,7 @@ # $USER is already defined host="$(cat /etc/conf.d/hostname | awk -F'"' '{ printf $2 }')" machine="$(cat /sys/devices/virtual/dmi/id/product_version)" -os='Gentoo' +os="Gentoo" kernel="$(uname -sr)" uptime="$(uptime -p | sed 's/up //')" packages="$(printf '%s\n' /var/db/pkg/*/* | wc -l)" @@ -62,11 +62,11 @@ if [ -x "$(command -v tput)" ]; then fi # you can change these -lc="${reset}${magenta}" # labels -nc="${bold}${magenta}" # user and hostname -ic="${reset}${white}" # info -a0="${bold}${magenta}" # first arch color -a1="${bold}${white}" # second arch color +lc="${bold}${magenta}" # labels +nc="${bold}${magenta}" # user and hostname +ic="${reset}${white}" # info +a0="${reset}${magenta}" # first gentoo color +a1="${reset}${white}" # second logo color cat < + +convert () { + ffmpeg -i "$in" \ + -acodec libvorbis -aq 6 -vn -ac 2 \ + -map_metadata 0 \ + "$out" +} + +if [ "" = "$1" ]; then + echo Converts audio files to Ogg Vorbis using ffmpeg. + echo Usage: $0 file1.ext1 file2.ext2 ... fileN.ext4 + echo ... produces file1.ogg file2.ogg ... fileN.ogg +fi + +for i in "$@"; do + in="$1" + ext="$(basename "$in" | sed -e 's/.*\.//')" + out="${in%.$ext}.ogg" + convert +done diff --git a/.local/bin/statusbar/sb-cpu b/.local/bin/statusbar/sb-cpu new file mode 100755 index 0000000..7648df1 --- /dev/null +++ b/.local/bin/statusbar/sb-cpu @@ -0,0 +1,37 @@ +#!/usr/bin/env sh + +# Module showing CPU load as a changing bars. +# Just like in polybar. +# Each bar represents amount of load on one core since +# last run. + +# Cache in tmpfs to improve speed and reduce SSD load +cache=/tmp/cpubarscache + +# id total idle +stats=$(awk '/cpu[0-9]+/ {printf "%d %d %d\n", substr($1,4), ($2 + $3 + $4 + $5), $5 }' /proc/stat) +[ ! -f $cache ] && echo "$stats" > "$cache" +old=$(cat "$cache") +printf " %s " " " +echo "$stats" | while read -r row; do + id=${row%% *} + rest=${row#* } + total=${rest%% *} + idle=${rest##* } + + case "$(echo "$old" | awk '{if ($1 == id) + printf "%d\n", (1 - (idle - $3) / (total - $2))*100 /12.5}' \ + id="$id" total="$total" idle="$idle")" in + + "0") printf "▁";; + "1") printf "▂";; + "2") printf "▃";; + "3") printf "▄";; + "4") printf "▅";; + "5") printf "▆";; + "6") printf "▇";; + "7") printf "█";; + "8") printf "█";; + esac +done; printf " \\n" +echo "$stats" > "$cache" diff --git a/.local/src/dwmblocks b/.local/src/dwmblocks index b78f4dc..5c9090a 160000 --- a/.local/src/dwmblocks +++ b/.local/src/dwmblocks @@ -1 +1 @@ -Subproject commit b78f4dc620d0ab9eb6e70eace07263b2c1f9a66c +Subproject commit 5c9090ae551a08e13201b92d63bcff8110264f23 diff --git a/.zshenv b/.zshenv index 5d85ee0..717a84d 100644 --- a/.zshenv +++ b/.zshenv @@ -7,12 +7,3 @@ export XDG_DATA_HOME="$HOME/.local/share" export XDG_STATE_HOME="$HOME/.local/state" export ZDOTDIR="$HOME/.config/zsh" - -## misc -export LESS_TERMCAP_md="$(printf '%b' '\e[01;32m')" -export LESS_TERMCAP_me="$(printf '%b' '\e[0m')" -export LESS_TERMCAP_se="$(printf '%b' '\e[0m')" -export LESS_TERMCAP_so="$(printf '%b' '\e[01;44;33em')" -export LESS_TERMCAP_ue="$(printf '%b' '\e[0m')" -export LESS_TERMCAP_us="$(printf '%b' '\e[01;35m')" -export LS_COLORS='rs=0:di=01;34:ln=01;35:mh=00:pi=40;35:so=01;33:do=01;33:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=00;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;33:*.jpeg=01;33:*.mjpg=01;33:*.mjpeg=01;33:*.gif=01;33:*.bmp=01;33:*.pbm=01;33:*.pgm=01;33:*.ppm=01;33:*.tga=01;33:*.xbm=01;33:*.xpm=01;33:*.tif=01;33:*.tiff=01;33:*.png=01;33:*.svg=01;33:*.svgz=01;33:*.mng=01;33:*.pcx=01;33:*.mov=01;33:*.mpg=01;33:*.mpeg=01;33:*.m2v=01;33:*.mkv=01;33:*.webm=01;33:*.ogm=01;33:*.mp4=01;33:*.m4v=01;33:*.mp4v=01;33:*.vob=01;33:*.qt=01;33:*.nuv=01;33:*.wmv=01;33:*.asf=01;33:*.rm=01;33:*.rmvb=01;33:*.flc=01;33:*.avi=01;33:*.fli=01;33:*.flv=01;33:*.gl=01;33:*.dl=01;33:*.xcf=01;33:*.xwd=01;33:*.yuv=01;33:*.cgm=01;33:*.emf=01;33:*.ogv=01;33:*.ogx=01;33:*.aac=01;33:*.au=01;33:*.flac=01;33:*.m4a=01;33:*.mid=01;33:*.midi=01;33:*.mka=01;33:*.mp3=01;33:*.mpc=01;33:*.ogg=01;33:*.ra=01;33:*.wav=01;33:*.oga=01;33:*.opus=01;33:*.spx=01;33:*.xspf=01;33:';