diff --git a/.config/ncmpc/config b/.config/.old/ncmpc/config similarity index 100% rename from .config/ncmpc/config rename to .config/.old/ncmpc/config diff --git a/.config/X11/xprofile b/.config/X11/xprofile index 964d5bc..6e51d6b 100644 --- a/.config/X11/xprofile +++ b/.config/X11/xprofile @@ -9,7 +9,8 @@ xss-lock -- slock & redshift & dunst &> /dev/null & #temp fix # MPD daemon start (if no other user instance exists) -[ ! -s "$XDG_CONFIG_HOME/mpd/pid" ] && mpd +[ -z "$(pgrep -fx mpd)" ] && mpd +[ -z "$(pgrep -f sb-mpdup)" ] && sb-mpdup & pulsemixer --set-volume 50 sbacklight set 3 & setbg & diff --git a/.config/beets/config.yaml b/.config/beets/config.yaml new file mode 100644 index 0000000..9d9474e --- /dev/null +++ b/.config/beets/config.yaml @@ -0,0 +1,10 @@ +directory: ~/music +original_date: yes +timid: yes +plugins: fetchart + +fetchart: + cautious: yes + cover_names: cover front art album folder + maxwidth: 800 + cover_format: JPEG diff --git a/.config/gnupg/gpg-agent.conf b/.config/gnupg/gpg-agent.conf index 949b2b2..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-gtk-2 +pinentry-program /usr/bin/pinentry-gnome3 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/pacman/hooks/cache_cleanup.hook b/.config/pacman/hooks/cache_cleanup.hook deleted file mode 100644 index 358f02f..0000000 --- a/.config/pacman/hooks/cache_cleanup.hook +++ /dev/null @@ -1,12 +0,0 @@ -[Trigger] -Operation = Remove -Operation = Install -Operation = Upgrade -Type = Package -Target = * - -[Action] -Description = Keep the last cache and the currently installed... -Depends = pacman-contrib -When = PostTransaction -Exec = /usr/bin/paccache -rvk2 diff --git a/.config/pacman/hooks/dashbinsh.hook b/.config/pacman/hooks/dashbinsh.hook deleted file mode 100644 index ed08b69..0000000 --- a/.config/pacman/hooks/dashbinsh.hook +++ /dev/null @@ -1,11 +0,0 @@ -[Trigger] -Type = Package -Operation = Install -Operation = Upgrade -Target = bash - -[Action] -Description = Re-pointing /bin/sh symlink to dash... -When = PostTransaction -Exec = /usr/bin/ln -sfT dash /usr/bin/sh -Depends = dash diff --git a/.config/pacman/hooks/pkglist.hook b/.config/pacman/hooks/pkglist.hook deleted file mode 100644 index a24d05a..0000000 --- a/.config/pacman/hooks/pkglist.hook +++ /dev/null @@ -1,10 +0,0 @@ -[Trigger] -Operation = Remove -Operation = Install -Type = Package -Target = * - -[Action] -Description = Update the pkglist... -When = PostTransaction -Exec = /bin/sh -c '/usr/bin/pacman -Qqe > /home/swytch/.config/paru/pkglist.txt' diff --git a/.config/paru/paru.conf b/.config/paru/paru.conf deleted file mode 100644 index fea7ea6..0000000 --- a/.config/paru/paru.conf +++ /dev/null @@ -1,29 +0,0 @@ -# -# $PARU_CONF -# /etc/paru.conf -# ~/.config/paru/paru.conf -# -# See the paru.conf(5) manpage for options - -# -# GENERAL OPTIONS -# -[options] -PgpFetch -Devel -Provides -DevelSuffixes = -git -cvs -svn -bzr -darcs -always -BottomUp -RemoveMake -SudoLoop -#UseAsk -#CombinedUpgrade -#CleanAfter -#UpgradeMenu -NewsOnUpgrade - -# -# Binary OPTIONS -# -#[bin] -#FileManager = vifm diff --git a/.config/paru/pkglist.txt b/.config/paru/pkglist.txt deleted file mode 100644 index 136a578..0000000 --- a/.config/paru/pkglist.txt +++ /dev/null @@ -1,110 +0,0 @@ -abcde -abook -adobe-source-han-sans-cn-fonts -adobe-source-han-sans-jp-fonts -alsa-plugins -alsa-utils -android-tools -android-udev -arandr -autoconf -automake -autorandr -base -beets -binutils -bison -capitaine-cursors -cdparanoia -clang -cmake -cronie -dash -dunst -efibootmgr -fakeroot -file -findutils -firefox -flex -gawk -gcc -gettext -git -grep -groff -grub -gsasl -gzip -htop -imagemagick -isync -iwd -jedi-language-server -libnotify -libtool -linux -linux-firmware -linux-lts -lynx -m4 -make -man-db -mpc -mpd -mpv -msmtp -ncmpcpp -neomutt -ninja -nnn -notmuch -pacman -pacman-contrib -pam-gnupg -paru -pass -patch -pkgconf -pulseaudio-alsa -pulsemixer -python-eyed3 -python-requests -redshift -sed -shotgun -sox -sudo -sxhkd -sxiv -texinfo -texlab -texlive-bibtexextra -texlive-core -texlive-latexextra -transmission-cli -tree-sitter -tremc -ttf-dejavu -ttf-fira-sans -ttf-iosevka-fixed-slab -ttf-nerd-fonts-symbols-mono -unzip -upower -usbutils -which -xcape -xclip -xf86-video-intel -xorg-server -xorg-xinit -xorg-xinput -xorg-xsetroot -xss-lock -xwallpaper -zathura -zathura-pdf-mupdf -zip -zsh -zsh-history-substring-search -zsh-syntax-highlighting diff --git a/.config/zsh/.zprofile b/.config/zsh/.zprofile index e4e030c..a0783b6 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 ## custom paths @@ -31,7 +33,7 @@ export SUDO_EDITOR="nvim" export EDITOR="nvim" export TERMINAL="st" export READER="zathura" -export BROWSER="firefox" +export BROWSER="firefox-bin" export IRC_CLIENT="irssi" export MAIL_CLIENT="neomutt" export MUSIC_CLIENT="ncmpcpp" @@ -39,3 +41,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 254c08b..6440b85 100755 --- a/.local/bin/fetch +++ b/.local/bin/fetch @@ -13,11 +13,12 @@ ## INFO # $USER is already defined -host="$(cat /etc/hostname)" -os='Arch Linux' +host="$(cat /etc/conf.d/hostname | awk -F'"' '{ printf $2 }')" +cpu="$(grep "name" /proc/cpuinfo | uniq | sed -e 's/.*: //' -e 's/ .-Core.*//')" +os="Gentoo" kernel="$(uname -sr)" uptime="$(uptime -p | sed 's/up //')" -packages="$(pacman -Q | wc -l)" +packages="$(printf '%s\n' /var/db/pkg/*/* | wc -l)" shell="$($SHELL --version | sed -e 's/(.*)//')" wm="$(tail -n 1 "$XDG_CONFIG_HOME/X11/xinitrc" | rev | cut -d ' ' -f 1 | rev)" @@ -56,25 +57,25 @@ if [ -x "$(command -v tput)" ]; then blue="$(tput setaf 4)" magenta="$(tput setaf 5)" cyan="$(tput setaf 6)" - white="$(tput setaf 15)" + white="$(tput setaf 7)" reset="$(tput sgr0)" fi # you can change these -lc="${bold}${green}" # labels -nc="${bold}${red}" # user and hostname -ic="${white}" # info -a0="${blue}" # first arch color -a1="${cyan}" # 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/bin/statusbar/sb-internet b/.local/bin/statusbar/sb-internet index 7447921..f7a7651 100755 --- a/.local/bin/statusbar/sb-internet +++ b/.local/bin/statusbar/sb-internet @@ -18,7 +18,7 @@ case "$state" in INTERFACE_DISABLED) str="WIFI DOWN" ;; *) str="$(printf "NO WIFI")";; esac -eth="$(cat /sys/class/net/eth0/operstate)" +eth="$(cat /sys/class/net/eth0/operstate &> /dev/null)" if [ "up" = "$eth" ]; then str="$(printf "%s / " "$str")" fi 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 ba8353c..717a84d 100644 --- a/.zshenv +++ b/.zshenv @@ -7,15 +7,3 @@ export XDG_DATA_HOME="$HOME/.local/share" export XDG_STATE_HOME="$HOME/.local/state" export ZDOTDIR="$HOME/.config/zsh" - -## paths -export PATH="$(find $HOME/.local/bin -type d | tr '\n' ':' | sed 's/:$//'):$PATH" - -## 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:';