Merge branch 'dev' into thesis

status: fix icons
        add sb-cpu
        fix sb-internet cat if non-existing iface
nvim: fix packer installation
        change packer icons
        change deprecated LSP installer
scripts: change default distro to Gentoo
zsh: set envvar in .zprofile
gnupg: update cache time
scipts: add oggconv
beets: add config
ncmpc: move config to ~/.config/.old
music: fix sb-mpdup startup
mpd: change instance check
This commit is contained in:
David JULIEN 2022-11-17 18:09:59 +01:00
commit 4ee03b5cf5
No known key found for this signature in database
GPG Key ID: 1DD6B2BA6DD78810
18 changed files with 126 additions and 222 deletions

View File

@ -9,7 +9,8 @@ xss-lock -- slock &
redshift & redshift &
dunst &> /dev/null & #temp fix dunst &> /dev/null & #temp fix
# MPD daemon start (if no other user instance exists) # 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 pulsemixer --set-volume 50
sbacklight set 3 & sbacklight set 3 &
setbg & setbg &

10
.config/beets/config.yaml Normal file
View File

@ -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

View File

@ -1,5 +1,4 @@
allow-preset-passphrase default-cache-ttl 86400
default-cache-ttl 604800 max-cache-ttl 86400
max-cache-ttl 604800
pinentry-program /usr/bin/pinentry-gtk-2 pinentry-program /usr/bin/pinentry-gnome3

View File

@ -5,7 +5,8 @@
local lspconfig = require("lspconfig") 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 globals = require("globals")
local signs = { local signs = {
@ -58,8 +59,8 @@ local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities = require("cmp_nvim_lsp").default_capabilities(capabilities) capabilities = require("cmp_nvim_lsp").default_capabilities(capabilities)
local servers = { "clangd", "sumneko_lua", "texlab" } local servers = { "clangd", "sumneko_lua", "texlab" }
lsp_installer.setup {
ensure_installed = servers, mason.setup({
ui = { ui = {
icons = { icons = {
server_installed = "", server_installed = "",
@ -67,7 +68,12 @@ lsp_installer.setup {
server_uninstalled = "" server_uninstalled = ""
} }
} }
} })
mason_lspconfig.setup({
ensure_installed = servers,
})
for _, server in ipairs(servers) do for _, server in ipairs(servers) do
local opts = { local opts = {

View File

@ -4,7 +4,6 @@
-- Description : neovim packer config file -- Description : neovim packer config file
local packer = require("packer")
local install_path = vim.fn.stdpath("data") .. "/site/pack/packer/start/packer.nvim" local install_path = vim.fn.stdpath("data") .. "/site/pack/packer/start/packer.nvim"
if vim.fn.empty(vim.fn.glob(install_path)) > 0 then if vim.fn.empty(vim.fn.glob(install_path)) > 0 then
print("Cloning packer...") print("Cloning packer...")
@ -20,14 +19,16 @@ if vim.fn.empty(vim.fn.glob(install_path)) > 0 then
print("Done.") print("Done.")
end end
local packer = require("packer")
packer.init({ packer.init({
display = { display = {
working_sym = 'o', -- The symbol for a plugin being installed/updated working_sym = '', -- The symbol for a plugin being installed/updated
error_sym = '', -- The symbol for a plugin with an error in installation/updating 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 done_sym = '', -- The symbol for a plugin which has completed installation/updating
removed_sym = '-', -- The symbol for an unused plugin which was removed 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) 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 header_sym = ' ', -- The symbol for the header line in packer's display
}, },
}) })
@ -68,7 +69,8 @@ return require("packer").startup(function()
use { use {
"neovim/nvim-lspconfig", "neovim/nvim-lspconfig",
requires = { requires = {
"williamboman/nvim-lsp-installer", "williamboman/mason.nvim",
"williamboman/mason-lspconfig.nvim",
}, },
config = function() require("plugin.lsp") end config = function() require("plugin.lsp") end
} }

View File

@ -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

View File

@ -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

View File

@ -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'

View File

@ -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

View File

@ -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

View File

@ -1,6 +1,8 @@
#!/bin/zsh #!/bin/zsh
# This file is sourced when launching a DM from startx/xinit # 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 # environment variables
## custom paths ## custom paths
@ -31,7 +33,7 @@ export SUDO_EDITOR="nvim"
export EDITOR="nvim" export EDITOR="nvim"
export TERMINAL="st" export TERMINAL="st"
export READER="zathura" export READER="zathura"
export BROWSER="firefox" export BROWSER="firefox-bin"
export IRC_CLIENT="irssi" export IRC_CLIENT="irssi"
export MAIL_CLIENT="neomutt" export MAIL_CLIENT="neomutt"
export MUSIC_CLIENT="ncmpcpp" export MUSIC_CLIENT="ncmpcpp"
@ -39,3 +41,10 @@ export MUSIC_CLIENT="ncmpcpp"
## misc ## misc
export _JAVA_AWT_WM_NONREPARENTING=1 export _JAVA_AWT_WM_NONREPARENTING=1
export _JAVA_OPTIONS=-Djava.util.prefs.userRoot="$XDG_CONFIG_HOME"/java 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:';

View File

@ -13,11 +13,12 @@
## INFO ## INFO
# $USER is already defined # $USER is already defined
host="$(cat /etc/hostname)" host="$(cat /etc/conf.d/hostname | awk -F'"' '{ printf $2 }')"
os='Arch Linux' cpu="$(grep "name" /proc/cpuinfo | uniq | sed -e 's/.*: //' -e 's/ .-Core.*//')"
os="Gentoo"
kernel="$(uname -sr)" kernel="$(uname -sr)"
uptime="$(uptime -p | sed 's/up //')" 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/(.*)//')" shell="$($SHELL --version | sed -e 's/(.*)//')"
wm="$(tail -n 1 "$XDG_CONFIG_HOME/X11/xinitrc" | rev | cut -d ' ' -f 1 | rev)" 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)" blue="$(tput setaf 4)"
magenta="$(tput setaf 5)" magenta="$(tput setaf 5)"
cyan="$(tput setaf 6)" cyan="$(tput setaf 6)"
white="$(tput setaf 15)" white="$(tput setaf 7)"
reset="$(tput sgr0)" reset="$(tput sgr0)"
fi fi
# you can change these # you can change these
lc="${bold}${green}" # labels lc="${bold}${magenta}" # labels
nc="${bold}${red}" # user and hostname nc="${bold}${magenta}" # user and hostname
ic="${white}" # info ic="${reset}${white}" # info
a0="${blue}" # first arch color a0="${reset}${magenta}" # first gentoo color
a1="${cyan}" # second arch color a1="${reset}${white}" # second logo color
cat <<EOF cat <<EOF
${a0} ${nc}${USER}${ic}@${nc}${host} ${a0} ${nc}${USER}${ic}@${nc}${host}
${a0} /\\ ${lc}OS: ${ic}${os} ${a0} _-----_ ${lc}cpu: ${ic}${cpu}
${a0} / \\ ${lc}KERNEL: ${ic}${kernel} ${a0} ( \\ ${lc}os: ${ic}${os}
${a0} /\\ \\ ${lc}SHELL: ${ic}${shell} ${a0} \\ 0 \\ ${lc}kernel: ${ic}${kernel}
${a1} / \\ ${lc}WM: ${ic}${wm} ${a1} \\ ) ${lc}shell: ${ic}${shell}
${a1} / ,, \\ ${lc}UPTIME: ${ic}${uptime} ${a1} / _/ ${lc}wm: ${ic}${wm}
${a1} / | | -\\ ${lc}PACKAGES: ${ic}${packages} ${a1} ( _- ${lc}uptime: ${ic}${uptime}
${a1} /_-'' ''-_\\ ${lc}MEMORY: ${ic}${mem_used}MiB/${mem_total}MiB ${a1} \\____- ${lc}packages: ${ic}${packages}
${lc}memory: ${ic}${mem_used}MiB/${mem_total}MiB
EOF EOF

23
.local/bin/oggconv Executable file
View File

@ -0,0 +1,23 @@
#!/usr/bin/env sh
# Author: Simon Legner <Simon.Legner@gmail.com>
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

37
.local/bin/statusbar/sb-cpu Executable file
View File

@ -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"

View File

@ -18,7 +18,7 @@ case "$state" in
INTERFACE_DISABLED) str="WIFI DOWN" ;; INTERFACE_DISABLED) str="WIFI DOWN" ;;
*) str="$(printf "NO WIFI")";; *) str="$(printf "NO WIFI")";;
esac esac
eth="$(cat /sys/class/net/eth0/operstate)" eth="$(cat /sys/class/net/eth0/operstate &> /dev/null)"
if [ "up" = "$eth" ]; then if [ "up" = "$eth" ]; then
str="$(printf "%s / " "$str")" str="$(printf "%s / " "$str")"
fi fi

@ -1 +1 @@
Subproject commit b78f4dc620d0ab9eb6e70eace07263b2c1f9a66c Subproject commit 5c9090ae551a08e13201b92d63bcff8110264f23

12
.zshenv
View File

@ -7,15 +7,3 @@ export XDG_DATA_HOME="$HOME/.local/share"
export XDG_STATE_HOME="$HOME/.local/state" export XDG_STATE_HOME="$HOME/.local/state"
export ZDOTDIR="$HOME/.config/zsh" 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:';